Skip to content

Nested fences broke the duplication sweep's one job - #55

Merged
robertblust merged 1 commit into
mainfrom
dupes-nested-fences
Sep 2, 2026
Merged

Nested fences broke the duplication sweep's one job#55
robertblust merged 1 commit into
mainfrom
dupes-nested-fences

Conversation

@robertblust

Copy link
Copy Markdown
Owner

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.

deFence tracked a boolean. Fences nest: the language fence sits inside the deck runtime fence 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.

talks/essential-complexity/index.html
  old boolean deFence blanks 575 of 1565 lines
  depth-aware deFence blanks 926        <- 351 lines wrongly counted, per deck

This is not a rounding error — it changes the plan. What I reported yesterday against what is actually there:

cluster reported actual
deck markup, 3/3 540 230
total 2,927 2,617

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.mjs 302 + og-check.mjs 141 + og-recipe.mjs 80 + export-og.mjs 18 ≈ 541, all 3/3) and the instance parser (build/instance.mjs 297 + verify/instance.test.mjs 253 = 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:

with the OLD boolean implementation:  5 tests, 4 pass, 1 fail
restored:                             5 tests, 5 pass, 0 fail

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

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>
@robertblust
robertblust merged commit 1645f9d into main Sep 2, 2026
1 check passed
@robertblust
robertblust deleted the dupes-nested-fences branch September 2, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant