Skip to content

Restore auto-transfer stashes when branch start aborts#352

Merged
NagyVikt merged 1 commit intomainfrom
agent/codex/fix-branch-start-stash-leak-2026-04-22-22-50
Apr 22, 2026
Merged

Restore auto-transfer stashes when branch start aborts#352
NagyVikt merged 1 commit intomainfrom
agent/codex/fix-branch-start-stash-leak-2026-04-22-22-50

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Guardex was leaving duplicate temporary stashes behind when branch start failed after protecting local changes from a protected branch. This change restores those changes back to the source checkout on failure, drops the temp stash, and locks the memory-bank failure path with a regression.

Constraint: Managed script and template copies must stay byte-for-byte aligned
Rejected: Clean up leaked stashes manually only | the startup flow would keep recreating them
Confidence: high
Scope-risk: narrow
Directive: Any future branch-start failure path after auto-transfer must either restore the root checkout or leave one explicit recovery instruction, never silent temp stashes
Tested: node --test test/branch.test.js; node --test test/metadata.test.js; bash -n scripts/agent-branch-start.sh; bash -n templates/scripts/agent-branch-start.sh; git diff --check; openspec validate --specs
Not-tested: Live gx branch start against this monorepo with concurrent external worktree churn

Guardex was leaving duplicate temporary stashes behind when branch start failed after protecting local changes from a protected branch. This change restores those changes back to the source checkout on failure, drops the temp stash, and locks the memory-bank failure path with a regression.

Constraint: Managed script and template copies must stay byte-for-byte aligned
Rejected: Clean up leaked stashes manually only | the startup flow would keep recreating them
Confidence: high
Scope-risk: narrow
Directive: Any future branch-start failure path after auto-transfer must either restore the root checkout or leave one explicit recovery instruction, never silent temp stashes
Tested: node --test test/branch.test.js; node --test test/metadata.test.js; bash -n scripts/agent-branch-start.sh; bash -n templates/scripts/agent-branch-start.sh; git diff --check; openspec validate --specs
Not-tested: Live gx branch start against this monorepo with concurrent external worktree churn
@NagyVikt NagyVikt merged commit 202b08d into main Apr 22, 2026
1 check passed
@NagyVikt NagyVikt deleted the agent/codex/fix-branch-start-stash-leak-2026-04-22-22-50 branch April 22, 2026 21:52
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.

1 participant