Skip to content

feat: fix forward after a failed rollback instead of a pause that needs root - #47

Merged
groupsky merged 1 commit into
mainfrom
feat/34-broken-fix-forward
Nov 19, 2026
Merged

groupsky merged 1 commit into
mainfrom
feat/34-broken-fix-forward

Conversation

@groupsky

Copy link
Copy Markdown
Contributor

What

After an apply fails and its rollback fails too, the instance is now broken instead of paused:

  • One message goes out with the reason (the error of the apply and of the rollback, each cut in the middle so the end stays) and the two ways out: a fix forward, or root with pullgate status NAME --resume.
  • The instance keeps fetching, and asks only for a fix forward: a commit that descends from the failed commit. The question starts with a fixed warning line and a Reason: line. In auto mode the owner is asked too.
  • A fix forward that passes apply and health ends the broken state. One that fails gets no rollback: the state stays broken, and the next newer commit is asked.
  • The failed commit and the old commit are never asked again (also with tries left, also with allow_older). Root checks the rule again at the tap.
  • Questions asked before the failure are dropped, so an old tap without the warning cannot apply.
  • pullgate status shows broken: since …, last error: …. Root's --resume ends it. Nothing from Telegram can end it. A pause file still stops everything.

DESIGN.md sections 10, 12 and 13, THREAT-MODEL.md T6, the README and the security reviewer checklist describe it.

Tests

internal/gate/broken_test.go: TestFailedRollbackIsBroken, TestBrokenFixForward, TestBrokenBadFixForwardStaysBroken, TestBrokenRefusesNonDescendant, TestBrokenAsksInAutoMode, TestRootResumeEndsBroken, TestBrokenDropsOlderQuestions, TestBrokenTapRefusesNonFixForward (failed commit, other commit, auto question).

Reviews

The security reviewer and a correctness review ran. Fixed: old questions survived the failure, an auto question could apply, the warning lost the apply error, the --resume text, the save-failure path, a fixed warning line, the reviewer checklist. Not done: tests for a failed save and a cut-off during a fix forward (both use the paths that exist and are tested today: in_progress stays and the next start pauses).

Fixes #34

🤖 Generated with Claude Code

…ds root

Fixes #34

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@groupsky
groupsky merged commit 91404b8 into main Nov 19, 2026
10 checks passed
@groupsky
groupsky deleted the feat/34-broken-fix-forward branch November 19, 2026 12:12
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.

feat: fix forward after a failed rollback instead of a pause that needs root

1 participant