fix(daemon): settle a Run fork's dispatched shimmer when the fork closes#940
Merged
Conversation
A self-archived Run fork left its annotated block shimmering forever:
the prompt's settle-before-archive step is unenforced, and the owner's
run only auto-clears on the OWNER's terminal state — which never comes
for fork-executed runs.
Deterministic backstop (spec 0076): program.execute now records each
fork's dispatch (owner id + annotated anchor); archive and delete of a
tracked fork settle the shimmer of its dispatched blocks directly
against the run's pending set, mirroring settle_verb_shimmer. Blocks
whose text drifted while the fork worked are caught by scanning the
live document for the fork's @{session:<id>} clip. The prompt is also
tightened into an explicit two-step finish (settle edit, then archive).
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.
Problem
Follow-up to #935: the fork self-archives when its task is done, but the annotated selection keeps shimmering. The prompt's "settle before archiving" step is unenforced, and the owner run's auto-clear only fires on the owner's terminal state — which never comes for fork-executed runs. Result: a closed fork, a block shimmering forever.
Fix
Deterministic daemon-side backstop (spec 0076):
program.executenow records each Run fork's dispatch (owner session id + the annotated anchor) in arun_fork_dispatchesmap — the Run-fork sibling ofpending_verb_merges.archiveanddeleteof a tracked fork settle the shimmer of its dispatched blocks directly against the run's pending set (mirroringsettle_verb_shimmer), covering self-archive, the auto-close path, and manual archive/delete alike. The entry is consumed on first close, so archive-then-delete settles once.@{session:<id>}clip, which travels with the block.construct_program_edit, then the archive call — "Never archive before the settle edit has succeeded." The backstop guarantees the outcome either way.Verification
cargo test --workspacegreen after fixing the feat(daemon): Run forks self-archive when their dispatched task completes #935 prompt-phrase assertion to the new wording (only failure in the run; daemon lib re-run 259/259).run_fork_close_settles_dispatched_shimmer_even_after_drift— drifted block text + surviving clip still settles; tracking entry consumed.program_selection_fork_run_delivers_and_submits_promptextended: archiving the fork (which never made a settle edit) leaves the owner run with zero pending blocks, observable immediately after the archive call returns.🤖 Generated with Claude Code