Repository navigation
fix(session): a swept fork stays retired - #1969
Merged
Merged
Conversation
The second sweep of a kept conversation asks furrow about a fork it retired on the first sweep, and logs "retired" again.
The checkpoint keeps naming a landed fork forever, and furrow answers a fork it no longer holds with success, so every launch asked furrow about the same forks and logged "retired" again. The sweep now remembers what it retired in forks-retired.json beside the checkpoint and skips those forks.
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
Every launch's startup sweep asked furrow about the same two landed forks and logged "retired" again. The laptop's
sweep.logshows the pair at every launch for days.Cause:
tasks.jsonkeepsgroundUniverseandmerge: mergedon a landed node forever.retireCheckpointForks(landedOnly)reads only that file, so it picks the same forks on every sweep.Workspace.DropForkreturns success for a fork furrow no longer lists ("a previous successful retirement is safe to retry"), so the sweep logs "retired" again.furrow statusplus onefurrow forksper fork in the person's project. Nothing was deleted again.Fix: the sweep now writes down each fork it retires and skips those forks after that.
The memory lives in its own file, not in
tasks.json. The task store rewrites the checkpoint whole whenever the conversation reopens, so a mark written there could be lost on the next save, or could overwrite that save. A missing, unreadable or unknown-schema file counts as empty. That costs one more furrow question for each fork and never removes anything. Each record is keyed by ground, furrow name and directory. Fork names carry a random suffix, so a new fork can't match an old record.Furrow does not need to change.
Evidence
Failing test first (commit 2381508):
TestASweptLandedForkStaysRetired. A landed fork is left behind (furrow was unavailable when it landed), then a kept conversation is swept twice, as two separate processes.the second sweep retired 1-4121ab again: [sweep: retired fork 1-4121ab of /tmp/…]. This is the laptop's line.Rig on Spark: a copy of the laptop home, with the paths in this session's checkpoint rewritten to a furrow-watched
afkitstand-in. Every furrow call is counted.status,forks,forks)The sweep never blocks the first frame: on dev, with each afkit
forkscall slowed by 4 s (8 s added to the sweep), the first frame was still 0.43 s on both launches.Full suite:
LC_ALL=C make checkon Spark, fleet job20261026-185034-002484, commit e5acfb8. Everything passes except failures that are already on dev (internal/release×2,seniordev/util TestFindUpRootFirst) and oneTestSealedTreeCarriesTheSessionTruthfailure (TempDir RemoveAll: directory not empty). That test doesn't touch the sweep, and it passes 20/20 in isolation on both this branch and dev. The sweep, retire, fork and seal tests ininternal/sessionandcmd/codeafpass on rerun. c17e1b1 adds only the change entry (make changelog-checkok).Merge Danger
Door: two-way
This adds one new file per session folder, and only once that session has had a fork retired. Reverting means the next sweep asks furrow again, which is the old behaviour.
Blast Radius: sweep
Only the background sweep's retirement path changes. Landing, reaping and ownership checks are unchanged.
🤖 Generated with Claude Code