Repository navigation
Description
Problem
QA SKILL.md has grown to 2,973 lines / ~18K words, with most growth from gap-detection sections added in 2026:
| Section | PR | Cost (rough) |
|---|---|---|
| Section 6c — detection-pattern verification | #572 (#551) | runs on skill regex/grep changes |
| Section 6d — Adversarial Re-Read structured | #584 (#582) | mandatory on all standard QA |
| §4 Q5 — intra-file sibling-site | #589 (#587) | every QA run |
| §5 — cross-file sibling-site | #576 (#573) | every QA run |
| Spec sibling-site scan mirror | #594 (#580) | every spec run |
| Spec ac-linter (title/body tension) | #586 (#571) | every spec run |
Each addition was reactive to a real failure (e.g., PR #547 missed 3 bugs that #551 would have caught). But cumulatively the gap-check prompts run on every QA invocation, paying tokens whether they surface anything or not.
We don't currently know the ratio of "gap flagged" → "gap actioned" (became a follow-up issue, AC-fix, or pre-merge change) vs. "gap flagged" → "no action taken / dismissed as out-of-scope."
If most flags don't graduate to action, we're paying ~Nx token cost for the small fraction that does — and the recurring guardrail memories (feedback_qa_break_vs_loop.md, feedback_evaluate_gaps_before_fixing.md, feedback_gap_fixing_diminishing_returns.md) suggest the dismissal rate is high.
The #513 trim (April 2026) explicitly removed verbose adversarial questions because they weren't earning their keep. We've added ~6 sections since. Without a signal-to-noise number, the trim/add cycle will repeat.
Strategy
Phase A — Mine existing data
- AC-1: From recent QA outputs (PR review comments + run logs), categorize each flagged gap:
- Actioned in same PR (fixed before merge)
- Filed as follow-up issue
- Dismissed in QA verdict ("not in scope" / "evaluated, not worth fixing")
- Not addressed (mentioned, no follow-through)
- AC-2: Segment by section: which gap-check sections produce the highest action rate, which produce mostly dismissals?
- AC-3: Estimate token cost per gap-check section (run with/without and diff the QA output token count on representative PRs).
Phase B — Output
- AC-4: Report action rate per section. Recommend keep / trim / remove.
- AC-5: If a section's action rate is below threshold (proposal: <30%), recommend either (a) removing it, or (b) gating it behind a deterministic precondition (e.g., only run §6c when diff touches
*.shor skill markdown).
Sample-size caveat
npx sequant stats shows 56 total local runs. Recent QA additions are even thinner. May need to expand the analysis window via gh pr list PR comments, not just local run logs. Flag this in Phase A.
Non-Goals
- Removing gap-checks pre-emptively without data.
- Adding new gap-checks. Inverse direction.
References
- investigate(metrics): chain mode 29% success rate vs 92% single-issue — failure forensics #604 — chain-mode forensics (similar data-driven pattern)
- Data-driven workflow optimization: systematic analysis of run logs and conversation data #437 — original data-driven workflow optimization issue
- PR fix(#513): simplify adversarial self-evaluation to 2-field risk assessment #514 (fix: simplify adversarial self-evaluation to 2-field risk assessment #513) — prior simplification of adversarial self-evaluation (33 lines → 8)
feedback_qa_break_vs_loop.md,feedback_evaluate_gaps_before_fixing.md,feedback_gap_fixing_diminishing_returns.md,feedback_qa_recommendation_vs_ac_gap.md— guardrails-against-gap-noise
Activity
admarble commentedon May 9, 2026
→ PROCEED — Investigation issue with 6 ACs phased A→B; mines existing data (
metrics.json,runs/*.json, PR comments). No implementation until findings drive it.Workflow:
spec → exec → qawith quality loop⚠ Sample-size caveat called out in body — only ~16 chain runs locally; widening window via
gh pr listPR comments may be needed in Phase A.⚠ Unblocks #609 once per-section action rate is reported.
admarble commentedon May 10, 2026
Supersedes prior assess from 2026-05-09 (PROCEED)
→ PROCEED — Investigation issue with 5 ACs phased A→B; mines existing data (
metrics.json,runs/*.json, PR comments). No implementation until findings drive it.Workflow:
spec → exec → qawith quality loop⚠ Sample-size caveat in body — only ~16 chain runs locally; widen window via
gh pr listPR comments in Phase A.⚠ Unblocks #609 once per-section action rate is reported.
admarble commentedon May 10, 2026
Spec — Plan
Complexity: Standard (5 ACs)
Workflow:
spec → exec → qawith quality loop (npx sequant run 608 -q)Conflict risk: #604 worktree open against
scripts/analytics/analyze-runs.ts— isolating #608 logic into a newscripts/analytics/gap-signal.tsmodule to avoid collision.Plan
scripts/analytics/gap-signal.ts.gh issue view --commentsover ~50 merged PRs since 2026-04-01 → parse QA-verdict comments → section-attribute each gap flag → classify fate (actioned / filed / dismissed / silent). Output:gaps.jsonl.docs/investigations/qa-gap-signal-to-noise.mdwith action-rate × token-cost table + keep/trim/remove/gate recommendations. For "gate," propose a deterministic precondition (file glob / label / AC pattern) ready for investigate(qa): extract deterministic gap-checks into pre-QA script gate #609.Acceptance Criteria
actioned_in_pr/filed_followup/dismissed/silent. Source: issue comments (perproject_qa_comment_location.md).metrics.tokensUsed: 0in.sequant/logs/run-*.json).docs/investigations/qa-gap-signal-to-noise.md; summary comment on this issue.Sample-size guard
Issue body warns ~16 chain runs locally. Mitigation: mining PR comments via
ghwidens to ~50 candidates since 2026-04-01. If post-mining N < 20 flags, surface as "needs more data" caveat — do not gate the deliverable on N (perfeedback_evidence_over_theory.md).Key open questions
docs/investigations/qa-gap-signal-to-noise.md(new directory). Will also post a summary comment here when the investigation closes out.Verification methods (Decision Framework)
All five ACs verify as Manual Test (analysis deliverables); AC-1 also generates a reproducible parser script that gets light Integration Test coverage on a fixture set of QA comments. Skipping
testgenphase — no Unit-Test-verified ACs.admarble commentedon May 10, 2026
Exec — Progress Update
PR: #623
Branch:
feature/608-investigate-metrics-gap-check-signal-to-noise-doesAC Coverage
classifyFate()ingap-signal.tsproducesactioned_in_pr/filed_followup/dismissed/silent/not_triggered; raw output at.sequant/gap-signal.jsonl(134 rows, gitignored)docs/investigations/qa-gap-signal-to-noise.md;displayReport()stdout tablemeasureSkillCost()reports lines + words per parent section. Single-shot ablation calibration deferred —metrics.tokensUsedis unwired in run logs as the spec called outdocs/investigations/qa-gap-signal-to-noise.mdplus this commentHeadline findings (window 2026-04-01 → 2026-05-10, 50 PRs, 134 flag rows)
Two clear remove/gate candidates — §6c (zero substantive findings in 11 emits, 156 SKILL.md lines per QA invocation) and §6d (9 findings, all dismissed-or-silent, no follow-up issue, no fix). Two clear keeps: §5 and the spec sibling-site scan, both at the proposed 30% threshold.
Files changed
scripts/analytics/gap-signal.ts(new — 470 LOC mining + classification)scripts/analytics/gap-signal.test.ts(new — 7 vitest cases, injected fetchers, no liveghcalls)docs/investigations/qa-gap-signal-to-noise.md(new — investigation report)CHANGELOG.md(added entry under[Unreleased] / ### Added)Test/Build/Lint Results
npm run build— ✅ cleannpm run lint— ✅ 0 errors, 0 warningsnpx vitest run scripts/analytics/gap-signal.test.ts— ✅ 7/7 passQuality Plan Alignment
Quality Plan Alignment: N/A — spec did not include a Feature Quality Planning section (investigation/analysis issue, not a feature).
Sample-size caveat (per spec)
§6d had only 14 emits because the structured form was promoted on 2026-05-06 (PR #584). The full 50-PR window is otherwise representative. Recommend re-running this analysis in 60 days to confirm the §6d trim recommendation:
npx tsx scripts/analytics/gap-signal.ts --since 2026-04-01 --limit 100.Pre-PR Confidence Check
gap-signal.tshas unit tests that cover section attribution, fate classification, action-rate math, and the missing-skill-file branch. Liveghfetchers are not unit-tested but were validated against real data (134 flags extracted, manually spot-checked across §4 Q5, §5, §6c, §6d). Acceptable — the live integration is a thin shell overgh issue view/gh pr listwhich would add brittle test surface for little value.Documentation
[Unreleased] / ### Addeddocs/investigations/qa-gap-signal-to-noise.mdNext Steps
admarble commentedon May 10, 2026
QA Review for Issue #608
Commit reviewed:
0d7befc(PR #623)AC Coverage
actioned_in_pr/filed_followup/dismissed/silentFateunion ingap-signal.ts:115-120covers all 4 required buckets +not_triggeredfor N/A;classifyFateregex set (FOLLOWUP_RE,ACTIONED_RE,DISMISS_RE) is reasonable; raw rows persisted to.sequant/gap-signal.jsonl(136 rows on live run).gap-signal.ts:48-109). However, both the CLIdisplayReportand the doc's TL;DR table iterate sections in declared/array order, not sorted descending. AddingsectionRollups.sort((a,b) => b.actionRate - a.actionRate)before the return atgap-signal.ts:431would meet the literal AC. Cosmetic — substantive data is correct.measureSkillCost, lines 317–337).metrics.tokensUsed: 0caveat ✅ (doc line 73). The "1 ablation calibration on one PR" is missing. Doc line 74 says "A single ablation calibration is recorded inline below", but the## Findingssection only quotes word counts (e.g. "156 lines / 1,406 words" for §6c) — no actual ablation measurement (e.g. PR-X token-count with vs without §6c prompt) appears anywhere in the doc. Promise unfulfilled.docs/investigations/qa-gap-signal-to-noise.md; summary comment on this issueassess/spec/execphase markers; no investigator-summary comment. The spec plan explicitly committed to "Will also post a summary comment here when the investigation closes out."git diffprecondition snippet; §4 Q5 gated by file-shape heuristic; §6d trimmed to 1-paragraph; §5 + Spec sibling kept; Spec AC linter regex tightening proposed. AC's "recommend either (a) removing it, or (b) gating it" allows adjustment ("proposal — adjust if data shows a natural gap"); the trim/regex-tighten deviations are reasoned.Coverage: 3/5 AC items fully met; 2 partially met (AC-3, AC-4).
CI Status
build (20.x)build (22.x)validate-skillstypecheckvalidate-pluginCI Summary: 3 passed, 2 pending, 0 failed. Diff is not markdown-only (touches
scripts/analytics/*.ts), so the markdown-only build-matrix relaxation does not apply — pending build checks remain gating. Re-check when build matrix completes.Quality Metrics
any)npx tsc --noEmit— clean.npx vitest run scripts/analytics/gap-signal.test.ts— 7/7 pass. Livenpx tsx scripts/analytics/gap-signal.ts --since 2026-04-01 --limit 50— produces well-formed table; per-section numbers match the doc's TL;DR (modest drift on §6d/§spec.aclinter run-counts since the doc was authored — expected as new merged PRs accrue).Test Coverage Analysis
scripts/analytics/gap-signal.tsgap-signal.test.ts(220 lines, 7 tests, mocked fetchers)docs/investigations/qa-gap-signal-to-noise.mdCHANGELOG.mdCoverage: Tests cover section attribution, fate classification (all 4 categories +
not_triggered), action-rate math, and missing-skill-file edge case. Mocked-fetcher pattern keeps tests live-gh-free. Gap: no integration test against a realgh issue viewpayload — but the AC-1 spec marks AC-1 as "Manual + Integration Test"; the unit fixtures functionally cover the integration path.Code Review
Strengths:
scripts/analytics/gap-signal.tsrather than touchinganalyze-runs.ts(which investigate(metrics): chain mode 29% success rate vs 92% single-issue — failure forensics #604 has open).SECTIONSarray, lines 48–109) is the right abstraction — each gap-check is a row with header regex, optional bullet anchor, SKILL.md path, and section anchor. Easy to add/remove sections.MineOptions.fetchers) so tests don't shell out — this is exactly the pattern that lets future maintainers re-run the analysis against fixture data.feedback_evidence_over_theory.md.Issues:
displayReportdoes not sort byactionRatedescending (gap-signal.ts:473iteratesreport.sectionsin array order). One-line fix:for (const s of [...report.sections].sort((a,b) => b.actionRate - a.actionRate)). See AC-2.mine()signature returns sections in declared order; if any consumer (the doc's TL;DR table generator, future CLI rendering) relies on declared order, sorting indisplayReportis the right fix rather than mutatingmine()'s output.docs/investigations/qa-gap-signal-to-noise.md. The doc line 74 promises "recorded inline below" but the## Findingssections only quote word counts. Add a 1–2 paragraph block under### Phase B — costshowing one PR re-run with one section's prompt removed and the token-count delta. See AC-3.Suggestions:
--outdefault.sequant/gap-signal.jsonlis fine, but consider gitignoring it;.sequant/already is in this repo (.sequant/state.jsonetc.). Verify by inspection — the file exists in working tree from the smoke run; not staged.excerpt.length > 60cutoff inextractFlag(line 265) is mentioned as a heuristic but not as a tunable; considerMIN_EXCERPT_LEN = 60constant for documentation.fetchIssueswallows all errors silently (return null). Fine for one-off analytics, but a one-line warning to stderr would help future debugging ifghrate-limits.Test Quality Review
report.sections[*].byFate/.actionRate— outputs, not internals.ghJSON or missingSEQUANT_PHASEmarker. Acceptable for a one-shot analytics script.gh-shelling boundary is mocked (makeFakeFetchers).Anti-Pattern Detection
Dependency Audit
N/A — no
package.jsonorpackage-lock.jsonchanges.Code Patterns
No critical issues.
execSynccalls inlistMergedPrIssuesandfetchIssueuse parameterized arguments (no shell concatenation of untrusted input — inputs are integers / ISO dates from CLI flags). One minor note:--search "merged:>=${since}"is a controlled string, not user-attacker-controlled.Critical Issues: 0
Warnings: 0
Execution Evidence
npx vitest run scripts/analytics/gap-signal.test.tsnpx tsc --noEmitnpx tsx scripts/analytics/gap-signal.ts --since 2026-04-01 --limit 50 --out /tmp/gap-signal-qa-test.jsonlEvidence status: Complete
CHANGELOG Verification
feat(#608): mine gap-check signal-to-noise across recent merged PRs)[Unreleased]entry(#608), includes script + doc paths)Result: CHANGELOG requirements met.
Manual Test ACs
All 5 ACs are spec-marked Manual (AC-1 also Integration Test). Runtime checks performed by this QA pass: live execution of
gap-signal.ts(AC-1, AC-2 data presence), grep for the ablation calibration in the doc (AC-3 — not found),gh issue viewfor summary comment (AC-4 — not found), inspection of recommendations table (AC-5).Risk Assessment
/Adversarial Re-?Read/i,/Detection Pattern Verification|Section 6c|§6c|.../i) are tied to today's section names. If a future skill change renames §6c to §6f, this script silently goes to "0 emits" and the next investigation will misread that as "section is dead" rather than "anchor drifted." Mitigation: re-run against a few fixture PRs whenever the QA SKILL.md adds/renames a gate.gh pr list/gh issue viewintegration is not exercised by the test file (only mocked fetchers). The smoke run I executed inline covers this for the 50-PR window but provides no permanent regression coverage. Acceptable for a one-shot analytics script.scripts/analytics/analyze-runs.tsis the obvious sibling (same directory, same purpose-class — workflow analytics). Spec correctly isolated this work into a new file to avoid investigate(metrics): chain mode 29% success rate vs 92% single-issue — failure forensics #604's worktree collision; no shared code that would carry the same root-cause pattern. None — no cross-file siblings with the same root cause.gap-signal.ts); there are no adjacent call sites in the same file that share a destructive/null-check/iteration pattern relevant to this change.Adversarial Re-Read
actioned_in_pr/filed_followup/dismissed/silent) appear literally in theFatetype union. Verbatim AC-5 threshold (< 30%) is implemented asactionRate < 0.30decision in the doc's recommendations. No verbatim-fixture regression.ghdata (post-fix validation), not a pre-fix bug repro. Numbers in the live run drift slightly from the doc (67 vs 66 QA comments, etc.) because new PRs have merged since the doc was authored — that's expected freshness, not evidence inflation.origin/feature/608-...; no stashed changes. Phase markers (spec:completed,exec:completed) are present and well-formed.analyze-runs.ts); intra-file = single-script fix.Findings: No severe gaps. Three non-severe gaps already enumerated in AC Coverage (sort order, ablation calibration, summary comment).
Status: Gaps Found
Verdict: AC_NOT_MET
Two ACs are partially met:
These are not fundamental design issues — both are completion gaps in the open PR. Per
feedback_fill_gaps_in_pr.md, the right move is to fill them in this PR rather than file follow-ups.Documentation
docs/investigations/qa-gap-signal-to-noise.mdwritten (197 lines, all sections present except the missing ablation paragraph)README.md— N/A (script is for one-shot analytics, not a new sequant CLI surface)Next Steps (in priority order)
wc -l <(gh issue view 589 --json comments -q '.comments[].body')with vs without the §X-prompt-section's contribution, and record the line/word-count delta as the calibration data point. 1–2 paragraphs under### Phase B — costresolves AC-3.docs/investigations/qa-gap-signal-to-noise.mdfor the full report.displayReport(gap-signal.ts:473) and re-render the doc's TL;DR table in the same order. Optional but aligns with the literal AC-2 wording./qa 608after fixes land — the verdict will move toREADY_FOR_MERGEonce AC-3 and AC-4 are completed (assuming pending CI build matrix has gone green by then).fix(#608): close QA gaps — sort by action rate + ablation calibration
admarble commentedon May 10, 2026
Investigation summary — gap-check signal-to-noise (per AC-4)
Full report:
docs/investigations/qa-gap-signal-to-noise.md. Raw flag rows:.sequant/gap-signal.jsonl(134 rows over 50 merged PRs, 2026-04-01 → 2026-05-10).TL;DR
Sections sorted by action rate, descending:
Key findings
Non-Goals,out of scope,non-blocking) or silent — visibility without action.Recommendations (input to #609)
.ts/.tsx/skill files containing regex/grep/awk/jq/sed literals); suppress the entire section when false. Largest single saving.N/Afor single-call-site / docs / config diffs)."etc." references unchanged codefalse-positive pattern, dismissed in feat(spec): ac-linter title/body tension — coverage tightening #597).Caveats
metrics.tokensUsed: 0); cost figures are word-count proxies anchored to one ablation calibration on §6c.Reproduce:
npx tsx scripts/analytics/gap-signal.ts --since 2026-04-01 --limit 50. Tests:npx vitest run scripts/analytics/gap-signal.test.ts.admarble commentedon May 10, 2026
QA Review for Issue #608 (re-run)
Commit reviewed:
b18a7bb(PR #623, after gap fixes)AC Coverage
actioned_in_pr/filed_followup/dismissed/silentFateunion (gap-signal.ts:115-120) covers all 4 required buckets +not_triggered;classifyFateregex set unchanged from prior pass; 134 raw rows persisted on live run.displayReportnow sorts sections descending byactionRate(gap-signal.ts:473-477); doc TL;DR table re-rendered in same order with explicit "Sections sorted by action rate, descending (matchesdisplayReportoutput)" caption. Live run output: §5 (33%) → Spec sibling (29%) → §4 Q5 (17%) → Spec AC linter (17%) → §6c (0%) → §6d (0%).metrics.tokensUsed: 0caveat ✅. Ablation calibration paragraph added (doc lines 78–101) — measures §6c against full QA SKILL.md on PR #616: 3,042 vs 2,886 lines, 18,703 vs 17,297 words, ~24,310 vs ~22,486 tokens, delta ~−1,824 tokens / QA invocation. Reproduce snippet included. Other rows (§6d ~660 tok, §4 Q5 ~260 tok) anchored to the same heuristic.docs/investigations/qa-gap-signal-to-noise.md; summary comment on this issuegit diffprecondition; §4 Q5 gated by file-shape heuristic; §6d trimmed to 1-paragraph; §5 + Spec sibling kept; Spec AC linter regex tightening proposed.Coverage: 5/5 AC items fully met (was 3/5 last pass; AC-2 + AC-3 + AC-4 closed)
Original ACs: 5/5 met
Derived ACs: N/A — no Feature Quality Planning section in issue comments
CI Status
build (20.x)build (22.x)validate-skillstypecheckvalidate-pluginCI Summary: 5 passed, 0 pending, 0 failed. PR
mergeable=MERGEABLE(wasCONFLICTINGbefore merge oforigin/main; resolved with merge commitd207dec).Quality Metrics
any)npx tsc --noEmit— clean.npx vitest run scripts/analytics/gap-signal.test.ts— 7/7 pass. Livenpx tsx scripts/analytics/gap-signal.ts --since 2026-04-01 --limit 10— table now sorted descending (§5 33% first, §6d 0% last). Tests untouched since prior pass; sort change is pure-output; doc/CHANGELOG markdown-only.Test Coverage Analysis
scripts/analytics/gap-signal.tsgap-signal.test.ts(220 lines, 7 tests)docs/investigations/qa-gap-signal-to-noise.mdCHANGELOG.mdThe new sort is one line at a public seam; not separately tested (test suite asserts on
report.sectionsshape, which is unchanged — the sort is a pure-display detail ofdisplayReport). Acceptable.Code Review
Strengths:
[...report.sections].sort(...)copies before sorting, so callers that consumereport.sections(the--jsonoutput, the JSONL row writer, the doc table generator) still see declared/structural order. Only the human-readabledisplayReportsees the sorted order. Right separation per the prior QA reviewer's suggestion."Sections sorted by action rate, descending (matches displayReport output)"makes the order intentional rather than a coincidence; future readers know not to re-shuffle.wc -l/wc -w/sed '1804,1959d' | wc -l), conservative 1.3-token-per-word heuristic with a^1footnote acknowledging the floor estimate. Other rows in the cost column now have a translation key.Issues: None substantive. The two PR-#623-vs-main file overlaps from before the merge (
CHANGELOG.md) are resolved; merge commit cleanly preserved both #608 and #618 entries.Suggestions: None.
Anti-Pattern Detection
Dependency Audit
N/A — no
package.json/package-lock.jsonchanges since last QA pass.Code Patterns
No issues. The sort lambda uses
b.actionRate - a.actionRate(descending) — correct direction; deterministic sinceactionRateisnumber. No NaN risk:actionRateistriggered.length > 0 ? actioned / triggered.length : 0(gap-signal.ts:425), so neverNaN. Tie-break (two sections at 0%) preserves stable order — fine since 0% sections are visually equivalent.Critical Issues: 0
Warnings: 0
Execution Evidence
npx vitest run scripts/analytics/gap-signal.test.tsnpx tsc --noEmitnpx tsx scripts/analytics/gap-signal.ts --since 2026-04-01 --limit 10 --out /tmp/gap-signal-smoke.jsonlwc -l .claude/skills/qa/SKILL.md && sed '1804,1959d' .claude/skills/qa/SKILL.md | wc -lEvidence status: Complete
CHANGELOG Verification
feat(#608): mine gap-check signal-to-noise across recent merged PRs)[Unreleased]entry(#608), includes script + doc paths)Result: CHANGELOG requirements met. Merge commit
d207deccorrectly preserved both the #608 and #618 entries side-by-side under### Added.Self-Evaluation
ghdata and produces 33% (§5) at the top of the table; ablation calibration verified by re-running thewc/sedcommands inline; AC-4 summary comment fetched back viagh issue viewto confirm posting.report.sections[*]shape and fate classification; the new sort is adisplayReport-only concern not exercised by tests. Live smoke covers the sort end-to-end.Verdict: READY_FOR_MERGE
All 5 ACs are now MET. The three completion gaps from the prior pass are closed:
displayReport; doc TL;DR table re-rendered in matching order.CI is green across all 5 checks. PR
mergeable=MERGEABLE. CHANGELOG entry present with both #608 and #618 preserved through the merge commit.Documentation
docs/investigations/qa-gap-signal-to-noise.mdcomplete (237 lines, ablation calibration present at lines 78–101)Next Steps
chore(#608): close QA suggestions — surface silent failures + lift ma…
feat(#608): mine gap-check signal-to-noise across recent merged PRs (#…
fix(#609): close three gaps surfaced in post-commit QA
feat(#609): extract deterministic QA gap-checks into precheck script (#…
fix(#834): §7 gates must be reachable — lint /qa's own enforcement ch…