Repository navigation
Description
Motivation
inferVerificationMethod (src/lib/ac-parser.ts) matches verification keywords with plain substring .includes(), not word boundaries. Two live false positives, both found while planning/measuring #938:
inferVerificationMethod("The feature requires additional validation before merge.")→browser_test, because"ui"is a substring of"requires".- The same
"ui"hit also fires inside"quick","guidance","building", and any other word containing the two-letter sequence.
The AC-6 measurement in #938 (PR #945) quantified the blast radius: running the (then-new) missing-evidence linter rule over the last 50 issues found 30/220 ACs flagged, and 17 of those 30 (57%) trace to this substring bug, not a genuine browser-test signal. "display" is a smaller instance of the same class.
Proposal
Anchor the single-word keywords (ui, api, click, display, dashboard, unit, etc.) to word boundaries (\bui\b) in VERIFICATION_KEYWORDS lookup, while leaving multi-word phrase keywords ("unit test", "end-to-end") as substring matches since those are already effectively self-anchoring.
The same fix applies to the sibling site in the same file: isGateTestEvidence matches GATE_TEST_KEYWORDS (flag, section, present, exists, ...) with the same substring .includes(), so "present" fires inside "represents" and "section" inside "intersection". Since real evidence text uses plurals ("flags are wired"), the gate-keyword anchoring is plural-tolerant (\bflags?\b). Scoped in as AC-4 (was originally deferred as a follow-up).
Acceptance Criteria
- AC-1:
inferVerificationMethod("The feature requires additional validation before merge.")returnsmanual, notbrowser_test. Evidence:npm test -- ac-parser(unit test asserting the exact string above) - AC-2: Existing keyword-match tests in
ac-parser.test.ts(standalone"ui","click","dashboard", etc. as real words) continue to pass unchanged. Evidence:npm test -- ac-parser(full existing suite, zero regressions) - AC-3: Re-running the AC-6 measurement script from feat(spec/qa): explicit Evidence: clause on ACs — declared verification replaces keyword inference #938/PR feat(#938): explicit Evidence: clause on ACs — declared verification replaces keyword inference #945 over the same 50-issue corpus shows a reduced hit count for
missing-evidence, with the reduction attributable to this fix. Evidence: rerun ofgh issue list --repo sequant-io/sequant --limit 50 --state all --json number,bodypiped through the linter; counts recorded in the PR body - AC-4:
isGateTestEvidence(sibling site, same file) anchors its single-wordGATE_TEST_KEYWORDSto word boundaries with plural tolerance (e.g.\bflags?\b): evidence text like "represents each hit as a row" or "at the intersection of both corpora" no longer classifies as a gate test, "flags are wired" still does, and all existingisGateTestEvidencetests pass unchanged. Evidence:npm test -- ac-parser
Non-Goals
- No change to multi-word phrase keywords (
"unit test","integration test","end-to-end") — those are not affected by this bug class. - No change to the
Evidence:clause /resolveVerificationMethoddeclared-evidence path from feat(spec/qa): explicit Evidence: clause on ACs — declared verification replaces keyword inference #938 — that already bypasses inference entirely when evidence is declared. - No change to
MANUAL_REVIEW_NEGATIVE_SIGNALS— multi-word phrases, already self-anchoring (same rationale as the phrase keywords above).
Context
Follow-up from #938 (PR #945) — flagged in that PR's QA review rather than fixed there, since it's a broader change to inferVerificationMethod than the Evidence-clause feature's scope.
Activity
fix(#938): close QA gaps — last-occurrence Evidence: split, direct sc…
feat(#938): explicit Evidence: clause on ACs — declared verification …
admarble commentedon Aug 17, 2026
Spec Plan (Phase 1)
Complexity: Standard (3 ACs, 1 directory)
Acceptance Criteria
inferVerificationMethod("The feature requires additional validation before merge.")returnsmanual— Unit Test (declared:npm test -- ac-parser). Given the exact string → When inferred → Thenmanual, notbrowser_test."ui","click","dashboard"as real words) keep passing — Unit Test (declared: fullac-parsersuite, zero regressions).gh issue listcorpus → linter; counts in PR body).Key findings from context gathering
src/lib/ac-parser.ts:151—lowerDesc.includes(keyword)overVERIFICATION_KEYWORDS(lines 105–132). Single-word keysui,api,unit,click,display,dashboard, etc. match inside longer words.ac-parser.test.ts:617–627("declared evidence overrides… false keyword hit") containsexpect(inferVerificationMethod(description)).toBe("browser_test")for the exact AC-1 string. That inline assertion must flip to"manual"and the comment reworded — the test's real subject (Evidence overrides inference) remains valid. This does not violate AC-2: it is an Evidence-override test, not a keyword-match test. All keyword-match tests (lines 486–535) use standalone real words ("Display user name", "Click button", "UI shows error") and pass unchanged under word boundaries.detectMissingEvidence(ac-linter.ts:366) fires whenverificationMethod !== "manual"and no Evidence clause — so falsebrowser_testinferences directly inflate its hit count; anchoring reduces it.gh issue list --limit 50 --state alltoday returns a different issue window than when feat(#938): explicit Evidence: clause on ACs — declared verification replaces keyword inference #945 ran (issues filed since then shift the window). To make the reduction attributable to this fix, fetch the corpus once, run the linter over the same snapshot twice — at the base commit and with the fix — and report before/after counts. Pin the same issue-number range as feat(#938): explicit Evidence: clause on ACs — declared verification replaces keyword inference #945's run if recoverable.Implementation Plan
Phase 1: Fix + unit tests
src/lib/ac-parser.ts— precompile a word-boundary regex per keyword at module scope (new RegExp(\b${escaped}\b), with regex-escaping), keep the existing longest-first precedence, replace the.includes()test at line 151. Recommend applying\banchoring uniformly to all keywords: behavior-identical for multi-word phrases ("unit test","end-to-end"—\bsits fine around hyphens), simpler than a split single/multi-word code path, and consistent with the Non-Goal (no behavioral change to phrase keywords).src/lib/ac-parser.test.ts— add AC-1's exact-string regression test inside theinferVerificationMethoddescribe block; update the line-617 test's inline assertion (browser_test→manual) and its comment.npm test -- ac-parser→ AC-1 + AC-2 green.Phase 2: Measurement (AC-3)
4. Fetch corpus snapshot once (
gh issue list --limit 50 --state all --json number,body→ file); run the missing-evidence linter over it at base commit and with the fix; record before/after hit counts (and how many of the eliminated hits trace toui/displaysubstring FPs) in the PR body.Design Review
inferVerificationMethod/VERIFICATION_KEYWORDSinsrc/lib/ac-parser.ts— it's the only substring-matching consumer;resolveVerificationMethodand callers are untouched.\b-anchored regexes. Rejected: keyword-by-keyword split (single-word regex vs multi-word.includes()) — two code paths for zero behavioral gain.EVIDENCE_CLAUSE_RE,UNIT_TEST_COMMAND_REin the same file).displays,clicks,clickedno longer match." True, and accepted (Open Question 1): inference is a fallback heuristic whose safe default ismanual; the robust channel is the declaredEvidence:clause from feat(spec/qa): explicit Evidence: clause on ACs — declared verification replaces keyword inference #938.Sibling Site (surfaced, not scoped in)
GATE_TEST_KEYWORDSmatching atac-parser.ts:298uses the same.includes()pattern with single-word keys — same bug class:"present"matches inside"represents","section"inside"intersection","flag"inside"camouflage". Not trivially co-located in risk: that classifier feeds the /qa §6i mutation gate (#939), and its substring behavior partially functions as useful stemming ("flag"→"flagged"). Recommend a follow-up issue with its own FP/FN analysis rather than widening this fix.Open Questions
displays/clicks/clicked→manual)? — Recommendation: yes, accept. Impact if wrong: some UI ACs infermanualand stop receiving the missing-evidence nudge — minor, and recoverable by adding explicit inflected keys later.Note: AC-linter flagged AC-2's
etc.as open-ended (warning only) — the declared Evidence clause ("full existing suite, zero regressions") pins the scope, so no rewrite needed.Recommended Workflow
Phases: spec → exec → qa
Quality Loop: disabled
Reasoning: SCOPE_OK bug fix in one module. Testgen skipped despite two declared unit-test ACs: AC-1 is a single assertion added to an existing describe block and AC-2 is the pre-existing suite — stub generation adds only overhead here (simple-bug-fix carve-out).
admarble commentedon Aug 17, 2026
Plan addendum — sibling scoped in as AC-4 (user decision)
Open Question 2 from the plan above is resolved: the
isGateTestEvidencesibling site is now AC-4 in the issue body instead of a follow-up issue.Implementation Plan changes:
GATE_TEST_KEYWORDSmatching inisGateTestEvidence(src/lib/ac-parser.ts:298) — with plural tolerance (\bflags?\bshape), since real evidence text uses plurals ("flags are wired", "fixtures exist") that plain\bflag\bwould drop. This is strictly-fewer-false-positives vs today:\bpresents?\bstill matches the verb "presents", but that already matched under substring, so no new over-firing; "represents", "intersection", "camouflage" stop matching.isGateTestEvidencedescribe block (ac-parser.test.ts:797); all existing positives use singular forms (incl. "fixture's" — apostrophe is a word boundary) and pass unchanged.MANUAL_REVIEW_NEGATIVE_SIGNALSstays substring — multi-word, self-anchoring (added to Non-Goals).isGateTestEvidencefeeds the /qa §6i mutation-verification gate andscripts/qa/backtest-mutation-gate.ts. Under-firing there lets a real gate test skip the mutation record (feat(#819): shared trust-model block — issue/PR text is data, not agent instructions #830 class) — the plural-tolerant anchoring exists precisely to prevent new under-firing; reviewers should check inflected keywords, not just the FP fixes.Verification methods: AC-4 = Unit Test (declared:
npm test -- ac-parser). Scope re-assessed with 4 ACs: still SCOPE_OK, one directory. Workflow unchanged: exec → qa, quality loop disabled.admarble commentedon Aug 17, 2026
Exec Complete
Tests: ✅ All passing (266 files, 5470 tests, 1 expected fail, 2 skipped)
Build: ✅ Succeeded
Lint: ✅ Passed
Files Changed: 3 (
src/lib/ac-parser.ts,src/lib/ac-parser.test.ts,CHANGELOG.md)AC Coverage
PR: #950
admarble commentedon Aug 17, 2026
QA Review for Issue #946
AC Coverage
inferVerificationMethod("The feature requires additional validation before merge.")returnsmanual, notbrowser_testac-parser.test.ts("does not match single-word keywords as substrings... #946 AC-1");npm test -- ac-parser→ 70/70 passing"ui","click","dashboard") continue to pass unchangedinferVerificationMethodkeyword tests pass unmodifiedbrowser_testfalse positives from the substring bug, zero new hitsisGateTestEvidencesibling site anchorsGATE_TEST_KEYWORDSto word boundaries with plural tolerance; existing tests pass unchangedisGateTestEvidencetests pass unchangedCoverage: 4/4 AC items fully met
Original ACs: 4/4 met
Derived ACs: N/A — no quality-plan-derived ACs (AC-4 was scoped in during planning as a sibling-site expansion, not a QA-derived AC)
Quality Plan Verification
N/A — no Feature Quality Planning section in the spec comment (Standard-tier bug fix; spec output omitted this section by design).
Precheck Findings
escapeRegExp,keywordMatcher,VERIFICATION_KEYWORD_MATCHERS,GATE_TEST_PLURAL_KEYWORDS,GATE_TEST_SINGULAR_KEYWORDS,GATE_TEST_PHRASE_KEYWORDS,GATE_TEST_KEYWORD_MATCHERS) — all internal toac-parser.ts, zero cross-file sibling sites (expected: none are exported)parseAcceptanceCriteriareturns exactly AC-1..AC-4, and "AC-6" only appears inside AC-3's own prose ("the AC-6 measurement script from #938/PR #945"), a reference to a different issue's AC. PR body's table (AC-1..AC-4) is complete.Source:
.sequant/gap-precheck.json(schemaVersion 1)CI Status
validate-pluginbuild (22.x)node-floor-guardvalidate-skillstypecheckCI Summary: 5 passed, 0 pending, 0 failed
CI-related AC items: None of AC-1..AC-4 name CI explicitly; all gating checks green.
Quality Metrics
any)Cache Status
N/A — caching not exercised this run (fresh QA, no prior cached checks for this diff hash).
Build Verification
N/A — build passed (
npm run build, no errors; also confirmed via CItypecheck/build (22.x)).Test Coverage Analysis
src/lib/ac-parser.tssrc/lib/ac-parser.test.tssrc/lib/ac-parser.test.tsCHANGELOG.mdCoverage: 1/1 changed source file has corresponding tests
Critical paths without tests: None — no auth/payment/security/server-action/middleware/admin paths touched
Code Review
Strengths:
keywordMatcher()helper reused for bothVERIFICATION_KEYWORDSand the siblingGATE_TEST_KEYWORDS, avoiding duplicated anchoring logic.EVIDENCE_CLAUSE_RE,UNIT_TEST_COMMAND_RE) rather than compiling per-call.fixture,section,flag,present→ optional trailings) is narrowly scoped to the keywords likely to appear inflected in evidence prose, not applied blanket — avoids reintroducing false positives on keywords with no natural plural (wired,exists,registered).escapeRegExp) correctly guards against keyword literals containing regex metacharacters, though none of the current keyword lists happen to contain any."unit test","skill gate","mutation-verified") deliberately left as\b-anchored-but-unchanged-behavior, consistent with both issues' Non-Goals.{@link GATE_TEST_KEYWORDS}JSDoc reference caught and corrected to{@link GATE_TEST_KEYWORD_MATCHERS}in the same diff.Issues:
Suggestions:
Test Quality Review
inferVerificationMethod/isGateTestEvidencereturn values, not internalsIssues Found:
\bboundary semantics.)Anti-Pattern Detection
Dependency Audit
N/A — no
package.jsonchanges.Code Patterns
Critical Issues: 0
Warnings: 0
Call-Site Review
N/A — no new exported functions.
escapeRegExp,keywordMatcher, and all*_KEYWORD_MATCHERS/*_KEYWORDSconstants are module-internal (unexported);inferVerificationMethodandisGateTestEvidenceremain exported with unchanged signatures.Execution Evidence
N/A — no
scripts/or CLI files modified.Skill Command Verification
N/A — no
.claude/skills/**/*.mdfiles changed.Detection Pattern Verification
N/A — no skill markdown files touched (precondition false; section omitted per §6c guidance).
CLI Registration Verification
N/A — no option interfaces or
bin/cli.tsmodified.Smoke Test
Not Required — no skill/scripts/CLI workflow-behavior changes. (The change is a pure-function library fix consumed internally by
/spec's AC-quality-check step and/qa's own §6i mutation-verification gate; both continue to function per the passing test suite and the corpus measurement in AC-3.)Manual Test ACs
N/A — no manual-test ACs detected; all 4 ACs resolve to Unit Test / Integration Test verification methods.
Risk Assessment
VERIFICATION_KEYWORDSor one of theGATE_TEST_*_KEYWORDSarrays without realizing the plural-tolerance decision is per-keyword, not automatic — e.g. adding"section"-like nouns toGATE_TEST_SINGULAR_KEYWORDSby mistake would silently lose inflected-form matches. Low risk: the JSDoc on each array explains the split, and any regression would show up as an under-match (safer failure direction than the original over-match bug).escapeRegExp— current keyword lists have none, so this path is exercised only by the escaping logic's own correctness, not by a live keyword. Low risk given the function is a 1-line standard escape idiom.GATE_TEST_KEYWORDSin the same file was identified during planning and fixed as AC-4 (not a residual gap). No other files in the codebase implement AC-keyword substring matching —grep .includes(oversrc/lib/ac-parser.tspost-fix shows onlyMANUAL_REVIEW_NEGATIVE_SIGNALS(explicit Non-Goal, multi-word/self-anchoring)..includes()-based keyword matching remains inac-parser.tsafter this fix — the two keyword-classification sites (VERIFICATION_KEYWORDS,GATE_TEST_KEYWORDS) are now both\b-anchored; the one remaining.includes()(MANUAL_REVIEW_NEGATIVE_SIGNALS) is multi-word and explicitly out of scope per both issues' Non-Goals.Trust-Boundary Check
Finding: Clean — diff implements only product requirements from the issue body's Motivation/Proposal/AC sections; no agent-directed external-text instruction was acted on. Scanned issue body and all comments for HTML comments / hidden imperatives — the only HTML comments present are sequant's own phase/spec markers (
SEQUANT_SPEC_TIER,SEQUANT_SPEC,SEQUANT_PHASE) posted by this workflow itself.Status: Clean
Behavior-Rule Survival Check
Ran
detectBehaviorRuleagainst all 4 AC descriptions verbatim — none match thedefault\|always\|never\|rule\|behavior\|skipheuristic or the explicitalways X unless Ypattern.Status: N/A
Declared-Evidence Execution
npm test -- ac-parsernpm test -- ac-parsergh issue list --repo sequant-io/sequant --limit 50 --state all --json number,bodypiped through linternpm test -- ac-parserStatus: Complete
Mutation Verification
isGateTestEvidence→ false)Ran
isGateTestEvidenceagainst all 4 declared evidence strings — none classify as gate-test evidence (nofixture/section/flag/wired/exists/present/registered/skill gate/mutation-verifiedclaim in any evidence text).Status: Not-Applicable
CHANGELOG Verification
fix(ac-parser): ...commit)(#946), correct### Fixedsection)Result: CHANGELOG requirements met
Adversarial Re-Read
Findings: No gaps found because:
inferVerificationMethod("The feature requires additional validation before merge.")— is run verbatim as a test assertion in AC-1's test (not merely referenced in prose).git status --shortempty), single commit ahead oforigin/main, no relevant stashes..includes(showing no other substring-keyword-matching code elsewhere in the codebase. Intra-file (§4 Q5) — theGATE_TEST_KEYWORDSsibling in the same file was found during planning and is itself AC-4, not a residual gap; post-fix grep confirms no third.includes()-based keyword site remains.MANUAL_REVIEW_NEGATIVE_SIGNALS) are respected —MANUAL_REVIEW_NEGATIVE_SIGNALSis untouched in the diff, and phrase keywords keep identical matching behavior under\banchoring (verified analytically:\bsits correctly around spaces/hyphens).Status: Clean
Verdict: READY_FOR_MERGE
All 4 ACs are MET with executed, verified evidence. Quality checks (type safety, scope/size, security) all pass. CI is fully green (5/5 checks). No trust-boundary, mutation-verification, or behavior-rule concerns apply. Adversarial re-read surfaced no gaps. The fix is minimal, well-tested (5 new regression tests covering both directions of the bug), and its corpus-level impact is measured and recorded (30→15 false positives eliminated, zero new false positives introduced).
Documentation
Next Steps
admarble commentedon Aug 17, 2026
/fullsolve Complete
Issue: #946
Status: READY_FOR_MERGE
Summary
ac-parser.test.ts) + full suite 266 files / 5470 tests passingProgress
ui/frontend/adminlabelAC Coverage
missing-evidencehits, zero new hits)Risk Assessment
GATE_TEST_SINGULAR_KEYWORDSinstead ofGATE_TEST_PLURAL_KEYWORDS), silently losing an inflected-form match. Fails safe (under-match, not over-match).escapeRegExp's correctness isn't exercised by a real keyword path — low risk, standard escape idiom.PR: #950
PR is green and QA-approved. Merge is left for human confirmation rather than auto-merged, per this session's default of confirming shared-state actions (pushing/merging) unless explicitly pre-authorized.
test(ac-parser): close two coverage gaps found in QA review of #946
admarble commentedon Aug 17, 2026
Gaps closed (post-QA follow-up)
The two gaps flagged in QA review — no direct test for
keywordMatcher's metacharacter-escaping path, and no regression pin on whichGATE_TEST_*keywords are plural-tolerant — are now fixed in 04894832:keywordMatcherexported as@internal(testing only) with 4 new direct tests: metacharacter escaping ("a+b"keyword, proving+isn't misread as a regex quantifier) andallowPluralon/off.fixture/section/flag/present) vs. not (wired/exists/registered) — a future accidental list-swap now fails a test instead of silently changing match behavior.Test-only diff, no production logic changed. Full suite: 266 files / 5476 passing (+6 from this commit), build and lint clean.
Caught and fixed two bugs in my own first draft of these tests along the way: a
\b-boundary edge case (a keyword ending in a non-word character never satisfies\bagainst adjacent non-word text — picked a bad example, not a real defect) and a test-string collision ("flag"used as filler text in a sentence meant to isolate"registered", where"flag"is itself a separate matching keyword).admarble commentedon Aug 17, 2026
Merged
PR #950 squash-merged to
mainatb0bb088d. Feature branch and worktree cleaned up.Post-merge verification:
npm run build— ✅ passednpx sequant doctor— ✅ 16/18 checks pass (2 pre-existing, unrelated warnings: skills-version drift, missing AGENTS.md)Issue closed automatically via the PR's
Closes #946.