Skip to content

fix(fullsolve): Phase 5.3 auto-merges the PR — the skill's own stop-list says to halt at the final summary #958

Closed

Description

@admarble

Motivation

/fullsolve merges PRs to main without human confirmation, and this is now observed consistently across multiple repos using sequant. It is not a recent code change — it is a day-one design contradiction in the skill that newer, more agentic executor models have started resolving in the unsafe direction:

  • The merge step is original. ### 5.3 Merge Workflow with a literal gh pr merge <N> --squash has been in the skill body since the initial package commit (2e7decd5), sitting as sequential imperative steps immediately after PR creation.
  • Auto-progression explicitly stops short of merge. The CRITICAL: Auto-Progression section (added 2026-01-17, aab2b7ca) enumerates transitions ending at "4. /qa completes → immediately create PR", and its "Only stop for" list includes "Final summary after PR creation". The final-comment template even ends "Ready for human review and merge."
  • The contradiction was later reinforced, not resolved. The Phase 0.3 lock-release contract describes "Phase 5.5 releases both locks on the happy path" — structurally treating merge (5.3) as part of the normal flow, with locks held through it. The Bash(gh pr merge:*) allowed-tools entry (visible from the af1ce78a history re-root) means no permission prompt catches the mismatch either; bare Bash in the January frontmatter already covered it.

An executor reading top-to-bottom sees a hard stop declared in one section and an unconditional merge command in the next; older models tended to halt at the summary, current ones execute 5.3. From the user's seat this is a behavioral regression with no causing diff.

