Skip to content

refactor: consolidate SQLite flip-proof harness - #118502

Merged
steipete merged 1 commit into
mainfrom
codex/cleanup50k-sqlite-flip-proof-20260802
Aug 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/cleanup50k-sqlite-flip-proof-20260802

Conversation

@steipete

@steipete steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The SQLite sessions/transcripts flip proof duplicated fixture construction, gateway client setup, child-output capture, read-only database lifecycles, and polling policy across one large E2E helper. That made the proof harder to audit and easier for equivalent lifecycle checks to drift.

Why This Change Was Made

Consolidates those repeated test-helper seams while preserving the exact 22-checkpoint execution order, 60-second operation budgets, continuous 1.5-second deletion-absence checks, shared-session reference semantics, and SQLite-only persistence assertions. No production code, schema, schema version, or runtime behavior changes.

Production LOC delta: 0. Test-helper delta: +391/-691 (net -300).

User Impact

No user-visible behavior change. Maintainers get a smaller, more coherent SQLite migration/lifecycle proof with one canonical implementation for repeated fixture, client, polling, child-process, and database-read operations.

Evidence

  • Final exact-head focused Testbox: test/scripts/sqlite-sessions-transcripts-flip-proof.e2e.test.ts — 1/1 passed in 81.38s (tbx_01kz30s9jjashv420k9295yjee).
  • Final exact-head changed gate: test-root typecheck, format checks, and tooling lint passed with 0 warnings/errors (tbx_01kz30smrddk4577mervcc5njv).
  • Final branch autoreview against origin/main: clean, no accepted/actionable findings, score 0.99.
  • git diff --check: clean.

@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels Aug 3, 2026
@steipete
steipete force-pushed the codex/cleanup50k-sqlite-flip-proof-20260802 branch from f75a12d to c401fa0 Compare August 3, 2026 05:23
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 1:28 AM ET / 05:28 UTC.

ClawSweeper review

What this changes

This PR consolidates repeated fixture setup, gateway-client construction, polling, archive inventory, and read-only SQLite inspection in the SQLite sessions/transcripts flip-proof test helper.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for normal maintainer review. It is a focused, test-only consolidation that preserves the existing 22-checkpoint SQLite lifecycle contract, and current main does not already contain its canonical helper extraction.

Priority: P3
Reviewed head: c401fa0ff77fbcfce8693e0d7c33fc7d40341868

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-reducing helper consolidation with a preserved E2E contract and exact-head validation evidence; only the ordinary refreshed-base and final-CI gates remain.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-labeled, internal test-only refactor includes exact-head Testbox execution evidence for the real gateway/doctor SQLite harness; no separate user-facing proof applies.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-labeled, internal test-only refactor includes exact-head Testbox execution evidence for the real gateway/doctor SQLite harness; no separate user-facing proof applies.
Evidence reviewed 6 items Current contract: The current E2E test fixes the required checkpoint order at 22 lifecycle stages and asserts migration, archive, compaction, plugin-SDK, concurrency, and deletion evidence. The PR keeps the same entrypoint while extracting repeated helper seams.
Focused test-only diff: The branch changes only the shared SQLite flip-proof helper. The refactor replaces local record coercion with the canonical non-array record helper and centralizes repeated gateway-client, polling, and read-only database operations; it does not alter production files, schema, or migrations.
Dependency contract: asOptionalRecord is explicitly documented and tested as the canonical coercion for a non-array record or undefined, matching the removed local helper’s behavior.
Findings None None.
Security None None.

How this fits together

The SQLite flip-proof harness runs gateway and doctor lifecycle scenarios against an isolated state directory, then records checkpoints from JSONL archives and SQLite tables. Its report is consumed by E2E tests and a dedicated CI lane to detect regressions in session and transcript migration, cleanup, and lifecycle behavior.

flowchart LR
  A[Gateway and doctor scenarios] --> B[SQLite flip-proof harness]
  B --> C[Fixture and client setup]
  C --> D[Lifecycle checkpoints]
  D --> E[Read-only SQLite inspection]
  E --> F[E2E assertions and CI proof]
Loading

Before merge

  • Add real behavior proof - Not applicable: This maintainer-labeled, internal test-only refactor includes exact-head Testbox execution evidence for the real gateway/doctor SQLite harness; no separate user-facing proof applies.
  • Resolve merge risk (P1) - GitHub reports the branch as behind main, and the dedicated SQLite flip-proof CI check was still in progress in the supplied status snapshot; merge should use a refreshed exact-head review after those gates settle.
  • Complete next step (P2) - The maintainer label keeps this PR on the normal human review path; wait for the exact-head CI gates and refreshed-base review rather than opening an automated repair lane.
Agent review details

Security

None.

PR surface

Tests -300. Total -300 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 391 691 -300
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 391 691 -300

Review metrics

Metric Value Why it matters
Production vs test LOC production +0; test helper +391/-691 (net -300) The only changed surface is test infrastructure, and the net reduction supports the stated goal of one canonical proof implementation rather than a production behavior change.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the refactor only after rebasing or refreshing against current main and confirming the dedicated flip-proof E2E check still demonstrates the unchanged 22-checkpoint lifecycle contract.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the refactor only after rebasing or refreshing against current main and confirming the dedicated flip-proof E2E check still demonstrates the unchanged 22-checkpoint lifecycle contract.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR refactors the existing proof harness rather than reporting a user-facing failure. The current E2E test provides a concrete contract for preserving the 22 checkpoint sequence and its assertions.

Is this the best way to solve the issue?

Yes. Consolidating repeated test-helper policy behind shared functions is the maintainable path, and the branch preserves the existing report entrypoint and contract consumers rather than creating a parallel harness.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fd10614a482b.

Labels

Label changes:

  • add P3: This is a focused internal test-helper refactor with no claimed production, schema, configuration, or user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-labeled, internal test-only refactor includes exact-head Testbox execution evidence for the real gateway/doctor SQLite harness; no separate user-facing proof applies.

Label justifications:

  • P3: This is a focused internal test-helper refactor with no claimed production, schema, configuration, or user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-labeled, internal test-only refactor includes exact-head Testbox execution evidence for the real gateway/doctor SQLite harness; no separate user-facing proof applies.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: All ten available commits touching the SQLite flip-proof helper are attributed to Peter Steinberger, including the recent current-main fixture work and this consolidation branch. (role: feature owner and recent area contributor; confidence: high; commits: 7fc23f904a18, c401fa0ff77f; files: test/helpers/sqlite-sessions-transcripts-flip-proof.ts, test/scripts/sqlite-sessions-transcripts-flip-proof.e2e.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh the branch against current main if needed and confirm the in-progress dedicated SQLite flip-proof CI check passes on the exact merge head.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Rank-up move status:

  • Confirmed the dedicated SQLite flip-proof E2E and the full changed gate on the exact patch head; focused Testbox passed 1/1 and the exact-head CI watcher completed green.
  • Refreshed the branch onto main before publication and verified stable patch identity. Subsequent main drift does not touch the target helper and is advisory under the native landing workflow, so no further rebase is needed unless the prepared head or target path changes.

@steipete
steipete merged commit 607cf8f into main Aug 3, 2026
98 of 100 checks passed
@steipete
steipete deleted the codex/cleanup50k-sqlite-flip-proof-20260802 branch August 3, 2026 05:35
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant