Skip to content

fix(chain): --chain --ready-gate resume re-executes already-gated links (COMPLETED_STATUSES misses waiting_for_human_merge/blocked) #837

Closed

Description

@admarble

Context

#817 added sequant run --ready-gate. A gated issue terminates in a sequant ready terminal status — waiting_for_human_merge (threshold reached) or blocked (guard halt) — instead of ready_for_merge. That is deliberate and correct: ready_for_merge would read as auto-merge-ready and defeat the human merge gate the whole feature exists to preserve.

Chain resume was not updated for those two new terminal statuses.

Problem

src/lib/workflow/chain-resume.ts:86:

const COMPLETED_STATUSES = new Set(["ready_for_merge", "merged"]);

computeResumePlan peels the contiguous completed prefix off the chain using that set (:109). Neither waiting_for_human_merge nor blocked is in it, so under sequant run --chain --ready-gate:

  1. Link A runs, gates cleanly, and is persisted waiting_for_human_merge.
  2. The chain later halts (rate limit, failure, Ctrl-C) at link C.
  3. Re-running to resume does not recognise A as complete, so A is re-executed from phase 0 — a full spec/exec/qa pipeline plus another full-weight ready gate.

This is wasteful, not incorrect — A's work is committed and re-running is idempotent-ish — but the cost is a complete re-run of the most expensive path in the tool, silently, on exactly the runs a user opted into for extra rigor. The more links that gated successfully before the halt, the worse it gets.

Chain interaction beyond "the gate runs per-issue after that issue's phases" was an explicit Non-Goal of #817, which is why this was deferred rather than fixed there. This issue tracks it so the surprise is not undiscovered.

Secondary: a comment that is now inaccurate

chain-resume.ts:175-181 explains the dirty-worktree fail-fast with:

createCheckpointCommit sweeps trailing uncommitted changes into a checkpoint commit; when it fails (commit hook, staging error, or unrelated dirty files) the status was already written as ready_for_merge, so this link still reads as a completed prefix while its tip is missing work.

For a gated link the status written is waiting_for_human_merge/blocked, so the "already written as ready_for_merge" premise no longer holds. This is a code comment, not user-facing output — but it is the comment a maintainer will read when reasoning about this exact code path, and it currently describes a case that no longer covers gated runs.

Acceptance Criteria

  • computeResumePlan treats a gated link's terminal statuses as completed for prefix-peeling purposes, so --chain --ready-gate resume skips already-gated links instead of re-executing them.
  • blocked is distinguished from waiting_for_human_merge in that decision — a guard-halted link needs human attention and must NOT be silently skipped as if it had passed; decide and document which of the two counts as a resumable-completed prefix.
  • The dirty-worktree safety check at chain-resume.ts:182 still fires for gated links (a gated link whose checkpoint commit failed must not become a rebase base), with its SkippedLink.status type widened accordingly.
  • A test fails if a gated link is re-executed on resume — drive computeResumePlan with a waiting_for_human_merge link and assert it lands in skipped, not active.
  • The chain-resume.ts:175-181 comment is corrected to cover gated terminal statuses.
  • Mutation-verified per the repo's gate-test rule: revert the COMPLETED_STATUSES change, confirm exactly the new test fails, and record the result.

Out of scope

Changing #817's terminal-status choice (it is deliberate); auto-merging gated links; any change to non-chain --ready-gate behavior.

References

