Skip to content

Commit aa2cd1a

Browse files
committed
Record what it takes to import a protocol written for humans
D-63: line endings are normalised on import, and duplicate rule codes stay refused. The second half was the maintainer's call, put to them with both options costed. Documents give way rather than the importer, because the alternative, reading only the shallowest numbered heading level as rules, would let a later document silently demote a family of real rules to prose by adding one shallow numbered heading. The runbook gains the edit a real protocol actually needs: de-number checklist headings, because anything numbered at level three or deeper is read as a citable rule. Windows endings need no edit anymore.
1 parent c4ca58b commit aa2cd1a

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

docs/DECISIONS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,3 +1538,18 @@ verified evidence, in writing, here.
15381538
heavier changes carried their proof when they landed: two mutation proofs
15391539
on the S4 routing and the state-machine tests, and two full
15401540
`./verify.sh --build --e2e` runs at exit 0.
1541+
- 2026-08-04 D-63: a protocol document is normalised for line endings on
1542+
import, and duplicate rule codes stay refused. The maintainer's real
1543+
2,774-line protocol imported as zero rules because it was saved with CRLF
1544+
endings and JavaScript's `.` does not match a carriage return, so not one of
1545+
its 129 headings matched the heading pattern. Normalisation happens once, at
1546+
the top of `importProtocol`, so nothing downstream and nothing stored
1547+
carries a stray return.
1548+
Fixing that exposed a second refusal: the document numbered five checklist
1549+
items under a level-4 heading, colliding with real rules 1 to 5. Two ways
1550+
out were put to the maintainer, and the decision is that documents give way
1551+
rather than the importer: the five checklist headings were de-numbered in
1552+
the source document. The alternative, treating only the shallowest numbered
1553+
heading level as rules, was rejected because a later document adding one
1554+
shallow numbered heading would silently demote a whole family of real rules
1555+
to prose, which is the exact failure this module exists to prevent.

docs/RUNBOOK.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ against a fake CLI committed to the repository.
174174
cleanly, so sharing `.next` between the two is not the cause.
175175
- **Port 3000 in use is not an error.** Dev falls back to 3001 and prints the
176176
URL it actually took. Read the line rather than assuming 3000.
177+
- **A real protocol document usually needs one edit before it imports:
178+
numbered checklist items.** Any heading at level three or deeper that starts
179+
with a number and a dot is read as a rule, so a "1. Type Verification" step
180+
inside a checklist collides with rule 1 of the catalogue and the import is
181+
refused for a duplicate code. Drop the numbers from the checklist headings;
182+
they are process guidance the reviewer still reads as a directive, and they
183+
were never codes a finding could cite. Windows line endings need no edit:
184+
they are normalised on import (D-63).
177185

178186
## Where things are
179187

0 commit comments

Comments
 (0)