Repository navigation
docs: split the agent baseline into an always-read core and on-demand parts (#4974) - #5066
Conversation
… parts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jakildev
left a comment
There was a problem hiding this comment.
Review — docs: split the agent baseline into an always-read core and on-demand parts (#4974)
Verdict: needs-fix
Stacked on #5058 (cross-author). Reviewing the child diff only — upstream is approved separately.
Needs-fix
docs/design/claude-md-sharing.md:43— the Decision still says Naming, Style, and What-belongs-in-agent-docs “live verbatim” inCLAUDE-BASELINE.md. This PR replaces those bodies with stubs and moves the full rules into two on-demand files, so the design’s primary concrete contract now contradicts the implementation it is meant to document. Update item 1 to describe the baseline API as the retained headings/stubs and name the on-demand files as the full-text homes.- Issue #4974 acceptance criterion 6 — the approved issue and plan require every moved section body to remain byte-for-byte unchanged, but
What belongs in agent-facing docschanges the canonical-home-map sentence. The departure is sensible and disclosed, but the criterion remains formally unmet and there is no human waiver or plan amendment in the thread. Preserve the agreed byte identity without leaving a false location claim, or obtain an explicit human amendment/waiver for criterion 6 before merge.
Nits (follow-up)
- PR body, Acceptance evidence criterion 1 — the checked-out head reports
docs/agents/INSTRUCTION-AUTHORING.mdas 3,085 bytes, not 3,080. Refresh the evidence value while amending the PR.
Praise
- The retained headings preserve the opt-out/anchor interface, and the new stubs clearly state when Codex must read each on-demand file.
- The reference, registry, role-contract, and focused lint suites all pass locally; current GitHub checks are otherwise green where complete, with linux-build, perf-gate, fleet-tests, and the aggregate status still pending at review time.
Acceptance (issue #4974)
| Criterion | Grade | Evidence |
|---|---|---|
| 1. Size budgets and no new offender | Met | Baseline is 245 lines / 13,477 bytes; conventions is 155 / 9,133; authoring is 54 / 3,085. The size lint exits 0 with no introduced offenders. |
| 2. Twelve baseline headings unchanged | Met | The current baseline retains the same twelve headings, in the same order, as the stacked base. |
| 3. Moved headings occur once in new homes | Met | Rules sweep finds four expected headings in CODE-CONVENTIONS.md and one in INSTRUCTION-AUTHORING.md. |
| 4. Rules registry and suites | Met | Registry lint exits 0; run_all.sh --only lint_rules passes 2/2 suites. |
| 5. Role/skill contract | Met | fleet-validate-roles passes all 14 protocols. |
| 6. Every moved section body unchanged | Unmet | Four sections are identical, but What belongs in agent-facing docs has the acknowledged canonical-home-map wording change; the issue/plan was not amended or waived. |
| 7. Reference lint and no new baseline entry | Met | Reference lint passes with 2,903 references and no new dead reference; the baseline JSON is unchanged. |
Test plan the author should run before re-review
-
python3 scripts/lint_instruction_size.py --against origin/master -
python3 scripts/lint_instruction_refs.py -
python3 scripts/fleet/lint_rules_registry.py -
bash scripts/fleet/tests/run_all.sh --only lint_rules -
scripts/fleet/fleet-validate-roles
🤖 Reviewed by Codex GPT-5 (review-pr skill; opus-class assignment)
Opus recheck not required (reviewed at opus class).
… note The moved `## What belongs in agent-facing docs` body is back to the baseline's exact text. Its "(the `## Canonical-home map` below)" now resolves to a short pointer section at the end of INSTRUCTION-AUTHORING.md that links to the map in the baseline. claude-md-sharing.md item 1 no longer says naming, style and what-belongs live verbatim in the baseline. It says the headings are the baseline API, and that the full text of the stubbed sections is in the on-demand files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed feedback (head
— worker |
jakildev
left a comment
There was a problem hiding this comment.
Re-review — docs: split the agent baseline into an always-read core and on-demand parts (#4974)
Verdict: needs-fix
Stacked on #5058 (cross-author). Reviewing the child diff only — upstream is approved separately.
The amendment resolves both prior needs-fix findings: Decision item 1 now describes the baseline API accurately, and all five moved section bodies compare byte-for-byte identical with the stacked base. The refreshed size evidence is also correct.
Needs-fix
docs/design/claude-md-sharing.md:173-195— the Discovery section still describes the pre-split two-file model: it says agents read only their startingCLAUDE.mdplus the baseline, calls that one extra read, and says a creation agent reads the same number of files. Under this PR's new contract, source or instruction work reads a third file (CODE-CONVENTIONS.mdorINSTRUCTION-AUTHORING.md), so those cost/discovery claims now contradict item 4 and the paragraph immediately above them. Make the count conditional: baseline-only sessions pay one extra read relative to the old root-only shape, while source/instruction sessions pay the additional on-demand read.
Praise
- The added pointer section preserves the exact moved authoring text without leaving its “below” reference dangling.
- The baseline remains within budget at 245 lines / 13,477 bytes; the two new files are 155 / 9,133 and 61 / 3,248, and the heading/anchor interface remains intact.
Acceptance (issue #4974)
| Criterion | Grade | Evidence |
|---|---|---|
| 1. Size budgets and no new offender | Met | Local size lint exits 0 with no introduced offender; measured sizes match the PR body. |
| 2. Twelve baseline headings unchanged | Met | Rules sweep reports the expected twelve headings in their original order. |
| 3. Moved headings occur once in new homes | Met | Rules sweep reports four convention headings and one authoring heading. |
| 4. Rules registry and suites | Met | Registry lint exits 0; local run_all.sh --only lint_ passes 9/9. |
| 5. Role/skill contract | Met | fleet-validate-roles passes all 14 protocols. |
| 6. Every moved section body unchanged | Met | Direct section comparison against stacked base 0b4a6f160 reports all five bodies identical (20/20, 45/45, 49/49, 14/14, 42/42 lines). |
| 7. Reference lint and no new baseline entry | Met | Reference lint reports 2,904 references, 12 inherited accepted dead references, and none new; the baseline JSON is unchanged. |
Checks
- Local instruction-size, instruction-reference, rules-registry, focused lint, and role-contract checks pass.
- GitHub
perf-gatefails on the samelibjack.so/CXXABI_1.3.15linker error present on currentmaster, so it is inherited. - GitHub
fleet-testsis red in unchanged claim/check-aggregate/Codex/survey test surfaces; the focused lint suites this PR touches pass locally and in CI.linux-buildwas still pending at review time.
Test plan the author should run before re-review
- Update the stale Discovery counts in
docs/design/claude-md-sharing.md. -
python3 scripts/lint_instruction_refs.py -
python3 scripts/lint_instruction_size.py --against origin/master
🤖 Reviewed by Codex GPT-5 (review-pr skill; opus-class assignment)
Opus recheck not required (reviewed at opus class).
… work A baseline-only session pays one extra read; a session that edits source or instruction files also reads CODE-CONVENTIONS.md or INSTRUCTION-AUTHORING.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed feedback (head
— worker |
jakildev
left a comment
There was a problem hiding this comment.
Re-review — docs: split the agent baseline into an always-read core and on-demand parts (#4974)
Verdict: approve
Stacked on #5058 (cross-author). Reviewing the child diff only — upstream is approved separately.
The latest amendment resolves the remaining needs-fix finding. The Discovery and alternatives sections now distinguish baseline-only sessions from source/instruction work, including the additional on-demand read, and the amendment changes no other surface.
Praise
- The baseline keeps all twelve stable heading/anchor identifiers while moving the full conditional rules into clearly triggered on-demand homes.
- The design note now describes both discovery paths and their read costs consistently with the implemented stubs and nested pointers.
Acceptance (issue #4974)
| Criterion | Grade | Evidence |
|---|---|---|
| 1. Size budgets and no new offender | Met | Baseline is 245 lines / 13,477 bytes; conventions is 155 / 9,133; authoring is 61 / 3,248. Local size lint exits 0 with no introduced offender. |
| 2. Twelve baseline headings unchanged | Met | Rules sweep reports the expected twelve headings in their original order. |
| 3. Moved headings occur once in new homes | Met | Rules sweep reports four convention headings and one authoring heading. |
| 4. Rules registry and suites | Met | Registry lint exits 0; detached focused fleet-tests job 20261112T094333Z-fleet-tests-de010d finished successfully with 9/9 suites passing and exit 0. |
| 5. Role/skill contract | Met | fleet-validate-roles passes all 14 protocols. |
| 6. Every moved section body unchanged | Met | The prior re-review verified all five bodies byte-for-byte against the stacked base; the latest commit changes only the design note. |
| 7. Reference lint and no new baseline entry | Met | Reference lint reports 2,904 references, 12 accepted inherited dead references, and none new. |
Checks
- Local instruction-size, instruction-reference, rules-registry, focused lint, role-contract, and whitespace checks pass.
- GitHub instruction, format, header, comment-reference, close-reference, Python, whitespace, and no-plan checks pass.
- GitHub
perf-gatefails on the samelibjack.so/CXXABI_1.3.15linker error as the latest current-master perf run, so it is inherited and unrelated to this documentation-only diff.linux-buildand GitHubfleet-testsremain pending at review time.
🤖 Reviewed by Codex GPT-5 (review-pr skill; opus-class assignment)
Opus recheck not required (reviewed at opus class).
Summary
docs/agents/CLAUDE-BASELINE.mdnow holds in full only what every session needs. It is 245 lines and 13,477 bytes, down from 398 and 23,348 on the base branch.docs/agents/CODE-CONVENTIONS.mdholds## Naming,## Style,## Encode contracts in code, not in commentsand## Deprecation markers, moved whole. Read it before editing source.docs/agents/INSTRUCTION-AUTHORING.mdholds## What belongs in agent-facing docs, moved whole. Read it before editing an instruction file. The moved text points at "the## Canonical-home mapbelow", so the file ends with a short## Canonical-home mapsection that links to the map in the baseline.#namingand the rest) still resolve, so the opt-out keys and the citations from.claude/keep working.engine/CLAUDE.md,creations/CLAUDE.mdandtest/CLAUDE.mdeach gain one pointer line to the conventions file. The existing citations of moved sections inscripts/fleet/CLAUDE.md(in place, no line added),creations/demos/CLAUDE.mdandengine/render/CLAUDE.mdnow point at the new file.docs/design/claude-md-sharing.mdrecords the split and what a stub means: an opt-out that names a stub heading opts out of the section it points to. Its Decision item 1 says every heading is in the baseline (the baseline API) and that the full text of the stubbed sections is in the on-demand files. It also says how the new files are found, and corrects its description of what the harness loads (nestedCLAUDE.mdfiles on first touch,.claude/rules/bypaths:, nothing path-scoped for Codex). Its Discovery and alternatives sections count the extra reads by work: one for a session that needs only the baseline, and one more for a session that edits source or instruction files.Test plan
python3 scripts/lint_instruction_size.py --against origin/master: exit 0,introduced:empty, the same inherited offenders.python3 scripts/lint_instruction_refs.pyin a clean worktree: the output is the same before and after the amendment. The only findings are the twodocs/pr-screenshotspaths, which exist only in a worktree where screenshots have been captured. CI is the gate here.python3 scripts/fleet/lint_rules_registry.py: exit 0.bash scripts/fleet/tests/run_all.sh --only lint_:9 suite(s) — 9 passed, 0 failed, 0 skipped.scripts/fleet/fleet-validate-roles: exit 0,OK: 14 protocols checked across 1 repo.Acceptance evidence
wc -lc docs/agents/{CLAUDE-BASELINE,CODE-CONVENTIONS,INSTRUCTION-AUTHORING}.md;python3 scripts/lint_instruction_size.py --against origin/master245 13477/155 9133/61 3248(both new files under the 400-linedocs/agentscap); lint exit 0,introduced:section empty##heading lines are identical tomaster'sfleet-rules-sweep --pattern '^## ' docs/agents/CLAUDE-BASELINE.md, diffed againstgit show origin/master:docs/agents/CLAUDE-BASELINE.md | grep '^## '12 match(es) in 1 file(s); diff empty (HEADINGS-IDENTICAL)fleet-rules-sweep --pattern '^## (Naming|Style|Encode contracts in code, not in comments|Deprecation markers)$' docs/agents/CODE-CONVENTIONS.md; same with'^## What belongs in agent-facing docs$' docs/agents/INSTRUCTION-AUTHORING.md4 match(es) in 1 file(s)(lines 11, 36, 86, 140);1 match(es) in 1 file(s)(line 11)lint_rulessuites passpython3 scripts/fleet/lint_rules_registry.py;bash scripts/fleet/tests/run_all.sh --only lint_rules2 suite(s) — 2 passed, 0 failed, 0 skippedfleet-validate-rolespassesscripts/fleet/fleet-validate-rolesOK: 14 protocols checked across 1 repo.origin/claude/4976-docs-correct-contradicted-statements) and each new file into##sections, trims blank and---edge lines, and compares the line listsIDENTICALpython3 scripts/lint_instruction_refs.py;git diff --stat origin/claude/4976-docs-correct-contradicted-statements...HEAD -- scripts/lint_instruction_refs_baseline.jsonPlan departures
## Canonical-home mapbelow)", and after the move the map is not below it. To keep the text byte-for-byte,INSTRUCTION-AUTHORING.mdends with a two-line## Canonical-home mapsection that links to the map in the baseline. That is the only text in the file that the plan did not list. The map itself, and the parsing inlint_rules_registry.py, stay in the baseline.fleet-pr-overlap --base claude/4976-docs-correct-contradicted-statements:VERDICT: overlap. Rows: lighting: bound light occlusion grid visits (#4992) #5042 and render: reset only listed per-axis store cells; skip the feeder raster and Hi-Z chain when nothing reads them (#4956) #5064 shareengine/render/CLAUDE.md, and fleet: add fleet-scratch for a pane's scratch dir, deletes and orphans #5048 and fleet: guard public posts against private references (#4985) #5059 sharedocs/agents/CLAUDE-BASELINE.md; all four areclean. docs: correct instruction statements the tree contradicts #5058 isupstream(this PR's parent). I also rangit merge-treeof this head against each of the four, and all merged cleanly.Closes #4974
🤖 Generated with Claude Code