fix(lint-surface): test-gate veto — ловить in-file collateral - #205
Merged
Conversation
… бачить collateral-veto
collateral-veto.mjs детектує колатеральні правки rung-а лише ПОЗА target-set
(інші файли), а canonical re-detect бачить лише той самий детектор/порушення.
Обидва пропускають правки ВСЕРЕДИНІ вже-таргетованого файлу — реальний кейс:
LLM-рунг видалив задокументований воркараунд Bun SQL-бага поряд із фіксованим
порушенням у upsert-order.js, зламавши проєктний тест, і clean-вердикт все
одно був прийнятий.
Додає test-gate.mjs: якщо змінений target-set файл має сестринський тест-файл
за конвенцією `<dir>/tests/<stem>.test.{mjs,js,ts}` (n-test.mdc), той тест
виконується через bunx vitest як частина verify. Провал → той самий шлях
rollback/feedback/телеметрія, що й collateral-veto (kind:"test-gate-veto").
Fail-open за дизайном: відсутній test-runner/таймаут/відсутність сестринського
тесту не блокує ladder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
collateral-veto.mjsdetects rung collateral edits only OUTSIDE the target-set, and canonical re-detect only re-runs the original detector against the original violation. Neither catches edits INSIDE an already-targeted file — a real case: an LLM ladder rung deleted a documented Bun SQL workaround right next to a fix inupsert-order.js, breaking the project test that guards it, and the clean verdict was still accepted.test-gate.mjs: for files modified inside the target-set, if a sibling test file exists by convention (<dir>/tests/<stem>.test.{mjs,js,ts}, pern-test.mdc), it's run viabunx vitestas part of verify. A failure takes the same rollback/feedback/telemetry path as collateral-veto (kind:"test-gate-veto").collateral-veto.mjs): missing test-runner, timeout, or no sibling test never blocks the ladder.resolveTargetSetout ofcollateral-veto.mjsso both vetoes share the same target-set normalization.deps.testRunneroverride throughrunFixPipeline→fixConcern→runRungfor unit testing without spawning real subprocesses.docs/run-fix.md,docs/collateral-veto.md, and addeddocs/test-gate.mdwith fresh CRC stamps.Test plan
npx vitest run scripts/lib/lint-surface/tests/— 154/154 passing, including two new tests reproducing the upsert-order.js-style scenario (broken sibling test → veto/rollback/escalation) and the fail-open case (no sibling test file)npx oxlint scripts/lib/lint-surface/— cleannpx cspellon all touched files — cleannode --checkon all new/modified.mjsfiles🤖 Generated with Claude Code