fix(ack): set the next state's transitions when ack.sh advances - #223
Merged
Merged
Conversation
ack.sh moved current_state forward but left the old state's transitions in state.json. A second ack before the hook fired again failed with "invalid next state ''", so the agent had to retry the gated command after every step. The gate now stores the flow's transition map in state.json as flow_transitions, and ack.sh sets transitions and next_state for the state it advances to. ensure_ack_sh rewrites an ack.sh that differs from the current script, so sessions started by an older steplock get the fix on their next block. The unused duplicate core/src/ack.sh is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tupe12334
marked this pull request as ready for review
September 29, 2026 11:08
6 tasks
tupe12334
added a commit
that referenced
this pull request
Sep 29, 2026
- Bump steplock to 0.2.1 for the ack.sh transitions fix (#223). - CHANGELOG: cut the Unreleased entry as 0.2.1 (2026-09-29). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ack.shmovedcurrent_stateforward but left the old state'stransitionsinstate.json. A second ack before the hook fired again failed withinvalid next state '', so an agent had to retry the gated command after every step. On a 9-step run of the Kev PR checklist that meant about 20 extra tool calls.state.jsonasflow_transitions.ack.shsetstransitionsandnext_statefor the state it advances to, so acks can run back to back.ensure_ack_shnow rewrites anack.shthat differs from the current script, so a session started by an older steplock gets the fix on its next block.core/src/ack.sh, an unused copy ofcore/scripts/ack.sh(onlyscripts/ack.shis embedded).schemas/session-state.schema.jsondocumentsflow_transitions. The field is optional, so olderstate.jsonfiles still load.Test plan
cargo test --lockedpasses (179 tests)cargo clippy --all-targets --locked -- -D warningspassescargo fmt --checkpassesack_sh_advances_twice_without_a_hook_call_betweenruns the realack.shthree times in a row (linear, branch, linear), then checks that the hook blocks at the last step. It fails on the oldack.shwithinvalid next state 'right'.ensure_ack_sh_replaces_stale_scriptreplaces the old test that asserted a staleack.shis keptsteplock, replaced an existing session's oldack.shon the next block. On this PR's own checklist run, 7 acks then ran back to back with no retried commandcargo auditruns only whenCargo.lockchanges)Kev review
Local Kev (
kev-latest), one round, verified facts only:flow_transitions0.69,all_transitions0.18,graph0.12ack.sh0.45, removing the duplicate script here 0.41. All are below the merge score, so the PR is kept as is.🤖 Generated with Claude Code