Skip to content

fix(#972): NEEDS_VERIFICATION maps to awaiting_verification; MCP force param - #977

Merged
admarble merged 3 commits into
mainfrom
feature/972-needs-verification-maps-to-ready-for-merge-blockin
Aug 29, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/972-needs-verification-maps-to-ready-for-merge-blockin

Conversation

@admarble

@admarble admarble commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • AC-1: Add awaiting_verification to IssueStatusSchema, derived in batch-executor.ts when QA verdict is NEEDS_VERIFICATION. Excluded from COMPLETED_ISSUE_STATUSES so a sequant run <N> --phases qa proceeds without --force. Surfaced as magenta in sequant status with nextAction hint pointing to the qa re-run.
  • AC-2: Add force boolean param to MCP sequant_run tool schema; forwarded as --force CLI arg (same pattern as qualityLoop). Silent-ignore eliminated — now either works or errors loudly if the schema rejects it.
  • AC-3: New docs/features/qa-verdict-workflow-states.md — verdict→state table plus prose on re-run policy for all four QA verdicts and the MCP force param.

Pre-PR AC Verification

AC Description Status Evidence
AC-1 NEEDS_VERIFICATION → awaiting_verification, excluded from completed, surfaced in status ✅ Implemented state-schema.ts:55, batch-executor.ts:1866-1873, completed-status.ts (absent), reconcile.ts:163, status.ts:119,264
AC-2 MCP sequant_run accepts force, forwards --force ✅ Implemented src/mcp/tools/run.ts:517-524,583-585
AC-3 Docs: verdict→state→re-run policy ✅ Implemented docs/features/qa-verdict-workflow-states.md

Test plan

  • npx vitest run src/lib/workflow/reconcile.test.ts — new test: awaiting_verification hint returns sequant run N --phases qa
  • npx vitest run src/mcp/server-extended.test.ts — new tests: force:true adds --force; force:false does not
  • npx vitest run src/lib/workflow/batch-executor.test.ts — new describe #972: NEEDS_VERIFICATION → awaiting_verification; READY_FOR_MERGE → ready_for_merge
  • npm run build && npm run lint — both pass clean

Note: the withActivityHook failure at batch-executor.test.ts:1464 reported during exec did not reproduce on orchestrator re-run (93/93 pass) — likely a flake; not introduced by this PR.

Closes #972

🤖 Generated with Claude Code

Orchestrator verification (2026-08-29)

Independently re-executed in the worktree: all three listed test files pass (reconcile + server-extended: 63/63; batch-executor: 93/93; completed-status: 7/7), npm run build and npm run lint clean. Data flow traced: run guard → isCompletedIssueStatus → COMPLETED_ISSUE_STATUSES (awaiting_verification absent); reconcile only transitions to merged/abandoned, so it cannot clobber awaiting_verification.

Follow-up commit 8c91a49 fixes two gaps found during verification: the MCP force description claimed force is required after NEEDS_VERIFICATION (opposite of AC-1's design), and the completed-set exclusion had no gate test (adding awaiting_verification to COMPLETED_ISSUE_STATUSES left the suite green).

Mutation-verified: AC-1 — added awaiting_verification to COMPLETED_ISSUE_STATUSES; test "does NOT treat awaiting_verification as completed — qa re-runs proceed without --force (#972)" failed; restored.
Mutation-verified: AC-1 — replaced the verdict ternary in batch-executor.ts with unconditional ready_for_merge; test "sets status to awaiting_verification when qa verdict is NEEDS_VERIFICATION" failed; restored.
Mutation-verified: AC-2 — removed the if (force) args.push(\"--force\") forwarding in src/mcp/tools/run.ts; test "#972: force:true forwards --force to the CLI args" failed; restored.

Second-look verification (2026-08-29, commit 70afc6f)

Adversarial pass over every exhaustive IssueStatus enumeration found three more gaps, fixed:

  1. state-cleanup merge-detection sweep skipped awaiting_verification — an issue whose PR a human verified and merged directly stayed awaiting_verification forever (the fix(chain): --chain --ready-gate resume re-executes already-gated links (COMPLETED_STATUSES misses waiting_for_human_merge/blocked) #837 shape recurring for the new status). Added to the sweep + test.
  2. Dashboard statusOrder omitted awaiting_verification: issues were grouped into byStatus but never rendered — invisible on the dashboard. Added (plus an explicit status CSS class).
  3. Reconcile hints named a nonexistent --phase flag (the CLI only has --phases <list>, bin/cli.ts:274) — pre-existing in the failed-phase and waiting_for_qa_gate hints, adjacent to this PR's new hint. Both corrected.

Verified clean by scope grep (--phase emitters: none remain), full affected test files (45/45), build, lint.

Mutation-verified: AC-1 — removed awaiting_verification from the state-cleanup sweep condition; test "#972: advances awaiting_verification to merged when PR is MERGED on GitHub" failed; restored.

…e param

AC-1: Add `awaiting_verification` to IssueStatusSchema (absent from
COMPLETED_ISSUE_STATUSES so qa re-runs proceed without --force).
Derive it in batch-executor when qa verdict is NEEDS_VERIFICATION.
Add nextAction hint and status display color.

AC-2: Add `force` param to MCP sequant_run tool schema; forward as
--force CLI arg, mirroring the qualityLoop param pattern.

AC-3: Add docs/features/qa-verdict-workflow-states.md documenting the
verdict→state table and re-run policy for all four QA verdicts.

Entire-Checkpoint: 13e0086b8d2d
…tion exclusion

- run.ts force description said force is required after NEEDS_VERIFICATION —
  the opposite of AC-1's design (awaiting_verification re-runs freely).
- completed-status.test.ts never asserted awaiting_verification is excluded
  from COMPLETED_ISSUE_STATUSES, so adding it to the set would have passed
  the suite while breaking AC-1's re-run guarantee.

Claude-Session: https://claude.ai/code/session_0178TZyoqDoCYehwfnQUDyNW
Entire-Checkpoint: 50bd5bb0ff10
…ashboard; fix --phase hints

Second-look gaps:
- state-cleanup merge-detection sweep skipped awaiting_verification, so an
  issue whose PR a human verified and merged directly stayed
  awaiting_verification forever (the #837 shape for the new status).
- dashboard statusOrder omitted awaiting_verification: issues were grouped
  but never rendered (invisible cards); also add explicit status class.
- reconcile hints named a nonexistent --phase flag (CLI has --phases only);
  affected the failed-phase and waiting_for_qa_gate hints (pre-existing).

Claude-Session: https://claude.ai/code/session_0178TZyoqDoCYehwfnQUDyNW
Entire-Checkpoint: 893094b0b7a0
@admarble
admarble merged commit 4d20e49 into main Aug 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NEEDS_VERIFICATION maps to ready_for_merge, blocking QA re-runs; MCP sequant_run ignores force

1 participant