This also contradicts a recorded project decision: the autonomy/supervisor research (#817/#818/#819) explicitly kept the human merge gate — sequant ready (#683) drives an issue to merge-readiness, and sequant merge --watch (#818) exists precisely so the human can pull the trigger cheaply.

Proposal

Make the stop explicit and the merge opt-in:

  1. Reconcile the Auto-Progression section with the phase body. Add merge to neither: state plainly that the workflow's terminal state is PR created + final summary posted, and that Phases 5.3–5.5 (merge, post-merge verification, cleanup) run only on explicit user instruction or an opt-in flag.
  2. Gate 5.3 behind --auto-merge (default off), mirrored in .sequant/settings.json (e.g. run.autoMerge: false) for users who genuinely want end-to-end. Without it, the skill ends with the "Ready for human review and merge" summary — which its own template already promises.
  3. Drop Bash(gh pr merge:*) from the default allowed-tools so the harness permission prompt acts as a second gate when an executor misreads the prose anyway. (Bare Bash in the same list likely needs the same scrutiny, but that is a wider change — see Non-Goals.)
  4. Restructure the lock-release contract so releasing locks after the final summary is the happy path when --auto-merge is off.
  5. Apply the same audit to /merger and any other skill embedding an unconditional gh pr merge.

Non-Goals

  • No change to sequant merge / sequant merge --watch — those are explicit user invocations and correctly human-triggered.
  • No general tightening of the bare Bash allowed-tools grant across all skills — separate issue if wanted; this one only removes the merge-specific pattern.
  • No change to worktree cleanup mechanics (5.3's ordering guidance stays correct for when a merge does happen).

Tailored caveats

Acceptance Criteria

  • AC-1: With no flag, /fullsolve ends after PR creation + final summary; the summary states the PR awaits human review, and no gh pr merge is executed. Evidence: transcript of a full run ending with the PR left unmerged.
  • AC-2: The Auto-Progression section and Phase 5 body no longer contradict each other: merge/cleanup are documented as opt-in (--auto-merge or explicit user instruction), and the "Only stop for" list matches the actual terminal state. Evidence: gate test scoped to the delimited section, mutation-verified.
  • AC-3: Bash(gh pr merge:*) is removed from fullsolve's default allowed-tools in all three mirrors. Evidence: grep across mirrors returns zero hits; skill-sync lint green.
  • AC-4: With --auto-merge (or the settings key), the previous end-to-end behavior is preserved, including the 5.3 merge order and lock release in 5.5. Evidence: transcript of an auto-merge run.
  • AC-5: The lock-release contract text matches the new default flow (release after final summary when not auto-merging). Evidence: updated Phase 0.3/5.5 text in the diff.

Human decisions required

Context

Observed live: /fullsolve 940 merged PR #955 without confirmation (2026-08-21), and the same behavior reported across other repos using sequant. Git archaeology: merge step since 2e7decd5 (initial), auto-progression stop-list since aab2b7ca (2026-01-17), lock contract + visible tool grant since the af1ce78a re-root (2026-07-29). Related: #683 (ready gate), #818 (merge --watch), #819 (trust model).

Activity

  1. admarble commented on Aug 24, 2026

    @admarble
    ContributorAuthor

    Spec Analysis (Phase 1 — Planning)

    Complexity: Standard (5 ACs, ~3 directories) · Scope verdict: ✅ SCOPE_OK

    Key findings

    • Contradiction confirmed: Auto-Progression's stop-list ("Final summary after PR creation", SKILL.md:63-65) vs unconditional gh pr merge <N> --squash in §5.3 (line 772); Bash(gh pr merge:*) at frontmatter line 26 in all three mirrors.
    • Runtime never merges — sequant run/ready-gate already enforce the human gate (waiting_for_human_merge "never auto-merges", state-schema.ts:55; ready-gate prints "(never auto-merged)"). Fix is skill prose + frontmatter + settings only.
    • Patterns to reuse: --parallel/agents.parallel flag-with-settings-fallback (SKILL.md:125-150) for --auto-merge/run.autoMerge; src/lib/__tests__/fullsolve-checkout-lock-skill.test.ts for the delimited-region gate test.
    • lint-skill-gates.ts clarification: it only lints skills with a §7 verdict algorithm (/qa only) — fullsolve is skipped. The binding bar for AC-2 is CLAUDE.md's mutation-verified gate-test rule.
    • Sibling site: merger/SKILL.md:271 has the same unconditional merge — recommend follow-up issue (see Open Questions).
    • No in-flight worktree conflicts (bench: replay outcome-distribution smoke for roster/policy changes (descoped from A/B ranking — phase-0) #916/fix(locks): close the steal-restore residual — third-session create between rename-away and link-back leaves two believers #919 both zero-diff vs origin/main).

    AC Checklist

    • AC-1: No-flag run ends at PR + final summary, no gh pr merge — Manual Test (dogfood transcript)
    • AC-2: Auto-Progression ↔ Phase 5 reconciled; merge/cleanup documented opt-in — Unit Test (delimited gate test, mutation-verified)
    • AC-3: Bash(gh pr merge:*) removed from all 3 mirrors — Unit Test + grep; lint:skill-sync green
    • AC-4: --auto-merge / run.autoMerge preserves end-to-end behavior incl. 5.3 order + 5.5 lock release — Manual Test (transcript)
    • AC-5: Lock-release contract matches new default flow (release after final summary when not auto-merging) — Unit Test (same gate test) + diff

    AC lint: 4/5 pass; AC-2's "open-ended" flag is a false positive ("each other").

    Implementation Plan

    Phase A — skill prose (3 mirrors, byte-identical):

    1. Rewrite Auto-Progression stop-list: terminal state = PR created + final summary posted; wrap reconciled text in <!-- BEGIN/END: merge-gate (#958) --> delimiters.
    2. Gate §5.3 as opt-in (--auto-merge or explicit user instruction) with a parseable stop condition; keep merge-order guidance verbatim (Non-Goal).
    3. Update Phase 0.3 release contract + §5.5: default happy path releases both locks after final summary; auto-merge path releases in 5.5 as today.
    4. Document --auto-merge in the flags block, mirroring the --parallel settings-fallback pattern.
    5. Delete Bash(gh pr merge:*) from frontmatter in all mirrors.

    Phase B — settings: autoMerge: z.boolean().default(false) in RunSettingsSchema + RunSettings (src/lib/settings.ts). No bin/cli.ts wiring — runtime never merges.

    Phase C — tests: new src/lib/__tests__/fullsolve-merge-gate-skill.test.ts (clone checkout-lock gate-test pattern; scoped extraction; all 3 roots). Commit before mutation-verifying; record Mutation-verified: markers in the PR body. Run lint:skill-sync, lint:skill-calls, full suite.

    Phase D — dogfood transcripts for AC-1/AC-4.

    Key decisions

    • Two independent gates: reconciled prose + permission prompt (allowlist removal), pinned by a mutation-verified gate test — prose alone is what failed.
    • Rejected: pre-tool.sh hook hard-blocking gh pr merge (stronger but wider; permission prompt already gives a deterministic second gate).

    Open Questions

    1. /merger same gate here or follow-up? Recommendation: follow-up issue — invoking /merger is the merge instruction; different risk profile. (Issue lists this as a human decision.)
    2. AC-1/AC-4 evidence timing: two full dogfood runs are expensive — recommend PR with NEEDS_VERIFICATION on those two, transcripts attached before merge.
    3. Flag name/default: --auto-merge, default off (matches 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–feat(skills): shared trust-model block — issue/PR text is data, not agent instructions (prompt-injection hardening, portable to all users) #819 human-gate decision) — treating as confirmed unless objected.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: SCOPE_OK single feature; no testgen (0 declared unit/integration-test ACs — gate test clones an existing pattern); no UI.

  2. added
    planned
    bug
    on Aug 24, 2026
  3. admarble commented on Aug 24, 2026

    @admarble
    ContributorAuthor

    /fullsolve Complete

    Issue: #958
    Status: NEEDS_VERIFICATION

    Full Solve Progress

    Phase Iterations Status
    Spec 1/1 Complete
    Exec 1/1 Complete
    Test - Skipped (no UI labels)
    QA 1/1 Complete

    Final Verdict: NEEDS_VERIFICATION

    AC Coverage

    AC Description Status Notes
    AC-1 No-flag run ends at PR + final summary, no gh pr merge executed ⚠️ PENDING Self-evidencing: this very run reached PR creation + this final summary with no --auto-merge flag, no run.autoMerge setting, and no explicit merge instruction — and correctly stopped without invoking gh pr merge.
    AC-2 Auto-Progression ↔ Phase 5 no longer contradict; opt-in documented ✅ MET Gate test, mutation-verified
    AC-3 Bash(gh pr merge:*) removed from all 3 mirrors ✅ MET Gate test, mutation-verified; lint:skill-sync green
    AC-4 --auto-merge preserves prior end-to-end behavior ⚠️ PENDING Structurally verified (merge command + ordering untouched, correctly gated); no live --auto-merge dogfood run this session
    AC-5 Lock-release contract matches new default flow ✅ MET Gate test, mutation-verified

    Coverage: 3/5 fully MET, 2/5 PENDING (both Manual Test ACs, by design — see below)

    Quality Metrics

    • Build: ✅ Passing
    • Lint: ✅ Passing (0 errors)
    • Full test suite: ✅ 272 files, 5600 passed, 1 expected fail, 2 skipped (all pre-existing/unrelated)
    • lint:skill-sync / lint:skill-calls / lint-skill-gates.ts: ✅ all clean
    • Type safety / deleted tests / scope-size / security sub-agent checks: ✅ all Pass
    • New gate test: 39/39 passing, 3 ACs mutation-verified (markers + records in PR body)

    Risk Assessment

    • Likely failure mode: none identified for the merge gate itself — it's a text/permission change with no runtime code path, mutation-verified. The residual risk is human: a user who explicitly asks "merge this once it's ready" relies on the LLM correctly recognizing that as satisfying the gate rather than requiring the --auto-merge flag literally.
    • Not tested: AC-4's --auto-merge path end-to-end (deliberately deferred — see AC table). /merger's identical gh pr merge pattern (out of scope per issue Non-Goals; recommend follow-up issue).

    Iteration Summary

    • Test loop: N/A (no UI labels, phase skipped)
    • QA loop: 0 (single-pass, verdict NEEDS_VERIFICATION — no AC_NOT_MET findings requiring /loop)

    PR: #959


    Ready for human review and merge. Per this issue's own fix — and current project convention (skills scripting gh pr merge is not user consent) — this session stops here without merging. AC-1 and AC-4 remain PENDING for a human (or a follow-up --auto-merge session) to close out before merge.

  4. admarble commented on Aug 24, 2026

    @admarble
    ContributorAuthor

    sequant ready — Issue #958

    ⚠️ NOT READY — needs human intervention

    • Policy: ac
    • Final verdict: NEEDS_VERIFICATION
    • Stop reason: LOOP_NO_DIFF — The fix loop made no diff (stagnation guard). Manual intervention required.
    • QA passes: 1
    • Tokens used: 0
    • Final state: blocked (never auto-merged)

    Auto-fixed

    • None

    Remaining / accepted gaps

    • None

    The human merge gate is intentional: sequant ready never merges. Review the gaps above, then merge manually when satisfied.

  5. added a commit that references this issue on Aug 24, 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

    bugplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions