Skip to content

I2521 — What a derive costs is measured per stage and per kind of change, and every file a stage reads is listed

Measure the present derive on a named commit, stage by stage, for the kinds of change the incremental design is meant to make cheap, and establish which files each stage reads, so that every later issue of this milestone is judged against a recorded baseline and a known input set.

READY wave 0 · p1 · deep-work profile · runs alone

Part of a-derive-does-only-the-work-its-inputs-changed — A derive does only the work its inputs changed, and can say why.

Ready. Every dependency is done, so majordomus plan start I2521 will be accepted.

Objective

Measure the present derive on a named commit, stage by stage, for the kinds of change the incremental design is meant to make cheap, and establish which files each stage reads, so that every later issue of this milestone is judged against a recorded baseline and a known input set.

Why

campaigns/majordomus-incremental-derive-prompt-pack/01_01_AUDIT_BASELINE.md asks for a read-only audit of the producers and a reproducible baseline before anything is built, and 00_00_MASTER_ORCHESTRATOR.md forbids a claim of time saved without measurements. The repository holds no such record: scripts/derive prints whole seconds per stage on stderr and keeps none of them, docs/OFFLOAD.md states about ten minutes idle and up to an hour under load without a commit or a sample count, and I1409 notes that two timings taken twenty minutes apart on one machine disagreed sixfold. scripts/generate-site-data declares its inputs as one list (--inputs), and nothing verifies that the list is everything the script reads.

Current state

No committed record states what the build, stage A, stage B, stage C and stage D cost at a given commit, nor what a no-op derive costs. The input list of stage B is declared by the script and unverified; the inputs of each target of majordomus generate are stated in prose in doc comments of apps/majordomus-cli/src/generate.rs.

Desired state

docs/PERFORMANCE.md carries a derive section with, for one named commit and machine, the duration of the build and of each stage for a cold run, a no-op run, one rule edited, one Rust source edited, one site source edited, one generated output deleted, one staged new file and one unstaged tracked edit, with sample counts, and separately the lock wait. The same section lists, per stage, the files observed to be read that the stage's declared inputs do not contain, each either added to the declaration or explained. Amended on 2026-10-18 by the derive-performance plan: each node is timed at monotonic millisecond resolution and reports its input fingerprint, cache status, run and queue time, outputs and changed-output count; the totals report wall time, CPU time, the critical path, the subprocess count and peak memory; cargo overhead is reported apart from the derivation; and the section answers which target dominates a no-op derive.

Scope

  • docs/PERFORMANCE.md
  • scripts/generate-site-data
  • apps/majordomus-cli/src/bench
  • .ai/repo/project/issues/I2521.yaml

Out of scope

  • Changing what any generator writes
  • A cold measurement taken by cleaning a build directory other worktrees share; cold runs happen in a disposable checkout with a build directory of its own
  • Budgets or gates on the measured durations

Dependencies

None. This issue is a root of the graph.

What waits on this

Acceptance criteria

  • Each of the eight scenarios has a recorded duration per stage with the commit, the machine, the load at the time and the number of samples
  • Every file scripts/generate-site-data was observed to read is in the output of scripts/generate-site-data --inputs or is named in the document with the reason it is not an input
  • The document states which stage is the largest share of a no-op derive, from the measurements and not from an estimate
  • No tracked generated file differs before and after the measurements
  • Each node of a measured run reports its input fingerprint, cache status, run and queue time in milliseconds, outputs and changed-output count, and each run reports wall, CPU, critical path, subprocess count and peak memory, with cargo overhead apart from the derivation

Validation

  • bin/majordomus plan validate
  • MJ_TEST_JOBS=2 bash test/run.sh 10_site_data 51_derived_artifacts_committed
  • scripts/derive-check

Evidence required

  • derive_baseline_measurements
  • stage_b_observed_reads

Evidence

None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.

Timeline

started
—
verified
—
completed
—

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I2521.yaml. Read it back with majordomus plan show I2521.

Searches the titles and descriptions of every page this site publishes.