I0820 — Catalogue, DAG, context and command-surface validators read their inputs once
Rewrite the remaining validators that loop mj_yget or mj_git per item so that each reads its inputs with one pass.
READY wave 2 · p0 · implementation profile · runs alone
Part of M004 — Performance is executable evidence, and the hot path does no canonical work twice.
Ready. Every dependency is done, so majordomus plan start I0820 will be accepted.
Objective
Rewrite the remaining validators that loop mj_yget or mj_git per item so that each reads its inputs with one pass.
Why
Together they cost 2.3 s of doctor after the two largest validators are fixed.
Current state
validate:catalogue 0.8 s, validate:context 0.6 s, validate:dag 0.5 s, validate:command_surface 0.35 s.
Desired state
Each of the four under 150 ms on this repository, with identical findings.
Scope
- lib/doctor.sh
- lib/context_docs.sh
- lib/commands.sh
- test/cases/28_catalogue.sh
- test/cases/42_dag_waves.sh
- test/cases/69_context_documents.sh
Dependencies
- I0818DONE The command registry is read in one pass
- I0819DONE The project model is loaded with one flatten per file and no per-file lookups
What waits on this
- I0822BLOCKED Every canonical file is flattened at most once per command
- I0828BLOCKED doctor under a declared budget, and the hook inherits it
- I0840BLOCKED context and its subcommands under a second
- I0842BLOCKED Before and after evidence for every optimisation
Acceptance criteria
- Each validator's phase under 150 ms
- The cases that mutate their inputs still fail on the mutation
Validation
- MJ_TIMING=1 bin/majordomus doctor
- bash test/run.sh 69_context_documents
Evidence required
- batch_reads
Evidence
None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.
Risk
The context validator shells out to git per document; batching it must keep the tracked-only rule.
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/I0820.yaml. Read it back with majordomus plan show I0820.