Skip to content

fix(ac-parser): inferVerificationMethod matches keywords as substrings, not word boundaries (#946) - #950

Merged
admarble merged 2 commits into
mainfrom
feature/946-fix-ac-parser-inferverificationmethod-matches-
Aug 17, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/946-fix-ac-parser-inferverificationmethod-matches-

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • inferVerificationMethod (VERIFICATION_KEYWORDS) matched single-word keywords via .includes(), so "ui" matched inside "requires", "quick", "guidance", "building"; "display" had the same class of false positive. Now \b-anchored.
  • Fixed the sibling site scoped in as AC-4: isGateTestEvidence (GATE_TEST_KEYWORDS) had the identical substring bug — "present" inside "represents", "section" inside "intersection", "flag" inside "camouflage" — this classifier feeds the feat(qa): mutation-verification becomes a parseable §7 gate instead of honor-system prose #939 §6i mutation-verification gate. Now \b-anchored with optional trailing "s" on the four keywords most likely to appear inflected in evidence prose (fixture, section, flag, present), so "flags are wired" and "fixtures exist" still match.
  • Multi-word phrase keywords ("unit test", "end-to-end", "skill gate", "mutation-verified") are unchanged — they were already effectively self-anchoring under substring matching.

Pre-PR AC Verification

AC Description Status Evidence
AC-1 inferVerificationMethod("The feature requires additional validation before merge.") returns manual ✅ Implemented src/lib/ac-parser.test.ts — "does not match single-word keywords as substrings of unrelated words (#946 AC-1)"
AC-2 Existing keyword-match tests (standalone "ui", "click", "dashboard") continue to pass unchanged ✅ Implemented Full ac-parser.test.ts suite, 70/70 passing
AC-3 Re-run of #938/PR #945 missing-evidence measurement over the same 50-issue corpus shows a reduced hit count attributable to this fix ✅ Implemented 30 → 15 flagged ACs (219 total ACs across 50 issues), all 15 eliminated hits diffed and confirmed as browser_test false positives from the substring bug, zero new hits
AC-4 isGateTestEvidence sibling site anchors GATE_TEST_KEYWORDS to word boundaries with plural tolerance; existing tests pass unchanged ✅ Implemented src/lib/ac-parser.test.ts — "should not match single-word gate-test keywords as substrings..." + "should match plural/inflected forms..." (#946 AC-4); all 8 pre-existing isGateTestEvidence tests pass unchanged

Measurement detail (AC-3)

Corpus fetched once via gh issue list --repo sequant-io/sequant --limit 50 --state all --json number,body, linted at base commit (f81f85e) and with this fix, over the identical snapshot:

Base (pre-fix) Fixed Δ
Total ACs (50 issues) 219 219 —
missing-evidence hits 30 15 -15 (-50%)

All 15 eliminated hits were browser_test inferences on ACs whose description contained the substring "display" or "ui" inside an unrelated word (e.g. displaySummary, guidance) — confirmed by diffing the hit list issue-by-issue. Zero new hits appeared after the fix.

Test plan

  • npm test -- ac-parser — 70/70 passing
  • npm run build — passes
  • npm run lint — passes
  • Full suite (npm test) — 266 test files, 5470 tests passing, 1 expected fail, 2 skipped

Closes #946

…s, not word boundaries (#946)

VERIFICATION_KEYWORDS and the sibling GATE_TEST_KEYWORDS (isGateTestEvidence)
matched single-word keywords via `.includes()`, so "ui" matched inside
"requires", "quick", "guidance", "building"; "display" had the same class of
false positive. Both now use \b-anchored regexes; multi-word phrases
("unit test", "skill gate", "mutation-verified") are unchanged since they
were already effectively self-anchoring. Gate-test keywords likely to appear
inflected in evidence prose (fixture, section, flag, present) tolerate an
optional trailing "s" so anchoring doesn't lose plural/verb forms.

Re-ran the #938/PR #945 missing-evidence measurement over the same 50-issue
corpus: 30 -> 15 flagged ACs, all 15 eliminated hits confirmed as
browser_test false positives from the substring bug, zero new hits.

Fixes #946
- Export keywordMatcher (@internal, testing only) and add direct unit
  tests for it: metacharacter escaping ("a+b" keyword — proves the
  literal isn't misinterpreted as a regex quantifier) and allowPlural
  on/off behavior.
- Add a regression-pinning test locking down which GATE_TEST_* keywords
  are plural-tolerant (fixture/section/flag/present) vs not
  (wired/exists/registered), so a future accidental list-swap fails a
  test instead of silently changing match behavior.

Test-only diff — no production logic changed.
@admarble
admarble merged commit b0bb088 into main Aug 17, 2026
5 checks passed
@admarble
admarble deleted the feature/946-fix-ac-parser-inferverificationmethod-matches- branch August 17, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ac-parser): inferVerificationMethod matches keywords as substrings, not word boundaries

1 participant