curate: hone AGENTS.md back under its 6,000-token budget (6,747 → 5,970) - #84
Merged
Conversation
The policy file has been over budget since the #79/#82/#80 rounds each added a bullet: 6,001 tokens on 2026-09-08, 6,747 at this branch point, against the 6,000 in .skills/context-budget. Loaded on every invocation, so the overrun is paid on every task. Class C throughout, plus one demotion. The rewrites drop words, never claims: prove-no-loss.sh --claims reports claims_dropped: 0, so every backticked identifier, issue reference and link target of the base file still exists, and each 81 warranted line was read against the destination that carries its reasoning (docs/CONVENTIONS.md for OOM/ACL/three-fates/dedupe keys, docs/STORAGE.md for the backend seam, docs/STREAMS.md for the compiled-in local default, docs/DEPLOYMENT.md for the guard and the co-core pin). The one move: Project Overview's command→fact diagram and the paragraph above it to docs/ARCHITECTURE.md, which is the founding-design doc and had 8.5k tokens of headroom. The rubric's own finding is that overviews in a policy file do not help an agent reach files faster; the identity line and the worker-first constraint stay. The one deletion: the four-line "Where the reasoning lives" mini-index, which listed four docs that ## Detail Docs already lists with fuller one-liners. Also this repo's first check-counts.sh pass: two rhetorical counts dropped to prose, nine judged in a new .skills/context-counts-ok. Seams 0/32 acked, two stale acknowledgements pruned on the tool's advice. 972 tests pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ullet The one line in the policy file that says not to set maxmemory on a broker three services share. Losing it saved eight tokens and left an agent reading this bullet with no reason not to reproduce it against co-broker. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two claims, not one: the worker has no use for that access, and a fetcher of public URLs must not widen its blast radius. The tightened version dropped the first and stranded the second's preposition across a relative clause, in the paragraph that states a security boundary. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ong file The row's subject is docs/STREAMS.md, so "one bullet per rule stated here" reads as a rule stated in STREAMS.md — and STREAMS.md's own opening line says `AGENTS.md`. Two tokens to stop the index contradicting the doc it indexes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merging it into **General:** left the Logging block with no pointer and opened the merged sentence with a dangling "Those". The pointer belongs beside the two lines an agent reads when adding a logger; General keeps its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…there The command→fact flow moved into docs/ARCHITECTURE.md and the Detail Docs row still said "founding design, module by module". The index is how an agent reaches a doc, so a relocation the index does not name is harder to find than it was inline — which makes the demotion a loss rather than a move. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
"by decision, not by schedule" kept the contrast and lost the evidence for it (the 2026-08-20 deployment flip), leaving a reader contrasting against a schedule they cannot see; "stays the compiled-in default deliberately (#7)" is the same claim, self-contained, and shorter. And the new overview pointer claimed the module map that Project Layout's pointer four sections down already claims — the shape the deleted mini-index was deleted for. Both pay for CR 13-17. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… additions CR 14's rewrite and CR 16's appended pointer each replaced a line the base file had verbatim, which prove-no-loss reported as a fresh loss and which two warrants then had to cover. Restoring both is cheaper than warranting them: the .env paragraph is now byte-identical to base, and the logging pointer is its own line. The additions from CR 13-17 are paid for out of the Detail Docs rows and the manifest note, so the file ships at 5,988 exact against the 6,000 budget rather than the 6,017 the fixes alone would have cost. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Phase 7's rule: a late fix rewrites the run's own row, and only across runs is the ledger append-only. CR 13-20 moved the count from 5,970 to 5,988 and the warrant count from 81 to 77, so the row now describes the commit it names. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AGENTS.mdis loaded on every invocation, and it has been over.skills/context-budgetsince the #79 / #82 / #80 rounds each added a bullet. 6,747 → 5,988 exact tokens against a 6,000 budget (ledger: 6,001 on 2026-09-08, so the overrun is four days and three issues old, not one branch's doing).Measured with
measure-context.sh --exact(Anthropiccount_tokens) at both ends; both rows are in.skills/context-metrics.jsonl, the after-row stamped with this branch's commit.Per-section disposition
docs/ARCHITECTURE.md.socraticode-policymarker pair;init-socraticoderegenerates it, so an edit here is reverted on the next run.The one relocation
AGENTS.md## Project Overview→docs/ARCHITECTURE.md## What it owns, and what it emits(new section, above## Project Layout):content.fetch/content.replicate→ fact diagram (verbatim)AGENTS.mdkeeps the identity line, the worker-first constraint (a charter rule, not an overview), and a pointer.docs/ARCHITECTURE.mdgoes 1,463 → 1,681 tokens against a 10,000 per-doc budget. The rubric's own measurement is that overviews in a policy file do not help an agent reach files faster; the constraint beside it does.The one deletion, with its warrant
duplicate— the four-line "Where the reasoning lives" list under Bus Conventions pointed atdocs/STREAMS.md,docs/CONVENTIONS.md,docs/STORAGE.mdanddocs/TESTING.md.## Detail Docs, 100 lines below in the same file, lists all four with fuller one-liners. Verified row by row before deleting.What proves the rewrites kept their claims
claims_dropped: 0is the load-bearing number: every backticked identifier,#NNNreference and link target present in the base file is still somewhere in the surface. The 77 warranted lines are class-C rewrites and re-wrapped fragments, each judged in.skills/context-loss-okagainst the destination that carries its reasoning —docs/CONVENTIONS.md(OOM, ACL, the three fates, the dedupe keys),docs/STORAGE.md(the backend seam,to_threadinside the shutdown budget),docs/STREAMS.md(the compiled-inlocaldefault),docs/DEPLOYMENT.md(guard verdicts, the co-core pin).Seams and counts
check-seams.sh: 0 to review, 32 acknowledged — but read that number narrowly. The sweep printednote: 157 tracked source file(s) not swept — nothing left the policy file since --base, and that premise is wrong: the diagram did leave AGENTS.md, so the source-side half never ran. Established by hand instead —grepforProject Overviewand for the diagram across*.py,*.sh,*.ymland*.mdoutsidedocs/plans/returns only AGENTS.md's own heading, so nothing outside the docs tree points at what moved. The tool's heuristic looks section-level (no##heading disappeared), which is agregoryfoster/skillsissue rather than an edit here. Four new judgements — threedocs/SKILLS.mdback-references that name the arrangement (## Project Layout,## Detail Docs) rather than a moved block, and one#79provenance heading indocs/TESTING.mdthis run moved nothing into. Two stale acknowledgements pruned on the tool's advice.check-counts.sh: this repo's first pass — 0 to review, 9 acknowledged in a new.skills/context-counts-ok. Two rhetorical counts dropped to prose rather than warranted ("the three ways a skew has already failed" → "the ways"; "one formatter, two installers" → "its formatter, its installers"); the rest areenumeratedbeside their list, plus onestable(XAUTOCLAIM's three-element reply — Redis wire format).Review round CR 13-20
Reviewed after the curation and before merge; eight findings, one commit each, all applied.
maxmemoryon the broker three services share.envsecurity paragraph was fused into one garden-path sentence and lost "the worker has no use for"docs/ARCHITECTURE.md's index row still said "founding design, module by module" — it now also holds the flow diagram13–17 add text; 19, 20 and trims to four Detail Docs rows pay for them, so the file ships at 5,988 rather than the 6,017 the fixes alone cost. The ledger row was rewritten in place to the shipping tree (Phase 7's within-run rewrite), not appended to.
Verification
uv run pytest— 972 passed, 44 deselected, coverage 99.86% (re-run after CR 13-20)uv run ruff check .— cleanmeasure-context.sh --exact—dead: [],dead_anchors: [],orphans: []Review notes
duplicated: 4is unchanged from the baseline and not this branch's doing: two runnable commands live in both## Common Commandsanddocs/COMMANDS.md/docs/DEPLOYMENT.md, which is the load-bearing-in-both-places case the tool asks you to judge rather than a copy left behind.Worth a second pair of eyes on the Bus Conventions rewrites specifically — that is where the words came from, and "same claim, fewer words" is the judgement a fresh reader is better placed to check than the author.
🤖 Generated with Claude Code