Repository navigation
research(storage): benchmark Turso ops workload (#2257) - #2281
Conversation
Problem: #2257 needed a representative workload measurement before deciding whether Turso should become a Polylogue backend candidate. The existing probe exercised feature compatibility but not an ops.db-shaped write/read path.\n\nWhat changed: extend devtools lab probe turso with SQLite WAL and Turso MVCC benchmarks over ingest-attempt, convergence-debt, and daemon-event rows. The probe cleans SQLite/Turso sidecars between runs, reports file footprint and duration, and keeps generated SQL out of command metadata.\n\nVerification: devtools test tests/unit/devtools/test_turso_probe.py -q; ruff format --check devtools/turso_probe.py tests/unit/devtools/test_turso_probe.py; ruff check devtools/turso_probe.py tests/unit/devtools/test_turso_probe.py; devtools lab probe turso --json; devtools verify --quick.
|
Warning Review limit reached
More reviews will be available in 7 minutes and 51 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7dadb3da4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
## Summary Deletes 5 of the 8 devtools modules the WS-C pruning ledger's tranche-1 table listed for deletion, plus their catalog entries and tests. Three named rows (`dev_loop`, `mutmut_campaign`/`run_campaign`, `proof_world_real_slice`) turned out to be live or contested on verification and are explicitly excluded — see Problem below. ## Problem `.agent/campaigns/2026-08-overhaul/ws-c-devtools-pruning.md` catalogs ~139 devtools modules toward a ~45k LOC / ~55 command target. Tranche 1 lists 8 "retired-workflow fossil" rows as high-confidence deletions, gated on a per-row checklist (rule 5, "EVIDENCE BEFORE DELETION"): re-grep `.beads-hooks/`, `.circleci/config.yml`, `.claude/hooks/`, `scripts/`, and `.github/workflows/*.yml` for module invocations before deleting, because string-keyed CLI dispatch and shell-invoked entrypoints don't show up in an import-graph grep (this is exactly how `pre_push_gate` and `coverage_gate` were wrongly flagged for deletion in the ledger's own 2026-08-18 correction pass). Re-running that checklist per row (the ledger's 2026-08-19 spot-check had already run it, but omitted `.github/workflows/*.yml` from the grep target list) found two more wrong entries before this PR was first opened, and a third was caught afterward by cold adversarial re-verification: - **`dev_loop` (3,844 LOC + a cited product-side family in `daemon/http.py`, `daemon/cli.py`, `route_contracts.py`)** is not dead. It's catalog-registered as `workspace dev-loop` with a large flag surface (`--prepare`/`--launch-daemon`/`--capture-cli`/`--receiver-smoke`/etc.), has a 1,629-line test file, and a 757-line doc (`docs/dev-loop.md`) linked from `docs/README.md`'s nav — last touched by a real feature commit 5 days before this PR (#3333, "close remaining polylogue-5en gaps"). The ledger's citation ("devloop workflow explicitly retired, CLAUDE.md: do not resurrect") is a name collision: CLAUDE.md's retirement note is about the unrelated bespoke Beads/conductor-packet workflow, not this branch-local daemon/browser-capture preflight tool. - **`mutmut_campaign` + `run_campaign` (624 LOC)** are two unrelated modules the ledger conflated by name similarity. `mutmut_campaign.py` (catalog: `bench mutation`) is invoked weekly by `.github/workflows/mutation-testing.yml` (`devtools bench mutation run "$campaign"`) — exactly the grep the spot-check missed by skipping `.github/workflows/`. `run_campaign.py` (catalog: `bench synthetic`) is a separate, live-tested command (`test_benchmark_campaigns.py::test_run_campaign_skips_seed_archive_for_daemon_live`) driving the ledger's own NEEDS-EVIDENCE/default-keep `large_archive_generator` + `synthetic_benchmark_runtime` modules; it has nothing to do with mutation testing. - **AUDITED AND EXCLUDED (found by cold verification after this PR's first push, restored in a follow-up commit): `proof_world_real_slice` (440 LOC + test)**. The ledger's row cited it as belonging to the closed `jxe` uplift campaign, but the module's own docstring and its test both cite `polylogue-212.11` instead — an **open, P3** bead whose notes name this tool as "the harness half of the real-archive-data extension" with a pending, unpromoted deliverable. Same name-collision failure class as the `dev_loop`/`mutmut_campaign` catches above, just missed on this row during the original per-row pass. Restored verbatim (module, test, and the `demo real-slice-screen` CommandSpec) from before deletion. All three exclusions were reported to the coordinator (the first two before this PR was opened, the third as soon as cold review surfaced it). ## Solution Deletes the remaining 5 rows, each independently re-verified clean (no hook/CI/doc/production references beyond the module's own catalog entry and test file): - `claim_vs_evidence.py` + `claim_vs_evidence_evidence.py` (+ both test files) — the `polylogue-sru` campaign closed with terminal artifacts 2026-07-06; this CLI re-proved an already-recorded claim. The durable production primitive it wrote through, `PublicClaimProjection` (`polylogue/insights/measurement/public_claims.py`), is untouched and lives independently. Trimmed `docs/findings/claim-vs-evidence.md`'s now-dead "Reproduce"/"Regenerate" sections (they invoked the deleted command) while keeping the finding's substantive text as a frozen historical record — the 2026-08-14 purge (#3950) had already retired "the closed claim-vs-evidence campaign's private-report/calibration/publishing harness" in spirit; this PR finishes that. - `turso_probe.py` (+ test) — Turso storage-backend research (#2257/#2281, June) concluded; direction settled on SQLite independence + Sinex mode. - `resume_ranking_eval.py` (+ test) — orphan: no catalog entry, no importers beyond its own test. - `help_latency_probe.py` (no dedicated test file existed) — one-shot CLI-latency research; not wired into any gate. - `temporal_read_profile.py` + `temporal_archive_aggregates.py` (+ both test files) — one-shot read-profiling research (July 2). Each deleted module's `CommandSpec` was removed from `devtools/command_catalog.py`, then `devtools render devtools-reference` regenerated `docs/devtools.md`. No CLAUDE.md tooling-list lines named any of the six deleted commands, so none needed trimming there. `proof_world_real_slice`'s `CommandSpec` was restored to the same spot in the follow-up commit and `devtools render devtools-reference` re-run. ## Verification - `devtools render all --check` — exit 0, no `out of sync` surfaces. - `devtools verify --quick` — `"status": "success"`, `"exit_code": 0` (run again after the `proof_world_real_slice` restore, still green). - `devtools verify` (full, complete-corpus) — `"status": "success"`, `"exit_code": 0`, `"terminal_green": true`, `"complete_corpus_covered": true`, `"non_green_count": 0`, `"release_baseline_allowed": true`. - `devtools test tests/unit/devtools/test_proof_world_real_slice.py` — 20/20 passed, confirming the restored module's tests are intact. - `python -m devtools.verify_doc_commands` — `67 doc files scanned, no stale commands` (caught and fixed one accidental literal reference to the now-deleted claim-vs-evidence command in the trimmed findings doc). Anti-vacuity: pure deletion (plus one restoration); reachability evidence per surviving row is in the ledger plus the re-verification above (all rows independently re-grepped against `.beads-hooks/`, `.circleci/config.yml`, `.claude/hooks/`, `scripts/`, `.git/hooks/`, and `.github/workflows/*.yml`, and cross-checked against `docs/` and git log recency). ## Bead disposition matrix This PR does not close, claim, or otherwise mutate any Beads issue — it is pure code/doc deletion against the campaign's markdown ledger, not a Beads tracker item. `mutated_beads` is empty; using the `self_contained` scope carrier. `polylogue-212.11` is cited as evidence for the `proof_world_real_slice` exclusion but is not touched, claimed, or closed by this PR. Candidate follow-ups for the coordinator (not closed by this PR): | Item | Note | | --- | --- | | Tranche 1 revision | The ledger's tranche-1 table and its "Est. ~8.6k LOC" total need updating to remove `dev_loop`, `mutmut_campaign`/`run_campaign`, and `proof_world_real_slice` as confirmed-live/contested, plus record the `.github/workflows/` gap in the spot-check methodology so future tranches don't repeat it. | | Tranche 2 execution | Unblocked to proceed independently; nothing in this PR touches tranche-2 rows. | ## Verification commands run ``` devtools render all --check devtools verify --quick devtools verify devtools test tests/unit/devtools/test_proof_world_real_slice.py python -m devtools.verify_doc_commands ``` <!-- polylogue-pr-scope:v2 { "assigned_beads": [], "dispositions": [], "mutated_beads": [], "scope_digest": "79a7984a9ec80a157c96dc8d28561159c642c15de3793837eff751fa7eac34a1", "scope_kind": "self_contained", "version": 2 } -->
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Adds a representative
ops.db-shaped benchmark todevtools lab probe tursoand uses it to close the Turso backend-swap evaluation with a measured no-swap decision.Problem
#2257 had enough feature-compatibility evidence to reject a direct
sqlite3to Turso swap, but it still lacked a representative Polylogue workload measurement. Without that, the issue stayed in a vague “maybe selected tier later” state instead of a concrete decision.Solution
The Turso probe now runs two comparable local workloads over ingest-attempt, convergence-debt, and daemon-event tables:
sqlite3.tursodb, with the generated SQL streamed on stdin so benchmark size is not limited by OS argument length.The benchmark cleans SQLite/Turso sidecars before each run, records duration, row count, DB bytes, sidecar bytes, stdout/stderr, and keeps generated SQL out of persisted command metadata. The live measurement on this host was:
Decision: do not migrate Polylogue storage to Turso now.
index.dbremains blocked by stored generated columns and FTS5;embeddings.dbwould require a separate vector-provider experiment;ops.dbis technically plausible but the representative local CLI/MVCC run does not show a reason to add a second backend yet. Keep Turso as an explicit lab probe/MCP inspection tool rather than a production dependency.Closes #2257.
Verification
I also ran the default baseline:
Those failures are not from this branch’s two modified files. They are existing command-surface/scenario expectation drift, plus one devtools catalog invariant that already fails because
lab schema compare/list/explainsharedevtools.schema_inspect. Focused Turso tests and the quick gates are clean.