Fix apply workflow sync before state hydration#271
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 9, 2026, 6:26 AM ET / 10:26 UTC. Summary Reproducibility: yes. at source level: current main hydrates generated state into the checkout and then runs Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge the narrow ordering fix after required checks and maintainer acceptance of the apply-lane automation risk, keeping apply-existing synced before hydration with no post-hydration rebase. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main hydrates generated state into the checkout and then runs Is this the best way to solve the issue? Yes. Moving the existing pull before setup-state is the narrow maintainable fix for the dirty-worktree rebase failure, and the PR adds focused ordering coverage. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 205a27a9d70d. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Added redacted runtime proof to the PR body showing the reordered apply-existing path syncs before hydration, hydrates state, and completes reconcile without running apply/close commands. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
git pull --rebasebefore state hydration so the source checkout is still clean when it syncs.setup-stateand does not rebase between hydration and reconcile.Fixes #270.
Validation
pnpm run build:allpassednode --test --test-name-pattern "apply workflow" test/clawsweeper.test.tspassedpnpm run format:checkpassedpnpm run checkreached build and lint successfully, then failed duringtest:uniton this Windows host in unrelated environment-sensitive tests: Codex proof spawn returnsEPERM, one test expects/usr/bin/git, and a POSIX file-mode assertion sees Windows modes.Runtime Proof
Generated from a fresh throwaway clone of this PR branch plus a fresh public state checkout. Paths are local temp paths and omitted here. No
apply-decisions, close, or other mutation command was run.This demonstrates the reordered apply-existing path can sync the source checkout before hydration, hydrate state, and reach/complete reconcile without the dirty-worktree rebase failure.