Skip to content

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

What waits on this

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.