Activity

  1. added
    bug
    on Jul 28, 2026
  2. admarble commented on Jul 28, 2026

    @admarble
    ContributorAuthor

    Plan (/spec)

    Complexity: Standard (6 ACs, 1 directory)

    AC Quality Check

    ⚠️ ACs are not machine-trackable. The issue uses bare - [ ] checkboxes with no
    AC-N: prefix. extractAcceptanceCriteria is label-anchored and returned 0 items,
    so nothing lands in .sequant/state.json. ACs are numbered AC-1…AC-6 below in issue
    order; future issues should use - [ ] **AC-1:** ….

    Two identifiers in the issue body don't match the code (harmless, but noting so the
    diff reads consistently):

    Issue says Actual export
    computeResumePlan computeChainResumePlan
    SkippedLink.status ChainResumeSkip.status

    Otherwise the ACs are specific and measurable — AC-6 even pins the verification method.


    Scope Assessment

    Non-Goals: present and explicit (#817's terminal-status choice, auto-merging gated
    links, non-chain --ready-gate behavior).

    Metric Value Status
    Feature count 1 ✅
    AC items 6 ⚠️ (at yellow threshold)
    Directory spread 1 (src/lib/workflow/) ✅

    Verdict: ✅ SCOPE_OK — 6 ACs is nominally yellow, but they are facets of one small
    change (one status set, one type, comments, tests), not six features.

    Conflict risk: none. In-flight #833 touches bin/cli.ts / cli-flags.ts /
    config-resolver.ts; #838 has no diff yet. No overlap with chain-resume.ts.
    (#833 does touch CHANGELOG.md — this PR will stay out of that file.)


    Acceptance Criteria

    AC-1 — computeChainResumePlan treats gated terminal statuses as completed.
    Verification: Unit Test.
    Given a chain [A(waiting_for_human_merge), B(undefined)] → When planning → Then A is in
    skipped and active === [B], with resumeBase = A's branch.

    AC-2 — blocked distinguished from waiting_for_human_merge; decision documented.
    Verification: Unit Test + code comment.
    Decision: only waiting_for_human_merge counts as completed. blocked does not.
    Rationale (to be written into the code):

    1. blocked is a generic, pre-existing member of IssueStatusSchema
      (state-schema.ts:58 — "Waiting on external input or dependency"), not gate-exclusive.
      Admitting it to the completed set would silently apply to every other writer of that
      status, present and future.
    2. Semantically a guard halt is the human-attention signal. Skipping it as a completed
      prefix is exactly what AC-2 forbids.
      Consequence: a blocked link stays in active and is re-executed — the existing
      conservative behavior, and the same choice already made for failed state lookups
      (planChainResumeFromState). Costly, but never silently wrong.

    AC-3 — dirty-worktree fail-fast still fires for gated links; status type widened.
    Verification: Unit Test.
    The check at :182 lives in the non-merged branch, so it covers gated links with no
    control-flow change. But the three failFast strings hardcode "is ready_for_merge but…",
    which is factually wrong for a gated link — they will be made status-accurate.

    AC-4 — a test fails if a gated link is re-executed on resume.
    Verification: Unit Test. Drive computeChainResumePlan with a waiting_for_human_merge
    link; assert it lands in skipped, not active.

    AC-5 — the chain-resume.ts:175-181 comment corrected.
    Verification: Manual (review). Two adjacent comments carry the same stale premise and
    will be corrected with it: the module header (:4-9) and the else-branch lead-in (:148-151).

    AC-6 — mutation-verified.
    Verification: Manual, recorded in the PR. Revert COMPLETED_STATUSES, confirm exactly
    the new test(s) fail, restore. Per the repo gate-test rule — the tautology detector does
    not catch this class.


    Implementation Plan

    Phase 1 — source (src/lib/workflow/chain-resume.ts)

    1. Replace the bare Set with a single source of truth so the set and the type cannot
      drift (this is what makes AC-3's widening structural rather than a second manual edit):
      const COMPLETED_STATUSES = ["ready_for_merge", "merged", "waiting_for_human_merge"] as const;
      type CompletedStatus = (typeof COMPLETED_STATUSES)[number];
      const COMPLETED_STATUS_SET = new Set<string>(COMPLETED_STATUSES);
      ChainResumeSkip.status becomes CompletedStatus (AC-3). Deliberately keeps AC-6's
      mutation cheap: dropping the array element fails the new test without a type error.
    2. Document the blocked exclusion at the constant (AC-2) — why, not just what.
    3. Make the three failFast messages interpolate last.status instead of hardcoding
      ready_for_merge (AC-3).
    4. Correct the stale comments at :175-181, :148-151, and the module header (AC-5).

    Phase 2 — tests (chain-resume.test.ts)

    1. Add: gated link is skipped, not re-executed (AC-4/AC-1); blocked link is not
      skipped (AC-2); dirty worktree on a waiting_for_human_merge resume base still fails
      fast and the message names the right status (AC-3).

    Phase 3 — verify

    1. npx vitest run src/lib/workflow/chain-resume + npm run build, then the AC-6
      mutation run, recorded in the PR body.

    Design Review

    1. Where does this logic belong? chain-resume.ts alone. In chain mode the
      orchestrator's chain branch and the non-chain skip guard (run-orchestrator.ts:844)
      are mutually exclusive, so chain-resume.ts is the only completed-status gate on
      this path. No orchestrator change is needed.
    2. Simplest correct approach? Add one string to one set. Everything else is the type
      widening AC-3 requires plus comment accuracy. Rejected: a ReadyGateStatus helper
      module (one call site — premature), and teaching the planner to fail-fast on blocked
      (goes beyond "must not be silently skipped", and would break resuming a chain whose
      blocker the user just fixed).
    3. Existing pattern followed? Yes — the "unknown/ambiguous state is treated as
      incomplete and re-executed" rule already stated at :250-252. Excluding blocked is
      that same rule, not a new one.
    4. What would a senior reviewer challenge? "Why not skip blocked too — isn't
      re-running it just as wasteful?"
      Because waste is the acceptable failure mode here and
      a silently-dropped blocked issue is not. AC-2 makes the same call.

    Sibling-site Scan

    One sibling carries the identical stale premise this change invalidates:

    src/lib/workflow/batch-executor.ts:1516-1521

    "Note the status above is already ready_for_merge, so a re-run reads this link as a
    completed prefix and does NOT redo it."

    For a gated link the status written two lines earlier is waiting_for_human_merge /
    blocked. Same root cause as AC-5, comment-only, ~2 lines. Not named in the ACs.

    Recommendation: include it. Leaving it corrects one half of a two-site explanation of
    the same mechanism and leaves the other actively contradicting the new code. It will be
    called out explicitly in the PR body as scope beyond the literal ACs.


    Open Questions

    1. A re-executed blocked link is silent. Skipped links print
      ! #N: already <status> — skipping; a blocked link just quietly re-runs the full
      gate. Recommendation: leave as-is — the ACs scope this to chain-resume.ts, and the
      fix belongs in the orchestrator's display. Impact if wrong: cosmetic surprise, not
      incorrect behavior. Worth a follow-up issue if it bites.

    Recommended Workflow

    Phases: spec → exec → qa
    Quality Loop: disabled
    Reasoning: bug label, no UI surface → no /test. Pure logic change with existing
    unit-test coverage → no /testgen (per the testgen table, bug-only skips it). Small,
    single-file diff → the standard QA pass is sufficient.

    Label Review

    Current: bug
    Recommended: bug (add no-browser-test to make the /test skip explicit)
    Reason: No UI surface; the label documents the skip rather than relying on absence.

  3. added
    planned
    no-browser-test
    on Jul 28, 2026
  4. added a commit that references this issue on Jul 28, 2026
  5. admarble commented on Jul 28, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #837

    PR: #839 · Branch: feature/837-fix-chain-chain-ready-gate-resume-re-executes- · HEAD: 439dcd1

    Size Gate

    Check Value
    Diff size 285 lines (threshold: 100)
    package.json changed No
    Security-sensitive paths No
    Decision Sub-agent-tier / Standard QA (reviewed inline — diff <600 lines, per project practice on worktree review)

    AC Coverage

    AC Description Status Notes
    AC-1 Gated terminal statuses treated as completed for prefix-peeling MET waiting_for_human_merge added to COMPLETED_STATUSES (chain-resume.ts:50-55). 3 tests cover single-link, mixed-prefix, and fully-gated chains.
    AC-2 blocked distinguished from waiting_for_human_merge; decision documented MET blocked excluded. Rationale written at the constant (chain-resume.ts:24-49), not just in the PR. 2 tests pin the exclusion.
    AC-3 Dirty-worktree check still fires for gated links; status type widened MET ChainResumeSkip.status → CompletedStatus. Check needed no control-flow change (already in the non-merged branch); 3 tests assert fail-fast fires and names the gated status.
    AC-4 A test fails if a gated link is re-executed on resume MET waiting_for_human_merge is a completed prefix — the gated link is skipped, NOT re-executed; asserts skipped, not.toContain(1) in active. Mutation-verified below.
    AC-5 chain-resume.ts:175-181 comment corrected MET Corrected, plus two adjacent comments carrying the same stale premise (module header, else-branch lead-in).
    AC-6 Mutation-verified per the repo gate-test rule MET Both directions run and recorded below.

    Coverage: 6/6 met.

    Note: the issue names computeResumePlan and SkippedLink; the actual exports are computeChainResumePlan and ChainResumeSkip. Same entities — flagged only so the diff reads consistently against the issue text.


    AC-6 Mutation Verification

    Mutation A — revert COMPLETED_STATUSES to ["ready_for_merge", "merged"]:

    Tests  8 failed | 17 passed (25)
    

    All 8 failures are the new #837 tests. All 17 pre-existing tests pass — the change is not over-coupled.

    Mutation B — add "blocked" to the array:

    Tests  3 failed | 22 passed (25)
    

    Exactly the 3 tests asserting blocked is excluded.

    Mutation A alone would have left one new test (blocked is NOT a completed prefix) passing in both states — vacuous against that mutation. Mutation B was run specifically to prove it. Every new test is sensitive to at least one direction; none are tautological. Restored: 25/25 pass.


    CI Status

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

    CI Summary: 5 passed, 0 pending, 0 failed. mergeable: MERGEABLE, mergeStateStatus: CLEAN.

    (Above is for 590b7bb; the CHANGELOG-only commit 439dcd1 was pushed after and re-triggers the same set.)


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 4 OK
    Lines added +250 (+CHANGELOG) –
    Lines deleted −35 –

    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    src/lib/workflow/chain-resume.ts Standard ✅ Yes chain-resume.test.ts (25), chain-resume.integration.test.ts
    src/lib/workflow/batch-executor.ts Standard ✅ Yes batch-executor.test.ts (57)

    Coverage: 2/2 changed source files have tests. No critical-path (auth/payments/admin) files touched.

    Suite results: chain-resume.test.ts 25/25 · ready-gate + chain-resume.integration 39/39 · batch-executor 57/57 · full src/lib/workflow + src/commands 82 files, 1616 passed, 2 skipped (main baseline 1607 + 9 new).

    Flake investigated, not waved off: the first worktree run showed 6 failures. All were spawnSync-based *.integration.test.ts timing out at 5000ms. Ruled out as cold-tsx-cache artifacts by three controls: the 4 files pass in isolation in the worktree; the same 82-file run passes on unmodified main; and the same 82-file run passes in the worktree once warm. None touch chain-resume or batch-executor.


    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ✅ OK Asserts on the returned plan (skipped/active/resumeBase/failFast), not internals.
    Coverage Depth ✅ OK Happy path, mixed prefixes, all-complete, and 3 fail-fast paths (no branch / destroyed branch / dirty worktree).
    Mock Hygiene ✅ OK Reuses the existing injected CompletedLinkResolver — no new mocks.
    Test Reliability ✅ OK Pure sync functions, fixed fake SHAs, no timing dependency.

    Code Review

    Strengths

    • COMPLETED_STATUSES as a const array deriving both the runtime Set and the CompletedStatus type makes AC-3's widening structural. The previous shape (a bare Set plus a hand-written union repeated in two places) is exactly what drifted to produce this bug; the new shape cannot.
    • The blocked exclusion rationale lives at the constant, so the next maintainer meets the reasoning where the decision is, not in a PR they'd have to find.
    • Interpolating last.status into the fail-fast messages fixes a real, if quiet, defect: those strings would have told a user their gated issue "is ready_for_merge" — a status it can never hold.

    Issues

    • None blocking.

    Observation (not a defect in this PR)

    The non-chain skip guard at run-orchestrator.ts:844 still filters only ready_for_merge/merged, so sequant run <gated-issue> without --chain still re-runs a waiting_for_human_merge issue. That is the same bug class, now asymmetric with chain mode. It is explicitly out of scope per the issue's Non-Goals ("any change to non-chain --ready-gate behavior"), so it was correctly left alone — flagging it for a follow-up decision rather than filing unprompted.


    Anti-Pattern Detection

    No await in loops added, no empty catch, no hardcoded secrets, no SQL concatenation, no timers. The peel loop is pure and synchronous. package.json untouched → no dependency audit.


    Call-Site Review

    New exported symbols: CompletedStatus (type only).

    Symbol Call Sites Loop? AC Match
    CompletedStatus chain-resume.ts only – ✅ Type-only export consumed by ChainResumeSkip

    grep for ChainResumeSkip|CompletedStatus outside chain-resume.ts returns nothing, so the interface widening breaks no consumer. No new runtime functions were added, so there is no new call site to audit.


    Execution Evidence

    N/A — no scripts/ or CLI-surface changes. Behavior is exercised through unit + integration suites, plus npm run build (clean) and full-suite runs above.


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (fix(#837):)
    [Unreleased] entry ✅ Present (added in 439dcd1)
    Entry format ✅ Under ### Fixed, issue number (#837)

    The gate initially failed — the first commit shipped without an entry, which under §7 demotes to AC_MET_BUT_NOT_A_PLUS. Fixed in-PR rather than deferred.


    Risk Assessment

    • Likely failure mode: A link is skipped whose branch tip does not actually contain its work — the successor then rebases onto an incomplete base. The dirty-worktree fail-fast is the guard, and it covers gated links unchanged; the residual risk is a checkpoint that fails and leaves the worktree clean, which is pre-existing and not widened here.
    • Verified, not assumed: the change could have converted a merely-wasteful bug into a hard stop — if gated links lacked branch in state, every resume would now hit the "no branch is recorded" fail-fast and halt the chain instead of re-running. Traced it: batch-executor.ts:745-771 writes branch/worktree early in executeIssue, long before the gate (~1467) and the status write (~1490). Gated links always have a branch recorded, so that regression does not exist.
    • Not tested: no end-to-end --chain --ready-gate run against real git — the planner is unit-tested over the injected resolver, and the real-git rebase path is covered by the pre-existing integration test, which this change does not alter.
    • Sibling sites considered (cross-file): run-orchestrator.ts:844 — same stale status set, deliberately out of scope (above). batch-executor.ts:1506 and :1525 — same stale premise, fixed in this PR and disclosed as beyond the literal ACs.
    • Sibling-line audit (intra-file): all three failFast messages in chain-resume.ts shared the hardcoded ready_for_merge root cause; all three corrected, not just the one the AC named. The last.status === "merged" branch was re-checked — gated links correctly route to the else (feature-branch tip) path, since their work is not in the merged base.

    Trust-Boundary Check

    Finding: Clean — the issue body is a technical bug report with code references and acceptance criteria. It contains no agent-directed instruction (no command to execute, URL to fetch, file to read or transmit, or instruction override). The diff implements only product behavior described by the ACs.

    Status: Clean


    Adversarial Re-Read

    Findings:

    1. Checked the state-write ordering rather than assuming it — the "does a gated link actually have branch in state?" question above. Had the answer been no, this fix would have been a regression, not an improvement. Confirmed against batch-executor.ts:745-771.
    2. Checked that blocked links still get their work committed — createCheckpointCommit is guarded on success && chainMode, not on the gate verdict, so a blocked link's work is on its branch. Re-executing it is therefore wasteful but safe, which is what makes the AC-2 exclusion defensible rather than merely conservative.
    3. Checked waiting_for_human_merge writers beyond --ready-gate — sequant ready (feat(cli): sequant ready <issue> — post-resolve A+ QA gate that drives an issue to merge-readiness #683) writes it too. A standalone sequant ready 100 followed by sequant run --chain 100 101 will now skip feat(#99): Add adversarial self-questioning to workflow phases #100. That is correct and desirable: ready certified it as merge-ready awaiting a human decision, and --force remains the escape hatch.
    4. Checked the all-gated chain — yields allComplete: true, so the orchestrator prints "All chain links already completed. Use --force to re-run" and exits 0 rather than doing nothing silently.
    5. Non-Goals audit — no change to feat(run): --ready-gate — run the post-QA ready gate inside sequant run (automates the any-gaps/fix-gaps second look, stops at human merge) #817's terminal-status choice, no auto-merge of gated links, no non-chain behavior change. The two batch-executor.ts edits are the only scope beyond the literal ACs and are disclosed in the PR body and above.
    6. Mutation asymmetry caught — Mutation A left one new test vacuous; ran Mutation B to close it rather than reporting "8 tests failed, verified."

    Status: Clean


    Verdict: READY_FOR_MERGE

    All 6 ACs met and mutation-verified in both directions. CI fully green, MERGEABLE/CLEAN. The change is minimal at its core (one string in one set) with the surrounding work being the structural type derivation AC-3 requires, message accuracy, and comment corrections. The one gate that initially failed (CHANGELOG) was fixed in-PR.

    Documentation

    • CHANGELOG entry added (439dcd1)
    • README — N/A (no new flag or user-facing surface; --ready-gate and --chain already documented)
    • docs/ — N/A (internal resume-planning correctness fix)

    Next Steps

    1. Merge fix(#837): --ready-gate resume no longer re-executes already-gated issues (chain and non-chain) #839 (human merge gate — this workflow never auto-merges).
    2. Decide whether the non-chain run-orchestrator.ts:844 asymmetry warrants a follow-up issue. Not filed unprompted, since the issue's Non-Goals put it out of scope.
  6. added
    ready-for-review
    on Jul 28, 2026
  7. added 3 commits that reference this issue on Jul 28, 2026
  8. admarble commented on Jul 28, 2026

    @admarble
    ContributorAuthor

    Gap Closure — #837

    Followed the "fix all gaps" instruction, which lifts this issue's own Non-Goal ("any change to non-chain --ready-gate behavior"). Recorded here since that was a deliberate scope boundary in the issue text.

    Swept every consumer of the completed-status concept rather than patching the one gap already flagged. Five candidates found, three real, two cleared.

    Fixed

    Gap A — non-chain pre-flight guard (run-orchestrator.ts:842) — the one flagged in the QA review.
    Tested status === "ready_for_merge" || status === "merged" inline, so sequant run <gated-issue> without --chain still re-ran an issue the ready gate had already cleared. Same waste as the chain bug, and asymmetric with chain mode once the chain half landed.

    Gap B — merge-detection sweep (state-cleanup.ts:303) — not previously surfaced.
    Skipped waiting_for_human_merge, so a gated issue whose PR a human then merged never advanced to merged and rotted in state. Partially masked: sequant status --reconcile catches it via classifyDrift, which is not status-gated; --cleanup did not.

    That sweep has now been patched three times for the same omission — #592 (in_progress), #606 (waiting_for_qa_gate), #837 (waiting_for_human_merge). That recurrence is the actual finding, so its list now carries an explicit note that it is deliberately wider than isCompletedIssueStatus — it asks "might this have a merged PR?", not "is this done?" — to stop a future reader "simplifying" the two into one.

    Gap C — stale comments invalidated by Gap A's fix.
    types.ts's --force doc ("skips ready_for_merge/merged issues"), the chain-resume.ts module header, and state-cleanup.test.ts's header, which asserted the old inline pair as a standing invariant.

    Structural change

    The predicate was spelled out inline at three sites with three different lists. It is now one module — completed-status.ts — owning isCompletedIssueStatus, with the waiting_for_human_merge inclusion and blocked exclusion rationale recorded once instead of per call site. Adding a status to IssueStatusSchema now has one obvious place to consider.

    The type guard also narrows link.status directly, so chain-resume.ts's as CompletedStatus cast is gone.

    Cleared (investigated, not defects)

    • isTerminalStatus (state-schema.ts:435) — force-clean deletes state entries for terminal statuses. TERMINAL_STATUSES = ["merged", "abandoned"] correctly excludes waiting_for_human_merge: a gated issue is awaiting a decision, not resolved. Had it been included, --cleanup would have deleted gated issues' state. Correct as-is.
    • getReadyForMergeIssues() (state-manager.ts:820) — returns only ready_for_merge, but has zero callers in src/, bin/, or scripts/. Dead surface; deliberately not touched (that is chore(types): reuseWorktrees is a declared-but-unconsumed RunOptions field #810's cleanup class, not this issue's).

    Mutation verification

    # Mutation Result
    A revert COMPLETED_STATUSES to ["ready_for_merge","merged"] 8 failed / 17 passed
    B add "blocked" to the set 3 failed / 22 passed
    C revert non-chain guard to the inline pair 0 failed — see below
    D drop waiting_for_human_merge from the cleanup sweep 1 failed (exactly the new case)

    Mutation C is the finding worth reporting. Reverting the non-chain guard compiled clean and failed nothing. completed-status.test.ts proves the predicate is correct but not that the orchestrator calls it — a correct predicate nobody consults is exactly the inert surface this repo has been bitten by twice (#795 --qa-gate, #810 reuseWorktrees).

    Closed with non-chain-skip-guard.test.ts, following the existing source-text guard pattern (run-options-dead-surface.test.ts) since the guard is an inline branch inside RunOrchestrator.run() and unreachable without standing up state, worktrees, GitHub and locks. Scoped to the region between the guard's marker comment and its state-lookup catch, per the repo rule that file-reading gate tests assert on a region — run-orchestrator.ts is ~1,700 lines and a whole-file assertion would pass or fail for unrelated reasons. @tautology-skip is claimed with its justification; re-running Mutation C now fails exactly its 2 assertions and nothing else.

    Verification

    • Full src/lib/workflow + src/commands: 84 files, 1627 passed, 2 skipped (was 82/1616 before this pass; main baseline 1607)
    • npm run build: clean
    • CI on 1e538ad3: 5/5 pass · MERGEABLE / CLEAN

    Verdict: READY_FOR_MERGE

    6/6 original ACs remain met; the three additional gaps are fixed and pinned. Still stops at the human merge gate.

  9. added a commit that references this issue on Jul 29, 2026
  10. added 2 commits that reference this issue on Aug 29, 2026
  11. added a commit that references this issue on Sep 9, 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

    bugno-browser-testplannedready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions