Repository navigation
Split rules.md and decisions.md into one named file per entry - #715
Merged
Merged
Conversation
tests/v2/design_docs.py is the one place that will know how docs/design/rules/ and docs/design/decisions/ are laid out: the README index, file-name slugs, the rules/ID citation pattern and how a citation resolves to its file. Nothing reads it yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A one-shot migration, deleted once the split lands. `split` refuses to write unless joining the pieces back reproduces rules.md and decisions.md byte for byte; a dry run on 901ab66 gives 59 files for rules/ and 68 for decisions/, both round-tripping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"the title run's floor" slugged to title-run-s-floor; it is title-runs-floor now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/design/rules/ holds a README (the old preamble, "Not in scope" and an index), one file per section Background and one per rule; docs/design/decisions/ holds a README (the entry conventions and an index grouped by rule section, then named topics) and one file per entry, the eleven differential-ledger arcs in one file. Each file is named <ID>-<name>.md, a slug-keyed entry <slug>.md. Generated by `uv run python tools/split_design_docs.py split`, which printed "round trip: rules.md and decisions.md both byte-identical": joining the pieces back reproduces both files byte for byte, and the script writes nothing unless both do. The only text added is each rule or entry file's `# ID — name` heading and the two indexes. The parsers read the folders through tests/v2/design_docs.py; the citation form is unchanged in this commit. corpus_rules.jsonl regenerates byte-identical. The checker sees 991 citations (153 with quotes): 990/152 on 901ab66 plus one fixture string in the new test_design_docs.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated by `uv run python tools/split_design_docs.py rewrite`: 1347 citations in 159 tracked .py/.md/.rst files. The checker reads the new form through design_docs.MENTION_RE, and test_no_old_design_doc_anchors keeps rules.md#/decisions.md# out of every tracked file, since an old-form citation would no longer be read and its quote would go unchecked. Every citation the checker saw before the rewrite it sees after (diffed by file, line and key); the count moves 991 -> 992 only by two citations in design_docs.py's docstring and one fixture string, now exempt with test_design_docs.py's other citation-shape fixtures. A key wrapped at its hyphen at the end of a comment line (mechanisms.md#ONE- PREDICATE-PER-, three sites) is matched again, pinned by test_mention_re_reads_a_key_wrapped_at_its_hyphen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every prose mention of rules.md or decisions.md that describes the current docs now names the folders (rules/, decisions/) or the entry it means; dated history entries keep the old names, since they record what the files were then. AGENTS.md says each rule and decisions key is its own named file indexed by its folder's README, and asks that a rule or decision cited in chat, a commit or a PR carry its name with its ID. decisions/README.md says how to add an entry under the new layout. Three wrapped references in test_order_correspondence.py (decisions.md / #two-input-invariants, and two #P6 ones) had never been read by the citation check; joined onto one line, they are now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/split_design_docs.py did the split and the citation rewrite; history keeps it. The citation check no longer needs to exempt it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- docs/design/AGENTS.md lists test_design_docs.py among the guards a reviewer can skip, and root AGENTS.md names the loader and its test. - rules/README.md: the deviation backlog is a grep over the folder, not over the README, which holds only the grammar's mentions. - decisions/README.md: the folder is the record, and its cross- references use the decisions/key form. - test_doc_citations.py: a floor on the citations the sweep finds (1,004 today), and an assert that the docs-side anchor pattern really differs from MENTION_RE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
decisions.md kept the blocks keyed by a vocabulary set (Excluded (TITLES), (MAIDEN_MARKERS), (SUFFIX_ACRONYMS — esq), the contested- memberships Open block, ...) after whichever entry preceded them, so the split filed them by position into the P3, W2, P5 and R4 entries, where nothing in the index says they are. Both reviews of the split flagged it: a wordlist editor following a comment to the TITLES exclusions faced 68 files. They now live, unedited and in their old order, in decisions/vocabulary-exclusions.md, which the README names as the home for any new set's block; every comment and doc that pointed at one of them points there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…713) The review of the block move found thirteen positional references left pointing at nothing: three inside the moved blocks ("the bullet of that date above", "see the entry above", "the item-4 bullet above") and ten entries that located a block by position ("the Excluded block below", "this file's Excluded block", "the W2 section"), plus titles.py's salutation comment. Each now names decisions/vocabulary-exclusions or the entry it meant. Also: decisions/README.md no longer claims one block per set, and says an entry may still record keep-outs inline (generational-words); the CAPITALIZATION_EXCEPTIONS pointers name which of its two blocks; the citation floor's comment says what 1,000 can and cannot catch. The lesson goes in docs/design/AGENTS.md: a move breaks positional references, and the citation check cannot see them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #715 +/- ##
=======================================
Coverage 99.03% 99.03%
=======================================
Files 46 46
Lines 4557 4557
=======================================
Hits 4513 4513
Misses 44 44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 #713.
docs/design/rules.md(31k words) anddocs/design/decisions.md(205k words, more than an agent's context window holds) are now folders of named files. Each folder has a README with the old preamble and an index:docs/design/rules/: one file per rule (S2-case-signal-at-the-suffix-slot.md) and one per section Background (S-suffixes-generational-and-credentials.md).docs/design/decisions/: one file per key (S2-case-signal-at-the-suffix-slot.md,vocabulary-collisions.md). The 11differential-ledgerarcs share one file. The vocabulary-keyedExcluded:/Open:blocks are gathered into the newvocabulary-exclusions.md, unedited and in their old order. They had no heading of their own, so the split had filed them by position into P3, W2, P5 and R4.mechanisms.mdis unchanged.Citations are now
rules/S2anddecisions/key(mechanisms.md#Xis unchanged). A script rewrote 1,347 of them across 159 tracked files.test_no_old_design_doc_anchorskeeps the old form out of every tracked.py/.md/.rstfile, because an old-form citation would no longer be read, and its quote would go unchecked. Citations carry only the ID, so renaming a file breaks nothing.Names. 39 rules take the name their decisions entry already had. Seven are new: C2 "parts past the second comma", O3 "compound family names written unmarked", P4 "a particle at the front of the name", R1 "fields are views of the parsed words", S1 "a bracketed credential is not a nickname", S3 "credentials written with interior periods", T2 "the katakana middle dot divides like a space". The ledger file is named "the differential ledger's arcs". AGENTS.md now asks that a rule cited in chat, a commit or a PR give its name with its ID.
Verification
round trip: rules.md and decisions.md both byte-identical. The final review rebuilt both documents independently. The only differences it found are the intended layout-describing prose edits, and it also found the NFD example lines intact.corpus_rules.jsonlregenerates byte-identical.test_mention_re_reads_a_key_wrapped_at_its_hyphennow pins that shape, and a floor (>= 1000) guards against losing a whole shape.rules/S99, misquoting an M3 excerpt, and appendingrules.md#S2todocs/design/AGENTS.mdeach failstest_doc_citations.py(3 failures). Breaking the folder names inMENTION_REdrops the count to 102 and fails the floor.tests/v2/test_design_docs.py): every file is indexed exactly once; each index title matches its file's heading and file name; every key resolves to exactly one file;rules/Sresolves to the section file, never toS1-…; a sentence-finalrules/S2.is a citation; a file path is not.python -m doctest README.rst.Reviews
A whole-branch code review and a design-docs review ran in parallel, and a third reviewer checked the fix commits. Every finding is fixed:
grep deviates:on "this file", "this file is the record", the guard list in docs/design/AGENTS.md).Known and left alone
decisions/3-0-reevaluations) is still not read by the code-side check, same as before the split. The docs-internal check does read it.#keyshorthands inside dated entries (about 90) now read like issue numbers.MENTION_REhas no leading word boundary; nothing checks that each rule file holds the rule its name claims; arules/P5-stylemention is silently not a citation.🤖 Generated with Claude Code