Skip to content

fix: prune start checkpoint on eviction#8

Merged
b2m9 merged 3 commits into
mainfrom
fix/prune-start-checkpoint-on-eviction
Jul 20, 2026
Merged

fix: prune start checkpoint on eviction#8
b2m9 merged 3 commits into
mainfrom
fix/prune-start-checkpoint-on-eviction

Conversation

@b2m9

@b2m9 b2m9 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary by cubic

Fixes incorrect handling of position-0 checkpoints during eviction. Eviction now prunes START-anchored checkpoints so revertTo can’t land on an unreachable state; redo-branch drops still keep them.

  • Bug Fixes

    • Prune checkpoints anchored to START when front eviction occurs; revertTo on a pruned name throws.
    • Clarified docs: pruning is by anchor identity; eviction prunes position-0 checkpoints, redo-drop does not.
    • Added tests for eviction vs. redo-branch behavior.
  • Refactors

    • Simplified pruneCheckpoints to accept readonly Anchor[] and updated call sites.

Written for commit 1f551d6. Summary will update on new commits.

Review in cubic

b2m9 and others added 3 commits July 20, 2026 15:27
A checkpoint taken at position 0 anchors to the START sentinel, which
pruneCheckpoints skipped unconditionally — so limit eviction left it
alive even though the state it named was no longer reachable, and
revertTo silently landed on a different state instead of throwing.

Prune START-anchored checkpoints whenever entries are evicted from the
front. A dropped redo branch still leaves them intact: position 0
remains reachable there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pruneCheckpoints takes a plain readonly Anchor[] instead of a
ReadonlySet: the redo-drop call site returns to its original shape, the
eviction site is one spread, and the types check by ordinary array
covariance rather than method bivariance. Reword the pruning docs to
state the real rule — pruning is by anchor identity, not state
reachability, which differ for a checkpoint anchored to the newest
evicted entry — and note in revertTo the invariant that keeps indexOf
from returning -1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Re-trigger cubic

@b2m9
b2m9 merged commit 80b152c into main Jul 20, 2026
2 checks passed
@b2m9
b2m9 deleted the fix/prune-start-checkpoint-on-eviction branch July 20, 2026 14:16
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