Repository navigation
fix(#920): phase-restricted runs without an implementing phase must skip PR creation - #924
Merged
admarble merged 2 commits intoAug 9, 2026
Conversation
…R creation instead of failing The worktree and branch are provisioned unconditionally of which phases run, so a clean spec-only pass (`--phases spec`, or the CI `sequant:spec-only` label) satisfied every conjunct of the PR-creation gate with zero commits — `gh pr create` then failed with GitHub's correct-but-unhelpful "No commits between main and …", and #879 folds that into a run failure for work that landed exactly where it was supposed to (the plan comment). Gate on evidence instead of the phase list: reuse `hasExecChanges` (the #537-aware, fail-open commits-ahead check `classifyExecChanges` already uses for the exec zero-diff guard) before attempting a PR. Zero commits skips PR creation with a stated reason, both logged and carried into the run summary; a branch that does have commits — including a qa-only resume — is unaffected. Also closes the #879 metrics residual: a PR creation failure now yields the new `pr_creation` failureCategory instead of an empty one. Mutation-verified: reverting the batch-executor gate fails exactly the AC-1/AC-5/AC-2/AC-8 tests (others unaffected); reverting the renderer's skip-note extras fails exactly the "shows the skip note" test.
8 tasks
Two gaps noted in QA review, both pre-existing before this PR touched the category enums: - run-log-schema.ts's ErrorContextSchema.category was never tested at all (not just for pr_creation) — add round-trip coverage for every ERROR_CATEGORIES value plus an invalid-value rejection. - error-classifier.ts has no dedicated test file; its pr_creation addition was only asserted as array membership. Add the missing invariant: classifyError/errorTypeToCategory must never themselves produce pr_creation, since it's assigned only at the batch-executor call site where a failed PR creation has no failing phase's stderr to classify. Mutation-verified both: removing pr_creation from the schema enum throws on parse (also breaks the TS build via batch-executor.ts's existing type coupling to the enum); making errorTypeToCategory's default case return pr_creation fails exactly the new invariant test.
admarble
deleted the
feature/920-fix-run-phase-restricted-runs-without-an-imple
branch
August 9, 2026 15:34
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sequant run 920 --phases spec, or the CIsequant:spec-onlylabel) skips PR creation instead of failing on GitHub's "No commits between main and …" — the gate now checkshasExecChanges(reusing fix(orchestrator): respect custom base branch in exec zero-diff guard (#534 follow-up) #537's base resolution) before attempting a PR.PR skipped — …note in the run summary, both driven by the newIssueResult.prSkippedReasonfield.pr_creationfailureCategory instead of an empty one.Pre-PR AC Verification
batch-executor.tsPR gate;batch-executor.test.ts"AC-1/AC-5"log()line inbatch-executor.ts;IssueSummary.prSkippedReasonrendered inrun-renderer.ts; tests inbatch-executor.test.ts,run-display.test.ts,run-renderer.test.tsphase-executor.tsexec guard not modified; existing tests atphase-executor.test.ts:2225still passbatch-executor.test.ts"AC-4"sequant:spec-onlylabel inherits gatetriggers.tsnever setsnoPr;batch-executor.test.ts"AC-1/AC-5"pr_creationcategory;batch-executor.test.ts"AC-6"--no-prsemantics unchangedbatch-executor.test.ts"AC-7"hasExecChangesinternally usesresolveBaseRef(#537-aware);batch-executor.test.ts"AC-8"Test plan
npm run buildpassesnpm run lintpasses (0 warnings)ERROR_CATEGORIESlength in__tests__/error-capture.test.ts), rest passCloses #920
🤖 Generated with Claude Code