Skip to content

Fix the README HTML coverage collapse; de-flake the generative gate#37

Merged
johnsoncodehk merged 1 commit into
masterfrom
fix-metric-hardening
Jun 10, 2026
Merged

Fix the README HTML coverage collapse; de-flake the generative gate#37
johnsoncodehk merged 1 commit into
masterfrom
fix-metric-hardening

Conversation

@johnsoncodehk

Copy link
Copy Markdown
Owner

The HTML parser-agree row published 1.2% because the metric's duplicated tree-normalizer kept reading the deleted CST text field — deduped into test/html-tree.ts (metric back at 95.35%), plus a coverage-table tripwire that refuses to publish a >20-point parser-agree collapse (broken harness ≠ result). While validating, found and removed the generative gate's 9s wall-clock budget: under machine load it cut the yaml depth strategies mid-walk and the #23/#24 witnesses silently vanished — generation is now a pure function of the grammar (all strategies were already work-capped; the 7-grammar sweep is ~5s). 29/29 gates.

…proof

Three faults, one incident. The README's HTML parser-agree row published 1.2%
(from 95.3%) after the auto-regen:

1. The HTML coverage harness duplicated the element-tree normalizer from
   html-conformance.ts ("VERBATIM from" — and then it drifted): the copy kept
   reading the CST `text` field the span-only contract deleted, so every tag
   compared as '' and tree equality collapsed. The normalizer now lives ONCE in
   test/html-tree.ts (side-effect-free, source-slicing); both the gate and the
   metric import it. Metric verified back at 95.35%.

2. The metric is not in the local gate chain, so the collapse shipped silently
   through two README regens. coverage-table now refuses to WRITE a parser-agree
   value that fell more than 20 points below the committed table — a collapse is
   a broken harness, not a result, and the auto-regen workflow must fail loudly
   instead of publishing it.

3. Found while validating the fix: the generative gate flaked under machine
   load — grammar-gen carried a 9s WALL-CLOCK budget (despite its own "ALL
   DETERMINISTIC" header), and on a saturated machine the yaml depth strategies
   were cut mid-walk, the #23/#24 witness shapes vanished from the corpus, and
   mustCover failed with no code change anywhere (it also made bisecting the
   README incident actively misleading). Every strategy is already bounded by
   deterministic work caps — the whole 7-grammar sweep is ~5s — so the timer is
   gone and generation is a pure function of the grammar again
   (opts.timeBudgetMs stays as a documented no-op, like opts.seed).

29/29 gates; html-conformance and src-coverage-html share one tree definition.
@johnsoncodehk johnsoncodehk merged commit a42b4e9 into master Jun 10, 2026
2 checks passed
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