Skip to content

feat(workspace): opt-in /resume stash for the clean-tree guard - #24

Merged
JasonZQH merged 1 commit into
devfrom
fix/writer-clean-tree-autostash
Jul 23, 2026
Merged

feat(workspace): opt-in /resume stash for the clean-tree guard#24
JasonZQH merged 1 commit into
devfrom
fix/writer-clean-tree-autostash

Conversation

@JasonZQH

Copy link
Copy Markdown
Owner

What

The writer clean-tree guard pauses on a dirty tree so the recorded git diff stays attributable to the writer alone. This adds an opt-in convenience so dogfooding doesn't require a manual commit/stash:

  • /resume stash tucks the user's uncommitted work into a git stash (excluding .curator/ via an explicit pathspec, so Curator's own ledger is never swept) and re-runs the writer on a clean baseline. Restore later with git stash pop.
  • Clearer dirty-pause card naming shell-valid commands (/resume stash | /resume continue) instead of a bare /resume.

Deliberate ceilings (documented in code)

  • No auto-pop — avoids a mid-loop merge conflict if the writer touched the same files; the user pops when the delivery is reviewed.
  • Advisory stash return — the clean-tree guard is the fail-safe: a failed/empty stash simply re-pauses, so the writer can never run on a dirty tree.

Also

Documents the future multi-worktree parallel model in docs/future-optimizations.html (the V1 direction that supersedes this guard).

Tests

pytest -p no:cacheprovider -q362 passed; ruff check src tests clean. (362, not 367 — this branch is off dev, which doesn't include the unrelated TUI-toolcall commit's ~5 tests.) New tests cover the stash helper, the .curator/ exclusion, the pause-card metadata, and the end-to-end /resume stash.

🤖 Generated with Claude Code

The writer clean-tree guard pauses on a dirty tree so the recorded diff stays
attributable to the writer alone. Add an opt-in convenience: `/resume stash`
tucks the user's uncommitted work into a git stash (excluding `.curator/`, so
Curator's own ledger is never swept) and re-runs the writer on a clean
baseline; the user restores later with `git stash pop`. Pair it with a clearer
dirty-pause card that names shell-valid commands (`/resume stash` |
`/resume continue`) instead of a bare `/resume`.

Deliberate ceilings: no auto-pop (avoids mid-loop merge conflicts), and the
stash return is advisory — the clean-tree guard remains the fail-safe, so a
failed or empty stash simply re-pauses. Both documented in code.

Also document the future multi-worktree parallel model in
docs/future-optimizations.html — the V1 direction that supersedes this guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JasonZQH
JasonZQH merged commit a8c8299 into dev Jul 23, 2026
5 checks passed
@JasonZQH
JasonZQH deleted the fix/writer-clean-tree-autostash branch July 23, 2026 19:57
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