Skip to content

fix(server): checkpoint reuse handles filenames starting with a colon - #42472

Open
only21mil wants to merge 2 commits into
pingdotgg:mainfrom
only21mil:fix/server-checkpoint-blobs-ignore-pathspec
Open

only21mil wants to merge 2 commits into
pingdotgg:mainfrom
only21mil:fix/server-checkpoint-blobs-ignore-pathspec

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

Checkpoint capture reuses blobs of unchanged untracked files (apps/server/src/vcs/checkpointUntrackedBlobs.ts) and re-checks remembered paths with git check-ignore -z --stdin, which reads a leading : as pathspec magic. A remembered :ignored file added to .gitignore later is missed (exit 1) and re-inserted into the next checkpoint, so that checkpoint holds an ignored file a fresh capture would not. A remembered :(magic) file makes git check-ignore fail (fatal: Invalid pathspec magic; on the real path its stderr exceeds the output cap, so reuse fails), dropping reuse for every file in that workspace on every capture.

Change

In apps/server/src/vcs/checkpointUntrackedBlobs.ts, I prefixed each git check-ignore stdin path with ./ and stripped one leading ./ from each echoed path—the same fix #42333 merged in WorkspaceEntries.ts. --literal-pathspecs, GIT_LITERAL_PATHSPECS, and :(literal) are rejected by git check-ignore (exit 128). git check-attr (the attribute read beside it) reads stdin paths literally, so I left it unchanged. In apps/server/src/vcs/GitVcsDriver.test.ts, I added two cases to the untracked-blob reuse table (:large.txt becoming ignored and :(magic) staying reused), skipped on Windows where : is not a legal filename.

Scope

Bug fix for wrong checkpoint contents and dropped untracked-blob reuse on colon-prefixed names. No issue: small fix for an obvious bug, matching #42333.

Verification

Steps (Linux): In three temp repos with 64 MiB untracked files (so staging crosses the reuse threshold after settling), run GitVcsDriver.checkpoints.captureCheckpoint three times—writing .gitignore (:ignored) before capture 3 in A and C—and compare the reusing driver's tree against a fresh driver's tree on both commits.

Setup: Linux, Git 2.53.0, Node 26.13.1; server-only (+5/-2 prod, +18/-2 test), no UI change, text evidence only.

Scenario (capture 3) 68d6ef6 62cff82
A: :ignored, plain.bin + .gitignore exit 1 ([]), reuses both, :ignored in tree (trees equal: false) exit 0 (["./:ignored"]), reuses ["plain.bin"] (trees equal: true)
B: :(magic), plain.bin (unchanged) stderr cap error (52 > 19 B), reuses nothing (trees equal: true) exit 1 ([]), reuses [":(magic)","plain.bin"] (trees equal: true)
C: :ignored, :(magic), plain.bin + .gitignore stderr cap error (52 > 28 B), reuses nothing (trees equal: true) exit 0 (["./:ignored"]), reuses [":(magic)","plain.bin"] (trees equal: true)

Tests (Node 26.13.1): On 68d6ef6, both new cases fail. On 62cff82, all 13 reuse cases pass three times. Removing the ./ strip on 62cff82 fails the new ignored case and the existing "it became ignored" case. vp run check:changed passes (format, lint, knip, graphql, typecheck, tests).

Test and script output
# 68d6ef6 — script (capture 3)
A: check-ignore stdin=[":ignored","plain.bin"] exit=1 stdout=[] | reused=[":ignored","plain.bin"] | trees equal: false
B: check-ignore stdin=[":(magic)","plain.bin"] FAILED VcsProcessOutputLimitError stream=stderr maxBytes=19 observedBytes=52
C: check-ignore stdin=[":(magic)",":ignored","plain.bin"] FAILED VcsProcessOutputLimitError stream=stderr maxBytes=28 observedBytes=52
# 62cff82 — script (capture 3)
A: check-ignore stdin=["./:ignored","./plain.bin"] exit=0 stdout=["./:ignored"] | reused=["plain.bin"] | trees equal: true
B: check-ignore stdin=["./:(magic)","./plain.bin"] exit=1 stdout=[] | reused=[":(magic)","plain.bin"] | trees equal: true
C: check-ignore stdin=["./:(magic)","./:ignored","./plain.bin"] exit=0 stdout=["./:ignored"] | reused=[":(magic)","plain.bin"] | trees equal: true
# 68d6ef6 — new tests
Tests  2 failed | 11 passed | 114 skipped (127)
# 62cff82 — mutant (no ./ strip)
Tests  2 failed | 11 passed | 114 skipped (127)
# 62cff82 — 3x runs
Tests  13 passed | 114 skipped (127) (x3)

