You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CI: gate the emitted parser against createParser (run emit-parser-verify) #7
test/emit-parser-verify.ts checks that the emitted parser (emitParser, PR #4) is byte-identical to createParser (the oracle) across the tests/cases corpus — but it is not run in CI. So a future change to gen-parser.ts, emit-parser.ts, gen-lexer.ts, or a grammar could silently make the emitted parser diverge from the oracle.
Add it to the CI test job over a stride-sample (a few hundred to a few thousand files, for runtime), so emitted == createParser is enforced on every push.
Optionally: emit the parser from cli.ts and add the emitted artifact to the npm run gen "must be in sync" check, so the committed emitted parser can't drift from the grammar either.
emit-parser-verify (plus emit-reject-messages and emit-lexer-verify) now run two ways:
in npm run check (the CI test job, every push) on a corpus-free in-repo corpus (test/emit-corpus.ts), so emitted == createParser is enforced without needing the external corpus; and
in a dedicated path-gated emit-parity CI job that pinned-clones the full TS tests/cases and runs all three over the whole corpus for breadth.
So a change to gen-parser.ts / emit-parser.ts / gen-lexer.ts / a grammar can no longer silently diverge — the gate re-emits and compares to the oracle on every push. (It already earned its keep: wiring it to the full corpus surfaced a pre-existing farthest-hint divergence, handled in #53.)
The optional second part — emit the parser from cli.ts as a committed artifact and add it to the npm run gen in-sync check — is deferred, not done. emitParser currently has no consumer outside the tests (it's generated on the fly), so committing it would add multiple MB of generated JS that nothing reads, and the parity gate above already enforces grammar→emitted correctness on every push. Worth revisiting only if/when the emitted parser becomes a distributed/inspectable product artifact (the URL-import direction); the in-sync mechanism is the same one npm run gen already applies to the other artifacts.
Activity
Rebuild the YAML scope-gap metric on an independent CST oracle (#18)
Scope multi-line YAML plain-scalar continuations as string (#12 #6/#7) (
Fold same-column YAML plain-scalar continuations (#12 #9) (#20)
johnsoncodehk commentedon Jun 20, 2026
Done — the core ask is resolved by PR #53.
emit-parser-verify(plusemit-reject-messagesandemit-lexer-verify) now run two ways:npm run check(the CItestjob, every push) on a corpus-free in-repo corpus (test/emit-corpus.ts), soemitted == createParseris enforced without needing the external corpus; andemit-parityCI job that pinned-clones the full TStests/casesand runs all three over the whole corpus for breadth.So a change to
gen-parser.ts/emit-parser.ts/gen-lexer.ts/ a grammar can no longer silently diverge — the gate re-emits and compares to the oracle on every push. (It already earned its keep: wiring it to the full corpus surfaced a pre-existing farthest-hint divergence, handled in #53.)The optional second part — emit the parser from
cli.tsas a committed artifact and add it to thenpm run genin-sync check — is deferred, not done.emitParsercurrently has no consumer outside the tests (it's generated on the fly), so committing it would add multiple MB of generated JS that nothing reads, and the parity gate above already enforces grammar→emitted correctness on every push. Worth revisiting only if/when the emitted parser becomes a distributed/inspectable product artifact (the URL-import direction); the in-sync mechanism is the same onenpm run genalready applies to the other artifacts.Closing as resolved.