Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
00b028c to
afa6526
Compare
afa6526 to
f15a882
Compare
…aw#195443) * fix(sandbox): avoid full template checkouts on source changes * test(sandbox): consolidate refresh proof and reconcile line credit * test(sandbox): remove inherited line credit now owned by main
What Problem This Solves
Fixes a full sandbox template checkout on every selected source commit, even when the pnpm lockfile is unchanged.
User Impact
Idle sandbox templates now advance their private source checkout and retain installed dependencies. Lockfile or Git-attribute changes still build a fresh template, and concurrent callers share one preparation. No new configuration or schema changes.
Why This Change Was Made
Use the existing template owner's exclusive refresh operation. Keep exact commit identity: lifecycle scripts and local packages can depend on ordinary source files, so a lockfile-only key would publish stale installation output. Import the Git delta, preserve unchanged checkout files, rerun pnpm, validate, and publish. Remove obsolete private Git objects before another session receives the snapshot. Each refresh gets a distinct installer identity; the config-prefixed pnpm option prevents optimistic repeat install from skipping lifecycle scripts while preserving custom-image compatibility.
The existing coalescing works: mutation wait is inside template preparation; application is each caller's separate native clone. This change does not eliminate that clone or claim to fix slow native filesystem cloning.
Related overlap: #195433 changes the same checkout owner and tests for filtered fetches; preserve both behaviors when integrating. #193214 shares template tests but its production diagnostics owners are unchanged here.
Evidence
Five counterbalanced before/after pairs after two A/A controls, on native APFS with 62,000 distinct synthetic payload blobs (1.10 GB logical), a real pnpm lockfile, and sandboxed pnpm 12.15.0:
All five candidate prepare+apply samples were 2.799–4.026 s. All arms verified exact HEAD, clean tracked source, fresh lifecycle output and fresh local-package contents. Baseline retained two template generations; candidate advanced one in place. Both deliberately performed two installs across seed and source change.
Limits and tradeoff: A/A wall times were 11.395 and 23.989 s on this shared host. Allocation increased 20% by campaign median; one separate attribution probe did not reproduce a fixed increase (sampled allocation was nearly equal), so resource non-regression remains inconclusive. The fixture has synthetic compression (7.29 MiB packed Git) and a small dependency graph. Btrfs, full Gateway traffic and a large agent database are unqualified. These are owner-boundary results, not a production end-to-end latency claim.
The full sandbox/worktree suites passed on explicit Node (1,532 tests) and Bun (1,527 tests), with existing skips. Final owner/checkout/installer tests passed on both; the final command spelling also passed affected installer/lifecycle tests. Real-owner and real-Git regressions fail before the fix. Separate real-pnpm proof covers registry-only repeat installs, source-dependent lifecycle output, local dependencies, single-build concurrent waiters, lockfile rebuilding, and private-history removal. Fresh Codex review is scoped-clean.
pnpm check:changed: all checks passed except 20 historical changelog-attribution findings reproduced exactly on parent465c110e4975690406b48709d58a581756c85b82. Commit266a7aa0fe69/ #194364 introduced this finding set; its parent had a different 26-finding failure. This is an unresolved main regression, not a passing gate. The final option-spelling edit has separate affected-test, formatting and lint verification.The reproducible driver is
scripts/perf/sandbox-template-commit-measure.ts. Production growth is 57 lines for refresh, builder identity and private-history cleanup; the scoped allocation is exactly 109 lines for this PR’s net test growth. Main separately owns the 19-line #195382 debt; the ratchet passes with zero slack. Owner and independent Git boundary coverage remain. No changelog edit: release-note context is in this body.CI follow-up: rebased onto
ac26a0d7f1f8, including upstream type fix3fa60aed. The test-line ratchet and previously failing root-other typecheck pass locally; focused checkout/template suites pass all 14 tests on both Node and Bun. Targeted formatting/lint and fresh Codex review are clean.Allocation follow-up: rebased onto
826999cd5f76and removed the duplicated inherited credit.node --import ./scripts/tsx.mjs scripts/check-test-lines-ratchet.mts --base origin/main --no-merge-basepasses: 6,586,850 lines, equal ceiling, zero slack. Fresh Codex review is clean.