Description
The fix in #149 introduced React language-ID mapping in two separate places that are conceptual inverses of each other but share no common constant or helper:
config/mod.rs — language_id_for_pattern_extension() maps (typescript, tsx) → typescriptreact and (javascript, jsx) → javascriptreact when building the extension map.
bridge/translator.rs — server_language_id_for_document() maps typescriptreact → typescript and javascriptreact → javascript for client routing fallback.
If one side is updated (e.g. adding vue → typescriptreact) without the other, behavior breaks silently with no compile error and no test failure.
Expected Behavior
A single authoritative definition of the React language-ID pairs — a constant, a small module-private map, or a dedicated type — consumed by both language_id_for_pattern_extension and server_language_id_for_document. Adding a new react-variant language should require changing exactly one place.
Actual Behavior
Two independent match arms encode the same knowledge in opposite directions, with no shared reference between them.
Environment
Logs / Evidence
Identified during adversarial critique of PR #149 (team-review cycle, 2026-05-24).
Description
The fix in #149 introduced React language-ID mapping in two separate places that are conceptual inverses of each other but share no common constant or helper:
config/mod.rs—language_id_for_pattern_extension()maps(typescript, tsx) → typescriptreactand(javascript, jsx) → javascriptreactwhen building the extension map.bridge/translator.rs—server_language_id_for_document()mapstypescriptreact → typescriptandjavascriptreact → javascriptfor client routing fallback.If one side is updated (e.g. adding
vue → typescriptreact) without the other, behavior breaks silently with no compile error and no test failure.Expected Behavior
A single authoritative definition of the React language-ID pairs — a constant, a small module-private map, or a dedicated type — consumed by both
language_id_for_pattern_extensionandserver_language_id_for_document. Adding a new react-variant language should require changing exactly one place.Actual Behavior
Two independent match arms encode the same knowledge in opposite directions, with no shared reference between them.
Environment
crates/mcpls-core/src/config/mod.rs,crates/mcpls-core/src/bridge/translator.rsLogs / Evidence
Identified during adversarial critique of PR #149 (team-review cycle, 2026-05-24).