#22 docs: curate the context surface to the 6,000-token budget (wave A, pair 3) - #23
Merged
Conversation
Bump the vendored skills pointer 549a88b -> 3fc7b71 (the merge carrying curating-context v1.2 and the cohort validation gate) and link the skill through the repo's two-hop vendoring convention. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
AGENTS.md was 19,032 tokens (exact, count_tokens) against a 6,000 budget, with `Bus Conventions` alone at 52% of the file, and all four reference docs orphaned — nothing in the policy file linked any of them. Now 5,773 tokens, under budget, with zero orphans and zero dead links. Every relocated block moved verbatim; prove-no-loss.sh accounts for all 226 non-blank lines of the original (106 inline, 120 relocated, 0 lost). Five new reference docs, all under the 10,000 per-doc budget: docs/ARCHITECTURE.md 8,091 layout tree + the bus-contract reasoning docs/DEPLOYMENT.md 4,232 topology, unit lifecycle, env-var reference docs/STORAGE.md 1,842 blob tree + retention docs/STYLE.md 1,034 the logging stack docs/TESTING.md 905 fakeredis divergences, live-broker fixtures A `## Detail Docs` index links those plus COMMANDS, SKILLS, and both contracts. Nothing was deleted — Phase 2 found no FALSE verdicts, so no warrant existed. The context manifest is re-embedded in the same change, per this repo's own rule that editing a description there is not what a search returns. Also installs the context-budget write guard (PostToolUse), the other half of the ratchet: the weekly run recovers ground, the guard stops regrowth between runs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`skills-submodule-update.sh` runs `git submodule update --remote --merge -- skills-vendor/` once per UTC day on main and commits the result, which would move `gregoryfoster-skills` past `3fc7b71` within a day and put two skill versions inside the wave-A arm. The hook takes no per-submodule exclusion and one submodule carries every `gregoryfoster` skill, so pinning `curating-context` alone is not expressible. Removing the SessionStart entry is the only remedy a consumer repo has today — the same one `CannObserv/cli` took (gregoryfoster/skills#100). The hook script stays in place, so restoring the refresh is a one-entry edit. `docs/SKILLS.md` records the pin, why the suspension is blunter than the problem, the manual update path while it holds, and when to restore. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Two follow-ups landed on this branch and one filed:
|
1. tests/core/test_logging.py — docs/DEPLOYMENT.md is a fourth uvicorn command site since the Server Lifecycle demotion; it was outside UVICORN_COMMAND_SOURCES, so the --log-config guard passed by not looking. 2. README.md — pointed at AGENTS.md for "Not everything in the journal is JSON", which moved to docs/STYLE.md on this branch. 3. docs/DEPLOYMENT.md — two relocated bullets end "see **Testing the bus**" and "see **Retention**", intra-file references at the branch point and cross-file now. Destinations named on continuation lines so the original lines stay verbatim. 4. docs/ARCHITECTURE.md — the layout tree read "docs/ — Reference docs (COMMANDS, SKILLS)". Warrant: disproven. `ls docs/*.md` returns seven, and this branch is what made it false. The roster now points at the Detail Docs index rather than re-listing. 5. .socraticodecontextartifacts.json — `architecture` named ./README.md while ./docs/ARCHITECTURE.md was `architecture-detail`, implying a parent/child pair that does not exist. Now `readme` and `architecture`. Re-embedded via codebase_context_index. 6. docs/ARCHITECTURE.md — dropped the duplicated "Replicator is a consumer first" lead-in; the line stays inline in AGENTS.md. 7. docs/SKILLS.md — records skills#99: the write-guard hook symlink is outside doctor.sh's heal scope and dangles on a submodule-less checkout, failing on every edit. Also completes the manual-update snippet, which omitted the commit the suspended hook used to perform. 8. README.md — its 24-row environment table duplicated docs/DEPLOYMENT.md with neither marked authoritative. Now a five-row table of what this VM actually overrides, pointing at DEPLOYMENT.md for the rest. prove-no-loss.sh reports exactly one line dropped — finding 4, with the warrant above. Everything else is still inline or relocated verbatim. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Code review round 1 — 8 findings, all actioned (a60a9b1).
One deletion, with its warrant
Warrant: disproven. Refuting command: Seven, not two — and this branch is what made the claim false. The replacement points at the Detail Docs index rather than re-listing, so it cannot go stale the same way again. The Gates, re-run after the fixes
|
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.
Closes #22. Wave A, pair 3 — adopt
curating-contextv1.2 and run it once.Before / after
Exact counts via
count_tokens(--exactsucceeded;tokens_exact: true).AGENTS.mdBus Conventions)Code Exploration Policy)The issue quoted 17,521 against remote
HEAD; the branch point measured 19,032. Same file, later commits.tokens_liverose 19,032 → 50,759, which is the expected shape of a successful demotion: the always-paid cost fell 70% while the reachable surface grew because four previously-orphaned docs are now linked and five new ones exist.Per-section disposition
init-socraticode, has its own idempotency contractdocs/ARCHITECTURE.md; 6-line signpost staysdocs/DEPLOYMENT.md/etccopy trap stay; table →docs/DEPLOYMENT.mddocs/DEPLOYMENT.mddocs/ARCHITECTURE.md,docs/STORAGE.md,docs/TESTING.mddocs/STYLE.mdBus Conventionsat 52% was the finding rather than a symptom, so it was demoted wholesale and rebuilt inline as nine rules that bind every change: two idempotency keys, store-then-publish,count=1, fail-loudfrom_wirewith a global dispatch table, DLQ vs retry, no outbox on the consume path, the three stream kinds,seed_fetch.pyas the only writer tocontent.fetch, and the two normative contracts.Every relocated block, with its destination
Verbatim moves.
prove-no-loss.sh --base <branch-point>accounts for all 226 non-blank lines: 106 still inline, 120 relocated, 0 unaccounted for.docs/ARCHITECTURE.md## Project Layouttree (62–92);## Bus Conventionsintro and bullets 189–211 and 214–220docs/DEPLOYMENT.md## Infrastructuretable + port prose (94–103);### Redis is Archiver-operated(105–111);## Server Lifecyclewhole (113–136); the environment-variable reference (155–183)docs/STORAGE.md### Retentionwhole (222–231)docs/STYLE.mddocs/TESTING.mdTesting the bus, the fakeredis divergences,real_redis, the dedupe-key namespace (233–239)Two normalisations the checker permits were the only edits in transit:
### Retentionbecame## Retentionat the top of its section, and### Redis is Archiver-operated…kept its level under## Infrastructure. No relative markdown links needed re-levelling — the original file had none (links.refswas empty, which is why every doc was an orphan).Every destination is under the 10,000 per-doc budget, so the demotion removed cost rather than relocating it.
Deletions
None. Phase 2 returned 41 TRUE, 50 UNVERIFIABLE, 0 FALSE — no warrant existed. The 50 UNVERIFIABLE are the expected classes: absolute VM paths (
/etc/replicator/.env), URI schemes (file://,redis://…,gs://…), illustrative templates (src/foo.py),file.py::symbolreferences, and cross-repo issue numbers. None was treated as a licence to delete.Also in this PR
.socraticodecontextartifacts.jsonre-embedded, not just edited. This repo's own rule is that the manifest is a source and nothing re-embeds it (Consume content.fetch-policy — replace the single env default with Watcher's per-host numbers (cannobserv#285) #19 CR A body-less 304 dead-letters — make "not modified" a first-class outcome before conditional GET is usable #17), socodebase_context_indexran in the same change — 17 artifacts. The five new docs are registered, andagent-guidelines's description now describes a routing file rather than the monolith it used to be.PostToolUsehook, budget 6,000 / doc budget 10,000. Never blocks; silent when an edit reduces the count. The weekly run recovers ground, the guard stops regrowth — a repo with one and not the other sawtooths..skills/context-metrics.jsonl,--no-loss ok, tagged with nine specific actions.docs/SKILLS.mdrecords the v1.2 pin and why breaking it costs the experiment a verdict.Verification
uv run pytest— 444 passed, 18 deselected, coverage 99.77%uv run ruff check .— cleanprove-no-loss.sh— exit 0, 0 unaccounted formeasure-context.sh --exact—links.dead: [],links.orphans: []Two things this run did not fix
docs/contracts/content-fetch-issuer-contract.mdis still 14,772 tokens, over the 10,000 per-doc budget. Nothing was demoted into it, per the issue. It needs splitting on its top-level headings — worth its own issue..claude/hooks/skills-submodule-update.shrunsgit submodule update --remote --merge -- skills-vendor/once per UTC day onmainand commits the result. Left alone it bumpsgregoryfoster-skillspast3fc7b71within a day, which puts two skill versions inside the wave-A arm and makesscore-cohort.shreturn INCONCLUSIVE. The hook has no opt-out flag and the submodule is one repo, so pinningcurating-contextalone is not possible — holding the pin means suspending the daily refresh for the duration of the experiment. Flagged rather than decided: that trade is a maintainer call, not a curation one.🤖 Generated with Claude Code