Skip to content

test(ci): trim duplicate SQLite lifecycle tours - #122308

Merged
steipete merged 4 commits into
mainfrom
perf/sqlite-flip-proof
Aug 11, 2026
Merged

steipete merged 4 commits into
mainfrom
perf/sqlite-flip-proof

Conversation

@steipete

@steipete steipete commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The scoped SQLite session lifecycle lane still ran several expensive feature tours whose observable contracts already have focused owners. It also wrote and archived a 128 MiB transcript to prove that the packaged archive worker remains responsive, duplicating the worker's focused stress suite.

Why This Change Was Made

  • remove duplicate manual-compaction, Plugin SDK, and cleanup/pruning tours from the shared lifecycle harness
  • delete duplicate source and built-gateway archive tours; focused archive-worker and Gateway lifecycle suites already prove worker invocation, byte preservation, row deletion, publication ordering, and RPC semantics
  • move every unique migration, restart, contention, destructive-lifecycle, scale, and full-agent-turn assertion into the shared assertion owner so the exact-artifact built lane retains them
  • keep main's scoped exact-run artifact job and worker count unchanged

User Impact

No product/runtime behavior changes. CI retains the SQLite migration and lifecycle contracts while spending less runner time on duplicate coverage.

Test-value audit

Removed tours have stronger focused owners:

  • manual compaction: src/gateway/server.sessions.compaction.test.ts
  • Plugin SDK session/transcript behavior: src/plugin-sdk/session-transcript-runtime.test.ts
  • cleanup/pruning and SQLite maintenance: src/config/sessions/session-accessor.conformance.test.ts, src/config/sessions/session-registry-maintenance.test.ts, and src/config/sessions/session-accessor.sqlite-cleanup-race.test.ts
  • archive worker invocation, byte preservation, row deletion, publication ordering, and RPC lifecycle: src/config/sessions/session-accessor.sqlite-archive.worker.test.ts and src/gateway/server.sessions.delete-lifecycle.test.ts

The retained exact-artifact lifecycle spine covers startup legacy import, doctor inspect/validate/import idempotence, rollback/restore, gateway restart, downgrade/re-upgrade, reset/restart/append ordering, destructive delete/archive, shared references, SQLite writer contention, concurrent clients, scale migration, and a full agent turn.

Evidence

  • hosted baseline: 2/2 passed, 178.63s Vitest, 226s whole job
  • hosted exact head: 1/1 passed, 82.87s Vitest, 149s whole job
  • improvement: 53.6% faster Vitest duration and 34.1% faster whole job
  • focused archive-worker and Gateway delete owner suites: 29/29 passed
  • focused helper/workflow tests: 140/140 passed before the main integration; targeted workflow guard passed after integration
  • targeted Oxlint: 0 warnings, 0 errors
  • oxfmt and git diff --check passed

@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR size: L and removed size: M labels Aug 11, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 11, 2026
@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 6:57 PM ET / 22:57 UTC.

ClawSweeper review

What this changes

This PR changes the SQLite session/transcript proof to run its source gateway without rebuilding unrelated artifacts, while removing duplicate lifecycle test tours covered by focused suites.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for maintainer handling: current main already routes this lifecycle proof through a dedicated built-runtime job, while this branch conflicts with that newer ownership and needs an intentional reconciliation.

Priority: P3
Reviewed head: 46e9828251ceac35e0ccbff7d6ae56c226cc7da9
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The branch has useful local validation, but its conflicted overlap with newer main leaves the final CI shape unproven.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal CI/test cleanup is exempt from the external-contributor proof gate; the PR body reports an after-change local run.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal CI/test cleanup is exempt from the external-contributor proof gate; the PR body reports an after-change local run.
Evidence reviewed 5 items Current main workflow: Current main owns the SQLite lifecycle proof in a dedicated job that waits for build artifacts, downloads the exact runtime, and runs the built-CLI proof with the prebuilt-dist guard.
Current proof contract: The current CI job explicitly sets OPENCLAW_E2E_USE_PREBUILT_DIST and runs the built-CLI lifecycle proof, preserving packaged-runtime coverage.
Focused replacement coverage: Current focused suites cover SDK transcript behavior and SQLite cleanup/archive races, supporting the PR's duplicate-tour rationale.
Findings None None.
Security None None.

How this fits together

The SQLite lifecycle proof seeds legacy session data, starts an isolated Gateway, invokes Doctor and session operations, then checks SQLite and archive state. CI selects the proof job and supplies either source or built-runtime entrypoints.

flowchart LR
A[Changed session code] --> B[CI scope selection]
B --> C[Built runtime artifact]
C --> D[SQLite lifecycle proof]
D --> E[Gateway and Doctor operations]
E --> F[SQLite and archive assertions]
Loading

Decision needed

