Is the supervisory layer real here? Read-only. Blocking by design: intended to run from a pre-commit hook and from CI.
Checks, in order:
-
policy.yamlparses;versionsupported; no unknown keys at any level. -
Every
profiles/*.yamlparses; every profile referenced by policy exists; no unknown keys. -
Enforcement wiring. For every entry in
policy.enforcement:pathresolves (onPATH, repository-relative, absolute, or as an executable path on the hook line itself) and the artifact named bywired_byexists, is executable, invokesmajordomus <first arg>, and does not swallow its exit code with|| trueor|| exit 0. When the hook is a dispatcher, the invocation is looked for in the hook file and in every file in its<hook>.d/directory; the finding names whichever file actually carries it. A subhook that carries the invocation but is not executable is reported as not wired, because the dispatcher skips it.wired_by: manualis reported as unverified, never as wired. Declared-but-not-wired is10. -
Every
projections[].targetexists, its provider has a template, and its entry in the content matches the stamp it carries. Missing or unstamped →12; mismatch →10(hand-edited). Formode: regionthe hash is taken over the region alone; absent or malformed markers are reported as such. -
The projection marked
always_loaded: trueis withincontext.always_loaded_budget_lines. -
Every repository-relative path referenced from the always-loaded projection resolves.
-
No hardcoded counts in the always-loaded projection (a digit sequence adjacent to words like
agents,files,apps,commands,skills,rules).Checks 5 to 7 judge generated content only. For a region projection that is the region and never the host document, so that every failure
doctorreports can be fixed by editing the policy. -
Retention caps not exceeded on
state/ledger.jsonlandstate/handovers/. -
Environment probes: bash version,
git,jqandshellcheckif present. Reported asINFO. Nothing indoctorneeds a tool beyond bash, git, and a checksum command.
$ majordomus doctor
OK policy .ai/repo/policy.yaml — parsed, version 1
OK profiles 4 files — parsed
FAIL wiring finish-contract — bin/majordomus is not invoked by .git/hooks/pre-push [reproduce: grep -n 'majordomus finish' .git/hooks/pre-push]
OK projection CLAUDE.md — content matches its stamp
FAIL budget CLAUDE.md — 212 lines, budget 150 [reproduce: wc -l CLAUDE.md]
OK links 3 projections — all references resolve
OK retention ledger 412 lines, cap 5000
INFO env bash 3.2.57, git 2.45, yq 4.44, jq 1.7
doctor: 2 failures
$ echo $?
10