Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Checkpoint capture reads only the two baseline ordinals it uses instead of loading checkpoint history. Existing capture behavior and the store’s default full-context reads remain unchanged, keeping the change narrowly scoped. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Note Written by merged main without rebasing and resolved the checkpoint conflicts while preserving run-owned missing baselines. capture still reads only ordinal 0 and the previous run; default context reads remain complete. the diff stays at three files. verified head |
|
+1 |
Replace the tracer-captured SQL text and EXPLAIN QUERY PLAN assertions with a direct check of the rows the baselines-only read returns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The automated pipeline stopped on this pull request and will not merge it: the fix is written and reviewed, but proving it needs something no worker has:
It stays open for a person to finish or close. |
|
This PR conflicts with See the conflict window. |
|
Note Written by Claude Opus 5.5 (Claude Code) on behalf of Navid The pipeline stopped this for lack of a same-platform run in the real app on macOS, so here is one on an Apple silicon Mac (M5 Max, 18 cores, macOS 27.0.1, Node 26.13.1): main at One
Rows come from a first run with an env-gated, logging-only probe (the same diff on both). Times come from a second run without it, from the server's own Same decisions and rows: the two inputs capture decides on (ordinal 0 preserved, baseline preserved) matched for all 1,039 captures. After normalising random ids, checkpoint ref hashes, timestamps and each side's scratch path, both databases hold the same 30,231 events in the same order per thread, and every column of all 30 thread-scoped tables matches (17 of them have rows, among them 1,039 runs and 1,048 checkpoints, all Not covered: real provider turns, the desktop client (this is the server driven over its MCP endpoint), Linux, nested repositories, and stopped or cancelled runs or missing or failed checkpoints in the live run (every run here completed; the existing capture tests cover those and pass on the rebased branch). Also histories past 1,031 runs, and a repeat of the timed run: there was one timed run, with n = 8 per row on a busy shared machine, so there is no run-to-run spread. Separately, outside this PR: the repository-scope baseline query from #35925, in the same context read, also searches the thread index (1,024 rows visited at 1,024 checkpoints, none returned here), so the context read as a whole still grows on both sides. Driver, probe, scripts, raw results and the rebased diff: https://gist.github.com/navidnadali/c412bf3a637b2859a1ddfe083454da78 Made with Claude Opus 5.5 via Claude Code. Reviewed by GPT-6.1 Sol via Codex. Independently verified by Claude Fable 5.2. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The automated pipeline stopped on this pull request and will not merge it: someone else pushed to perf/checkpoint-baseline-ordinals (head is now bdec466); the pipeline does not build on commits it did not review It stays open for a person to finish or close. |
Checkpoint capture reads every ready checkpoint ordinal in its scope, although it only checks ordinal
0andmax(0, run.ordinal - 1). The work grows with checkpoint history on every capture. This is the smaller checkpoint-read issue reported in #24895.The production capture caller now opts into baseline selection. The store derives the two ordinals from the decoded run inside the existing transaction and uses the existing unique scope/ordinal index. Calls without that option still return every ready ordinal, including the cancelled ordinal-one context's
[0, 1]result.This is a focused redundant-read defect under CONTRIBUTING.md's obvious-bug exception: unused historical rows are materialized and discarded, and the fix preserves capture decisions and events. No product behavior, public schema, migration, provider ownership, workspace selection, locking, or finalization changes. Current patches and discussions for #31012, #29521, #30862, #31349, #30875 and the closed duplicate #31844 were checked; their work is not included here.
Verification
Base and policy revision:
6577c6b6185167c0e502fa01f9e8e8f2dee6ff25.[0, 127]; the ordinal-one cases also fail the bounded-index-plan assertion. After the fix, all 8 capture tests pass. The default full-context assertion, cancellation[0, 1], missing-baseline, rollback, and repeat-capture checks pass.vp test run apps/server/src/orchestration-v2/CheckpointCaptureService.test.ts: 8 passed.vp run check:changed upstream/main --concurrency 1: format, lint, both knip checks, generated GraphQL, 3 affected package typechecks, and 63 tests in 3 files passed. No repository-wide test run.Runtime transcript
Ran the actual
CheckpointCaptureService,CheckpointService,EventSink, SQLite reader worker, and Git driver with isolated file-backed SQLite databases and disposable real Git repositories on macOS, Node 26.13.0, SQLite 3.54.0, Git 2.50.1. Each fixture seeded 4,000 checkpoint metadata records and created the real baseline refs used by capture. No user repositories, live T3 state, paid provider turns, or running application server were used.[0, 3999][][0][0, 3999]Observed SQLite plans for the actual statement:
The after trace identifies the reader connection. Before/after event types and payloads match after normalizing capture-clock timestamps; random event IDs are excluded from that comparison. Capture still records
value.txtas one addition/one deletion, andgit show <captured-ref>:value.txtreturns the expected edited contents. Metadata marked missing produces the same baseline events. Cancellation stays cancelled, rollback emits nothing, and a repeated capture emits no additional events. Default full-context counts remain identical before/after.This demonstrates bounded row selection and equivalent service behavior on synthetic history. It does not claim end-to-end latency, production-database benchmarking, or web/desktop/mobile/provider coverage.
Implemented and independently reviewed by GPT-6-based Codex agents using the Codex harness.