Repository navigation
Description
What
The SOP-002 decoy suites for JavaScript and TypeScript (tests/decoys/test_decoy_javascript.py, tests/decoys/test_decoy_typescript.py, arriving on main with #9466) found real engine leaks. Each is filed as its own issue and locked in the suite as @pytest.mark.xfail(strict=True): fixing a leak makes its test pass unexpectedly, which fails the suite until the marker is removed. That is the signal the leak is closed. Part of the epic #8863 (keyword-family validity).
Leaks
- JavaScript/TypeScript: hashbang #! and Annex B HTML-like <!-- / --> comments are not stripped, commented code counts in every keyword family #9451 JavaScript/TypeScript: hashbang #! and Annex B HTML-like comments are not stripped, commented code counts in every keyword family
- JavaScript/TypeScript: a regex literal containing \/\/ (/^https?:\/\//) is read as a // comment, code after it on the line is lost #9452 JavaScript/TypeScript: a regex literal containing // (/^https?:///) is read as a // comment, code after it on the line is lost
- Python/JavaScript scientific: the library name has no left boundary (import my_numpy, ./my-numpy) and the match spans the whole line #9453 Python/JavaScript scientific: the library name has no left boundary (import my_numpy, ./my-numpy) and the match spans the whole line
- Python/TypeScript/JavaScript exfiltration_camouflage: 'log' has no left boundary, fetch("/api/blog") and requests.post(".../changelog") count #9455 Python/TypeScript/JavaScript exfiltration_camouflage: 'log' has no left boundary, fetch("/api/blog") and requests.post(".../changelog") count
- TypeScript/JavaScript rce_funnel: child_process has no left boundary, my_child_process.spawn("python") counts #9457 TypeScript/JavaScript rce_funnel: child_process has no left boundary, my_child_process.spawn("python") counts
- TypeScript explicit_casts: an import/export alias (import * as React, import { A as B }, export { X as Y }) counts as a cast #9458 TypeScript explicit_casts: an import/export alias (import * as React, import { A as B }, export { X as Y }) counts as a cast
- TypeScript explicit_casts: a generic type argument before a keyword (extends B<T> implements C) counts as a <T>value cast #9459 TypeScript explicit_casts: a generic type argument before a keyword (extends B implements C) counts as a value cast
Recall gaps the suite noticed (not filed: decide with the contract before calling them bugs)
rce_funnelmisses"python3"- TypeScript
exfiltration_camouflagemisses a keyword inside nested parentheses that JavaScript catches
Note
#9453 and #9455 also affect Python: fix the JS/TS arms here; the Python arms are in the Python issue. Whichever PR lands second closes them.
How
Follow .claude/skills/family-validity-fix/SKILL.md, docs/agents/family-validity-checklist.md and docs/agents/decoy-spec-protocol.md (SOP-002). Rules live in gitgalaxy/standards/language_standards/languages/javascript.py, gitgalaxy/standards/language_standards/languages/typescript.py. First check that the suite is on main (ls tests/decoys/test_decoy_javascript.py); if it is not yet, the PR it arrives in (#9466) has not merged: wait. Per leak: reproduce with the snippet in the leak issue, name the cause class, read the contract, make the smallest fix, then remove that test's xfail marker, flip the cell's gate in tests/family_validity_baseline.json from leak to pass (decoys..), regenerate the charts (python tests/tools/family_validity_chart.py --write), run the suite both directions, time CPU before and after (seconds, on keyword-rosetta and language-crucible), and bless the goldens once for the PR. If keyword-rosetta counts move, label rosetta:rebless-owed. One PR for this language only, with one Closes #N line per leak it fixes. A real fix needs no rule contract change; where the contract is draft or silent, file the question on #8862 instead of guessing.
The suite is a measurement: do not weaken a test to make a fix pass, and do not skip a leak because the fix is awkward.
🤖 Generated with Claude Code
Activity