Skip to content

fix(store): prune run checkpoints and preserve SQLite delta baselines - #2336

Merged
DeliciousBuding merged 1 commit into
masterfrom
fix/sqlite-checkpoint-delta
Sep 6, 2026
Merged

fix(store): prune run checkpoints and preserve SQLite delta baselines#2336
DeliciousBuding merged 1 commit into
masterfrom
fix/sqlite-checkpoint-delta

Conversation

@DeliciousBuding

@DeliciousBuding DeliciousBuding commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #2335
Refs #2333 / #2256.

Two production-line fixes at existing ownership boundaries:

  • Remove a run's checkpoint from the shared in-memory evidence-pruning path used by terminal cleanup and thread deletion.
  • Include a deep-cloned checkpoint map in SQLite's committed delta baseline, so unchanged checkpoints are not rewritten and removals become durable row deletes.

No pool/PRAGMA/schema/API/timer changes. Update the Edge owner document for checkpoint lifetime and the actual finished terminal run status.

Regression evidence

Corrected red output on mainline, followed by green behavior.

  • Real SQLite audit trigger: unrelated run mutation rewrote two unchanged fixture checkpoints before the fix; now zero. A legitimate checkpoint content edit updates only its own row and is durable.
  • Terminal-run cleanup and thread deletion: old code retained the checkpoint in memory, in the database and after reopen; the fix removes it while preserving an unrelated queued run and checkpoint.
  • Readback happens before a final Close/Flush could hide a missing durable write.
  • Existing clone test now covers nested checkpoint Files ownership.

Validation

  • New behavioral regressions pass on Windows with pure-Go SQLite.
  • Full store-package Linux race: PASS (4.996 s).
  • Full store-package Windows tests (CGO_ENABLED=0): PASS (1.569 s).
  • go vet ./internal/store, staticcheck 2026.1, verify-doc-ssot.py, and diff check pass.
  • The test(store): benchmark snapshot persistence and SQLite facade contention #2334 benchmark fixture is unchanged. All 45 matching non-race Linux samples pass: unchanged-checkpoint row amplification falls from 13 / 103 / 1003 to 3. At 1,000 runs without readers, the local median mean write time is 62.315 → 39.663 ms; writer-only allocation slightly increases, not decreases. Full raw before/after evidence is on fix(store): prune run checkpoints and persist their delta state #2335. All seven required CI gates passed.

Boundaries

Only isolated generated fixtures. No production database, deployment or migration. This prevents future orphan retention through the corrected removal paths; it does not automatically repair checkpoints already orphaned in an existing live store. Any existing-data repair is a separate scope. Allocation/timing comparisons are local workload results, not production guarantees.

Fix checkpoint retention after run cleanup or thread deletion and stop rewriting unchanged checkpoint rows. Closes #2335.

Co-authored-by: Codex <codex@vectorcontrol.tech>
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: f1efd785-46cf-4366-ae29-bc377378185f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DeliciousBuding

Copy link
Copy Markdown
Collaborator Author

Final-head review at 350ee4fba3bc938e0fe472fe059218724fcbed40: live strict branch protection still requires exactly validate, go-edge, go-hub, windows-go, windows-frontend, backend-required, frontend-required; all seven are present and SUCCESS. Merge state CLEAN. No submitted reviews or unresolved threads; a skipped automated review is not counted as approval.

The two production lines, real SQLite negative/positive regressions and owner-document change were reviewed together. Full local package/Windows/race/static/doc validation and 45 matching-fixture post-fix samples pass. No migration, existing orphan repair or runtime deployment.

@DeliciousBuding
DeliciousBuding merged commit 4e3739e into master Sep 6, 2026
41 checks passed
@DeliciousBuding
DeliciousBuding deleted the fix/sqlite-checkpoint-delta branch September 6, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(store): prune run checkpoints and persist their delta state

1 participant