Skip to content

Conversation

@khaong
Copy link
Contributor

@khaong khaong commented Feb 13, 2026

Summary

  • Remove ACTIVE_COMMITTED phase from session state machine — checkpoints now condense immediately on GitCommit regardless of session phase (no more deferred condensation)
  • Remove PendingCheckpointID from session state — simplifies PostCommit to single-pass, PrepareCommitMsg to fresh-ID-only, and HandleTurnEnd to no longer dispatch ActionCondense
  • Add trailing transcript handling — post-commit conversation (summaries, explanations) with no new file edits is appended to the prior checkpoint via new UpdateCommitted operation
  • Update documentation — CLAUDE.md, architecture docs, and regenerated state diagram reflect the simplified lifecycle

30 files changed, 1325 insertions, 1106 deletions across 6 commits.

Design

See docs/plans/2026-02-13-checkpoint-boundary-realignment-design.md for full design rationale.

Before: ACTIVE + GitCommit → ACTIVE_COMMITTED (deferred condensation at TurnEnd)
After: ACTIVE + GitCommit → ACTIVE + [Condense, MigrateShadowBranch] (immediate condensation)

Test plan

  • Unit tests for state machine transitions (ACTIVE_COMMITTED removed, backward compat via PhaseFromString)
  • Unit tests for trailing transcript guards (no LastCheckpointID, new files touched, no new transcript, successful append)
  • Unit tests for UpdateCommitted (append transcript, not-found, multi-session matching)
  • Integration tests for trailing transcript (appended when no new files, skipped when new files touched)
  • Integration tests for immediate condensation flow (commit-before-stop)
  • mise run fmt && mise run lint && mise run test:ci all pass

🤖 Generated with Claude Code

khaong and others added 6 commits February 13, 2026 16:22
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
Copilot AI review requested due to automatic review settings February 13, 2026 07:07
Copy link
Contributor

Copilot AI left a 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

Copy link

@cursor cursor bot left a 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"
Copy link

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant