Skip to content

investigate(metrics): gap-check signal-to-noise — does flagged → action rate justify cumulative QA prompt cost? #608

Closed

Description

@admarble

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 *.sh or 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

Activity

  1. added
    enhancement
    qa
    needs-improvement
    on May 9, 2026
  2. admarble commented on May 9, 2026

    @admarble
    ContributorAuthor

    → 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 → qa with quality loop

    npx sequant run 608 -q
    

    ⚠ Sample-size caveat called out in body — only ~16 chain runs locally; widening window via gh pr list PR comments may be needed in Phase A.
    ⚠ Unblocks #609 once per-section action rate is reported.

  3. admarble commented on May 10, 2026

    @admarble
    ContributorAuthor

    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 → qa with quality loop

    npx sequant run 608 -q
    

    ⚠ Sample-size caveat in body — only ~16 chain runs locally; widen window via gh pr list PR comments in Phase A.
    ⚠ Unblocks #609 once per-section action rate is reported.

  4. admarble commented on May 10, 2026

    @admarble
    ContributorAuthor

    Spec — Plan

    Complexity: Standard (5 ACs)
    Workflow: spec → exec → qa with quality loop (npx sequant run 608 -q)
    Conflict risk: #604 worktree open against scripts/analytics/analyze-runs.ts — isolating #608 logic into a new scripts/analytics/gap-signal.ts module to avoid collision.

    Plan

    • Phase 1 — Mine: New scripts/analytics/gap-signal.ts. gh issue view --comments over ~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.
    • Phase 2 — Cost: Word-count proxy of QA SKILL.md sections (cheap, deterministic) + 1 ablation calibration on one PR (ground-truth scale factor). Avoids N×$1–2 of re-running full QA.
    • Phase 3 — Report: docs/investigations/qa-gap-signal-to-noise.md with 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

    • AC-1 (Manual + Integration Test): Categorize each flagged gap as actioned_in_pr / filed_followup / dismissed / silent. Source: issue comments (per project_qa_comment_location.md).
    • AC-2 (Manual): Per-section action rate sorted descending. Sections: §4 Q5, §5, §6c, §6d, §6e, spec sibling-scan, spec ac-linter.
    • AC-3 (Manual): Per-section token cost via word-count proxy + 1 ablation calibration. Acknowledge run logs do not capture per-section token usage (metrics.tokensUsed: 0 in .sequant/logs/run-*.json).
    • AC-4 (Manual): Report at docs/investigations/qa-gap-signal-to-noise.md; summary comment on this issue.
    • AC-5 (Manual): For sections with action_rate < 30% (proposal — adjust if data shows a natural gap), recommend removal or deterministic gating with implementable precondition for investigate(qa): extract deterministic gap-checks into pre-QA script gate #609.

    Sample-size guard

    Issue body warns ~16 chain runs locally. Mitigation: mining PR comments via gh widens 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 (per feedback_evidence_over_theory.md).

    Key open questions

    1. AC-3 token-cost methodology: word-count proxy + single ablation calibration is the cheap default. Confirm before exec or we'll over/under-spend on re-running QA.
    2. Sample window: April 1 onward (covers all six gap-check sections post-introduction). Going earlier dilutes the dataset with PRs predating §6d/§6c.
    3. Report location: 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 testgen phase — no Unit-Test-verified ACs.

  5. added
    planned
    on May 10, 2026
  6. admarble commented on May 10, 2026

    @admarble
    ContributorAuthor

    Exec — Progress Update

    PR: #623
    Branch: feature/608-investigate-metrics-gap-check-signal-to-noise-does

    AC Coverage

    AC Status Evidence
    AC-1 (categorize each flag) ✅ MET classifyFate() in gap-signal.ts produces actioned_in_pr / filed_followup / dismissed / silent / not_triggered; raw output at .sequant/gap-signal.jsonl (134 rows, gitignored)
    AC-2 (per-section action rate sorted) ✅ MET TL;DR table in docs/investigations/qa-gap-signal-to-noise.md; displayReport() stdout table
    AC-3 (per-section token cost via word-count proxy) ✅ MET (with caveat) measureSkillCost() reports lines + words per parent section. Single-shot ablation calibration deferred — metrics.tokensUsed is unwired in run logs as the spec called out
    AC-4 (report + summary comment) ✅ MET docs/investigations/qa-gap-signal-to-noise.md plus this comment
    AC-5 (gate/remove recommendations <30% threshold) ✅ MET Recommendations §1–5 in report; deterministic preconditions proposed for #609

    Headline findings (window 2026-04-01 → 2026-05-10, 50 PRs, 134 flag rows)

    Section Triggered Action rate Skill lines Recommendation
    §4 Q5 — intra-file sibling-line 6 / 44 17% 12 Gate by file-shape
    §5 — cross-file sibling-site 3 / 44 33% 7 Keep
    §6c — detection-pattern verify 0 / 11 0% 156 Gate by file glob
    §6d — Adversarial Re-Read 9 / 14 0% 35 Trim
    Spec — sibling-site scan 7 / 7 29% 8 Keep
    Spec — AC linter (title/body) 6 / 15 17% 4 Tighten regex

    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 live gh calls)
    • 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 — ✅ clean
    • npm run lint — ✅ 0 errors, 0 warnings
    • npx vitest run scripts/analytics/gap-signal.test.ts — ✅ 7/7 pass

    Quality 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

    • Weakest part: Fate classification is heuristic — silent/dismissed buckets are noisier than actioned/filed (the script can't always distinguish "reviewer considered the finding and folded it into the verdict prose without explicit fate keywords" from "no action taken"). Magnitude per-section noise floor estimated at ±5–10pp; documented in the report's "Noise floor" subsection. The directional signal (§6c near-zero, §6d zero-action) is strong enough to drive recommendations.
    • Coverage gaps: gap-signal.ts has unit tests that cover section attribution, fate classification, action-rate math, and the missing-skill-file branch. Live gh fetchers 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 over gh issue view/gh pr list which would add brittle test surface for little value.

    Documentation

    • CHANGELOG entry added under [Unreleased] / ### Added
    • Investigation report at docs/investigations/qa-gap-signal-to-noise.md

    Next Steps

    1. Review PR feat(#608): mine gap-check signal-to-noise across recent merged PRs #623.
    2. Once merged, investigate(qa): extract deterministic gap-checks into pre-QA script gate #609 has the data + deterministic preconditions it needs to ship the §6c gate and §6d trim.
  7. admarble commented on May 10, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #608

    Commit reviewed: 0d7befc (PR #623)

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original Categorize each flagged gap as actioned_in_pr / filed_followup / dismissed / silent MET Fate union in gap-signal.ts:115-120 covers all 4 required buckets + not_triggered for N/A; classifyFate regex set (FOLLOWUP_RE, ACTIONED_RE, DISMISS_RE) is reasonable; raw rows persisted to .sequant/gap-signal.jsonl (136 rows on live run).
    AC-2 Original Per-section action rate sorted descending. Sections: §4 Q5, §5, §6c, §6d, spec sibling-scan, spec ac-linter MET (with sort-order gap) All 6 sections covered with action-rate computed (gap-signal.ts:48-109). However, both the CLI displayReport and the doc's TL;DR table iterate sections in declared/array order, not sorted descending. Adding sectionRollups.sort((a,b) => b.actionRate - a.actionRate) before the return at gap-signal.ts:431 would meet the literal AC. Cosmetic — substantive data is correct.
    AC-3 Original Per-section token cost via word-count proxy + 1 ablation calibration. Acknowledge run logs do not capture per-section token usage PARTIALLY_MET Word-count proxy ✅ (measureSkillCost, lines 317–337). metrics.tokensUsed: 0 caveat ✅ (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 ## Findings section 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.
    AC-4 Original Report at docs/investigations/qa-gap-signal-to-noise.md; summary comment on this issue PARTIALLY_MET Report ✅ (197 lines at correct path; clear TL;DR + Findings + Recommendations summary). Summary comment is not posted on issue #608. Issue thread currently has only assess/spec/exec phase markers; no investigator-summary comment. The spec plan explicitly committed to "Will also post a summary comment here when the investigation closes out."
    AC-5 Original For sections with action_rate < 30%, recommend removal or deterministic gating with implementable precondition for #609 MET Recommendations cover all 6 sections (doc lines 191–197): §6c gated by file-glob with concrete git diff precondition 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

    Check State Bucket Impact
    build (20.x) IN_PROGRESS pending ⏳ PENDING
    build (22.x) IN_PROGRESS pending ⏳ PENDING
    validate-skills SUCCESS pass ✅ MET
    typecheck SUCCESS pass ✅ MET
    validate-plugin SUCCESS pass ✅ MET

    CI 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

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 4 OK (within scope: 1 script, 1 test, 1 doc, 1 CHANGELOG)
    Lines added +928 -
    Lines deleted -0 -

    npx tsc --noEmit — clean. npx vitest run scripts/analytics/gap-signal.test.ts — 7/7 pass. Live npx 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

    Changed File Tier Has Tests? Test File
    scripts/analytics/gap-signal.ts Standard ✅ Yes gap-signal.test.ts (220 lines, 7 tests, mocked fetchers)
    docs/investigations/qa-gap-signal-to-noise.md Optional N/A (docs)
    CHANGELOG.md Optional N/A (changelog)

    Coverage: 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 real gh issue view payload — but the AC-1 spec marks AC-1 as "Manual + Integration Test"; the unit fixtures functionally cover the integration path.


    Code Review

    Strengths:

    • Module isolation matches the spec's conflict-avoidance plan: new file at scripts/analytics/gap-signal.ts rather than touching analyze-runs.ts (which investigate(metrics): chain mode 29% success rate vs 92% single-issue — failure forensics #604 has open).
    • Section catalog (SECTIONS array, 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.
    • Fetchers are dependency-injected (MineOptions.fetchers) so tests don't shell out — this is exactly the pattern that lets future maintainers re-run the analysis against fixture data.
    • Noise floor is documented honestly in the report (lines 58–65): two known misclassification directions with magnitude estimate and the conclusion "directional but not precise. Action-rate numbers are accurate to ±10pp." This is the right framing per feedback_evidence_over_theory.md.
    • §6c header regex avoids the §2e collision — explicit comment at lines 73–75 explains why the generic "Anti-Pattern Detection" header is excluded. Catches a real hazard (§2e vs §6c are different sections sharing a phrase).

    Issues:

    • displayReport does not sort by actionRate descending (gap-signal.ts:473 iterates report.sections in 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 in displayReport is the right fix rather than mutating mine()'s output.
    • Ablation calibration paragraph missing from docs/investigations/qa-gap-signal-to-noise.md. The doc line 74 promises "recorded inline below" but the ## Findings sections only quote word counts. Add a 1–2 paragraph block under ### Phase B — cost showing one PR re-run with one section's prompt removed and the token-count delta. See AC-3.
    • Summary comment not posted on issue investigate(metrics): gap-check signal-to-noise — does flagged → action rate justify cumulative QA prompt cost? #608. See AC-4.

    Suggestions:

    • The --out default .sequant/gap-signal.jsonl is fine, but consider gitignoring it; .sequant/ already is in this repo (.sequant/state.json etc.). Verify by inspection — the file exists in working tree from the smoke run; not staged.
    • The excerpt.length > 60 cutoff in extractFlag (line 265) is mentioned as a heuristic but not as a tunable; consider MIN_EXCERPT_LEN = 60 constant for documentation.
    • fetchIssue swallows all errors silently (return null). Fine for one-off analytics, but a one-line warning to stderr would help future debugging if gh rate-limits.

    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ✅ OK Asserts on output report.sections[*].byFate / .actionRate — outputs, not internals.
    Coverage Depth ⚠️ WARN Happy paths well-covered; no test for malformed gh JSON or missing SEQUANT_PHASE marker. Acceptable for a one-shot analytics script.
    Mock Hygiene ✅ OK Only the gh-shelling boundary is mocked (makeFakeFetchers).
    Test Reliability ✅ OK Deterministic; no timing dependencies.

    Anti-Pattern Detection

    Dependency Audit

    N/A — no package.json or package-lock.json changes.

    Code Patterns

    No critical issues. execSync calls in listMergedPrIssues and fetchIssue use 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

    Test Type Command Exit Code Result
    Unit tests npx vitest run scripts/analytics/gap-signal.test.ts 0 7/7 pass
    Typecheck npx tsc --noEmit 0 clean
    Live smoke npx tsx scripts/analytics/gap-signal.ts --since 2026-04-01 --limit 50 --out /tmp/gap-signal-qa-test.jsonl 0 50 issues / 67 QA / 35 spec / 136 flag rows; per-section table matches doc TL;DR within new-PRs drift.

    Evidence status: Complete


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (feat(#608): mine gap-check signal-to-noise across recent merged PRs)
    [Unreleased] entry ✅ Present (CHANGELOG.md line 12, well-formed, references (#608), includes script + doc paths)
    Entry format ✅ Valid

    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 view for summary comment (AC-4 — not found), inspection of recommendations table (AC-5).

    AC Verification Method Runtime Test Status Evidence
    AC-1 Manual + Integration Test ✅ Executed Tests + live run produce correctly-classified flag rows
    AC-2 Manual ✅ Executed All 6 sections present in output; sort-descending NOT applied
    AC-3 Manual ⚠️ Executed Word-count proxy present; ablation calibration missing from doc
    AC-4 Manual ⚠️ Executed Report present; summary comment not posted on issue
    AC-5 Manual ✅ Executed Recommendations cover all 6 sections

    Risk Assessment

    • Likely failure mode: Heuristic mining drift as the QA SKILL.md evolves — the per-section header regexes (e.g. /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.
    • Not tested: Live gh pr list / gh issue view integration 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.
    • Sibling sites considered: scripts/analytics/analyze-runs.ts is 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.
    • Sibling-line audit: None — single-script fix. All gap-detection logic lives in one file (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

    # Sub-prompt Finding
    1 Verbatim fixtures Issue body has no fenced code blocks beyond the AC checklist. Verbatim AC-1 categories (actioned_in_pr / filed_followup / dismissed / silent) appear literally in the Fate type union. Verbatim AC-5 threshold (< 30%) is implemented as actionRate < 0.30 decision in the doc's recommendations. No verbatim-fixture regression.
    2 Evidence framing Smoke run was executed against today's gh data (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.
    3 Process state Working tree clean; branch matches origin/feature/608-...; no stashed changes. Phase markers (spec:completed, exec:completed) are present and well-formed.
    4 Sibling sites Per Section 5: cross-file = none (intentional spec-time isolation from analyze-runs.ts); intra-file = single-script fix.
    5 Out-of-scope/Non-Goals Issue Non-Goals: "Removing gap-checks pre-emptively without data" and "Adding new gap-checks. Inverse direction." This PR honors both — it ships a measurement tool plus recommendations for #609, not pre-emptive removals. The doc's recommendations (gate §6c, trim §6d, etc.) are explicitly handed off to #609 to implement, keeping #608 as data-only.

    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:

    • AC-3 — word-count proxy and run-log caveat delivered, but the explicitly-promised "1 ablation calibration on one PR" is absent from the doc.
    • AC-4 — report file is present and complete, but the summary comment on this issue (committed to in the spec plan) has not been posted.

    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

    • CHANGELOG entry added (line 12, well-formed)
    • docs/investigations/qa-gap-signal-to-noise.md written (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)

    1. Add the ablation calibration paragraph to the doc. Pick one PR from the window (e.g. feat(#587): /qa §4 Q5 intra-file sibling-site audit + cross-file §5 reframe #589 since §4 Q5 was its own AC), measure 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 — cost resolves AC-3.
    2. Post the AC-4 summary comment to issue investigate(metrics): gap-check signal-to-noise — does flagged → action rate justify cumulative QA prompt cost? #608 — short version of the doc's TL;DR + Recommendations summary is sufficient. Reference docs/investigations/qa-gap-signal-to-noise.md for the full report.
    3. Add the descending sort in 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.
    4. Re-run /qa 608 after fixes land — the verdict will move to READY_FOR_MERGE once AC-3 and AC-4 are completed (assuming pending CI build matrix has gone green by then).
  8. added
    needs-work
    and removed
    needs-improvement
    on May 10, 2026
  9. added a commit that references this issue on May 10, 2026
  10. admarble commented on May 10, 2026

    @admarble
    ContributorAuthor

    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:

    Section Triggered Action rate Skill lines Recommendation
    §5 — cross-file sibling-site 3 / 44 33% 7 Keep
    Spec — sibling-site scan 7 / 7 29% 8 Keep
    §4 Q5 — intra-file sibling-line 6 / 44 17% 12 Gate by file-shape
    Spec — AC linter (title/body) 6 / 15 17% 4 Gate by AC count
    §6c — detection-pattern verify 0 / 11 0% 156 Gate by file glob
    §6d — Adversarial Re-Read 9 / 14 0% 35 Trim

    Key findings

    Recommendations (input to #609)

    1. §6c — gate by file-glob precondition (.ts/.tsx/skill files containing regex/grep/awk/jq/sed literals); suppress the entire section when false. Largest single saving.
    2. §6d — trim from structured 4-sub-prompt block to 1-paragraph adversarial prompt. Keep the safety net, drop the structure that's producing 9 findings + 0 actions.
    3. §4 Q5 — gate by file-shape heuristic (auto-fill N/A for single-call-site / docs / config diffs).
    4. §5, Spec sibling-site — keep as-is.
    5. Spec AC linter — keep, tighten the regex (recurring "etc." references unchanged code false-positive pattern, dismissed in feat(spec): ac-linter title/body tension — coverage tightening #597).

    Caveats

    • Heuristic action-rate numbers are accurate to ~±10pp (noise floor analysis in report §"Phase A — mining").
    • §6d had only 14 emits because the section was promoted to mandatory on 2026-05-06 (PR feat(#582): /qa Adversarial Re-Read structured section before READY_FOR_MERGE #584). Re-run in 60 days to confirm the trim recommendation against more data.
    • Per-section token attribution from the QA model is unwired (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.

  11. admarble commented on May 10, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #608 (re-run)

    Commit reviewed: b18a7bb (PR #623, after gap fixes)

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original Categorize each flagged gap as actioned_in_pr / filed_followup / dismissed / silent MET Fate union (gap-signal.ts:115-120) covers all 4 required buckets + not_triggered; classifyFate regex set unchanged from prior pass; 134 raw rows persisted on live run.
    AC-2 Original Per-section action rate sorted descending. Sections: §4 Q5, §5, §6c, §6d, spec sibling-scan, spec ac-linter MET displayReport now sorts sections descending by actionRate (gap-signal.ts:473-477); doc TL;DR table re-rendered in same order with explicit "Sections sorted by action rate, descending (matches displayReport output)" caption. Live run output: §5 (33%) → Spec sibling (29%) → §4 Q5 (17%) → Spec AC linter (17%) → §6c (0%) → §6d (0%).
    AC-3 Original Per-section token cost via word-count proxy + 1 ablation calibration. Acknowledge run logs do not capture per-section token usage MET Word-count proxy ✅. metrics.tokensUsed: 0 caveat ✅. 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.
    AC-4 Original Report at docs/investigations/qa-gap-signal-to-noise.md; summary comment on this issue MET Report ✅ (now 237 lines at correct path). Summary comment posted at #608 issue comment 4414453731 with sorted TL;DR table, key findings, recommendations, and caveats.
    AC-5 Original For sections with action_rate < 30%, recommend removal or deterministic gating with implementable precondition for #609 MET Recommendations cover all 6 sections (doc lines 230–237); §6c gated by file-glob with concrete git diff precondition; §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

    Check State Conclusion Impact
    build (20.x) COMPLETED SUCCESS ✅ MET
    build (22.x) COMPLETED SUCCESS ✅ MET
    validate-skills COMPLETED SUCCESS ✅ MET
    typecheck COMPLETED SUCCESS ✅ MET
    validate-plugin COMPLETED SUCCESS ✅ MET

    CI Summary: 5 passed, 0 pending, 0 failed. PR mergeable=MERGEABLE (was CONFLICTING before merge of origin/main; resolved with merge commit d207dec).


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 4 OK (within scope: 1 script, 1 test, 1 doc, 1 CHANGELOG)
    Lines added +971 -
    Lines deleted −0 -

    npx tsc --noEmit — clean. npx vitest run scripts/analytics/gap-signal.test.ts — 7/7 pass. Live npx 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

    Changed File Tier Has Tests? Test File
    scripts/analytics/gap-signal.ts Standard ✅ Yes gap-signal.test.ts (220 lines, 7 tests)
    docs/investigations/qa-gap-signal-to-noise.md Optional N/A (docs)
    CHANGELOG.md Optional N/A (changelog)

    The new sort is one line at a public seam; not separately tested (test suite asserts on report.sections shape, which is unchanged — the sort is a pure-display detail of displayReport). Acceptable.


    Code Review

    Strengths:

    • Sort is non-mutating — [...report.sections].sort(...) copies before sorting, so callers that consume report.sections (the --json output, the JSONL row writer, the doc table generator) still see declared/structural order. Only the human-readable displayReport sees the sorted order. Right separation per the prior QA reviewer's suggestion.
    • Doc table caption is explicit — "Sections sorted by action rate, descending (matches displayReport output)" makes the order intentional rather than a coincidence; future readers know not to re-shuffle.
    • Ablation calibration is reproducible and honest — concrete PR (fix(state): reconcile false-positive — empty orphan branches mistakenly flagged as merged #616, a no-skill-change Fixed-bucket PR), verifiable line/word counts (wc -l / wc -w / sed '1804,1959d' | wc -l), conservative 1.3-token-per-word heuristic with a ^1 footnote 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.json changes since last QA pass.

    Code Patterns

    No issues. The sort lambda uses b.actionRate - a.actionRate (descending) — correct direction; deterministic since actionRate is number. No NaN risk: actionRate is triggered.length > 0 ? actioned / triggered.length : 0 (gap-signal.ts:425), so never NaN. Tie-break (two sections at 0%) preserves stable order — fine since 0% sections are visually equivalent.

    Critical Issues: 0
    Warnings: 0


    Execution Evidence

    Test Type Command Exit Code Result
    Unit tests npx vitest run scripts/analytics/gap-signal.test.ts 0 7/7 pass
    Typecheck npx tsc --noEmit 0 clean
    Live smoke npx tsx scripts/analytics/gap-signal.ts --since 2026-04-01 --limit 10 --out /tmp/gap-signal-smoke.jsonl 0 Sorted output: §5 33% / §4 Q5 0% / §6c 0% / §6d 0% / Spec sibling 0% / Spec AC linter 0% — 10-PR window has lower trigger counts but sort direction confirmed (33% first).
    Ablation reproduce wc -l .claude/skills/qa/SKILL.md && sed '1804,1959d' .claude/skills/qa/SKILL.md | wc -l 0 3042 / 2886 — matches the doc's calibration table.
    CI All 5 checks (build 20.x/22.x, validate-skills, typecheck, validate-plugin) - SUCCESS

    Evidence status: Complete


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (feat(#608): mine gap-check signal-to-noise across recent merged PRs)
    [Unreleased] entry ✅ Present (line 13, well-formed, references (#608), includes script + doc paths)
    Entry format ✅ Valid

    Result: CHANGELOG requirements met. Merge commit d207dec correctly preserved both the #608 and #618 entries side-by-side under ### Added.


    Self-Evaluation

    • Verified working: Yes — sort change executed on real gh data and produces 33% (§5) at the top of the table; ablation calibration verified by re-running the wc/sed commands inline; AC-4 summary comment fetched back via gh issue view to confirm posting.
    • Test efficacy: Medium — the 7 unit tests cover report.sections[*] shape and fate classification; the new sort is a displayReport-only concern not exercised by tests. Live smoke covers the sort end-to-end.
    • Likely failure mode: None new vs prior pass. Sort is one line, non-mutating, deterministic. The pre-existing risk (heuristic mining drift if QA SKILL.md section names change) is unchanged.
    • Verdict confidence: High — three closure gaps from the prior pass each have explicit verifiable evidence; no new gaps introduced.

    Verdict: READY_FOR_MERGE

    All 5 ACs are now MET. The three completion gaps from the prior pass are closed:

    CI is green across all 5 checks. PR mergeable=MERGEABLE. CHANGELOG entry present with both #608 and #618 preserved through the merge commit.

    Documentation

    Next Steps

    1. Merge PR feat(#608): mine gap-check signal-to-noise across recent merged PRs #623. The investigation closes investigate(metrics): gap-check signal-to-noise — does flagged → action rate justify cumulative QA prompt cost? #608; recommendations feed into investigate(qa): extract deterministic gap-checks into pre-QA script gate #609 for implementation.
    2. In investigate(qa): extract deterministic gap-checks into pre-QA script gate #609: apply the gating recommendations (§6c file-glob precondition, §6d trim, §4 Q5 file-shape gate, Spec AC linter regex tightening); keep §5 and Spec sibling-site scan.
    3. Re-run this analysis in 60 days (per the report's sample-size caveat) to confirm the §6d trim recommendation against more data after feat(#582): /qa Adversarial Re-Read structured section before READY_FOR_MERGE #584 has been live longer.
  12. added
    ready-for-review
    and removed
    needs-work
    on May 10, 2026
  13. added a commit that references this issue on May 11, 2026
  14. added 3 commits that reference this issue on May 11, 2026
  15. added a commit that references this issue on Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplannedqaready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions