Repository navigation
Description
Epic: graph-2026-10-review-surface Tier: judgment Execution: sequant_run Blocked by: #1524, #1504, #1471, #1507
- Blocked by: 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
- Blocked by: feat(run): a dropped error leaves a trace — noteSuppressed() counts into the run log, batch-executor's 25 silent catches converted #1504
- Blocked by: refactor(logs): one run-log module — parseLogFile, listLogFiles, resolveLogDir, formatDuration defined once #1471
- Blocked by: refactor(workflow): split runIssueWithLogging (1,620 lines) into stage functions of ≤ 200 counted lines, behaviour-preserving #1507
Problem
state-schema.ts defines a per-AC record with status and evidence; StateManager.updateACStatus can write it; nothing calls it. The record is set to pending at registration and stays there (17 of 17 items on this checkout). Every renderer in this graph reads that record (I-2), so it needs one producer: at the point where the QA phase output is already parsed for counts (parseQaSummary, phase-executor.ts:615, consumed at :1272), parse per-AC status with the function RS-01 measured, write each AC through updateACStatus with its evidence text, and copy the list into the run log's issue entry as an optional acs[]. An AC the parse cannot classify is written unknown (I-8). A failed state write is counted through #1504's helper (I-9), which is why this waits for it.
The hook lives in a new sibling module called from one line, because phase-executor.ts is #1471's file and batch-executor.ts is #1507's; this node lands after both.
Acceptance Criteria
- AC-1: The parse reproduces the fixture's ground truth. Evidence:
npx vitest run src/lib/workflow/ac-status.test.ts -t "fixture"→≥ 10 passed, 0 failed(one case per fixture in__tests__/fixtures/qa-comments/; statuses equalexpected.jsonexcept the three labels 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's test pins as known parser misses (922 AC-3, 1265 AC-2 and AC-7), which the case overlays asKNOWN_MISSESand fails if a pinned miss appears or disappears; an AC id absent from the comment yieldsunknown) - AC-1 is classified as a gate test by
isGateTestEvidence; the PR body carries itsSEQUANT_MUTATIONrecord (flip one non-pinned status inexpected.json→ that fixture's case fails; restore). - AC-2: The state record is written through the existing updater against a real temp state file. Evidence:
npx vitest run src/lib/workflow/ac-status.integration.test.ts→≥ 3 passed, 0 failed(realStateManageron a temp dir, no fs mock; after a QA phase result,getAcceptanceCriteria(issue).itemscarry the parsed statuses and evidence; an AC in the comment but not in the issue is ignored and counted; an issue with no prior AC record gets one registered from its body first, then written; achmod 0555state directory makes the write fail andsuppressed.byScope.stateincrements) - AC-3: The updater has a caller. Evidence:
grep -rn 'updateACStatus(' src --include='*.ts' | grep -v test | grep -vc 'state-manager.ts'→≥ 1 - AC-4: The run log carries
acs[]as an optional field and the schema version is unchanged. Evidence:grep -c 'acs: z' src/lib/workflow/run-log-schema.ts→≥ 1andgrep -c 'version: z.literal(1)' src/lib/workflow/run-log-schema.ts→1 - AC-5: Renderers do not import the parser (I-2; constraint: holds today, binding on every later PR). Evidence:
grep -rl 'ac-status' src/lib/cli-ui src/commands | grep -v test | wc -l | tr -d ' '→0 - AC-6: No test lines are added beyond the two files above and no skill directory is touched. Evidence:
git diff --name-only $(git merge-base origin/main HEAD)..HEAD | grep -cE '^(plugin/|\.claude/skills/|templates/skills/)'→0(constraint)
Prior fixes / producers
- Producers of the AC record:
StateManager.updateAcceptanceCriteria(registration, fromparseAcceptanceCriteria) andupdateACStatus(dead). Two producers of one record; this node makes the second one live and leaves the first unchanged, so the AC states the outcome: after any QA phase, the record reflects the QA output. - Prior fixes on QA-output parsing:
parseQaVerdictfirst-match fix (v2.18.0),parseQaSummary(bug(run): orchestrated 'sequant run --phases qa' re-run computes a fresh verdict but never posts it, contradicting the stale comment left visible #964),SEQUANT_PHASEmarker parsing. Class: the output format is skill-owned and frozen, which is why §10 names the marker as the long-term producer.
May touch
src/lib/workflow/ac-status.ts (new), ac-status.test.ts, ac-status.integration.test.ts (new), the one call line at the QA summary hook (in phase-executor.ts after #1471, or the module #1507 extracts), src/lib/workflow/log-writer.ts and run-log-schema.ts (optional acs[], after #1504's block), CHANGELOG.
Non-Goals
- Rendering (RS-03).
- Changing the QA skill's output (frozen; §10).
- Any status other than the five:
met,not_met,pending,blocked,unknown. - Any edit under
plugin/,.claude/skills/,templates/skills/(I-1).
Done when
After a QA phase, state.json's AC items and the run log's acs[] say what QA said, per criterion, with unknown where it could not tell.
Activity
docs(#1523): HANDOFF.md for graph-2026-10-review-surface — W0 and #1520…
admarble commentedon Oct 27, 2026
Complexity: Standard (6 ACs, 3 directories)
The tracker's RD-1 line reads: "parser-now if ≥ 90% … otherwise marker-first after the freeze." #1524 measured 80% (76 comments, 343 ACs; fixture precision 97%, recall 98%). The runner's note on #1524 says the producer work "is scheduled after the plugin freeze". Two documents say otherwise. PROJECT-DISCUSSION RD-B says that below 90%, "RS-02 ships with
unknownas the common case and the marker becomes the first post-freeze node", and HANDOFF.md lists #1525 as unblocked.Recommendation: ship now under RD-B. The parser rarely says something wrong (97% precision on the fixture); the 20% it cannot read becomes
unknown(I-8), not a wrong status. TheSEQUANT_ACmarker later replaces the parse at the same call site. The owner must confirm this before launch. This plan assumes they confirm.AC Quality Check
Each Evidence command was run against
main(d6d66a9):saveStatewrites toos.tmpdir()and then callsrenameSyncontostate.json. A rename over a0444file succeeds on POSIX (checked locally: the rename succeeded and the content was replaced). Rename permission depends on the directory, not the file. Suggested edit: "achmod 0555state directory makes the write fail". Skip the test whenprocess.getuid() === 0.0today. Gates the work.grep -c 'acs'is0today but loose: any word containing "acs", such as "traces", would satisfy it. Suggestgrep -c 'acs: z'. The second clause is a constraint,1today.Scope Assessment
Non-Goals: present. They exclude rendering, edits to the QA skill, statuses outside the five, and edits under the frozen directories.
Features: 1. ACs: 6. Directories:
src/lib/workflow,scripts/qa,__tests__/fixtures(read only).Verdict: ✅ SCOPE_OK
Findings that change the plan
unknownis not inACStatusSchema. The schema haspending,met,not_metandblocked, soupdateACStatus(…, "unknown")fails Zod validation insaveState. Addunknownto the enum, and add an optionalunknowncount inupdateAcceptanceCriteriaSummary. Older CLIs that read astate.jsoncontainingunknownwill reject it; name this in the CHANGELOG.updateAcceptanceCriteriahas no caller insrc/; only/spec'snpx tsxblock writes the record. On this checkout 4 of 17 issues have a record.updateACStatusthrows "has no acceptance criteria" for the rest, so most runs would write nothing. See OQ-2.notes, notevidence.AcceptanceCriterion.evidenceholds the issue's declaredEvidence:clause (feat(spec/qa): explicit Evidence: clause on ACs — declared verification replaces keyword inference #938), and overwriting it would destroy that clause.updateACStatus's 4th parameter isnotes. The QA row text (trimmedrest, capped at about 200 characters) goes there.scripts/qa/ac-status-parse-coverage.ts. MoveAcStatus,firstStatusToken,leadingAcIds,proseLinesandparseAcStatusesintosrc/lib/workflow/ac-status.ts. The script re-exports them, so its existing test is unchanged (AC-6). This leaves one copy of the regex.leadingIdsInBody(body)besideparseAcStatuses, or return the extra ids from it.Acceptance Criteria
AC-1: Unit test (gate). Given each of the 12 fixtures and the issue AC ids from
expected.json→ whenparseAcStatusesruns → then each status equalsexpected.json, and absent ids areunknown. The mutation record is required in the PR body: flip one status inexpected.json, and exactly that fixture's case fails.AC-2: Integration test, with a real
StateManageron a temp dir and no fs mock. Cases: (a) statuses and notes are written; (b) an extra id in the comment is ignored and counted; (c) a read-only state dir →suppressedCounts().byScope.stateincrements (callresetSuppressed()inbeforeEach).AC-3: grep. The single call site is in the new module.
AC-4: grep, with
acs: z.array(...).optional()onIssueLogSchema.AC-5 and AC-6: constraint greps.
Implementation Plan
Phase 1: Parser into src
src/lib/workflow/ac-status.tswith the pure parse moved from the script, plusleadingIdsInBody. The script imports and re-exports.state-schema.ts, addunknowntoACStatusSchemaand an optionalunknowncount to the summary.Phase 2: Producer
ac-status.ts, addrecordAcStatuses({ issueNumber, output, stateManager, logWriter }). It readsgetAcceptanceCriteria(issue)for the ids, parses, callsupdateACStatus(id, status, notes)once per id, counts ignored extras, and returnsacs[]. Each failure goes tonoteSuppressed("state", err, "ac-status:recordAcStatuses"). No throw ever reaches the caller.batch-executor.ts, after theupdatePhaseStatusblock (about line 2503), guarded byphase === "qa" && result.output. It sits beside the#964verdict post, which has the same "QA produced a parseable result" gate.mapAgentSuccessCoreinphase-executor.tsstays pure: it has noStateManager.Phase 3: Run log
run-log-schema.ts: addacs: z.array({ id, status, notes? }).optional()onIssueLogSchema, after feat(cli): cost per run where a user looks — one line in the run summary, cost in the run log and sequant logs, from the metrics record, labelled "SDK estimate" #1527's block.log-writer.ts: add asetAcStatuses(issueNumber, acs)setter that followssetSpecRecommendation, and spread it in the issue builder. The version stays1.Design Review
src/lib/workflow/ac-status.ts, which owns the parse and the write. Batch-executor gets one line, so refactor(workflow): split runIssueWithLogging (1,620 lines) into stage functions of ≤ 200 counted lines, behaviour-preserving #1507's split stays intact.parseQaSummary, which would enlargephase-executor.tsand couple counts to the per-AC status.parseQaVerdictfirst-match fix (v2.18.0),parseQaSummary(bug(run): orchestrated 'sequant run --phases qa' re-run computes a fresh verdict but never posts it, contradicting the stale comment left visible #964), andqa-gaps-marker.ts. That is ≥ 2 prior fixes, so the stop rule applies. Record it as deliberately local. Reason: the plugin freeze (I-1) forbids the skill-side marker, andunknownbounds the damage. The class is tracked in PROJECT-DISCUSSION §10, but §10 has no issue yet; see OQ-3.parseQaSummary?" It produces counts, not per-id rows.updateAcceptanceCriteria(registration, via/speconly) andupdateACStatus(new caller). Consumers areupdateAcceptanceCriteriaSummary,sequant status, and feat(cli): the AC table on every surface — terminal run summary lines per criterion, an ACs column in sequant status, a block in sequant logs; all read the one record #1526 later.qa-cache.ts:92has its own enum and is untouched. The run log'sacs[]has one producer (log-writer) and one consumer (feat(cli): the AC table on every surface — terminal run summary lines per criterion, an ACs column in sequant status, a block in sequant logs; all read the one record #1526).Open Questions
acceptanceCriteriais absent, register the record first by calling the existingupdateAcceptanceCriteria(extractAcceptanceCriteria(body)). The body comes fromprovider.fetchIssue, one extraghcall on QA only. The registration producer itself is unchanged. Alternative: skip and write onlyacs[], but then "Done when" fails for most runs and RS-06 would reopen this node. This changes AC-2: add a 4th case, "no prior record → registered then written".SEQUANT_ACmarker as an issue now? It is needed to complete the Q3 record ("class tracked in #N"). Recommendation: yes, file it, blocked on the freeze lift.acs: z). The owner edits the AC lines; a comment alone does not change them.Recommended Workflow
Phases: exec → qa
Quality Loop: enabled
Reasoning: Judgment tier. The change widens a schema enum and makes state writes in the run path. AC-1 and AC-2 already name their test files, so testgen would add little.
Label Review
Current: graph-2026-10-review-surface. Recommended: add
enhancementandplanned.admarble commentedon Oct 27, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 6/6 met
Gaps:
fix(#1525): the QA hook reports ids the QA output names but the issue…
admarble commentedon Oct 28, 2026
QA Verdict: NEEDS_VERIFICATION
AC coverage: 6/6 met
Gaps:
admarble commentedon Oct 28, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 6/6 met
Gaps:
KNOWN_MISSESoverlay replaces theexpected.jsonlabel for the three pinned ACs. I changed 922 AC-3's label frommettounknowninexpected.json: bothac-status.test.tsandscripts/qa/ac-status-parse-coverage.test.tsstill passed (26 of 26), and I restored the file. A parser change on those ACs is caught, but an edit to those three labels is not. The first QA pass found the same gap, and no change since has fixed it.Suggestions:
KNOWN_MISSES, for example{ label: "met", parsed: "unknown" }, and assert thatexpected.jsonstill carries that label.AcStatusEntrynon-exported, or use it from the run-log type.test(#1525): the fixture case also checks that each pinned KNOWN_MISS…
admarble commentedon Oct 28, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 6/6 met
Gaps:
expected.jsonlabel is different from the pinned parse. It does not assert what the label is. So changing 922 AC-3 frommettounknownis now caught, but changing it frommettonot_metstill passes. The last QA suggested storing the expected label inKNOWN_MISSES({label, parsed}), which would close this fully.AcStatusEntryis exported but nothing imports it. This is what failsknip-advisory.test(#1525): KNOWN_MISSES pins the expected.json label as well as the…
admarble commentedon Oct 28, 2026
QA Verdict: READY_FOR_MERGE
AC coverage: 6/6 met
Gaps:
feat(#1525): one producer for per-AC status — parse the QA phase outp…