Not checked: Windows (new cases skipped there), macOS, a full app turn (the script calls the same driver method a turn's capture calls).

Who tested: An AI agent ran every check.

Generated with Gemini 4 Neon in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The untracked-blob reuse check prefixes cached paths with ./ before calling git check-ignore and removes that prefix from returned paths before matching. Tests cover colon-prefixed and pathspec-magic-looking filenames on non-Windows platforms.

Changes: Untracked blob reuse

Layer / File(s) Summary
Normalize paths for Git ignore checks
apps/server/src/vcs/checkpointUntrackedBlobs.ts, apps/server/src/vcs/GitVcsDriver.test.ts
The reuse logic prefixes cached paths with ./ before passing them to git check-ignore and removes the prefix from returned paths before matching. Tests verify that :large.txt is not reused when ignored and that :(magic) remains eligible for reuse.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge, stienswout

Merge Risk: Minimal · up to a392b

This change makes checkpoint reuse handle untracked files whose names begin with a colon, so ignored files are no longer treated incorrectly. No actionable merge-blocking risk remains in the reviewed change.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(server): checkpoint reuse handles filenames starting with a colon" names the main change: checkpoint blob reuse now handles untracked filenames beginning with :. It follows the conven…
Description check Passed The description covers the problem, change, scope, and verification sections from the template. The Problem section explains the pathspec-magic bug and its effects. The Change section explains the `./…
Linked Issues check Passed The only linked issue is #42333. It is closed and completed, so it supplies historical context only. No active directly linked targets remain, so no linked-issue coding requirements apply. The reviewe…
Out of Scope Changes check Passed The whole-PR diff of apps/server/src/vcs/checkpointUntrackedBlobs.ts (merge base to head) prefixes each git check-ignore stdin path with ./ and strips one leading ./ from echoed paths. This directly a…
Full details: Title check

Explanation

The title "fix(server): checkpoint reuse handles filenames starting with a colon" names the main change: checkpoint blob reuse now handles untracked filenames beginning with :. It follows the conventional commit format and matches the raw summary and PR objectives, which describe the ./ prefix and strip in checkpointUntrackedBlobs.ts plus the two colon-prefixed test cases.

Full details: Description check

Explanation

The description covers the problem, change, scope, and verification sections from the template. The Problem section explains the pathspec-magic bug and its effects. The Change section explains the ./ prefix and strip, and why git check-attr is unchanged. The Scope section gives a reason for having no linked issue. The Verification section gives specific steps, a results table, test output, and what was not checked. The template's agent-model line is present ("Generated with Gemini 4 Neon"). The Scope section cites #42333 as the matching prior fix, and the objectives state that issue is closed. Minor gap: the template asks for a conventional commit title and a linked issue for bug fixes; the author gave a reason for no issue, which the template allows for small obvious fixes.

Full details: Linked Issues check

Explanation

The only linked issue is #42333. It is closed and completed, so it supplies historical context only. No active directly linked targets remain, so no linked-issue coding requirements apply. The reviewed head changes only the checkpoint untracked-blob reuse path. That path is not part of #42333. The incremental change from 62cff82 to a392b42 is not identified in the summary, and the whole-PR diff of checkpointUntrackedBlobs.ts at head matches the raw summary.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff of apps/server/src/vcs/checkpointUntrackedBlobs.ts (merge base to head) prefixes each git check-ignore stdin path with ./ and strips one leading ./ from echoed paths. This directly addresses the stated bug: a leading colon in a remembered filename read as pathspec magic. The change is limited to this stdin/output normalization; git check-attr is unchanged, as the PR description states. The test file GitVcsDriver.test.ts adds two reuse-table cases (:large.txt becoming ignored, :(magic) staying reusable), which test the same bug. The test file was not re-read in this check and relies on the raw summary. No unrelated change was found. The PR has no linked issue, but its stated objective is the colon-prefixed filename reuse bug, and the changes implement it.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 62cff82 and a392b42.

Files selected for processing: 1

  • apps/server/src/vcs/GitVcsDriver.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
…-blobs-ignore-pathspec

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the fix/server-checkpoint-blobs-ignore-pathspec branch from e55a44b to a392b42 Compare November 24, 2026 23:28

This branch has not been deployed

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

Labels

size:XS 0-9 changed lines (additions + deletions). takeover:in-progress A takeover lead is working on this PR vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants