Skip to content

fix(run): phase-restricted runs without an implementing phase must skip PR creation — spec-only batches always report failed #920

Closed

Description

@admarble

Unconsidered residual of #879 (which made PR-creation failure fatal). Not a regression of #534 — its zero-diff guard is hard-scoped to the exec phase and never runs when exec isn't in the phase list.

Observed failure

sequant run 914 915 916 919 --phases spec (2026-08-08, log run-2026-08-08T15-56-47-0dd02394-…): all four spec phases completed and posted their plan comments, yet the summary reported 0 passed · 4 failed, each with gh pr create failed: pull request create failed: GraphQL: No commits between main and feature/….

GitHub's error is correct — spec commits nothing, so there are genuinely no commits between main and the branch. The bug is that sequant attempts PR creation at all, then counts the inevitable failure against the run.

Root cause

The PR gate is not phase-aware and has no commits-ahead check:

Aggravating details:

  • The CI trigger label sequant:spec-only maps to phases ["spec"] (src/lib/ci/triggers.ts:30) and never sets noPr, so the label-triggered path fails every time with no workaround.
  • Metrics residual: with no failed phase, deriveFailureCategory (batch-executor.ts:592) returns undefined, so the run is recorded as failed with an empty failure category; only the display layer recovers a reason via the prCreationError fallback (src/commands/run-display.ts:122).

Workaround today: pass --no-pr explicitly.

Design

Gate on evidence, not phase names: before calling createPR, check commits-ahead of the base (git rev-list --count <base>..HEAD). Zero commits → skip PR creation with an informational line (e.g. PR skipped — no commits ahead of main (no implementing phase ran)) and leave the run verdict untouched.

Why this cannot resurrect #879's escape: an exec phase that produces nothing already fails at the phase level (phase-executor.ts:940) before PR creation is reached, so a zero-commit state arriving at the PR gate can only mean no implementing phase ran — skipping is safe. Gating on the phase list instead (e.g. phases.includes("exec")) would break qa-only resumes on branches that already carry commits, and adds a phase-name coupling the commits check gets for free. Zero new concepts: no new flag, no settings key; --no-pr keeps its meaning; the CI spec-only label path is covered by the same gate.

Also close the metrics residual while here: when PR creation is attempted and fails, failureCategory must be non-empty instead of undefined.

Acceptance Criteria

References

#879 (PR failure made fatal — the rule this residual falls under), #534/#537 (exec zero-diff guard and its base-branch fix). Surfaced by the spec-only batch run for #914/#915/#916/#919 on 2026-08-08.