Question Recommendation
Should this PR add a distinct source-only performance check, or should its conflicted workflow changes be dropped in favor of main’s dedicated built-runtime lifecycle job? Retain built-runtime ownership: Drop the obsolete workflow reroute and keep main’s dedicated job as the canonical lifecycle proof.

Why: Current main changed the same CI ownership immediately before this branch and the supplied GitHub state reports a merge conflict, so the intended proof boundary needs maintainer direction.

Before merge

  • Resolve merge risk (P1) - The branch conflicts with current main’s dedicated built-runtime lifecycle job; a mechanical rebase could discard its speedup or weaken packaged-artifact coverage.
  • Complete next step (P2) - A maintainer must choose the canonical CI proof shape before branch repair; the maintainer label also prevents automated cleanup.
Agent review details

Security

None.

PR surface

Tests -336, Config 0. Total -336 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 8 230 566 -336
Docs 0 0 0 0
Config 1 3 3 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 233 569 -336

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; test and CI support +233/-569 This is a substantial test-suite consolidation, so the focused owner-boundary coverage must remain sufficient before removing tours.
E2E configuration surface 1 added environment control OPENCLAW_E2E_SKIP_BUILD changes global E2E setup behavior and must remain narrowly scoped to the intended proof.

Stored data model

Persistent data-model change detected: migration/backfill/repair: test/helpers/sqlite-sessions-transcripts-flip-proof-assertions.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Reconcile against the lifecycle job (recommended)
    Resolve the conflict by retaining main’s packaged-runtime proof and preserve only a separately justified source-only check.
  2. Pause the branch
    Pause or close the branch if main’s dedicated job already supplies the intended speed and coverage improvement.

Technical review

Best possible solution:

Retain main’s exact built-runtime lifecycle proof and keep a source-only lane only if it proves a distinct invariant with an exact-head timing comparison.

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

Not applicable: this PR changes internal CI and test execution rather than reporting a user-facing defect; its timing result is reported in the PR body.

Is this the best way to solve the issue?

No: the source-run approach was plausible for the old workflow, but current main now owns this proof through a dedicated built-runtime job.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is CI/test performance cleanup without evidence of a user-facing regression.
  • add merge-risk: 🚨 automation: The branch changes CI routing and conflicts with main’s newer dedicated lifecycle-proof job.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal CI/test cleanup is exempt from the external-contributor proof gate; the PR body reports an after-change local run.

Label justifications:

  • P3: This is CI/test performance cleanup without evidence of a user-facing regression.
  • merge-risk: 🚨 automation: The branch changes CI routing and conflicts with main’s newer dedicated lifecycle-proof job.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal CI/test cleanup is exempt from the external-contributor proof gate; the PR body reports an after-change local run.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Authored the mainline commit that introduced the current dedicated SQLite lifecycle CI job. (role: recent CI lifecycle contributor; confidence: high; commits: d035dba6c768; files: .github/workflows/ci.yml, test/scripts/ci-workflow-guards.test.ts)
  • steipete: Current-main history associates Peter Steinberger with the adjacent E2E test consolidation work. (role: recent adjacent test contributor; confidence: medium; commits: 7a1d5a86c7ba; files: test/vitest/vitest.e2e.config.ts, test/helpers/sqlite-sessions-transcripts-flip-proof.ts)

Rank-up moves

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

  • Rebase or explicitly drop the workflow hunk against current main’s dedicated lifecycle job.
  • Add an exact-head hosted baseline/head timing comparison if a source-only lane remains.

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 force-pushed the perf/sqlite-flip-proof branch from 46e9828 to 6f3b6c8 Compare August 11, 2026 23:01
@steipete steipete changed the title test(ci): accelerate SQLite flip proof test(ci): trim duplicate SQLite lifecycle tours Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head hosted proof is green and clears the requested 30% bar:

Metric Baseline Exact head Improvement
Vitest duration 178.63s (2/2 passed) 82.87s (1/1 passed) 53.6% faster
Whole job 226s 149s 34.1% faster

The removed case was the remaining duplicate built-gateway archive tour. Focused owners retain archive worker invocation, archived-byte preservation, SQLite row deletion, publication ordering, and Gateway RPC lifecycle semantics. The exact-artifact lane retains the unique migration, restart, downgrade/re-upgrade, contention, scale, destructive lifecycle, and full-agent-turn spine.

Baseline: https://github.com/openclaw/openclaw/actions/runs/31544877889/job/93957841566
Exact head: https://github.com/openclaw/openclaw/actions/runs/31546741684/job/93962793504

@steipete
steipete merged commit 76c7cd7 into main Aug 11, 2026
106 checks passed
@steipete
steipete deleted the perf/sqlite-flip-proof branch August 11, 2026 23:51

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 12, 2026
* test(ci): accelerate SQLite flip proof

* test(sessions): replace duplicate archive stress tour

* test(sessions): preserve SQLite lifecycle contracts

* test(sessions): drop duplicate archive assertions

---------

Co-authored-by: Amp <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

2 participants