Skip to content

fix(qa): parseQaSummary returns null when AC statuses are bold words with no emoji — the SEQUANT_QA_GAPS findings marker is then never read #1194

Closed

Description

@admarble

Epic: field-2026-09-28 (downstream non-Node adoption) Tier: mechanical Graph: tracker #1203

Problem. The status matcher (phase-executor.ts:609) only accepts rows that start with ✅ ❌ ⚠️ ⭐ ℹ️ ❓ ❗. A table written | AC-1 | **MET** | … | or | AC-1 | **PENDING** | … | gives acTotal === 0. Then parseQaSummary returns null (:681) before it reads the findings marker (:691). The skill's own examples use ⏳ PENDING and 🔄 Overridden, and the matcher accepts neither.

Field evidence. A qa phase ended ### Verdict: NEEDS_VERIFICATION with a well-formed SEQUANT_QA_GAPS marker carrying 4 findings (2 pause_for_human). Its AC table used **MET** / **PENDING**. The run log recorded summary: null, and the posted verdict comment was only the heading and the verdict marker. The operator had to open the transcript to learn what needed verifying. In the same batch, two other qa phases with the same skill and the same sequant parsed fine. So the skill's status formatting varies from issue to issue, and the parser has to accept every form the skill's own examples use.

AC

  • AC-1: An AC table using bold status words with no emoji (**MET**, **PENDING**, **NOT MET**) parses to the correct acMet/acTotal. Evidence: npx vitest run src/lib/workflow/phase-executor.test.ts
  • AC-2: A valid SEQUANT_QA_GAPS marker is returned as findings even when no AC row parses. Evidence: npx vitest run src/lib/workflow/phase-executor.test.ts
  • AC-3: The skill's documented status forms (⏳ PENDING, 🔄 Overridden) parse. Evidence: npx vitest run src/lib/workflow/phase-executor.property.test.ts
  • AC-4: The verdict comment for NEEDS_VERIFICATION lists the PENDING ACs and the pause_for_human findings; a findings-only summary (no parsed AC rows) never prints "0/0 met" (bug(qa): the posted verdict comment publishes a miscounted AC coverage — "0/1 met" on an 8-AC issue under an AC_MET verdict #1073 class). Evidence: npx vitest run src/lib/workflow/batch-executor.test.ts

Fixture: the shape above with generic text (bold statuses, 4-finding marker).

Related: #937, #972, #1095, #1119.

Graph metadata

May touch

  • src/lib/workflow/phase-executor.ts
  • src/lib/workflow/batch-executor.ts
  • .claude/skills/qa/SKILL.md
  • skills/qa/SKILL.md
  • templates/skills/qa/SKILL.md

File overlap (don't run in the same wave; merge one first):

Activity

  1. added
    bug
    qa
    graph-2026-09-field
    on Sep 28, 2026
  2. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    Context for wave 2 (graph-run #1203) — main now includes #1193 (PR #1211) and #1196 (PR #1212). Both change src/lib/workflow/phase-executor.ts and the qa skill neighbourhood, so the line refs in this issue have moved. On current main: parseQaSummary is at phase-executor.ts:608 and the early if (acTotal === 0) return null; is at :671. Work from the symbols, not the old line numbers.

    Launch constraints (read before starting) — all phases, including the qa phase:

    • The exec and qa phases must NOT run the full npm test. Every MCP phase has a hard 30-minute wall, and wave-1 exec phases ran 25–29 min. Run only the AC Evidence commands and the test files next to the code you change, in the foreground with timeout. CI runs the full suite.
    • Commit WIP early and often (at least every ~10 minutes). Committed work survives a phase timeout; uncommitted work does not.
    • Mutation markers: the failedTest field in <!-- SEQUANT_MUTATION: … --> must start with the test file path (src/…/x.test.ts > describe > case). A describe name or bare test title there floors /qa §6i to AC_NOT_MET.
    • Tracker reference: refer to the graph tracker as Refs #1203 or "tracker tracker(graph): field report 2026-09-28 — downstream non-Node adoption gaps (10 nodes) #1203". Never put a closing verb (Fixes/Closes/Resolves) next to tracker(graph): field report 2026-09-28 — downstream non-Node adoption gaps (10 nodes) #1203 anywhere in the PR body, tables included. The PR should close only this issue.
  3. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (4 ACs, 1 directory)

    AC Quality Check

    extractAcceptanceCriteria returns 0 items for this issue body — it expects checkbox form (- [ ] AC-N:), and this issue uses plain - AC-N: bullets, so the programmatic linter couldn't run. Inline review of all 4 AC:

    • Each AC is one line, carries an Evidence: clause naming a concrete vitest run command, and makes a falsifiable claim. No vague/unmeasurable/open-ended language found.
    • AC-1's example text writes **NOT MET** (space) while the codebase's existing vocabulary uses NOT_MET (underscore) — not a lint defect, but a concrete implementation detail called out in Open Questions below.
    • Evidence-vacuity check (ran the cited command against main): all four cited test files exist today (phase-executor.test.ts, phase-executor.property.test.ts, batch-executor.test.ts) and pass on main as a whole file — but the specific behaviors AC-1–AC-4 describe are new assertions that don't exist yet (confirmed by reading parseQaSummary/buildQaVerdictComment source below: bold-no-emoji, ⏳/🔄, and the acTotal===0-with-marker path are all unhandled). The Evidence commands only become meaningful once the implementer adds the new cases to those files — flag this for /exec: running the existing file unmodified proves nothing.

    Non-Goals: ⚠️ Not found in the issue body. Consider adding scope boundaries (e.g. "not fixing verdict-determination logic, not touching SKILL.md wording").


    Scope Assessment

    Metric Value Status
    Feature count 1 (parser hardening) ✅
    AC items 4 ✅
    Directory spread 1 (src/lib/workflow/) ✅

    Verdict: ✅ SCOPE_OK


    Acceptance Criteria

    AC-1: Bold status words with no emoji parse correctly

    Verification: Unit Test
    Scenario: Given a QA output containing | AC-1 | ... | **MET** | ... | (and **PENDING**, **NOT MET** rows) → When parseQaSummary runs → Then acTotal/acMet count them same as the emoji forms.
    Assumptions: STATUS_CELL (phase-executor.ts:613-614) must tolerate a **-wrapped cell in addition to the existing optional-emoji prefix; "NOT MET" (space) must resolve to the same bucket as "NOT_MET" (underscore) — see Open Question 1.

    AC-2: A valid SEQUANT_QA_GAPS marker survives acTotal === 0

    Verification: Unit Test
    Scenario: Given QA output with no parseable AC row but a well-formed SEQUANT_QA_GAPS marker (findings array non-empty) → When parseQaSummary runs → Then it returns a summary object (not null) with findings populated, rather than short-circuiting at the if (acTotal === 0) return null; guard (phase-executor.ts:671).
    Assumptions: parseQaGapsMarker(output) must be computed before the acTotal === 0 guard so its result (marker present vs. absent) can gate the early return, not just feed the post-guard code path at line 680. A marker with an explicitly empty {"findings":[]} array (still !== null) is a judgment call — see Open Question 2 on whether that alone should also suppress return null.

    AC-3: ⏳ PENDING and 🔄 Overridden parse

    Verification: Unit Test (property-based)
    Scenario: Given a status cell ⏳ PENDING (U+23F3, no variation selector) or 🔄 Overridden (U+1F504) → When parseQaSummary runs → Then the row is counted (not silently skipped).
    Assumptions: ⏳ must be added to the STATUS_CELL emoji alternation. "Overridden" is not in the current keyword set (MET|NOT_MET|PARTIALLY_MET|PARTIAL|PENDING|N/A) and needs a new bucket — see Open Question 3 on whether it counts toward acMet.

    AC-4: NEEDS_VERIFICATION comment lists PENDING ACs and pause_for_human findings; never prints "0/0 met"

    Verification: Unit Test
    Scenario: Given a NEEDS_VERIFICATION verdict with a summary containing PENDING AC rows and findings marked recommendedAction: "pause_for_human" → When buildQaVerdictComment (batch-executor.ts:764) runs → Then the comment enumerates which ACs are PENDING and surfaces the pause_for_human findings distinctly (not just folded into the generic gaps list); and given a findings-only summary (acTotal === 0, from the AC-2 fix) → Then the comment never prints an AC coverage: 0/0 met line.
    Assumptions: The QaSummary schema (run-log-schema.ts:211-227) has no per-AC id/status tracking today — only aggregate acMet/acTotal counts. Listing "which ACs are PENDING" requires parseQaSummary to additionally return something like pendingAcIds: string[] (new optional schema field). The existing countsUsable guard (batch-executor.ts:778-779) already structurally prevents "0/0 met" once acTotal === 0, so that half of AC-4 needs a regression test more than new logic — confirm it isn't broken by the AC-2 change, don't assume it's free.


    Implementation Plan

    Phase 1: Extend STATUS_CELL matching (phase-executor.ts)

    1. Broaden the optional-prefix group to accept ** (bold, no emoji) in addition to the existing emoji alternation, mirroring how parseQaVerdict's regex already tolerates a run of non-alphanumeric characters between label and value (line 506-509 comment explains the precedent).
    2. Add ⏳ (U+23F3) to the emoji alternation.
    3. Add a normalization step so "NOT MET" (space) and "NOT_MET" (underscore) resolve identically — decide the exact keyword-normalization approach (regex alternation vs. .replace(/\s+/g, "_") before matching).
    4. Add an "OVERRIDDEN" keyword resolving per Open Question 3's decision (recommend: counts as MET-equivalent).

    Phase 2: Let a valid marker survive acTotal === 0 (phase-executor.ts)

    1. Hoist const rawFindings = parseQaGapsMarker(output); above the if (acTotal === 0) return null; guard (currently line 671; marker parse currently at line 680).
    2. Change the guard to if (acTotal === 0 && rawFindings === null) return null;.
    3. Continue building gaps/suggestions/findings from rawFindings as today.

    Phase 3: Track PENDING AC ids and expose them (run-log-schema.ts, phase-executor.ts)

    1. Add pendingAcIds: z.array(z.string()).optional() to QaSummarySchema.
    2. In parseQaSummary's table-row and checklist-item loops, when a row/item resolves to PENDING, record its AC-N id (both loops already extract the id for tableIds/listIds — reuse that).
    3. Return pendingAcIds on the summary object (only when non-empty, matching the existing ...(findings && {findings}) pattern).

    Phase 4: Render PENDING ACs and pause_for_human findings in the verdict comment (batch-executor.ts)

    1. In buildQaVerdictComment, when verdict === "NEEDS_VERIFICATION" and summary.pendingAcIds?.length, add a line/list naming them.
    2. Filter summary.findings for recommendedAction === "pause_for_human" and render them in a distinct labeled block (not merged into the generic **Gaps:** list, which already unions marker + prose text).
    3. Leave the existing countsUsable suppression logic (line 778-779) unchanged; add a regression test proving it still holds for a findings-only (acTotal === 0) summary under NEEDS_VERIFICATION.

    Phase 5: Tests

    1. phase-executor.test.ts (describe("parseQaSummary", …) at line 258): add cases for bold-no-emoji (AC-1), acTotal-0-with-marker (AC-2).
    2. phase-executor.property.test.ts (describe("parseQaSummary (property)", …) at line 78): add ⏳/🔄 Overridden cases (AC-3).
    3. batch-executor.test.ts: add cases for PENDING-AC listing, pause_for_human surfacing, and the 0/0-met regression (AC-4).

    No dependencies between phases 1-2 (same function, sequential edits) and phase 3-4 (schema + consumer) — do 1-2 first since 3-4 build on the same function's output shape.


    Design Review

    1. Where does this logic belong? Stays in phase-executor.ts (parseQaSummary) and batch-executor.ts (buildQaVerdictComment) — the existing owners of QA-output parsing and verdict-comment rendering. No new module needed.
    2. What's the simplest correct approach? Widen the existing regex/keyword vocabulary rather than rewriting the parser; add one optional schema field (pendingAcIds) rather than a general per-AC status map, since AC-4 only asks to list PENDING ids, not track full per-AC history.
    3. What existing pattern does this follow? Same "accept the skill's actual output shapes" hardening as bug(qa): the posted verdict comment publishes a miscounted AC coverage — "0/1 met" on an 8-AC issue under an AC_MET verdict #1073 (checklist fallback) and bug(qa): parseQaVerdict records the first Verdict mention in the transcript, not the final heading — #1070 passed qa three times and was recorded AC_NOT_MET each time #1119 (verdict final-match-wins) — the parser keeps chasing the skill's real-world formatting drift rather than the skill being pinned to the parser's narrower vocabulary.
    4. What would a senior reviewer challenge? Whether "Overridden" should count toward acMet at all (Open Question 3) — an incorrect default here could silently flip a verdict from NEEDS_VERIFICATION to READY_FOR_MERGE on a table that was actually flagging a human-approved exception, not a clean pass.

    Feature Quality Planning

    All standard checks pass. Notable items:

    • Schema change (pendingAcIds optional field) is additive/backward-compatible — no migration needed for existing .sequant/logs records.
    • No security surface touched (pure string/regex parsing over already-fetched GitHub comment text).

    Open Questions

    1. Does "NOT MET" (space) need to parse identically to "NOT_MET" (underscore)? AC-1's own example text uses the space form. Recommendation: yes, normalize before matching. Impact if wrong: AC-1's own fixture fails to parse, since the issue's chosen example isn't the underscore form the rest of the codebase uses.
    2. Should a marker with an explicitly empty {"findings":[]} array (still non-null) also suppress return null when acTotal === 0? Recommendation: yes — treat "valid marker present" (parses, regardless of array length) as the signal, not "has findings", since the SKILL.md explicitly instructs emitting {"findings":[]} on a clean pass and that's the more consistent contract. Impact if wrong: a clean-pass QA turn with zero AC rows and zero findings still returns null, and downstream /loop/logging can't distinguish "marker ran, found nothing" from "marker never ran."
    3. Does 🔄 Overridden count toward acMet? SKILL.md:3120 describes it as "An approved Section 11a override is documented" — an accepted resolution, not a failure. Recommendation: count it as MET-equivalent. Impact if wrong: a Manual Test row using the skill's own documented Overridden status could push a verdict toward NEEDS_VERIFICATION/AC_NOT_MET when the override was already human-approved, or the reverse (falsely READY_FOR_MERGE) if treated as unconditionally MET without checking that it really was approved — either way, worth a one-line confirmation from the issue author before /exec locks it in.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: bug label only, SCOPE_OK, single-directory mechanical fix with concrete Evidence commands per AC — targeted tests written directly in /exec are sufficient; testgen adds ceremony without benefit here. Not UI-facing, not security-sensitive, no CI-dependent AC.


    Label Review

    Current: bug, qa, graph-2026-09-field
    Recommended: bug, qa, graph-2026-09-field, planned
    Reason: No complexity/UI/security label warranted; scope and AC support the existing labels as-is.
    Quality Loop: Won't auto-enable — SCOPE_OK, no complex/refactor/breaking label, no yellow/red scope signal.

    → gh issue edit 1194 --add-label planned


    Dependencies / Conflict Risk

    --- DRAFT GITHUB ISSUE COMMENT (PLAN) ---

    Spec: Implementation Plan

    Complexity: Standard (4 ACs, 1 directory) · Scope: ✅ SCOPE_OK · Workflow: exec → qa (quality loop disabled)

    AC Checklist

    • AC-1 (Unit Test): Bold status words with no emoji (**MET**, **PENDING**, **NOT MET**) parse to correct acMet/acTotal. Evidence: npx vitest run src/lib/workflow/phase-executor.test.ts
    • AC-2 (Unit Test): A valid SEQUANT_QA_GAPS marker returns as findings even when acTotal === 0. Evidence: npx vitest run src/lib/workflow/phase-executor.test.ts
    • AC-3 (Unit Test, property-based): ⏳ PENDING and 🔄 Overridden parse. Evidence: npx vitest run src/lib/workflow/phase-executor.property.test.ts
    • AC-4 (Unit Test): NEEDS_VERIFICATION comment lists PENDING ACs + pause_for_human findings; findings-only summary never prints "0/0 met". Evidence: npx vitest run src/lib/workflow/batch-executor.test.ts

    Implementation Plan (5 phases)

    1. Broaden STATUS_CELL (phase-executor.ts:613-614): accept **-bold prefix, add ⏳ (U+23F3), normalize NOT MET ↔ NOT_MET, add OVERRIDDEN keyword.
    2. Hoist parseQaGapsMarker above the acTotal === 0 guard (line 671) so a valid marker (even {"findings":[]}) prevents the early return null.
    3. Add pendingAcIds: z.array(z.string()).optional() to QaSummarySchema (run-log-schema.ts:211); populate it from the existing table/checklist id-extraction loops.
    4. buildQaVerdictComment (batch-executor.ts:764): list pendingAcIds and surface recommendedAction === "pause_for_human" findings distinctly when verdict is NEEDS_VERIFICATION; regression-test the existing 0/0-met suppression against the new acTotal-0-with-marker case from step 2.
    5. Add the AC-1–AC-4 test cases to the three files named above.

    Key Decisions Needing Confirmation

    1. "NOT MET" (space) normalizes to the same bucket as "NOT_MET" — recommended, since AC-1's own fixture uses the space form.
    2. A marker with {"findings":[]} (empty but present) also counts as "marker found" for the acTotal-0 guard — recommended, matches the skill's clean-pass convention.
    3. 🔄 Overridden counts as MET-equivalent (an approved override per SKILL.md §11a is a resolution, not a failure) — recommended, but flagging for explicit sign-off since a wrong default here can flip a verdict silently.

    Conflict Risk

    #1198 (open) also touches batch-executor.ts per this issue's "May touch" list — no active worktree conflict today; re-check before this PR merges.

  4. added
    planned
    on Sep 29, 2026
  5. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 4/4 met

    Gaps:

  6. added a commit that references this issue on Sep 29, 2026
  7. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    Runner follow-up (graph-run #1203) — QA verdict AC_MET_BUT_NOT_A_PLUS hid two defects that would have shipped. Both fixed on PR #1214 @ f50de5f9:

    • Reproduced QA's notes-cell case: | AC-1 | desc | ✅ MET | Not met in first pass; fixed | parsed 0/1. A table status cell must now hold the keyword alone, bold, or followed by a separator; the checklist fallback is unchanged.
    • The NEEDS_VERIFICATION comment listed each pause_for_human finding twice (Gaps + Needs human review). Now listed once. The new test builds the summary with parseQaSummary instead of hand-writing gaps.
    • The PR body had no closing reference (only the tracker ref). Added Closes #1194; closingIssuesReferences = [1194].

    Executed: npx vitest run src/lib/workflow/phase-executor.test.ts src/lib/workflow/phase-executor.property.test.ts src/lib/workflow/batch-executor.test.ts → 301/301. Both fixes mutation-verified (markers in the PR body).

  8. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 4/4 met

    Gaps:

    • AC ids repeated across the AC Coverage and Manual Test tables are double-counted, and a newly parsed Overridden row credits acMet for an AC the coverage table marks PENDING
    • A notes cell starting with a status word followed by an em dash still overrides the status cell in the right-to-left scan
    • Source comments contain literal \u2014 / \u00A7 escape text instead of the characters
  9. added a commit that references this issue on Sep 29, 2026
  10. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    Runner follow-up, round 2 (graph-run #1203). The second QA pass returned AC_MET_BUT_NOT_A_PLUS. Fixed on PR #1214 @ 2e5111d7:

    • An AC repeated across the coverage and Manual Test tables is now counted once, from its first row. Before, a later 🔄 Overridden row could credit a PENDING AC.
    • Literal \u2014 escapes in comments are replaced with the real characters.

    Documented, not fixed: a notes cell written as Not met — fixed still reads as the status, because the em dash stays a separator for ✅ MET — verified. Mutation-verified. The three test files pass 302/302, and CI test = success.

  11. added a commit that references this issue on Sep 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

    buggraph-2026-09-fieldplannedqa

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions