feat(session): protocol-safe checkpoint cut planner - #455
Open
bobzhang wants to merge 1 commit into
Open
Conversation
Session::checkpoint_cut plans coverage boundaries in protocol units: the largest to_sequence at or below the request where no assistant tool call is pending, so a summary always swallows batches whole. A prefix cut inside a batch silently drops the batch's uncovered sibling results from every later projection with nothing standing in for them — the property test pins both directions. Conservative at the log edge: a crashed batch keeps its calls pending forever, clamping boundaries below it. Both checkpoint sites gain a warn-only invariant probe (full-range coverage swallows batches whole, so behavior is unchanged): a clamp on the auto path means a sequencing bug let a checkpoint start mid-batch; on the manual path it flags a crash-truncated log. The planner is the substrate the verbatim-tail, eviction, and incremental-checkpoint work consumes next, where clamps become binding. Co-Authored-By: Claude Fable 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
Third slice of the compaction production-hardening plan (R1: the substrate every later stage consumes). Stacked on #453.
Session::checkpoint_cut(requested_to~)returns the largest coverage boundary at or below the request where no assistant tool call is pending — so a checkpoint summary always swallows assistant/tool batches whole. A prefix cut inside a batch silently drops the batch's uncovered sibling results from every later projection, with nothing standing in for them; the property test pins both the clean and the split direction.Design points:
auto_compaction_cut_clamped/compaction_cut_clamped). Behavior is unchanged: full-range coverage swallows batches whole. A clamp on the auto path indicates a sequencing bug; on the manual path it flags a crash-truncated log.The verbatim-tail, deterministic-eviction, and incremental-checkpoint stages consume this API next, where clamps become binding instead of diagnostic.
Testing
moon check --deny-warnclean; agent_session 36/36, agent+compact 67/67.🤖 Generated with Claude Code