Repository navigation
feat(#938): explicit Evidence: clause on ACs — declared verification replaces keyword inference - #945
Merged
admarble merged 3 commits intoAug 13, 2026
Conversation
- ac-parser: parse trailing `Evidence:` clause into AcceptanceCriterion.evidence; resolveVerificationMethod prefers declared evidence over keyword inference (backtick unit-test command -> unit_test, other backtick command -> integration_test, prose -> manual), falling back to inferVerificationMethod when no evidence is declared (AC-1, AC-2) - ac-linter: flag test-type ACs with no named evidence as incomplete, warning-only (AC-5) - spec/SKILL.md: testgen recommendation counts declared-evidence ACs before inferred ones (AC-3) - qa/SKILL.md: new §6g Declared-Evidence Execution — requires the declared command be executed/verified before an evidence-bearing AC is MET, wired into the §7 verdict algorithm and required in both QA modes (AC-4) - scoped gate tests for AC-3/AC-4 skill wiring; skill mirrors synced via npm run sync:skills
…ision, fix regressions - lint-skill-gates.test.ts hardcodes "§6g" as a synthetic placeholder id in its "catches a NEWLY ADDED section with no wiring" self-test; renaming the real Declared-Evidence Execution section to §6h avoids the id collision that made the self-test's injected unwired section read as already wired - testgen-skill.test.ts asserted the pre-#938 literal detection-logic strings verbatim; updated to the new declared-evidence-first wording - ac-parser.test.ts's verbatim #842 AC-6 fixture contains the literal text `describe.skipIf(!distExists)` as quoted subject matter, tripping dist-skip-guard.test.ts's source-text scanner; split across a string concatenation so the runtime string is unaffected but the source no longer contains a contiguous match - CHANGELOG entry for the Evidence: clause feature, including the AC-6 measurement result (30/220 ACs flagged over the last 50 issues, 17 of which trace to the pre-existing ui/display substring inference bug) Full unit project: 203 files, 4567 tests passed. Build and lint clean.
This was referenced Aug 13, 2026
Closed
…hema test, follow-up issues filed - ac-parser: splitEvidenceClause now splits on the LAST `Evidence:` occurrence instead of the first. AC prose can legitimately contain the word "Evidence:" before the real trailing clause (e.g. "cites strong Evidence: peer review... Evidence: `npm test -- foo`"); splitting on the first match corrupted extraction. Single-occurrence behavior unchanged (51 existing parser tests still pass), 2 new regression tests added. - ac-parser.test.ts: added direct unit tests for createAcceptanceCriterion's evidence parameter (state-schema.ts), previously exercised only transitively through parser tests. - Filed #946 (inferVerificationMethod substring-match bug, e.g. "ui" matching inside "requires") and #947 (fenced code-block AC examples silently shadowing the real AC via first-occurrence dedupe — this happened live to #938's own issue body). Both issues use the new Evidence: syntax on their own ACs. - Closed AC-4's live-dogfood requirement for real: extracted #946's actual declared-evidence AC-1 via extractAcceptanceCriteria, confirmed evidence field populated correctly, and executed the literal declared command (`npm test -- ac-parser`) — 56/56 passed. A genuine dogfood run on a real issue with a real declared-evidence AC, not a synthetic demo. Build, lint, and all evidence-related test files (131 tests) pass. src/commands/doctor.test.ts has 2 pre-existing failures unrelated to this change (confirmed identical on this branch's base commit and untouched since a May PR) — not fixed here as out of scope.
admarble
deleted the
feature/938-feat-spec-qa-explicit-evidence-clause-on-acs-d
branch
August 13, 2026 06:47
admarble
added a commit
that referenced
this pull request
Aug 13, 2026
Move the Evidence: clause entry (#938/#945) from the already-tagged [2.11.0] section into [Unreleased] — that feature landed in a commit after the v2.11.0 tag, so the published release never actually shipped it. Also document three 2.11.0 features that had no user-facing docs: the Evidence: clause syntax itself, the checkout-scoped lock and its pre-tool.sh HOOK_BLOCKED guard, and sequant worktree resolve/verify. Entire-Checkpoint: cd8d0213a8f9
4 tasks done
admarble
added a commit
that referenced
this pull request
Aug 17, 2026
…s, not word boundaries (#946) (#950) * fix(ac-parser): inferVerificationMethod matches keywords as substrings, 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 * test(ac-parser): close two coverage gaps found in QA review of #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.
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
Evidence:clause to Acceptance Criteria (- [ ] **AC-1:** ... Evidence: \npm test -- foo`).parseACLinesplits it into a newAcceptanceCriterion.evidencefield;resolveVerificationMethoduses declared evidence in place of keyword inference (backtick unit-test command →unit_test, other backtick command →integration_test, prose →manual), falling back to the existinginferVerificationMethodonly when no clause is present. Legacy issues (noEvidence:` clause) parse identically to before./spec's testgen recommendation counts declared-evidence ACs before inferred ones (all three skill mirrors)./qagains §6h "Declared-Evidence Execution": for any AC with a declared runnable command, QA must execute it (or verify a captured run) before marking that ACMET. Wired into the §7 verdict algorithm (declared_evidence_status), required in both Simple Fix and Standard QA modes,scripts/lint-skill-gates.tspasses clean.ac-lintergains a warning-only rule flagging a test-type AC with no named evidence asincomplete.Pre-PR AC Verification
parseACLineextracts trailingEvidence:clause; legacy ACs parse with zero diffsrc/lib/ac-parser.ts(splitEvidenceClause);src/lib/ac-parser.test.ts— legacy-corpus zero-diff tests use verbatim single-line ACs from #853 (AC-1) and #842 (AC-6), not synthetic fixturesresolveVerificationMethodinsrc/lib/ac-parser.ts; test asserts prose "e2e" + Evidence naming a unit-test command →unit_testwins, plus a second conflict fixture (inferVerificationMethod("...requires...")→browser_testvia the "ui" substring, a live false-positive discovered while planning this issue)/spectestgen recommendation counts declared-evidence ACs before inferredspec/SKILL.mdTestgen Phase Auto-Detection section, synced across.claude/skills,skills,templates/skills; scoped gate test insrc/lib/__tests__/evidence-clause-skill.test.ts, mutation-verified (see below)/qa§6h requires the declared command executed/verified before an evidence-bearing AC is METEvidence:-bearing AC (not a synthetic demo). Extracted #946's AC-1 viaextractAcceptanceCriteria, confirmed theevidencefield populated correctly, then executed the literal declared commandnpm test -- ac-parser— 56/56 passed, exit 0 — before crediting the AC.ac-linterflags test-type ACs with no named evidence asincomplete, warning-onlydetectMissingEvidenceinsrc/lib/ac-linter.ts; positive (unit/integration/browser) and negative (evidence present, manual-type) tests insrc/lib/ac-linter.test.tsCoverage: 6/6 fully met.
Post-QA gap fixes
The first QA pass on this PR found 4 gaps (see the QA comment on #938 for the original review). All addressed:
inferVerificationMethodsubstring-match bug ("ui"matching inside"requires", etc.) — filed as fix(ac-parser): inferVerificationMethod matches keywords as substrings, not word boundaries #946 rather than fixed here (broader change than this PR's scope)./specplanning) — filed as fix(ac-parser): fenced code-block AC examples get parsed as real ACs, silently shadowing the real one #947.splitEvidenceClausesplit-on-first-occurrence bug — AC prose can legitimately contain the word"Evidence:"before the real trailing clause (e.g. "cites strong Evidence: peer review... Evidence:npm test -- foo"); the first match would swallow the real clause. Fixed in this PR: now splits on the LAST occurrence. 2 regression tests added; all 51 pre-existing parser tests still pass unchanged.state-schema.ts'screateAcceptanceCriterionevidence parameter had only transitive test coverage — added 3 direct unit tests.Measurement (AC-6)
Command:
Then
extractAcceptanceCriteria+lintAcceptanceCriteria(this PR's code) over each issue body, counting ACs flaggedincompletewithproblem.includes("verification not named").ui/displaykeyword substring-match bug ininferVerificationMethod(not a genuine test-type signal)False-positive framing: 17 of the 30 hits (57%) trace to
inferVerificationMethod's.includes()substring match on"ui"/"display"(e.g. matching inside "quick", "requires", "guidance") rather than the AC actually needing a browser test — a defect class independent of this PR, filed as a follow-up rather than fixed here (word-boundary matching is a broader change toinferVerificationMethodthan the Evidence-clause feature). This means the new rule's precision is currently gated by that pre-existing bug: fixing the substring-match issue would roughly halve today's hit rate on this corpus. Recorded here so the later escalate-to-gate decision (see issue body's "Human decisions required") has real numbers rather than a guess.Mutation verification
src/lib/__tests__/evidence-clause-skill.test.ts(AC-3, AC-4 skill wiring) — 5 mutations run, each restored viagit checkoutafter confirming precise targeting:spec/SKILL.md's testgen detection-logic wording to the pre-feat(spec/qa): explicit Evidence: clause on ACs — declared verification replaces keyword inference #938 text → exactly 2 tests failed (the two AC-3 wording tests), 7/9 passed.ac-parser.test.ts/ac-linter.test.ts(AC-1, AC-2, AC-5) rely on the standard positive/negative test structure (unit_test resolves only when a matching command is declared;manualnever flags for missing evidence) rather than a separate mutation pass, since the runtime logic is directly exercised by 50+ assertions across both files.Test plan
npm run build— passesnpm run lint— passesnpx vitest run --project unit— 203 files, 4567 tests passed (4570 after the post-QA fixup commit; 2 pre-existing unrelated failures insrc/commands/doctor.test.tsconfirmed identical on this branch's base commit, untouched since a May PR — out of scope)npx tsx scripts/lint-skill-gates.ts— no violations (declared_evidence_status wired end-to-end)npm run lint:skill-sync— all 44 files synced across the three skill mirrors/qadogfood run on a declared-evidence AC — see AC-4 row aboveCloses #938
Related: #946, #947 (follow-ups filed from this PR's own QA review)
🤖 Generated with Claude Code