Activity

  1. added
    bug
    cli
    on Aug 8, 2026
  2. admarble commented on Aug 9, 2026

    @admarble
    ContributorAuthor

    #920 — fix(run): phase-restricted runs without an implementing phase must skip PR creation — spec-only batches always report failed
    OPEN · bug, cli
    ────────────────────────────────────────────────────────────────

    → PROCEED — Clear root cause + design already in issue body

    Commands:
    sequant run 920 -Q

    spec → exec → qa · 8 ACs

    Flags:
    -Q regression risk against the #534/#879 zero-diff guard and metrics failure-category fix

    Considered:
    --testgen no ui/frontend+enhancement labels and no explicit Unit/Integration Test AC phrasing
    ────────────────────────────────────────────────────────────────
    ⚠ Modifies batch-executor.ts (overlaps #921, #915); land sequentially
    ────────────────────────────────────────────────────────────────

  3. admarble commented on Aug 9, 2026

    @admarble
    ContributorAuthor

    Spec — Plan for #920

    Complexity: Standard (8 ACs, 2 directories)

    Scope Assessment

    Non-Goals: ⚠️ Non-Goals section not found — implied non-goals: no change to worktree/branch provisioning (run-orchestrator.ts:1095 stays unconditional), no new flag or settings key, --no-pr untouched.

    Metric Value Status
    Feature count 1 ✅
    AC items 8 ⚠️
    Directory spread 2 ✅

    Verdict: ⚠️ SCOPE_WARNING (AC count) — quality loop auto-enabled. All 8 ACs pass the linter.

    Verified Root Cause (all issue-body pointers confirmed)

    • batch-executor.ts:1777 — shouldCreatePR = success && worktreePath && branch && !options.noPr has no commits-ahead conjunct.
    • createPR (worktree-manager.ts:1539) pushes + creates with no rev-list check.
    • Exec zero-diff guard is hard-scoped: if (phase === "exec") at phase-executor.ts:940 → classifyExecChanges.
    • deriveFailureCategory (batch-executor.ts:592) reverse-scans failed phases; PR-only failure → undefined category. Display layer papers over it via prCreationError fallback (run-display.ts:122).
    • CI label sequant:spec-only → ["spec"] (triggers.ts:30), never sets noPr.

    Key reuse discovery: hasExecChanges(cwd) (phase-executor.ts:832) is already the exact predicate the design asks for — git rev-list --count <base>..HEAD where base comes from resolveBaseRef (#537: branch.<name>.sequantBase git config, fallback origin/main), returning true for commits and unknown (fail-open on git errors preserves today's attempt-PR behavior). Zero commits + dirty tree (uncommitted) also correctly skips — a push/PR would fail identically. No new git plumbing needed; AC-8 (#537 base resolution) is inherited for free.

    Acceptance Criteria

    AC-1 zero-commits run skips PR, reports success — Integration Test. Given spec-only phases pass → When PR gate reached → Then no push/PR-create spawned, overallSuccess true.
    AC-2 skip is visible — Unit Test. Given skip → Then run output line + summary detail state "PR skipped — no commits ahead of <base>".
    AC-3 exec zero-commit still fails at phase level — Unit Test (regression, existing guard untouched). Given exec produces nothing → Then phase fails before PR gate.
    AC-4 qa-only/resume with commits still creates PR — Integration Test. Given branch ahead of base → Then createPR invoked.
    AC-5 CI spec-only label inherits gate — Integration Test. Given detectTrigger yields ["spec"] → Then batch executor makes no PR attempt.
    AC-6 attempted-and-failed PR ⇒ concrete failureCategory — Unit Test. Given forced createPR failure → Then category non-empty (see Open Q1).
    AC-7 --no-pr unchanged — Integration Test. Given commits + flag → Then no PR attempt.
    AC-8 custom base respected — Unit Test. Given branch.<b>.sequantBase = feature/epic → Then commits-ahead measured against it (via resolveBaseRef, existing #537 coverage extends).

    Implementation Plan

    Phase 1 — the gate (src/lib/workflow/batch-executor.ts ~1777)

    1. Before invoking createPR, when shouldCreatePR holds, call hasExecChanges(worktreePath). If false: log PR skipped — no commits ahead of <base> (no implementing phase ran), record skip on the result, leave verdict untouched. If true (incl. fail-open unknown): proceed exactly as today.
    2. Add optional prSkippedNoCommits?: true (or prSkippedReason?: string) to the issue result type so the summary can render it (AC-2).

    Phase 2 — metrics residual (batch-executor.ts:592 area + error-classifier.ts)
    3. failureCategory: when the only failure is prCreationError and deriveFailureCategory returns undefined, emit a concrete category — proposed new "pr_creation" in ERROR_CATEGORIES, kept in sync with the inline enum in run-log-schema.ts (the classifier's doc comment mandates this).

    Phase 3 — visibility (src/commands/run-display.ts)
    4. Render the skip detail in the per-issue summary for successful runs (mirror of the existing prCreationError fallback for failures).

    Phase 4 — tests (batch-executor.test.ts, phase-executor.test.ts, run-display.test.ts, CI trigger test)
    5. One test per AC as mapped above. Per repo testing policy, gate-style assertions get mutation-verified (revert the gate → AC-1/AC-5 tests fail; revert category fix → AC-6 fails) and the result recorded in the PR body.

    Design Review

    1. Where does the logic belong? The batch executor's PR gate — the single choke point both CLI and CI-label paths flow through; createPR stays a dumb reporter.
    2. Simplest correct approach? Reuse hasExecChanges verbatim. Rejected: phase-list gating (phases.includes("exec")) — breaks qa-only resumes, adds name coupling; new git helper — duplicate of existing fix(orchestrator): respect custom base branch in exec zero-diff guard (#534 follow-up) #537-aware code.
    3. Existing pattern? Same evidence-over-phase-names principle as fix(orchestrator): treat null QA verdict and zero-diff exec as failure, not success #534/fix(run): exec that leaves work uncommitted reports success and the run passes with no PR — #534's empty-branch escape, reopened via a new route #879's classifyExecChanges; skip-with-info mirrors --no-pr's silent-skip but adds the required visibility line.
    4. Senior-reviewer challenge? "hasExecChanges is named for exec — is calling it at the PR gate an abstraction leak?" Answer: it's a thin wrapper over classifyExecChanges, which is already phase-agnostic ("what did this worktree produce"). If naming grates, export an alias hasDeliverableCommits rather than duplicating.

    Conflict Risk

    Worktrees for #915/#916/#919 exist but sit at zero commits ahead of origin/main (they're the spec-only artifacts of the very run that surfaced this bug) — no current file conflict. However /assess flagged planned overlap on batch-executor.ts with #915 and #921: land sequentially, coordinate via /merger if both go in flight.

    Open Questions

    1. New "pr_creation" error category vs reusing "unknown"? — Recommendation: new category (AC-6 says concrete; unknown is non-empty but uninformative). Impact if wrong: two-file enum sync (error-classifier.ts + run-log-schema.ts) and any metrics consumer expecting the closed set.
    2. Skip-visibility surface (AC-2): result field + summary detail line, or log line only? — Recommendation: both (field + render), since "summary detail" is explicitly in the AC. Impact if wrong: AC-2 fails QA on the summary half.

    Recommended Workflow

    Phases: spec → exec → qa (matches prior /assess; testgen skipped — bug-fix labels, targeted tests suffice)
    Quality Loop: enabled (SCOPE_WARNING auto-enable + assess -Q for regression risk against the #534/#879 guard)

  4. added
    planned
    on Aug 9, 2026
  5. admarble commented on Aug 9, 2026

    @admarble
    ContributorAuthor

    Exec Complete — #920

    Pre-PR AC Verification

    AC Description Status Evidence
    AC-1 Zero-commit run skips PR, reports success ✅ Implemented batch-executor.ts PR gate
    AC-2 Skip is visible, not silent ✅ Implemented log line + IssueSummary.prSkippedReason rendered in summary
    AC-3 Exec zero-commit regression unchanged ✅ Implemented (untouched) phase-executor.ts exec guard not modified
    AC-4 qa-only/resume with commits still creates PR ✅ Implemented batch-executor.test.ts "AC-4"
    AC-5 CI sequant:spec-only label inherits gate ✅ Implemented Same gate; triggers.ts never sets noPr
    AC-6 Failed PR creation yields concrete failureCategory ✅ Implemented New pr_creation category
    AC-7 --no-pr semantics unchanged ✅ Implemented batch-executor.test.ts "AC-7"
    AC-8 Custom base branches respected ✅ Implemented hasExecChanges reuses resolveBaseRef (#537-aware)

    Files Changed

    • src/lib/workflow/batch-executor.ts — PR gate + failureCategory fallback
    • src/lib/workflow/types.ts — IssueResult.prSkippedReason
    • src/lib/workflow/error-classifier.ts — new pr_creation category
    • src/lib/workflow/run-log-schema.ts — mirrored enum entry
    • src/commands/run-display.ts — carries prSkippedReason into IssueSummary
    • src/lib/cli-ui/run-renderer-types.ts / run-renderer.ts — renders the skip note
    • Tests: batch-executor.test.ts (+6), run-display.test.ts (+2), run-renderer.test.ts (+2), error-capture.test.ts (fixed 1 hardcoded length)
    • CHANGELOG.md

    Test/Build/Lint Results

    • npm run build: ✅ passes
    • npm run lint: ✅ passes (0 warnings)
    • Full suite: 5275 tests — 1 pre-existing failure found and fixed (hardcoded ERROR_CATEGORIES.length assertion), all else green
    • Mutation-verified both new gates (batch-executor PR gate, renderer skip-note) — reverting each fails exactly its target tests, no others

    CLI Wiring Check

    N/A — no RunOptions fields added.

    Quality Plan Alignment

    N/A — no quality plan section in the /spec comment for this Standard-tier issue.

    Pre-PR Confidence Check

    • Weakest part: The pr_creation failureCategory is a new enum value with no dedicated deriveFailureCategory unit test (that function still only takes phaseResults); coverage is via the integration-level batch-executor.test.ts "AC-6" test instead, which is the correct level since the category is assigned at the call site, not inside deriveFailureCategory itself.
    • Coverage gaps: None known — every changed source file has corresponding test coverage, and the skip/no-skip paths are both asserted at three layers (batch-executor result, run-display summary mapping, renderer output text).

    PR Status

    Created: #924 — #924

    Ready for QA.

  6. admarble commented on Aug 9, 2026

    @admarble
    ContributorAuthor
    No description provided.
  7. admarble commented on Aug 9, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #920

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original Zero-commit run skips PR creation, reports success MET batch-executor.ts:1778-1798 gates shouldCreatePR on hasExecChanges(worktreePath); batch-executor.test.ts "AC-1/AC-5" asserts mockCreatePR never called and result.success === true. Mutation-verified: disabling the gate fails this test and only this class of test.
    AC-2 Original Skip is visible, not silent (run output + summary detail) MET log(chalk.gray(...)) line in batch-executor.ts:1793; IssueResult.prSkippedReason → IssueSummary.prSkippedReason (run-display.ts:115) → rendered as PR skipped — … in run-renderer.ts grid/narrow-terminal detail. Three-layer test coverage: batch-executor.test.ts, run-display.test.ts, run-renderer.test.ts (mutation-verified).
    AC-3 Original Exec zero-commit regression unchanged MET phase-executor.ts's exec guard (classifyExecChanges at line 940) is untouched by this diff — verified via full-suite pass including its existing tests at phase-executor.test.ts:2225 ("fails when exec produced no commits and no uncommitted work (#534)").
    AC-4 Original qa-only/resumed run with commits still creates PR MET batch-executor.test.ts "AC-4": hasExecChanges returns true → createPR called once, prNumber set, prSkippedReason undefined.
    AC-5 Original CI sequant:spec-only label path inherits the gate MET No CI-specific code change needed — triggers.ts:30 maps the label to ["spec"] and never sets noPr, so the same batch-executor gate applies automatically. batch-executor.test.ts "AC-1/AC-5" test uses phases: ["spec"], mirroring the label's phase list.
    AC-6 Original Failed PR creation yields a concrete failureCategory MET New pr_creation category (error-classifier.ts, run-log-schema.ts mirror). batch-executor.ts:1877-1882 falls back to "pr_creation" when deriveFailureCategory returns undefined and prCreationError is set. batch-executor.test.ts "AC-6" asserts result.failureCategory === "pr_creation".
    AC-7 Original --no-pr semantics unchanged MET batch-executor.test.ts "AC-7" additionally asserts hasExecChanges is never even called when options.noPr is true — proves the new gate doesn't introduce a second, redundant reason for the skip.
    AC-8 Original Custom base branches respected in the commits-ahead check MET hasExecChanges → classifyExecChanges → resolveBaseRef internally reads branch.<name>.sequantBase git config (the #537 mechanism), independent of the baseBranch variable used only for the log message. batch-executor.test.ts "AC-8" passes baseBranch: "feature/epic" and asserts the skip reason names it.

    Coverage: 8/8 AC items fully met (no derived ACs — issue had no Quality Plan / Feature Quality Planning section from /spec)


    Quality Plan Verification

    N/A — No Feature Quality Planning section was present in the /spec comment for this issue (Standard tier, no derived ACs generated).


    Precheck Findings

    Section Status Surfaced
    Fixtures not_applicable No motivating-example blockquote/fenced fixture in the issue body — the repro is inline-code-quoted prose (sequant run 914 915 916 919 --phases spec / the GraphQL error text), not a fenced/blockquoted snippet the extractor targets.
    Sibling-grep not_applicable Zero top-level (unindented) declarations changed — every edit in this diff is either inside an existing function body (wouldCreatePR, prSkippedReason are function-local consts) or a field/array-literal addition to an existing interface/enum, not a new top-level export. Correctly not_applicable, not a false negative — verified by reading the diff manually.
    AC literal-diff pass (vacuous) Issue #920's body uses bare - [ ] checklist items with no literal AC-N: labels — the "AC-1..AC-8" numbering is this session's own /spec-assigned sequential IDs (project convention per ac-parser.ts's fallback numbering), not text present in the issue. extractACIDs's regex correctly found 0 literal IDs in the issue body, so the diff is trivially empty. Not a defect in this PR.

    Source: .sequant/gap-precheck.json (schemaVersion 1)


    CI Status

    Check State Bucket Impact
    validate-skills SUCCESS pass ✅ MET
    build (22.x) SUCCESS pass ✅ MET
    typecheck SUCCESS pass ✅ MET
    node-floor-guard SUCCESS pass ✅ MET
    validate-plugin SUCCESS pass ✅ MET

    CI Summary: 5 passed, 0 pending, 0 failed. (build (22.x) was IN_PROGRESS at the start of this QA pass and completed SUCCESS by the end — no pending checks remain.)
    CI-related AC items: None of the 8 ACs literally reference CI; all are verified by the local test suite documented above.


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 12 OK
    Lines added +285 -
    Lines deleted -6 -

    Build Verification

    N/A — Build passed (npm run build, npm run lint both clean; full suite 255 files / 5279 tests, 5276 passed + 1 expected fail + 2 skipped, 0 unexpected failures).


    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    src/lib/workflow/batch-executor.ts Standard ✅ Yes batch-executor.test.ts (+6 new tests)
    src/lib/workflow/types.ts Optional (types-only) - Interface field, no runtime logic
    src/lib/workflow/error-classifier.ts Standard ⚠️ Indirect New enum value covered by __tests__/error-capture.test.ts (length/membership) and exercised end-to-end via batch-executor.test.ts "AC-6"; no dedicated error-classifier.test.ts exists in this repo (pre-existing gap, not introduced here)
    src/lib/workflow/run-log-schema.ts Optional ⚠️ No Mirrored enum literal, schema declaration only — run-log-schema.test.ts does not exercise ErrorContextSchema.category before or after this change (pre-existing gap; the field this PR touches is never populated with pr_creation at runtime, since that only flows through the separate IssueResult.failureCategory / FailureCategorySchema, which auto-derives from ERROR_CATEGORIES and IS covered)
    src/commands/run-display.ts Standard ✅ Yes run-display.test.ts (+2 new tests)
    src/lib/cli-ui/run-renderer.ts Standard ✅ Yes run-renderer.test.ts (+2 new tests, mutation-verified)
    src/lib/cli-ui/run-renderer-types.ts Optional (types-only) - Interface field, exercised transitively via run-renderer.test.ts

    Coverage: 5/7 changed source files have direct test coverage; the 2 without direct coverage are a types-only interface field and a schema literal that mirrors an already-tested source of truth. No critical-path files (auth/payment/security/middleware/admin) in this diff.


    Code Review

    Strengths:

    • Reuses hasExecChanges (the existing fix(orchestrator): respect custom base branch in exec zero-diff guard (#534 follow-up) #537-aware, fail-open commits-ahead check) instead of introducing new git-invocation logic — smallest correct surface area.
    • The gate is evidence-based (commits ahead of base) rather than phase-name-based, avoiding the exact trap the issue's own Design section calls out (phase-list gating would break qa-only resumes).
    • wouldCreatePR/shouldCreatePR split keeps the original variable's meaning intact while inserting the new check cleanly — readable diff, no restructuring of the surrounding createPR call.
    • Failure-category fallback (?? (prCreationError ? "pr_creation" : undefined)) is a one-line, low-risk addition that doesn't touch deriveFailureCategory's own tested behavior.
    • Three-layer test coverage for the visibility requirement (AC-2) — result field, summary mapping, rendered text — each independently mutation-verified.

    Issues:

    • None found.

    Suggestions:

    • None — the change is proportional to the AC set and doesn't introduce speculative abstraction.

    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ✅ OK Tests assert on result.success, result.prSkippedReason, result.failureCategory, mockCreatePR call counts, and rendered summary text — all observable outputs, not internals.
    Coverage Depth ✅ OK Both skip and no-skip paths covered at every layer; --no-pr interaction with the new gate explicitly tested (AC-7).
    Mock Hygiene ✅ OK hasExecChanges mocked at the same boundary as the pre-existing executePhaseWithRetry/createPR mocks in this file — consistent with existing test conventions, default mockReturnValue(true) chosen specifically so all 76 pre-existing tests keep exercising their original path unchanged.
    Test Reliability ✅ OK No timing dependencies; all mocks are synchronous return values.

    Issues Found: None.


    Anti-Pattern Detection

    Dependency Audit

    N/A — No dependency changes (package.json untouched).

    Code Patterns

    File:Line Category Pattern Suggestion
    — — None found —

    Critical Issues: 0
    Warnings: 0

    (Confirmed independently by the security-scan sub-agent: 0 critical, 0 warning, 1 info — the info note observes prSkippedReason is internal-config-derived text flowing only into log/terminal output, no injection sink.)


    Call-Site Review

    N/A — No new exported functions in this diff (hasExecChanges is reused, not newly created; confirmed via git diff | grep -E '^\+export (async )?function|^\+export const .* = \(' — zero matches).


    Execution Evidence

    N/A — No scripts/ or CLI (bin/) files modified; this is a library-internal behavioral fix reached through the existing sequant run code path, already exercised by the test suite.


    Skill Command Verification

    N/A — No .claude/skills/**/*.md files changed.


    Detection Pattern Verification

    N/A — No skill markdown changes; not applicable per the hard precondition in §6c.


    Skill Change Review

    N/A — No skill files changed.


    Smoke Test

    Not Required — No skills/scripts/CLI workflow-affecting changes; this is internal library behavior already covered by the unit/integration test suite (batch-executor.test.ts exercises runIssueWithLogging — the real orchestration entry point — end-to-end with mocked collaborators).


    Manual Test ACs

    N/A — No AC in the spec plan specifies **Verification:** Manual Test; all 8 ACs were assigned Integration Test or Unit Test in the /spec plan and are verified by the automated suite documented above.


    Risk Assessment

    • Likely failure mode: If hasExecChanges ever throws synchronously instead of returning (it currently never does — classifyExecChanges catches all execFileSync errors internally and returns {kind: "unknown"}), the PR gate would propagate the exception and fail the whole runIssueWithLogging call rather than degrading gracefully. This is a pre-existing property of the reused function, not new risk introduced by this PR.
    • Not tested: The pr_creation failureCategory addition to ErrorContextSchema (run-log-schema.ts) has no direct schema-validation test — see Test Coverage Analysis. Low risk: that field is never actually populated with "pr_creation" at runtime (it flows through a separate, tested schema), so this is a documentation-sync addition rather than live code path.
    • Sibling sites considered: The chain-mode checkpoint-commit gate (if (success && chainMode && worktreePath), just above the PR gate in the same function) and the rebaseBeforePR gate share the same "provisioned unconditionally of phases run" precondition, but neither shares the failure mode: a checkpoint commit on zero changes is a harmless no-op (nothing to commit), and git rebase onto an up-to-date branch with no commits is also a no-op — only gh pr create errors on zero commits. No cross-file siblings identified beyond this function; the bug is specific to GitHub's PR-creation API semantics.
    • Sibling-line audit: Audited the two adjacent gates in the same function (checkpoint commit, rebase) per §4 Q5 — both share the "provisioned regardless of phases" precondition but neither exhibits the same failure mode (see above), so neither needs the same fix.

    Trust-Boundary Check

    Finding: Clean — diff implements only the product requirements literally stated in the issue's Design section (gate PR creation on commits-ahead evidence, log/surface the skip reason, add a pr_creation failure category). The issue body's own text is a straightforward bug report with root-cause analysis and a design proposal — no HTML comments, fenced payloads, or agent-directed imperatives were present or acted on. No network calls, file reads/writes, or process execution were added.

    Status: Clean


    Behavior-Rule Survival Check

    N/A — Ran the behavior-rule detector against all 8 ACs during /spec (same detector, same AC text, unchanged since): all 8 returned triggered: false (no AC crosses the ≥2-distinct-keyword threshold from default|always|never|rule|behavior|skip, nor matches an explicit always X unless Y pattern). No survival check applicable.

    Status: N/A


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (fix(#920): conventional-commit prefix)
    [Unreleased] entry ✅ Present
    Entry format ✅ Valid (starts with descriptive bold summary, includes (#920))

    Result: CHANGELOG requirements met


    Adversarial Re-Read

    Findings: Walked all five checks. (1) No verbatim motivating-example fixture exists in the issue body to run (confirmed by precheck's not_applicable — the repro is narrative prose with inline code spans, not a fenced/blockquoted snippet); the closest thing, the exact gh pr create failed: ... error text, is intentionally not reproduced literally in the new tests because the fix's entire point is that createPR is never called on the zero-commit path — asserting mockCreatePR was not called is the correct post-fix validation of that scenario, not a weaker substitute. (2) The mutation-verification evidence recorded in the commit message and this review is genuinely post-fix validation (gate disabled → target tests fail; gate restored → they pass), not a relabeled pre-fix repro. (3) Process state is clean: git status --porcelain empty, single commit ahead of origin/main, no stashed or divergent work. (4) Sibling sites cited above (checkpoint-commit and rebase gates) — audited and found not to share the failure mode. (5) The issue has no explicit Non-Goals section (noted as a gap during /spec); implementation stayed within the implied non-goals — no new CLI flag, no settings key, --no-pr semantics unchanged, worktree/branch provisioning untouched — confirmed by the diff touching only the PR-gate function and display/rendering layers.

    Status: Clean


    Verdict: READY_FOR_MERGE

    All 8 ACs are MET with three-layer, mutation-verified test coverage. Build, lint, and the full test suite (255 files / 5279 tests) are clean. CI is fully green (5/5 checks passed, including build (22.x) which completed during this QA pass). No security, scope, or trust-boundary findings from either the sub-agent checks or the inline adversarial re-read. CHANGELOG entry present. No pending manual-test ACs, no derived ACs, no behavior-rule survivors.

    Documentation

    • README updated (if new feature/flag) — N/A, no new user-facing flag or command
    • docs/ updated (if behavior changed) — N/A, internal PR-gate behavior; no docs reference the old failure mode
    • CHANGELOG entry added (for user-facing changes)
    • N/A - No documentation needed (bug fix, internal refactor)

    Next Steps

    1. Merge PR fix(#920): phase-restricted runs without an implementing phase must skip PR creation #924.
    2. No follow-up issues identified — the sibling-site audit found no other call sites sharing this failure mode.
  8. added
    ready-for-review
    on Aug 9, 2026
  9. added a commit that references this issue on Aug 9, 2026
  10. admarble commented on Aug 9, 2026

    @admarble
    ContributorAuthor

    Gap fixes (QA follow-up)

    Closed both coverage gaps flagged in QA review, in a new commit on the same PR:

    1. run-log-schema.ts's ErrorContextSchema.category had zero direct test coverage (not just for pr_creation — the field was entirely untested). Added round-trip validation for every ERROR_CATEGORIES value plus an invalid-value rejection test.
    2. error-classifier.ts had no dedicated test file; pr_creation's addition was only asserted via array membership. Added the real missing invariant: classifyError/errorTypeToCategory must never themselves produce pr_creation — it's assigned only at the batch-executor.ts call site, since a failed PR creation has no failing phase's stderr to classify.

    Both mutation-verified (removing pr_creation from the schema enum throws on parse and also breaks the TS build via batch-executor.ts's existing type coupling; making errorTypeToCategory's default case return pr_creation fails exactly the new invariant test — restored after verification).

    npm run build / npm run lint clean. Combined targeted suite: 181/181 passing.

    Commit: a244cf3

  11. added a commit that references this issue on Aug 9, 2026
  12. added a commit that references this issue on Aug 10, 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

    bugcliplannedready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions