A heading inside a fenced block is a quotation, not a section — and §550's evidence had already been destroyed on master - #3203
Merged
Conversation
SKILL 551 shipped a titles_lost guard so `tri skill renumber` refuses rather than deleting a section. It refuses on TITLES. The damage that had already reached master was one level finer. SKILL 550 quotes three `## N.` heading lines inside a fenced block, as the evidence for the duplicate it describes. On master 4d63859 those three lines were gone and so was the closing fence, leaving an unclosed fence with SKILL 551 inside it. The guard did not fire because 550's title was still there; only its body had been cut, and cutting a body is invisible to a set of titles. Repaired from 093367b: 550 is byte-identical to what was written, 515 sections, ascending, no duplicates, fence state closed at end of file. skillnum::sections now knows CommonMark's rule -- an OPENING fence may carry an info string, a CLOSING fence may not. On master 518 lines match `## N. ` and 3 are quotations, so the count becomes 515. The rule is not decoration: a naive toggle on every ``` mispairs 19 fences in this file, because blocks quoting command output that contains a "``` numbers" line were read as closing early, which flips the parity for everything after. That is why fence parity gave nonsense as a health check, and why "the file has an odd number of markers" was never the right question. The population is self-inflicted and will grow: this file's method is to quote the artefact that proves the finding, so every new section that quotes a heading makes a heading-counting parser wronger. A guard is only as fine as the unit it compares. titles_lost catches a dropped section, not a truncated one, not a reordered one, and not a body edited in place. Worth stating whenever a guard is written. SKILL 552. Refs #3195
The first draft of SKILL 552 quoted the damage as a fenced block containing a bare ``` line. That inner marker closes the outer block -- the exact rule the section is about -- so `## 551.` became a real heading, the file went to 517 sections and `tri skill check` printed PROBLEMS. Caught in one command on the same commit by the gate that exists for it. The example is indented rather than fenced. A fence quoting a fence has no safe spelling here, and writing it as a fenced block would have added a fourth quoted heading in the act of explaining why quoted headings are a problem. Refs #3195
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
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.
#3201 shipped a
titles_lostguard sotri skill renumberrefuses rather than deleting a section. Itrefuses on titles. The damage that had already reached master was one level finer.
What was on master
§550 quotes three
## N.heading lines inside a fenced block, as the evidence for the duplicate itdescribes. On
4d63859those three lines were gone, and so was the closing fence — leaving anunclosed fence with §551 inside it.
The guard did not fire because §550's title was still there. Only its body had been cut, and
cutting a body is invisible to a set of titles.
Repaired from
093367b7: §550 is byte-identical to what was written; 516 sections, ascending, noduplicates, fence state closed at end of file.
The parser now knows what a fence is
skillnum::sectionsmatched every line beginning## N.. On master that is 518 lines, of which3 are quotations. CommonMark's rule brings it to the truth:
That rule is not decoration here. A naive toggle on every
**mispairs 19 fences in this file**, because blocks quoting command output that contains a ````numbers ```` line were read as closingearly — which flips the parity for everything after and puts three quarters of the file "inside" a
block. That is why fence parity gave nonsense as a health check, and why "the file has an odd number
of markers" was never the right question.
The population is self-inflicted and will grow. This file's whole method is quoting the artefact
that proves the finding. Every new section that quotes a heading makes a heading-counting parser
wronger.
And writing the section did it again
The first draft of the paragraph documenting the damage quoted it as a fenced block containing a bare