Skip to content

fix: clarify external checkpoint discovery warning#889

Draft
peyton-alt wants to merge 40 commits intomainfrom
fix/external-checkpoint-warning-copy
Draft

fix: clarify external checkpoint discovery warning#889
peyton-alt wants to merge 40 commits intomainfrom
fix/external-checkpoint-warning-copy

Conversation

@peyton-alt
Copy link
Copy Markdown
Contributor

@peyton-alt peyton-alt commented Apr 9, 2026

When checkpoints are pushed to a separate checkpoint remote, the push can succeed even though entire.io may not be able to discover that remote from the repository. The old hint only told the user to commit .entire/settings.json, but it didn’t explain the consequence.

This change makes the post-push warning consequence-first:

[entire] Note: Commit and push .entire/settings.json or entire.io may not find checkpoints on this remote.

Scope:

  • only after successful pushes to an external checkpoint remote URL
  • only when .entire/settings.json is not tracked by git
  • only once per push process

Refs: #859


Note

Medium Risk
Adds a new post-push hint gated by an external checkpoint URL and a git ls-files check, plus introduces a new Copilot JSONL compaction path; both affect user-facing CLI output and transcript parsing behavior.

Overview
After successful pushes to an external checkpoint URL remote, the CLI now emits a consequence-first hint when /.entire/settings.json is not tracked by git, and ensures this message prints only once per process via sync.Once (applied to both v1 doPushBranch and v2 doPushRef).

The transcript compactor gains Copilot JSONL support: format detection is added post-truncation, a new compactCopilot converter inlines tool.execution_complete results into preceding tool_use blocks, and fixture-based tests + sample data validate the transformation.

Reviewed by Cursor Bugbot for commit fe2de3e. Configure here.

peyton-alt and others added 30 commits March 30, 2026 18:45
Pre-session dirty files (CLI config files from `entire enable`, leftover
changes from previous sessions) were incorrectly counted as human
contributions, deflating agent percentage.

Root cause: PA1 (first prompt attribution) captures worktree state at
session start. This data was used to correct agent line counts (correct)
but also added to human contributions (wrong).

Fix:
- Split prompt attributions into baseline (PA1) and session (PA2+)
- PA1 data still subtracted from agent work (correct agent calc)
- PA1 contributions excluded from relevantAccumulatedUser
- PA1 removals excluded from totalUserRemoved
- Include PendingPromptAttribution during condensation for agents
  that skip SaveStep (e.g., Codex mid-turn commits)
- Add .entire/ filter to attribution calc (matches existing PA filter)
- Fix wrapcheck lint errors in updateCombinedAttributionForCheckpoint

Verified end-to-end: 100% agent with config files committed alongside.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: b0cb4216f6bc
…ibution

Checkpoint package changes required by the attribution baseline fix:
- PromptAttributionsJSON field on WriteCommittedOptions and CommittedMetadata
- UpdateCheckpointSummary method on GitStore for multi-session aggregation
- CombinedAttribution field on CheckpointSummary
- Preserve existing CombinedAttribution during summary rewrites

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: b8963737336c
…arentCommitHash

Fixes all 4 issues from Copilot and Cursor Bugbot review:

1. Precompute parentCommitHash on postCommitActionHandler struct
   using ParentHashes[0] (avoids extra object read, no silent error)
2. Remove duplicated 6-line parentCommitHash computation from
   HandleCondense and HandleCondenseIfFilesTouched
3. Thread parentTree through condenseOpts/attributionOpts and use it
   for non-agent file line counting — ensures diffLines uses parent→HEAD
   (consistent with parentCommitHash file scoping) instead of
   sessionBase→HEAD which over-counted intermediate commit changes
4. Add ParentTreeForNonAgentLines test proving the fix (TDD verified:
   HumanAdded=8 without fix → HumanAdded=3 with fix)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 12f5c4373467
Three fixes for multi-session attribution:

