Skip to content

The always-loaded instruction file has a line budget with a failing check

Exactly one projection is marked always_loaded: true — the file every session of the worker reads before doing anything. The policy sets context.always_loaded_budget_lines; update refuses to write a projection over the budget, and doctor fails if the file on disk is over it. A budget without a failing check is a wish.

guaranteed Deterministic and blocking. Implemented, and a behavioural test proves it.

Over budget, nothing is written at all.

What it means

Exactly one projection is marked always_loaded: true — the file every session of the worker reads before doing anything. The policy sets context.always_loaded_budget_lines; update refuses to write a projection over the budget, and doctor fails if the file on disk is over it. A budget without a failing check is a wish.

How it works

lib/update.sh counts the rendered lines of the always-loaded target after generation; over budget, it writes nothing and exits 10. lib/doctor.sh re-checks the file on disk on every run, so an edit that pushes it over is caught even if someone forced it. The same file is also checked for unresolved references and hardcoded counts.

How to see it

sed -i.bak 's/always_loaded_budget_lines: 150/always_loaded_budget_lines: 10/' .ai/repo/policy.yaml
majordomus update
# FAIL budget      CLAUDE.md — would be 78 lines, budget 10; nothing written

What it does not cover

The budget is in lines because that is what can be counted honestly without a tokenizer. It says nothing about token count and is never presented as one.

Why it exists

One always-loaded operating contract in the source environment oscillated between empty and about eleven hundred lines across roughly two hundred hand edits before a hard budget with a failing check pinned it under fifty. The uncapped sibling file regrew several times over within weeks.

Detail rendered from docs/claims/context-budget.md.

Provenance

defined in
read it on this site · share/skeleton/policy.yaml
implemented in
lib/update.sh · majordomus update
proved by
test/cases/03_update.sh
claim id
context-budget

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 03_update

Where this claim is used

Related claims same implementation

The moments this answers