-
Notifications
You must be signed in to change notification settings - Fork 152
Remove deferred condensation and add trailing transcript handling #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ACTIVE + GitCommit now emits [Condense, MigrateShadowBranch] instead of
transitioning to ACTIVE_COMMITTED. PhaseFromString("active_committed")
returns PhaseActive for backward compatibility with existing state files.
PhaseActiveCommitted is kept as a deprecated var so external packages
continue to compile during migration.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 4d348d4af066
…ommitMsg With ACTIVE_COMMITTED removed, PostCommit now condenses immediately for ACTIVE sessions instead of deferring to HandleTurnEnd. This eliminates PendingCheckpointID (only needed for deferred condensation) and simplifies PrepareCommitMsg, HandleTurnEnd, and InitializeSession. Key changes: - Remove PendingCheckpointID from session.State - Simplify PostCommit from two-pass to single-pass processing - Fix shadow branch deletion for ACTIVE sessions after condensation by comparing current BaseCommit to original shadow branch name - Remove ActionCondense handling from HandleTurnEnd (now no-op) - Simplify PrepareCommitMsg to always generate fresh checkpoint IDs - Remove hasOtherActiveSessionsOnBranch (unused after refactor) - Remove createShadowBranchWithTranscript test helper (unused) - Update all tests referencing ACTIVE_COMMITTED to use PhaseActive - Update integration tests to verify immediate condensation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 9bad6d35da69
Update doc comments and assertions in phase_transitions_test.go to reflect that PostCommit condenses immediately instead of deferring to TurnEnd. Clean up remaining ACTIVE_COMMITTED references across hooks, doctor, reset, and strategy interface comments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 72c47dedec2f
Add UpdateCommitted to checkpoint store for appending transcript content to existing committed checkpoints. At TurnEnd and InitializeSession, if uncondensed transcript exists and no new files were touched, append trailing conversation to the prior checkpoint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 4343d8d4bcb7
Remove ACTIVE_COMMITTED phase references, update state machine transitions to reflect immediate condensation on PostCommit, document trailing transcript handling, and remove PendingCheckpointID references. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 4343d8d4bcb7
Remove stale "deferred condensation" references in comments and add defensive guard for empty sessions list in UpdateCommitted. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: be0b5b98ed8d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR simplifies the session state machine by removing the ACTIVE_COMMITTED phase and implementing immediate condensation during commits instead of deferred condensation. It also adds trailing transcript handling to capture post-commit conversation that belongs to the condensed checkpoint.
Changes:
- Removes ACTIVE_COMMITTED phase from the state machine, with backward compatibility for old state files
- Removes PendingCheckpointID field from session state, simplifying checkpoint ID management
- Implements immediate condensation on GitCommit events (ACTIVE + GitCommit stays ACTIVE, condenses immediately)
- Adds trailing transcript handling via new UpdateCommitted operation to append post-commit conversation to checkpoints
- Updates all related tests, integration tests, and documentation to reflect the simplified lifecycle
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/session/phase.go | Removes ACTIVE_COMMITTED phase constant, adds backward compatibility mapping to ACTIVE |
| cmd/entire/cli/session/state.go | Removes PendingCheckpointID field from State struct |
| cmd/entire/cli/checkpoint/committed.go | Adds UpdateCommitted method and helper functions to append transcript/prompts to existing checkpoints |
| cmd/entire/cli/strategy/manual_commit_hooks.go | Refactors PostCommit to condense immediately on ACTIVE+GitCommit; updates HandleTurnEnd to handle trailing transcripts |
| cmd/entire/cli/strategy/manual_commit_trailing.go | New file implementing handleTrailingTranscript logic with guards and idempotency |
| cmd/entire/cli/integration_test/trailing_transcript_test.go | New integration tests verifying trailing transcript append and skip scenarios |
| cmd/entire/cli/strategy/phase_postcommit_test.go | Updates unit tests for immediate condensation behavior, removes deferred condensation tests |
| cmd/entire/cli/strategy/phase_prepare_commit_msg_test.go | Updates tests to use LastCheckpointID instead of PendingCheckpointID |
| CLAUDE.md | Updates architecture documentation to reflect simplified state machine |
| docs/architecture/claude-hooks-integration.md | Documents trailing transcript handling in TurnEnd hook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
| // | ||
| // Deprecated: ACTIVE_COMMITTED has been removed from the state machine. | ||
| // All references should be migrated to PhaseActive. | ||
| var PhaseActiveCommitted Phase = "active_committed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deprecated exported variable is unused throughout codebase
Low Severity
The exported PhaseActiveCommitted variable is declared as deprecated but has zero references anywhere in the codebase — all usages were migrated to raw Phase("active_committed") strings or removed. The comment claims it's kept "so that external packages referencing it continue to compile during the migration," but since no package references it, it's dead code that could confuse future readers into thinking the phase is still meaningful.


Summary
UpdateCommittedoperation30 files changed, 1325 insertions, 1106 deletions across 6 commits.
Design
See
docs/plans/2026-02-13-checkpoint-boundary-realignment-design.mdfor full design rationale.Before:
ACTIVE + GitCommit → ACTIVE_COMMITTED(deferred condensation at TurnEnd)After:
ACTIVE + GitCommit → ACTIVE + [Condense, MigrateShadowBranch](immediate condensation)Test plan
mise run fmt && mise run lint && mise run test:ciall pass🤖 Generated with Claude Code