Repository navigation
Conversation
New `scripts/qa/precheck.ts` runs three deterministic gap-checks before
the QA agent and emits `.sequant/gap-precheck.json`:
- fixtures — verbatim motivating-example extraction from issue body
(feeds §6d Q1 / §6c Step 4)
- siblingGrep — changed-identifier scan for cross-file sibling sites
(feeds §5)
- acLiteralDiff — AC checkbox IDs in issue body vs PR body (feeds §1)
`qa/SKILL.md` gains Phase 0c that runs the precheck inline and consumes
its findings. §6c becomes a file-glob hard precondition (no skill-md
diff → emit nothing). §6c Step 4 prefers precheck `fixtures` over the
inline `awk` extractor when available. §6d trims to a single
adversarial paragraph (per #608's 9/14 / 0-actioned signal).
Inline fallback preserved on missing/error/`not_applicable` output.
Mirrored across all three `qa/SKILL.md` copies. Exit code always 0.
Investigation doc at `docs/investigations/qa-precheck-extraction.md`
covers AC-1 (22-row gate classification), AC-2 (per-PR run frequency),
AC-5 (section-size delta calibration via #608's 50-PR window:
~−1,585 tok/invoke window-typical), and AC-6 (regression-coverage
methodology against PR #547 / PR #533 shapes).
Builds on #608's signal-to-noise data which informed Phase A scope.
6 tasks
Gap 1 — §6c precondition greps diff hunks, not file content. The first cut of this section's precondition shelled out to `xargs grep -lE ...` against the *current* skill-md file content. All 19 sequant SKILL.md files mention `grep|awk|jq|sed` in unrelated example code, so the gate triggered on 100% of skill-md PRs and the cost-saving intent of #608 / #609 evaporated. The fix iterates the diffed skill-md files and only triggers §6c when the **added lines** contain the patterns. On 6 historical merged PRs (#623 #620 #621 #617 #622 #547) the new gate skips §6c on 4/6 (67%) — vs 0/6 under the old content-grep gate. Mirrored across `.claude/skills/`, `templates/skills/`, `skills/`. Gap 2 — `extractIdentifiersFromDiff` skips indented locals. `content = line.slice(1).trimStart()` defeated the comment's claim of "no nested-block decls" by stripping the indent that distinguishes top-level from function-body declarations. The dogfood run on #609 surfaced 24 identifiers (17 of them local `const lines = …` / `let inFence = …` style variables). Dropping `.trimStart()` brings the surface to top-level decls only. New test asserts indented `+ const local = …` is skipped while `+const topLevel = …` matches. Gap 3 — Empirical 5-PR replay for AC-5 / AC-6. New `--base-sha` / `--head-sha` CLI flags let `precheck.ts` replay against historical merged PRs. SHAs validated with `/^[0-9a-f]{4,40}$/` to avoid shell injection. Ran replay against 6 PRs (5 recent + #547 for AC-6 demo): aggregate ≈ −1,002 tok/PR under the new gate; PR #620's replay surfaced `acLiteralDiff.missingInPR.length = 8` — a real catch the inline §1 prose was supposed to make but #608's data shows §1 surfaced silently for years. Investigation doc appended with per-PR table + correction to the prior "true on 0 PRs" calibration claim. Test count: 27 → 30 (indented-skip + 2 parseArgs flag tests). `scripts/check-skill-sync.ts` reports qa/SKILL.md synced 3/3.
…te-qa-extract-deterministic-gap-checks-in # Conflicts: # CHANGELOG.md
admarble
deleted the
feature/609-investigate-qa-extract-deterministic-gap-checks-in
branch
May 11, 2026 23:16
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
scripts/qa/precheck.ts(618 LOC + 27 passing tests) runs three deterministic gap-checks before the QA agent and writes findings to.sequant/gap-precheck.json: fixtures (verbatim motivating-example extraction → §6d Q1 / §6c Step 4), siblingGrep (changed-identifier cross-file scan → §5), acLiteralDiff (AC checkbox IDs issue body vs PR body → §1). Exit code always 0.qa/SKILL.mdgains Phase 0c: Precheck Findings that consumes the JSON inline and falls back to inline checks on missing/error/not_applicable. §6c becomes a file-glob hard precondition; §6c Step 4 prefers precheckfixturesover the inlineawkextractor; §6d trims to a single adversarial paragraph (per investigate(metrics): gap-check signal-to-noise — does flagged → action rate justify cumulative QA prompt cost? #608's 9/14 / 0-actioned signal). Mirrored across all threeqa/SKILL.mdcopies.docs/investigations/qa-precheck-extraction.md(22-row gate classification, per-PR run frequency, section-size delta calibration ≈ −1,585 tok/invoke window-typical, PR feat(#529): enforce manual-test AC gate in QA skill #547 / PR feat(assess): default spec phase ON, remove bug/docs auto-skip #533 regression-shape coverage methodology). Builds directly on investigate(metrics): gap-check signal-to-noise — does flagged → action rate justify cumulative QA prompt cost? #608's signal-to-noise data — §6c and §6d were classified as remove-or-gate (not script) candidates, confirmed here.AC Coverage
docs/investigations/qa-precheck-extraction.mdPhase A — 22-row table covering §1 through §6escripts/qa/precheck.ts→.sequant/gap-precheck.jsonqa/SKILL.mdconsumes precheck + inline fallbackscripts/check-skill-sync.ts→synced qa/SKILL.md — 3/3 match)AC_MET_BUT_NOT_A_PLUSper QA)QA was already run pre-commit (
AC_MET_BUT_NOT_A_PLUS— all 6 ACs MET; demotion was uncommitted + empirical-replay-deferred). Re-running/qa 609post-merge will validate the precheck against its own non-trivial diff.Test plan
npm run build— passes (tscclean)npm run lint— passes (eslint clean, 0 warnings)npx vitest run scripts/qa/precheck.test.ts— 27/27 passnpx tsx scripts/qa/precheck.ts --issue 609 --out /tmp/pre.json— smoke; emits valid JSON; exit 0npx tsx scripts/check-skill-sync.ts—qa/SKILL.mdsynced 3/3/qa 609after PR creation — confirms precheck self-detects its own 7 new exported functions as candidate sibling-site identifiers (expected per QA Adversarial Re-Read)Closes #609