Nested fences broke the duplication sweep's one job - #55
Merged
Conversation
deFence tracked a boolean, and fences nest: the language fence sits inside the deck runtime fence in every deck. The inner end marker cleared the flag, so everything from there to the outer end marker was counted as duplication while the package generates it. In talks/essential-complexity/index.html that was 351 lines, and it was the same in all four decks. The effect was not a rounding error. It put deck markup at the top of the consolidation list at 540 lines when the real figure is 230, and the honest total drops from 2,927 to 2,617. The next plan would have been scoped against a number this tool invented. This is the third time the sweep has been wrong by construction, and all three times the wrong answer read as a clean result rather than as a failure. So the fence logic now has tests, and they run in CI. The nested-fence test is proven red against the boolean implementation it replaces. The sweep itself stays out of CI: it needs all three checkouts side by side. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The sweep's job is to decide which lines the package owns and exclude them. It got that wrong, and — as with the two errors before it — the wrong answer read as a clean result rather than as a failure.
deFencetracked a boolean. Fences nest: thelanguagefence sits inside thedeck runtimefence in every deck. The inner end marker cleared the flag, so every line from there to the outer end marker was counted as duplication while in fact the package generates it.This is not a rounding error — it changes the plan. What I reported yesterday against what is actually there:
Deck markup was top of the consolidation list on a number this tool invented. It is not top of the list. The largest remaining clusters are the OG/card toolchain (
og-recipe.test.mjs302 +og-check.mjs141 +og-recipe.mjs80 +export-og.mjs18 ≈ 541, all 3/3) and the instance parser (build/instance.mjs297 +verify/instance.test.mjs253 = 550, 2/3) — which puts the spec's own tier 4 back at the front, where it was before I moved it.The fence logic now has tests, and they run in CI. Five of them, covering nesting, marker syntax in CSS/HTML/JS comments, and the rule that an unversioned section heading is the page's own rather than a fence. The nested-fence test is proven red against the boolean implementation it replaces:
The sweep itself stays out of CI — it reads all three checkouts side by side, so it only runs on a machine that has them. Only its fence logic is testable in isolation, and the fence logic is where all three failures happened. The module now guards its scan behind an
argv[1]check so importing it for a test does not launch a three-repository walk.🤖 Generated with Claude Code