Skip to content

docs: split the agent baseline into an always-read core and on-demand parts (#4974) - #5066

Merged
jakildev merged 3 commits into
claude/4976-docs-correct-contradicted-statementsfrom
claude/4974-split-agent-baseline
Nov 15, 2026
Merged

jakildev merged 3 commits into
claude/4976-docs-correct-contradicted-statementsfrom
claude/4974-split-agent-baseline

Conversation

@jakildev

@jakildev jakildev commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • docs/agents/CLAUDE-BASELINE.md now 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.
  • New docs/agents/CODE-CONVENTIONS.md holds ## Naming, ## Style, ## Encode contracts in code, not in comments and ## Deprecation markers, moved whole. Read it before editing source.
  • New docs/agents/INSTRUCTION-AUTHORING.md holds ## What belongs in agent-facing docs, moved whole. Read it before editing an instruction file. The moved text points at "the ## Canonical-home map below", so the file ends with a short ## Canonical-home map section that links to the map in the baseline.
  • Each moved heading stays in the baseline as a three-line stub: the rule in one sentence, when to read the full text, and the link. All twelve headings and their anchors (#naming and the rest) still resolve, so the opt-out keys and the citations from .claude/ keep working.
  • The canonical-home map names the two new files as the homes of the moved topics and keeps every rule-file row.
  • engine/CLAUDE.md, creations/CLAUDE.md and test/CLAUDE.md each gain one pointer line to the conventions file. The existing citations of moved sections in scripts/fleet/CLAUDE.md (in place, no line added), creations/demos/CLAUDE.md and engine/render/CLAUDE.md now point at the new file.
  • docs/design/claude-md-sharing.md records 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 (nested CLAUDE.md files on first touch, .claude/rules/ by paths:, 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.py in a clean worktree: the output is the same before and after the amendment. The only findings are the two docs/pr-screenshots paths, 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.
  • A script compared each moved section's body on the base branch with the body in its new file. All five are identical.

Acceptance evidence

Criterion Check run Observed
1. Instruction size: baseline ≤ 250 lines and ≤ 14,000 bytes; no introduced offender; both new files within budget wc -lc docs/agents/{CLAUDE-BASELINE,CODE-CONVENTIONS,INSTRUCTION-AUTHORING}.md; python3 scripts/lint_instruction_size.py --against origin/master 245 13477 / 155 9133 / 61 3248 (both new files under the 400-line docs/agents cap); lint exit 0, introduced: section empty
2. Rules sweep: the baseline's twelve ## heading lines are identical to master's fleet-rules-sweep --pattern '^## ' docs/agents/CLAUDE-BASELINE.md, diffed against git show origin/master:docs/agents/CLAUDE-BASELINE.md | grep '^## ' 12 match(es) in 1 file(s); diff empty (HEADINGS-IDENTICAL)
3. Rules sweep: each moved heading matches once in its new file 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.md 4 match(es) in 1 file(s) (lines 11, 36, 86, 140); 1 match(es) in 1 file(s) (line 11)
4. Fleet tool tests: the rules-registry lint and the lint_rules suites pass python3 scripts/fleet/lint_rules_registry.py; bash scripts/fleet/tests/run_all.sh --only lint_rules exit 0; 2 suite(s) — 2 passed, 0 failed, 0 skipped
5. Role/skill contract: fleet-validate-roles passes scripts/fleet/fleet-validate-roles exit 0, OK: 14 protocols checked across 1 repo.
6. Each moved section's body is unchanged (shown as moved lines in the diff) A script splits the base branch's baseline (origin/claude/4976-docs-correct-contradicted-statements) and each new file into ## sections, trims blank and --- edge lines, and compares the line lists Naming 20/20, Style 45/45, Encode contracts 49/49, Deprecation markers 14/14, What belongs in agent-facing docs 42/42: all IDENTICAL
7. The reference lint (#4971 has landed) passes with no new baseline entry python3 scripts/lint_instruction_refs.py; git diff --stat origin/claude/4976-docs-correct-contradicted-statements...HEAD -- scripts/lint_instruction_refs_baseline.json no finding from this PR's files (output identical before and after the amendment); the baseline JSON diff is empty, so this PR adds no baseline entry

Plan departures

Closes #4974

🤖 Generated with Claude Code

… parts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jakildev jakildev added fleet:wip Work in progress — not ready for review fleet:author-claude Implementation last authored by Claude; route review to Codex labels Nov 12, 2026
@jakildev
jakildev added this pull request to stack #5067 November 12, 2026 08:50
@jakildev jakildev added fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend and removed fleet:wip Work in progress — not ready for review labels Nov 12, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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” in CLAUDE-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 docs changes 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.md as 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).

@jakildev jakildev added fleet:needs-fix Fleet reviewer found issues — author must address fleet:needs-windows-smoke PR needs windows-debug build + smoke-run validation and removed fleet:reviewing-mac-pool-5 labels Nov 12, 2026
@jakildev jakildev removed the fleet:needs-fix Fleet reviewer found issues — author must address label Nov 12, 2026
… 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>
@jakildev jakildev added fleet:changes-made Agent addressed human feedback — ready for human re-review and removed fleet:amending-mac-pool-1 labels Nov 12, 2026
@jakildev

Copy link
Copy Markdown
Owner Author

Addressed feedback (head 855545e72):

  • docs/design/claude-md-sharing.md:43: Decision item 1 no longer says naming, style and what-belongs live verbatim in the baseline. It now says every heading is in the baseline (the baseline API), that the sections every session needs live there in full, and that the full text of the stubbed sections is in the on-demand files named in item 4.
  • Criterion 6: the moved ## What belongs in agent-facing docs body is back to the baseline's exact text, "(the ## Canonical-home map below)" included. To keep "below" true, INSTRUCTION-AUTHORING.md now ends with a two-line ## Canonical-home map section that links to the map in the baseline. A section-by-section comparison against the base branch reports all five moved bodies IDENTICAL (42/42 lines for this one). The registry lint still parses the map from the baseline and exits 0.
  • Nit, criterion 1 evidence: refreshed to the amended file, 61 3248 (the old head was 3,085 bytes, as you said).
  • Re-run: size lint exit 0 with introduced: empty; registry lint exit 0; run_all.sh --only lint_ 9/9 passed; fleet-validate-roles OK, 14 protocols. In a clean worktree the reference lint gives the same output before and after the amendment.

— worker

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 starting CLAUDE.md plus 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.md or INSTRUCTION-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-gate fails on the same libjack.so / CXXABI_1.3.15 linker error present on current master, so it is inherited.
  • GitHub fleet-tests is red in unchanged claim/check-aggregate/Codex/survey test surfaces; the focused lint suites this PR touches pass locally and in CI. linux-build was 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).

@jakildev jakildev added fleet:needs-fix Fleet reviewer found issues — author must address and removed fleet:changes-made Agent addressed human feedback — ready for human re-review fleet:reviewing-mac-pool-5 labels Nov 12, 2026
@jakildev jakildev removed the fleet:needs-fix Fleet reviewer found issues — author must address label Nov 12, 2026
… 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>
@jakildev jakildev added fleet:changes-made Agent addressed human feedback — ready for human re-review and removed fleet:amending-mac-pool-5 labels Nov 12, 2026
@jakildev

Copy link
Copy Markdown
Owner Author

Addressed feedback (head c451b0cf3):

  • docs/design/claude-md-sharing.md Discovery: the read counts now depend on the work. Every agent reads at least its starting CLAUDE.md and the baseline. A session that needs only the baseline pays one extra Read. A session that edits source or instruction files pays one more, for CODE-CONVENTIONS.md or INSTRUCTION-AUTHORING.md. The closing paragraph compares against the pre-design status quo the same way: a baseline-only engine agent reads one extra file, a baseline-only creation agent reads the same number, and source or instruction work adds the on-demand file on top.
  • Same claim in the alternatives section (line ~101): "one extra file Read per agent invocation" now says it is two for source or instruction work and points at Discovery. I left the baseline-admission criterion (line ~302) as it was. It weighs the cost of the baseline read itself, which is still one file.
  • PR body: the design-note summary bullet now mentions the conditional counts.
  • Re-run: reference lint ok (2,904 references, none new); size lint exit 0 with introduced: empty; registry lint exit 0.

— worker

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-gate fails on the same libjack.so / CXXABI_1.3.15 linker error as the latest current-master perf run, so it is inherited and unrelated to this documentation-only diff. linux-build and GitHub fleet-tests remain pending at review time.

🤖 Reviewed by Codex GPT-5 (review-pr skill; opus-class assignment)

Opus recheck not required (reviewed at opus class).

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge and removed fleet:changes-made Agent addressed human feedback — ready for human re-review fleet:reviewing-mac-pool-5 labels Nov 12, 2026
@jakildev
jakildev merged commit 51f8b78 into master Nov 15, 2026
12 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fleet:approved Fleet reviewer approved — ready for human merge fleet:author-claude Implementation last authored by Claude; route review to Codex fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend fleet:needs-windows-smoke PR needs windows-debug build + smoke-run validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: split the agent baseline into an always-read core and on-demand parts

1 participant