Background
Follow-up to #1071. The 11 WASM-only language extractors have all been ported to Rust, and a drift guard exists between the JS-side NATIVE_SUPPORTED_EXTENSIONS Set and Rust's parser_registry.rs::from_extension (see tests/parsers/native-drop-classification.test.ts — the NATIVE_SUPPORTED_EXTENSIONS drift guard describe block).
However, the gate is one layer removed from the literal acceptance criterion in #1071:
A CI gate prevents future drift: a test that fails when a JS LANGUAGE_REGISTRY entry has no corresponding Rust extractor (or an explicit allowlist of intentionally WASM-only languages).
The gap
NATIVE_SUPPORTED_EXTENSIONS in src/domain/parser.ts:434 is hand-maintained, not derived from LANGUAGE_REGISTRY. The chain looks like this:
LANGUAGE_REGISTRY (JS source of truth for supported languages, drives WASM parsing)
NATIVE_SUPPORTED_EXTENSIONS (JS-side hand-maintained mirror of the Rust enum)
parser_registry.rs::from_extension (Rust source of truth for native extractor coverage)
The existing drift guard covers links 2 ↔ 3. Link 1 ↔ 2 has no test. If someone adds a new WASM-only language to LANGUAGE_REGISTRY without also adding the extensions to NATIVE_SUPPORTED_EXTENSIONS and without porting a Rust extractor, no test fires — those files would silently be classified as unsupported-by-native on the native engine and only the JS WASM backfill (#967, #1068) would parse them. That's exactly the regression class #1071 was meant to prevent.
Proposal
Add a drift test that asserts every extension in LANGUAGE_REGISTRY is present in NATIVE_SUPPORTED_EXTENSIONS, with an explicit WASM_ONLY_ALLOWLIST for any intentional exceptions (currently empty). When the allowlist is empty, the test is equivalent to LANGUAGE_REGISTRY ↔ Rust extractor parity.
Suggested location: extend tests/parsers/native-drop-classification.test.ts with a new describe block, e.g. LANGUAGE_REGISTRY ↔ NATIVE_SUPPORTED_EXTENSIONS parity.
Acceptance criteria
- New test fails if a
LANGUAGE_REGISTRY entry's extensions are missing from NATIVE_SUPPORTED_EXTENSIONS (and not on the allowlist).
- Existing tests still pass on main without modification.
- The allowlist is documented in-code so future contributors know when to use it vs. when to port to Rust.
Background
Follow-up to #1071. The 11 WASM-only language extractors have all been ported to Rust, and a drift guard exists between the JS-side
NATIVE_SUPPORTED_EXTENSIONSSet and Rust'sparser_registry.rs::from_extension(seetests/parsers/native-drop-classification.test.ts— theNATIVE_SUPPORTED_EXTENSIONS drift guarddescribe block).However, the gate is one layer removed from the literal acceptance criterion in #1071:
The gap
NATIVE_SUPPORTED_EXTENSIONSinsrc/domain/parser.ts:434is hand-maintained, not derived fromLANGUAGE_REGISTRY. The chain looks like this:LANGUAGE_REGISTRY(JS source of truth for supported languages, drives WASM parsing)NATIVE_SUPPORTED_EXTENSIONS(JS-side hand-maintained mirror of the Rust enum)parser_registry.rs::from_extension(Rust source of truth for native extractor coverage)The existing drift guard covers links 2 ↔ 3. Link 1 ↔ 2 has no test. If someone adds a new WASM-only language to
LANGUAGE_REGISTRYwithout also adding the extensions toNATIVE_SUPPORTED_EXTENSIONSand without porting a Rust extractor, no test fires — those files would silently be classified asunsupported-by-nativeon the native engine and only the JS WASM backfill (#967, #1068) would parse them. That's exactly the regression class #1071 was meant to prevent.Proposal
Add a drift test that asserts every extension in
LANGUAGE_REGISTRYis present inNATIVE_SUPPORTED_EXTENSIONS, with an explicitWASM_ONLY_ALLOWLISTfor any intentional exceptions (currently empty). When the allowlist is empty, the test is equivalent toLANGUAGE_REGISTRY ↔ Rust extractorparity.Suggested location: extend
tests/parsers/native-drop-classification.test.tswith a new describe block, e.g.LANGUAGE_REGISTRY ↔ NATIVE_SUPPORTED_EXTENSIONS parity.Acceptance criteria
LANGUAGE_REGISTRYentry's extensions are missing fromNATIVE_SUPPORTED_EXTENSIONS(and not on the allowlist).