Skip to content

adding tests, small improvement / better guard#568

Merged
khaong merged 1 commit intoskip-fully-condensed-sessionsfrom
soph/review-skip-fully-condensed-sessions
Mar 1, 2026
Merged

adding tests, small improvement / better guard#568
khaong merged 1 commit intoskip-fully-condensed-sessionsfrom
soph/review-skip-fully-condensed-sessions

Conversation

@Soph
Copy link
Collaborator

@Soph Soph commented Mar 1, 2026

This is on top of #556

  • adding a better guard to make sure the session really ended
  • added FullyCondensed skip to filterSessionsWithNewContent - this prevents unnecessary sessionHasNewContent calls during PrepareCommitMsg, which is on the git commit hot path
  • adding unit tests
  • adding an integration test validating we can get reactive those sessions

Entire-Checkpoint: 1043cf5253ff
Copilot AI review requested due to automatic review settings March 1, 2026 20:33
@Soph Soph requested a review from a team as a code owner March 1, 2026 20:33
@cursor
Copy link

cursor bot commented Mar 1, 2026

PR Summary

Low Risk
Small guard changes in git hook session filtering/skip logic plus expanded test coverage; behavior changes are narrowly scoped and validated by new unit/integration tests.

Overview
Ensures FullyCondensed is treated as an ENDED-only optimization: PostCommit/PrepareCommitMsg now skip sessions only when state.FullyCondensed && state.Phase==ENDED, avoiding accidental skipping of non-ended sessions.

Adds coverage to lock in the intended lifecycle: unit tests assert ActionClearEndedAt clears FullyCondensed, PostCommit tests validate when the flag is set and that fully-condensed ENDED sessions are skipped on later commits, and a new integration test verifies reactivating an ENDED+fully-condensed session clears the flag so future commits aren’t silently ignored.

Written by Cursor Bugbot for commit 70cc27d. Configure here.

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 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.PhaseEnded guard to both PostCommit and filterSessionsWithNewContent skip conditions, making the FullyCondensed invariant explicit and defensive
  • Added three new unit tests covering: setting FullyCondensed after 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

@khaong khaong merged commit 958e4c3 into skip-fully-condensed-sessions Mar 1, 2026
8 checks passed
@khaong khaong deleted the soph/review-skip-fully-condensed-sessions branch March 1, 2026 22:23
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.

3 participants