Skip to content

A projection can own only the region between its markers, leaving the rest of the file untouched

A projection declared with mode: region owns the text between <!-- majordomus:begin <policy hash> <content hash> --> and <!-- majordomus:end --> and nothing else. Everything outside those two lines belongs to the repository, is never read as input, and is never rewritten. update splices the rendered body into the region; doctor and watch compare the region body with the content hash in its own marker, never the file.

declared statusdeclared status: guaranteed Declared deterministic and blocking, implemented, and naming the behavioural test that is to prove it. Whether a recorded run supports it is the evidence verdict, shown beside it.

recorded evidencerecorded evidence: not run Declared guaranteed, and not supported by a recorded run: the test is named, and no passing run of the current inputs is recorded. how evidence is recorded

How a repository that already has a hand-written CLAUDE.md adopts Majordomus. An edit outside the markers is never drift; an edit inside them is caught. Malformed markers are refused, not guessed at.

What it means

A projection declared with mode: region owns the text between <!-- majordomus:begin <policy hash> <content hash> --> and <!-- majordomus:end --> and nothing else. Everything outside those two lines belongs to the repository, is never read as input, and is never rewritten. update splices the rendered body into the region; doctor and watch compare the region body with the content hash in its own marker, never the file.

How it works

lib/common.sh carries the primitives: mj_region_extract returns the current region body and distinguishes no begin marker from malformed markers; mj_region_splice rebuilds the whole file around a new body; mj_projection_mode defaults an unset mode to file, so every existing policy keeps its behaviour. lib/update.sh renders the provider template into the region and writes the policy hash and the region body's hash into the begin marker. An unknown mode is a policy error and exits 10 rather than guessing. lib/doctor.sh and lib/watch.sh read the mode from the policy and compare the region body with its marker; the budget, link and count checks measure the region and report the host document's length as information, because the host is not the tool's to shrink. The bootstrap check (mj_validate_bootstrap) reads the same span: the pointer at .ai/README.md must be in the region, and a rule corpus is refused in the region and nowhere else, so a host document's own rule bullets and rules headings are not a finding.

How to see it

majordomus update                 # writes the region into CLAUDE.md
echo "a paragraph of my own" >> CLAUDE.md
majordomus doctor                 # ok — the edit is outside the region
sed -i '' 's/one active task/two active tasks/' CLAUDE.md
majordomus doctor
# FAIL projection  CLAUDE.md — content differs from its own stamp (hand-edited?)

What it does not cover

The tool does not create the markers for you in a file it did not write. If the begin marker is missing, update appends the region at the end of the file; where in the document the region belongs is an editorial decision. Markers that are present but malformed — a begin without an end, or an end before its begin — are refused rather than repaired.

Why it exists

A repository that already has a hand-authored CLAUDE.md had to choose between keeping its own governance root and adopting the tool. mode: region removes the choice: the authored text stays authoritative and the generated supervisory section sits inside it, stamped like any other projection.

Detail rendered from docs/claims/region-projection.md.

From the statement to the proof

  1. 1 · the public statement

    A projection can own only the region between its markers, leaving the rest of the file untouched

    Made on Policy, Projection.

  2. 2 · the canonical claim

    region-projectiondeclared status: guaranteed in docs/CLAIMS.yaml

    Defined in read it on this site · docs/SCHEMAS.md

  3. 3 · the implementation

    lib/update.sh · majordomus update

  4. 4 · the test and the scenarios

    Test: test/cases/13_region_projection.sh

    Executed in Adopt a repository that already has its own rules.

  5. 5 · the recorded runs

    recorded evidence: not run how evidence is recorded

Verify it yourself

The test runs in a disposable temporary repository and asserts the behaviour, not a string in the source.

from a clone of the repository
bash test/run.sh 13_region_projection

Where this claim is used

responsibilities it covers

Related claims same implementation

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