1. Cross-session file exclusion: Thread allAgentFiles (union of all
   sessions' FilesTouched) through the attribution pipeline. Files
   created by other agent sessions are no longer counted as human work.

2. Exclude .entire/ from commit session fallback: When the commit
   session has no FilesTouched and falls back to all committed files,
   filter out .entire/ metadata created by `entire enable`.

3. PA1 baseline uses base tree for new sessions: New sessions
   (StepCount == 0) always diff against the base commit tree, not
   the shared shadow branch which may contain other sessions' state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 209a37190167
Entire-Checkpoint: 3790cba265e6
Entire-Checkpoint: c9595c52ab4a
Entire-Checkpoint: 9f07aeebbf93
Entire-Checkpoint: f1c37c8efc47
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tering

- Test AllAgentFiles cross-session exclusion in CalculateAttributionWithAccumulated
- Test committedFilesExcludingMetadata filters .entire/ paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The combined_attribution field now diffs parent→HEAD once and classifies
files as agent vs human based on the union of sessions with real
checkpoints (SaveStep ran). Filters .entire/ and .claude/ config paths.

Also adds ReadSessionMetadata for lightweight per-session metadata reads.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…mmit-inflation

Fix attribution inflation from intermediate commits
don't show multiple spaces for codex single line start message rendering
Entire-Checkpoint: 36db97269a69
Entire-Checkpoint: 93066e1dac3c
Entire-Checkpoint: 4fdb72622b7f
Entire-Checkpoint: 730e93f6b572
Soph and others added 9 commits April 8, 2026 17:21
Entire-Checkpoint: 766ab74c76fd
Checkpoints V2: add migration option
Fix timeout for attach integration test on some machines
fix issue with entire attach using wrong codex path
Guard the redact.JSONLBytes + compactTranscriptForV2 calls in
CondenseSession behind settings.IsCheckpointsV2Enabled. Previously the
redaction ran unconditionally even though its output was only consumed by
compactTranscriptForV2, which already had an internal v2 guard and would
discard the result.
Skip transcript redaction when checkpoints v2 is disabled
Copilot AI review requested due to automatic review settings April 9, 2026 05:54
@peyton-alt peyton-alt requested a review from a team as a code owner April 9, 2026 05:54
@peyton-alt peyton-alt force-pushed the fix/external-checkpoint-warning-copy branch from fe2de3e to b2d247b Compare April 9, 2026 05:58
@peyton-alt peyton-alt marked this pull request as draft April 9, 2026 05:59
Copy link
Copy Markdown
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 improves user feedback after pushing checkpoints to an external checkpoint remote by warning (once per process) when .entire/settings.json isn’t tracked, clarifying that entire.io may not be able to discover the checkpoint remote. It also adds support for compacting GitHub Copilot CLI transcripts into the normalized transcript.jsonl format.

Changes:

  • Emit a consequence-first post-push note for external checkpoint remote pushes when .entire/settings.json is untracked (deduped via sync.Once).
  • Add Copilot transcript compaction (assistant.message / tool.execution_complete → inlined tool results) plus fixtures and a unit test.
  • Rename the Codex "message" constant to a shared transcriptTypeMessage for reuse in format detection.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cmd/entire/cli/strategy/push_common.go Adds printSettingsCommitHint + isSettingsTrackedByGit to print the clarified warning after successful URL pushes.
cmd/entire/cli/strategy/push_v2.go Invokes the new post-push settings hint after successful v2 ref pushes.
cmd/entire/cli/strategy/push_common_test.go Adds tests covering settings tracking detection and hint printing/deduping.
cmd/entire/cli/transcript/compact/compact.go Routes Copilot-format transcripts through the new compactor.
cmd/entire/cli/transcript/compact/copilot.go Implements Copilot JSONL detection and compaction with inlined tool results.
cmd/entire/cli/transcript/compact/copilot_test.go Adds fixture-based test for Copilot compaction.
cmd/entire/cli/transcript/compact/testdata/copilot_full.jsonl Adds a Copilot raw transcript fixture.
cmd/entire/cli/transcript/compact/testdata/copilot_expected.jsonl Adds expected normalized output for the Copilot fixture.
cmd/entire/cli/transcript/compact/codex.go Renames the "message" type constant used by Codex parsing.

Comment on lines +253 to +266
old := os.Stderr
r, w, err := os.Pipe()
require.NoError(t, err)
os.Stderr = w

printSettingsCommitHint(context.Background(), "origin")

w.Close()
var buf bytes.Buffer
if _, readErr := buf.ReadFrom(r); readErr != nil {
t.Fatalf("read pipe: %v", readErr)
}
os.Stderr = old

Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests temporarily replace the process-wide os.Stderr but don’t restore it via t.Cleanup/defer, so a t.Fatalf/require failure before restoration can leak the redirected stderr into later tests. Consider using t.Cleanup to always restore os.Stderr (see strategy/checkpoint_token_test.go for an example), and also close both pipe ends via defer to avoid FD leaks on early returns.

Copilot uses AI. Check for mistakes.
@peyton-alt peyton-alt force-pushed the fix/external-checkpoint-warning-copy branch from b2d247b to 8ffca11 Compare April 9, 2026 06:02
@peyton-alt peyton-alt force-pushed the fix/external-checkpoint-warning-copy branch from 8ffca11 to 4926cc9 Compare April 9, 2026 06:19
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.

6 participants