Repository navigation
feat(emit): build section files an agent reads one topic at a time - #2496
Conversation
…2466) `resolve_chain.py --emit <dir> --sections <root>...` builds one file per heading of each template, under `.agents/sections/<template ID>/`, and a root file that maps each topic to its file, to be read when the work first touches it. - Each file carries the rules under its template's title, each section it extends or names by ID, and each extension of its own, in chain order, so precedence holds and no rule is left to a reference - Overrides, the declined list and the checked cut apply as in the other modes; the root file and skills, inlined or not, are byte-identical - SYS-28 checks that the files together hold exactly the inlined root file's rules, that copies match, and that the map reads on demand, for planted templates and every root, and that two runs agree - SYS-27 scans the section files for template paths too - ADR-060 records the mode, outside the frozen surface until a benchmark round measures it; FR-06-08 and FR-06-09 state it Closes #2466. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
|
Codex round 1:
|
…erride Two faults in the section files, from the review of #2496: - An `[EXTEND:]` or `[OVERRIDE:]` reached only the heading whose tags named it, though a section runs to the next `[ID:]`. A later heading in the same section now carries the section it extends, and that section's file carries the later heading - In a three-level override chain, the middle override's rows are all replaced, so the link from the first ID to the last override was lost. The relationships are now read before replaced rows are dropped, and the last surviving override stands for every ID down the chain, so a rule naming or extending the first ID carries it SYS-28's planted templates gain both cases; each fails without its fix. The root file and skills, inlined or not, stay byte-identical. Part of #2466. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
|
Round 1 fixes pushed (c5327a9), each with a planted SYS-28 case and a negative control; existing modes and the benchmark chain's section files byte-identical. |
|
Codex round 2: two P2s, fixing — a reference to an ID that spans headings dropped its rules; relationships attached across a blank line and from overridden rows. |
Two more faults in the section files, from the second review of #2496: - A heading that named its own section's ID dropped the name, though an ID can run over several headings. A later heading naming it now carries the section's other headings; the visited set stops cycles - A relationship reached rows it does not govern: the blank line between a heading and its new `[ID:]`, and the rows of a replaced subsection. Only a surviving rule line now takes one; a replaced section's tags still feed the override chain SYS-28's planted templates gain the three cases; each fails without its fix. The root file and skills, inlined or not, stay byte-identical. Part of #2466. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
|
Codex round 3: two P2s, fixing — a declined heading drops a relationship its adopted siblings need; an override under an inherited section ID records no edge. |
Two more faults in the section files, from the third review of #2496, both relationship bookkeeping read after rows were filtered out: - Declining a heading dropped its tags before the relationships were read, so an extension that opens at a declined heading no longer reached its adopted siblings. The extent of each section is now read from every parsed row; only which rules are delivered is filtered. A declined override still replaces nothing and relates nothing - An override was recorded only against an ID its own heading declared, so one under an untagged heading inside its title's section was lost when a later template overrode that section. It is now recorded against the section it sits in, declared or inherited SYS-28's planted templates gain both cases; each fails without its fix. The root file and skills, inlined or not, stay byte-identical. Part of #2466. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
|
Round 3 fixes pushed (d53326a). Codex round 4: one P2, fixing — an overridden title-level ID leaves its surviving children without the replacement's governing rules. Sweeping the whole class with one property check. |
…relationship From the fourth review of #2496: where a later template overrides a title's ID while the title's headings keep IDs of their own, the title's rules are removed, and the headings' files carried neither them nor their replacement. A heading under an overridden title is now governed by the override that replaces it, read from the unfiltered rows. SYS-28 gains a generic property, a reading of the unfiltered chain apart from the emitter's: every file carrying a heading must hold what each of its relationships owes, the rules under its title, each section its section extends and each ID its prose names, each resolved through the overrides to what survives. Run against each earlier version of the mode, it alone reports every omission the four reviews found. The root file and skills, inlined or not, stay byte-identical. Part of #2466. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
|
Round 4 fix pushed (e1248fa, plus a generic relation check that catches every earlier omission). Codex round 5: one P2, fixing — references by heading name ("see Transport security") are not followed. |
From the fifth review of #2496: the templates name another section by its heading, as the authoring rules ask, but the section files followed only backticked IDs. Security headers kept "see Transport security" and lost HSTS's `includeSubDomains` and one-year `max-age`. - A heading named in the templates' own forms is now carried: its exact text in double quotes, after "see", or a link to its anchor, matched case and all, so plain prose names none - It resolves in the naming template first, then anywhere in the chain, read from the unfiltered rows and through overrides to what survives - Every root's references resolve: 8 distinct, 17 across the 39 roots; SYS-28 lists any that no chain template has instead of failing SYS-28's planted templates gain the cases, and its reference reading of the unfiltered chain follows heading references too; on the 39 roots it reports 13 omissions without the fix. The root file and skills, inlined or not, stay byte-identical. Part of #2466. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
|
Round 5 fix pushed (c47f868: heading-name references resolve; 17 in the 39 roots, all resolved). Codex round 6: two P2s, fixing — a quoted heading wrapped across lines is missed; an inherited override ID over-carries unrelated topics. |
…wn rules From the sixth review of #2496: - A heading named in prose was read line by line, so one quoted across a wrapped line was missed. Each paragraph and bullet outside code is now read whole. No real root gains a reference: all 39 still resolve the same 17 - An override under an untagged heading inherits its title's ID, and every heading sharing that ID stood in for the replaced section, those before the override included. An override's own rules now replace it where they survive; the section it sits in stands in only where that section is overridden in turn. No real root's section files change SYS-28's planted templates gain both cases; each fails without its fix. Its reference reading joins wrapped lines too, and gains the dual of its missing-rules check: a file may hold no rule its own topic's relationships do not reach. Run against the earlier emitters, the dual reports each rule they carried too far. The root file and skills, inlined or not, stay byte-identical. Part of #2466. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
|
Codex round 7 (gpt-6-astra, high): no findings.
🤖 Generated with Claude Code |
Main added SYS-29, which fails a removed or renamed frozen ID. Both sides are kept, with no ID shared: SYS-28 (section files) stays, SYS-29 follows it in the registry, the test index and the smoke module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3
|
Merged Codex full review after the merge (gpt-6-astra, high): no findings. Smoke 40/40, CI passes. Ready for the maintainer to merge. 🤖 Generated with Claude Code |
The emitter can now write task-sized section files that an agent reads one topic at a time, from a map in the root. Each file is a complete section plus the rules it depends on.
How a file's rules are chosen, in chain order, until nothing new is pulled in:
checkcut, as in the other modesSizes, the benchmark's
lazyrefchain: 125 files, 106 KB (median 106 words); map 11.7 KB. The inline root is 73 KB, so the copies add about 45 %.ADR-060 records the mode: security sections load on demand here too, unlike ADR-058, and the mode is not frozen until a benchmark round decides (Round 6: measure the check loop and section files, each paired within the round solid-ai-benchmark#169). Marked Accepted; the owner may want Proposed.
FR-06-08, FR-06-09, glossary, 5.4 row, AGENTS.md command.
smoke 39, conformance, fork_sync, sync_docs,
resolve_chain --check, redundancy audit, quality ratchet, mypy, ruff, pyflakes, markdownlint, pre-commitStacked on #2495. Closes #2466.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DpT5xQh3AgRFs2tJwMT4g3