Skip to content

investigation(qa): per-AC status parse coverage over ≥ 60 QA verdict comments, with a hand-labelled fixture — decides parser-now or marker-first (RD-1) #1524

Closed

Description

@admarble

Epic: graph-2026-10-review-surface Tier: judgment Execution: split (phases write the script, fixture and report; the owner adds the blind re-read line, AC-5) Blocked by: #1523

Problem

The QA skill posts per-AC results as free-form prose (tables in some comments, bullet lists in others; the skill's own notes record ~45% format variance in past specs). The only machine marker is SEQUANT_PHASE with the overall verdict. A producer that parses per-AC status from that prose is either good enough to ship or it is not, and the sample taken at planning (4 issues, 24 ACs, 23 matched) is too small to say. This node measures it on every QA-marked comment since 2026-08-01 (49 exist at planning) against hand-labelled ground truth, commits the fixture that RS-02's tests run against, and writes the RD-1 line.

Acceptance Criteria

  • AC-1: A fixture of real QA comments with ground truth exists. Evidence: ls __tests__/fixtures/qa-comments/*.md | wc -l | tr -d ' ' → ≥ 10 and jq -e '[.[] | .acs | length] | add >= 40' __tests__/fixtures/qa-comments/expected.json > /dev/null && echo ok → ok (each fixture is a verbatim public comment from this repo; expected.json maps fixture → [{id, status}] with status in met|not_met|pending|unknown, labelled by hand before the parser is written)
  • AC-2: The coverage script runs over every QA-marked comment since 2026-08-01 (49 at planning) and reports a number. Evidence: npx tsx scripts/qa/ac-status-parse-coverage.ts --since 2026-08-01 --json | jq -e '.comments >= 45 and (.acs | type == "number") and (.classified | type == "number")' > /dev/null && echo ok → ok
  • AC-3: Against the fixture, the candidate parse's precision is reported, not only recall. Evidence: npx tsx scripts/qa/ac-status-parse-coverage.ts --fixture --json | jq -e '(.precision | type == "number") and (.recall | type == "number")' > /dev/null && echo ok → ok (a stray MET in prose near an AC id must count as a false positive)
  • AC-1 and AC-3 are classified as gate tests by isGateTestEvidence; the PR body carries a SEQUANT_MUTATION record for each (delete one fixture's entry from expected.json → the ≥ 40 check fails; remove the false-positive case from the fixture → precision reads 100% and the record names it; restore).
  • AC-4: The evidence file records the numbers and the RD-1 line. Evidence: grep -cE '^RD-1: (parser-now|marker-first) — coverage [0-9]+% on [0-9]+ comments, precision [0-9]+%' docs/evidence/review-surface/ac-parse-coverage.md → 1
  • AC-5: Eight fixtures are re-labelled blind at the end and the agreement is recorded (human-read metric rule). Evidence: grep -cE '^Re-read: [0-9]+ of 8 agreed' docs/evidence/review-surface/ac-parse-coverage.md → 1

Prior fixes / producers

May touch

scripts/qa/ac-status-parse-coverage.ts (new), __tests__/fixtures/qa-comments/ (new), docs/evidence/review-surface/ac-parse-coverage.md (new).

Non-Goals

  • Writing the producer (RS-02).
  • Any edit under plugin/, .claude/skills/, templates/skills/ (I-1).
  • Fixtures from any private repo; this repo's public comments only.

Done when

The RD-1 line is on the tracker with its coverage and precision numbers, and the fixture RS-02 will test against is committed.

Activity

  1. added
    graph-2026-10-review-surface
    on Oct 19, 2026
  2. admarble commented on Oct 19, 2026

    @admarble
    ContributorAuthor

    Runner context, 2026-10-19, before launch (review-surface W0, beside #1521/#1528; judgment tier, all phases on Opus; stop-at-PR). main = ec9d583.

    No file overlap with anything else in this wave.

    For every phase, and the qa phase by name: run the full suite at most once, in the foreground, under timeout, after a WIP commit. Each MCP-dispatched phase has a 30-minute wall, and this wave runs 7 issues at once. Prefer the targeted npx vitest run <files> for the ACs.
    CHANGELOG: add [Unreleased] lines, not changelog.d/ fragments. #1370 has not merged.
    Freeze: nothing under plugin/, .claude/skills/ or templates/skills/.
    Health baseline: if this PR changes a measured metric, regenerate scripts/qa/health-baseline.json with npx tsx scripts/qa/health-report.ts --write-baseline after the last source change. Never hand-edit it. npm run lint:health must print "no metric rose".

  3. admarble commented on Oct 19, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (5 ACs, 3 directories)

    AC Quality Check

    lintAcceptanceCriteria: 5/5 passed. Each AC is on one line with an Evidence: clause, and the issue has a ## Non-Goals section.

    • Vacuity check against main (ec9d583): every Evidence command fails today. scripts/qa/ac-status-parse-coverage.ts, __tests__/fixtures/qa-comments/ and docs/evidence/ do not exist yet. Nothing is vacuous.
    • Gate-test classification: isGateTestEvidence returns true for AC-1 and AC-3 and false for AC-2, AC-4 and AC-5, as the issue says. ⚠️ The §6i parser keeps only the file-path segment of failedTest. The Evidence commands for AC-1 and AC-3 are jq/npx one-liners, and those cannot be failedTest. Exec must add a vitest file (see Plan, step 4). If it does not, both SEQUANT_MUTATION records classify test_not_in_diff, which floors the verdict at AC_NOT_MET.
    • The mutation bullet under AC-3 has no - [ ], so the parser does not see it as an AC. That is intended: it is an instruction, not a criterion.
    • Title/body tension: the title says "≥ 60 QA verdict comments". The body and AC-2 say 49 at planning, with a floor of ≥ 45. On a live count today (2026-10-19), 76 comments carry SEQUANT_PHASE {"phase":"qa"} and were created since 2026-08-01: 61 completed and 15 failed. The body's AC-2 floor is the binding number. The 49-vs-76 gap is Open Question 1.

    Scope Assessment

    Non-Goals: the producer (RS-02/#1525); any edit under plugin/, .claude/skills/ or templates/skills/ (I-1); fixtures from private repos.

    Metric Value Status
    Feature count 1 (measurement script + fixture + report) ✅
    AC items 5 ✅
    Directory spread 3 (scripts/qa/, __tests__/fixtures/, docs/evidence/) ✅

    Verdict: ✅ SCOPE_OK

    In-flight overlap: none. #1521's worktree touches scripts/qa/health-baseline.json, and this PR may touch it too (it is regenerated, never hand-edited). Whichever PR merges second regenerates it after merging main.


    Acceptance Criteria

    AC-1: Fixture of real QA comments with ground truth

    Verification: Integration Test (shell Evidence) + a gate test in vitest
    Scenario: Given ≥ 10 verbatim QA comments from this repo → When expected.json is read → Then it maps each fixture to [{id, status}] with ≥ 40 entries in total, every status in met|not_met|pending|unknown.
    Assumptions: The labels are committed in an earlier commit than the parser. That commit order is the only evidence a reviewer can check for "labelled before the parser is written". The fixture set must contain at least one real comment where an AC id sits near a stray MET in prose, so that AC-3's false-positive case exists (Open Question 3).

    AC-2: Coverage over every QA-marked comment since 2026-08-01

    Verification: Integration Test (live gh, needs auth in the QA phase)
    Scenario: Given gh auth → When --since 2026-08-01 --json runs → Then the JSON has comments ≥ 45 and acs and classified are numbers. A coverage ratio is also reported.
    Assumptions: since on /issues/comments filters by updated_at, so the script also filters on created_at on the client. The denominator acs is the AC ids parsed from each comment's issue body by extractAcceptanceCriteria, not the ids mentioned in the comment (Open Question 2).

    AC-3: Precision as well as recall on the fixture

    Verification: Integration Test + a gate test in vitest
    Scenario: Given the fixture → When --fixture --json runs → Then precision and recall are numbers. Given the stray-MET comment → Then that AC counts as a false positive, and precision is below 1.
    Assumptions: Definitions: TP = parsed status equals the truth label and is not unknown. FP = parsed status is not unknown and differs from truth, or is assigned to an id the truth does not list. FN = truth is not unknown and the parse is unknown or missing.

    AC-4: Evidence file with numbers and the RD-1 line

    Verification: Manual Test (grep)
    Scenario: Given the runs in AC-2 and AC-3 → When the report is written → Then exactly one line matches ^RD-1: (parser-now|marker-first) — coverage N% on M comments, precision P%.
    Assumptions: The decision rule is RD-B: parser-now if coverage ≥ 90%. The line records exec's proposal. RD-1 is a human approval point, so the owner confirms it on #1523.

    AC-5: Blind re-read of 8 fixtures (owner's step)

    Verification: Manual Test (owner)
    Scenario: Given the committed labels → When the owner re-labels 8 fixtures without looking at expected.json → Then Re-read: N of 8 agreed … is added.
    Assumptions: Execution is split. Exec must not write this line. It writes a placeholder that does not match the regex, for example Re-read (owner): pending — 8 fixtures listed below. QA should report AC-5 as PENDING (owner), not as an exec failure.


    Implementation Plan

    Phase 1: Corpus and fixture (labels first)

    1. Write fetchQaComments({since}) in scripts/qa/ac-status-parse-coverage.ts, modelled on the harvest shape in scripts/qa/backtest-mutation-gate.ts. It runs gh api repos/{owner}/{repo}/issues/comments?since=… --paginate through execFileSync. It selects bodies matching SEQUANT_PHASE: {"phase":"qa", filters on created_at ≥ since, and fetches each distinct issue's body once for extractAcceptanceCriteria.
    2. Pick ≥ 10 comments that cover different formats: tables, bullet lists, failed-status verdicts, and pre-/post-feat(qa): mutation-verification becomes a parseable §7 gate instead of honor-system prose #939 shapes. At least one must contain the stray-MET-near-AC-id prose. Save each one verbatim as __tests__/fixtures/qa-comments/<issue>-<commentId>.md. Hand-label expected.json with ≥ 40 ACs. Commit the labels before step 3.

    Phase 2: Candidate parse and metrics

    1. In the same script, add parseAcStatuses(body, acIds): Map<id, status>. Start from the 23/24 regex taken at planning, AC-N … (MET|NOT MET|PENDING|✅|❌|⚠), and anchor it to table rows and list-item lines rather than free prose. Add scoreFixture() for precision and recall, and the CLI flags --since <date>, --fixture and --json. Keep the parser in the script. RS-02 (feat(run): one producer for per-AC status — parse the QA phase output, write the state record through updateACStatus, carry acs[] in the run log; unknown is a status #1525) owns src/lib/workflow/ac-status.ts and may lift it later. Only export it.
    2. Add scripts/qa/ac-status-parse-coverage.test.ts, which runs offline. Write (a) a fixture-shape test: ≥ 10 .md files, ≥ 40 labelled ACs, every status in the enum, every key backed by a file. Write (b) a test that names the stray-MET case and asserts it scores as an FP with precision < 1. Run both mutations from the issue and record them in the PR body, with failedTest set to scripts/qa/ac-status-parse-coverage.test.ts > ….

    Phase 3: Report

    1. Run both modes and write docs/evidence/review-surface/ac-parse-coverage.md. Include the corpus definition and count (76 vs 49, explained), coverage, precision, recall, the per-format misses, the commands to re-run, the RD-1 line, and the Re-read (owner): pending placeholder that lists the 8 fixtures for the owner.
    2. Add a CHANGELOG.md [Unreleased] line (not a changelog.d/ fragment, because feat(#1351): improve(release): changelog fragments instead of a shared [Unreleased] block — 121/192 main commits touch CHANGELOG.md #1370 has not merged). Run npx tsx scripts/qa/health-report.ts --write-baseline if a metric moved. npm run lint:health must print "no metric rose". Run npx vitest run scripts/qa/ac-status-parse-coverage.test.ts. Run the full suite at most once, in the foreground under timeout, after a WIP commit.

    Design Review

    1. Where does this logic belong? scripts/qa/, next to backtest-mutation-gate.ts: a re-runnable measurement over a real corpus. Not in src/, because I-2 gives the AC-status producer to RS-02 alone.
    2. What's the simplest correct approach? One script with two modes, one regex parser and a static fixture. Rejected: an LLM classifier, which would measure a different parser than the one RS-02 would ship. Also rejected: synthetic fixtures, which the issue forbids and which hide format variance.
    3. What existing pattern does this follow, and how often has it been re-patched? It follows the corpus-backtest pattern (backtest-mutation-gate.ts from feat(qa): mutation-verification becomes a parseable §7 gate instead of honor-system prose #939, scripts/spec/measure-corpus.ts). The neighbouring prose parser, parseQaVerdict, has been re-patched for format drift: its own comment records the emoji-prefix fix, and the bold/header variants were added separately. That history is the risk RD-1 measures, and it argues for marker-first. It is input to the decision, not a divergence from this issue's lever, because this node measures and does not ship a parser.
    4. What would a senior reviewer challenge? "Labelled by hand" when an agent does the labelling. Answer: the commit order, plus the owner's blind re-read in AC-5, which is the agreement check. "Why not count ACs mentioned in the comment?" That inflates coverage, because a comment that skips an AC drops out of the denominator.
    5. Every producer and consumer of the artifact. Producers of QA comments: the QA skill's own post (frozen), buildQaVerdictComment (src/lib/workflow/batch-executor.ts:886), and feat(qa): the verdict comment names its reviewer — separate session, driver and model, author's driver and model beside it — and the docs name phases.qa.agent as the independence knob #1521, which appends a reviewer line after the fixture's cutoff. Fixture consumers: this script's test and feat(run): one producer for per-AC status — parse the QA phase output, write the state record through updateACStatus, carry acs[] in the run log; unknown is a status #1525. Report consumer: the owner's RD-1 decision on tracker: graph-2026-10-review-surface — the acceptance criterion as the unit every surface shows: producer, renderers, cost, verdict attribution, Read-first comment, issue form #1523. There is one producer per artifact, so no parity test is needed.

    No design choice needs an ADR. This is a measurement, and RD-1 is recorded on the tracker.


    Feature Quality Planning

    All standard checks pass. Notable items:

    • Network in tests: the vitest file must stay offline (fixture only). Only the CLI's --since mode calls gh.
    • Publication: docs/ subdirectories self-publish to the landing site. docs/evidence/review-surface/ will become public, which is fine because the content is public comments plus numbers. Keep the private-repo exclusion.
    • Verbatim fixtures: do not trim or normalise them. Name each file by its comment id so it can be traced back.

    Open Questions

    1. Which corpus does "QA-marked" mean (76 now vs 49 at planning)? Recommendation: every comment with SEQUANT_PHASE {"phase":"qa"…} created since 2026-08-01, with the count broken down by status (61/15) in the report. Impact if wrong: the coverage denominator shifts. Report the completed-only number as well.
    2. Coverage denominator. Recommendation: the issue-body AC ids. Impact if wrong: the ids-mentioned-in-the-comment alternative overstates coverage.
    3. What if no real comment contains a stray MET? Recommendation: search the 76 for prose like AC-N … was NOT MET … now MET first. If none exists, record that in the report, keep fixtures verbatim, and ask the owner rather than synthesise one. Impact: the AC-3 mutation record would have nothing to name.
    4. Precision floor for parser-now. RD-B sets only the 90% coverage rule. Recommendation: report precision and let the owner weigh it at RD-1. Do not invent a threshold.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: All five ACs are shell- or grep-verified measurement checks. The gate-test vitest file is part of exec's own deliverable, so testgen stubs would duplicate it. QA must run AC-2 against live gh, and must treat AC-5 as owner-pending (split execution).


    Label Review

    Current: graph-2026-10-review-surface
    Recommended: + planned
    Reason: Planning is complete. No UI and no security surface.
    Quality Loop: Won't auto-enable (SCOPE_OK).

  4. added
    planned
    on Oct 19, 2026
  5. admarble commented on Oct 19, 2026

    @admarble
    ContributorAuthor

    Correction to the runner context above (health baseline), 2026-10-19:

    • Regenerate scripts/qa/health-baseline.json only to record a metric that went down.
    • If npm run lint:health reports a metric rose (for example functions.longest.lines or emptyCatch.total), do not regenerate to make it pass. Restructure so the metric holds: put new logic in a new small function instead of growing an existing long one.
    • If holding it is impossible, leave the baseline unchanged and name the rise in the PR body for the owner.
  6. admarble commented on Oct 19, 2026

    @admarble
    ContributorAuthor

    QA Verdict: NEEDS_VERIFICATION

    AC coverage: 4/5 met

    Gaps:

    • Corpus count discrepancy untraced; selector may include orchestrator verdict comments — dropped: disclosed in evidence file §1 and reproducible from the stated selector

    Suggestions:

    • The issue counted 49 comments at planning; the script finds 76–77. The evidence file says this wasn't traced. The selector matches any <!-- SEQUANT_PHASE: {"phase":"qa" comment. That may include the orchestrator's compact verdict comments as well as the skill's full reviews, and that would change how the 80% should be read.

    Pending ACs:

    • AC-5

    Needs human review:

    • AC-5 blind re-read is an owner step not yet performed
    • Required CI checks still pending
  7. added 2 commits that reference this issue on Oct 19, 2026
  8. admarble commented on Oct 19, 2026

    @admarble
    ContributorAuthor

    Execution Verification (runner, 2026-10-19), PR #1554 @ c4f5cda

    QA returned NEEDS_VERIFICATION with two gaps, CI and AC-5. The runner re-ran AC-1..AC-5 verbatim:

    • AC-1: 12, ok
    • AC-2: ok
    • AC-3: ok (precision 0.97, recall 0.98)
    • AC-4: 1
    • AC-5: 1

    Both gate mutations reproduced.

    AC-5: the owner delegated the blind re-label to the runner session as a second labeller. The runner wrote its labels to a file before opening expected.json: 8 of 8 agreed. 6 of 6 agreed on the fully blind fixtures; 1265 and 922's AC-3 labels had been seen during verification. This is disclosed in the evidence file §5.

    RD-1 resolves to marker-first (80% < 90%), so the producer work it gates is scheduled after the plugin freeze.

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

    graph-2026-10-review-surfaceplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions