adding tests, small improvement / better guard#568
Conversation
Entire-Checkpoint: 1043cf5253ff
PR SummaryLow Risk Overview Adds coverage to lock in the intended lifecycle: unit tests assert Written by Cursor Bugbot for commit 70cc27d. Configure here. |
There was a problem hiding this comment.
Pull request overview
This PR adds defensive improvements and comprehensive test coverage on top of PR #556, which introduced the FullyCondensed flag for performance optimization. The PR strengthens the guard conditions for the FullyCondensed flag, adds the optimization to the PrepareCommitMsg hot path, and provides thorough unit and integration tests for the full lifecycle.
Changes:
- Added
&& state.Phase == session.PhaseEndedguard to both PostCommit andfilterSessionsWithNewContentskip conditions, making theFullyCondensedinvariant explicit and defensive - Added three new unit tests covering: setting
FullyCondensedafter ENDED session condensation, skipping on subsequent commits, and verifying non-ENDED sessions never get the flag - Added an integration test verifying that reactivating a fully-condensed ENDED session correctly clears the flag (the critical safety scenario)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
cmd/entire/cli/strategy/manual_commit_hooks.go |
Added && state.Phase == session.PhaseEnded guard to the FullyCondensed skip conditions in both PostCommit loop and filterSessionsWithNewContent |
cmd/entire/cli/session/phase_test.go |
Expanded TestApplyTransition_ClearsEndedAt to a table-driven test covering both FullyCondensed=true and FullyCondensed=false cases, verifying the flag is cleared on reactivation |
cmd/entire/cli/strategy/phase_postcommit_test.go |
Three new unit tests for the FullyCondensed flag lifecycle in PostCommit |
cmd/entire/cli/integration_test/fully_condensed_test.go |
New integration test for the complete reactivation-clears-flag scenario |
This is on top of #556