Skip to content

perf(state): defer integrity scans after proven process crashes - #164846

Merged
steipete merged 3 commits into
mainfrom
steipete/perf-micro-integrity-gate-by-provenance-20260919
Oct 4, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/perf-micro-integrity-gate-by-provenance-20260919

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

After an unclean process restart, agent sessions can wait minutes for a full-file integrity scan even when SQLite can recover the intact WAL normally. Related: #164670.

User Impact

A proven same-boot Linux process crash admits native agent workers after header, journal, ownership, and schema checks, while the existing background verifier performs the full integrity and foreign-key check. Unknown or foreign provenance, PID reuse, dirty receipts alone, migrations, older SQLite without non-backfilling WAL observation, and other openers retain the full gate.

This deliberately relies on SQLite WAL crash recovery for a narrowly classified process death. Unrelated storage damage can be discovered after admission. Confirmed damage drains existing actors, reconfirms the file, persists quarantine, and refuses retained actors and new opens.

Why This Change Was Made

The lease owner records host, boot, PID namespace, application version, and physical-file provenance. A lease stays opened_at=0 until admission succeeds, so killing an opener during a mandatory full scan cannot turn that unfinished scan into a deferred restart. The existing verifier queue supports quick/full requests, with full requests taking precedence; its checking and confirmation children share shutdown ownership.

The repair preserves UUID lease IDs and stores the versioned binding separately in nullable agent_database_leases.provenance, to preserve the existing identifier contract. The existing first-use additive-schema owner creates the column without a schema-version bump. Legacy rows receive NULL and retain full admission; older readers accept the compatible nullable column. Stopped-writer maintenance accepts the missing column before migration, through its exact schema-compatibility contract, without altering the old schema. Present-column drift and every other mismatch still fail admission. Cleanup deletes provenance with its owning lease. No configuration option, new store, or identifier compatibility shim is added.

Admission PRAGMAs now live in the existing sanctioned sqlite-integrity.ts owner. The provenance module has no raw SQLite access; no allowlist expansion or suppression was added. Admission retains version-qualified wal_checkpoint(NOOP) through the shared WAL observer. PASSIVE was rejected by measurement because it synchronously backfills pages.

Empty and absent WALs are equivalent when confirming corruption: native readers can create or retouch an empty sidecar themselves. The main file, nonempty WAL, and rollback journal keep exact generation checks. Advisory success does not mint a writer-owned clean-close certificate; without separately established durable verification, a later graceful restart can still require a full gate.

Evidence

Measurement

Prior rig evidence, before this identifier/storage repair: Linux, 1,100,000 synthetic events, a 5,112,291,328-byte main database, and SIGKILL of the admitted owner during an open write transaction.

Measurement Full gate baseline Deferred gate
Integrity gate 85.118 s 0.019 s
Native admission 86.139 s 1.786 s
Seeded session read 86.378 s 2.037 s
Full background verification synchronous passed at +13.070 s

These measure native worker admission/session operations, not full Gateway/WebSocket readiness. The baseline was cold/contended with a small WAL; the final cell had a large WAL and different cache/load conditions. A warm baseline scan took 3.327 s. The architectural result is removal of the foreground scan, not a universal speedup ratio. An initial large-WAL cell had 1,622,254,152 WAL bytes; the final replay observed 1,399,782,392 bytes before remaining writes finished, so its exact final WAL size is unobserved.

The previous rig also proved full-gate corruption refusal and deferred corruption quarantine at +46.406 s, after which a retained actor and fresh open refused work. The corrected generation comparator changed a native empty-WAL corruption reproducer from inconclusive to confirmed terminal failure. All rig state was synthetic and its worktrees were removed.

Repair validation

Repair validation runs on Blacksmith Testbox (blacksmith-testbox, profile openclaw-check, Node 24.19.0, SQLite 3.53.3), lease tbx_01m43bhf84mftd158zh8s5pge5, based on 59c5b0b9a5d6c2a7a4b8431a13d50c528605474d plus repair commit 0892bfd85d6f4aa7bae99872b1ec1012f49d9569, final tree 3eeeb0848ab9852c24497142d4b67aa71ae0d62a. Source hashes, physical checkout, HEAD, and the staged Git tree were verified remotely.

CI run 37198741596 provided the original failure: 11 UUID-shape assertions in session-transcript-reconcile.lifecycle.test.ts and session-transcript-reconcile.lease.test.ts, plus three raw-SQL architecture diagnostics. Both transcript test files remain unchanged. The crash regression now independently checks UUID keys and provenance-column bindings. A new additive-schema test checks legacy-row preservation, NULL provenance, unchanged user_version, and rollback/retry.

The original validation reported 210 tests across 13 focused files on lease tbx_01m42yr00v8zqpdhwddx6an46r (workflow); its published evidence did not retain the exact 13 filenames. The repair reruns all changed runtime test files and relevant lease/WAL/preflight/schema siblings, with exact commands and counts recorded below.

334 distinct tests passed, with one existing case-insensitive-filesystem case skipped on Linux. The 75 tests affected by the physical-file helper move passed again, and the final native/maintenance standalone replay passed another 41 tests. Independent review of the complete repair, including upgrade compatibility, is scoped-clean through P2.

Remote validation Result Wrapper / payload wall time
Two failing transcript files + additive schema 24 passed 52.49 / 79.34 s
Fifteen crash, integrity, lease, WAL, preflight, Doctor and schema files 227 passed 88.08 / 91.96 s
Five affected files after moving the physical-file helper 75 passed 70.89 / 85.81 s
Snapshot, maintenance, existing writer and integrity worker 83 passed, 1 filesystem skip 53.22 / 109.75 s
Final standalone native + maintenance files 25 + 16 passed 34.368 s / 11.854 s per file
Architecture + first full staged gate 34/34 checks, including all 27 test type graphs payload 29m14s
Architecture + final staged gate after upgrade repair 34/34 checks and all 27 test type graphs passed payload 29m56s

The new schema regression fails against the original owner, then passes after restoring candidate bytes. It takes 2 ms; its full file takes 19.23 s wall and 357 ms test work, mostly spending wall time on worker compilation. The final native crash case takes 6.293 s, reusing one killed child across eight cases without adding a process or timer. It verifies UUID keys, separate provenance, conservative refusal cases, and no foreground scan/backfill on the supported SQLite version.

The upgrade repair also has failing-before/passing-after proof. Snapshot fixtures originally fail in both DELETE and WAL modes because seven columns receive six positional values. Existing-schema maintenance originally rejects a published lease table missing provenance. The corrected snapshot cases take 1.542/1.493 s; current/old-table maintenance takes 430/433 ms, proving actual ownership acquisition/release preserves the schema and version.

Exact commands and validation recovery notes

Exact focused commands (all on the lease above):

node scripts/run-vitest.mjs src/config/sessions/session-transcript-reconcile.lifecycle.test.ts src/config/sessions/session-transcript-reconcile.lease.test.ts src/state/openclaw-state-db-schema-additive.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/infra/sqlite-integrity.test.ts src/state/openclaw-agent-db.integrity-cache.test.ts src/state/openclaw-agent-db.integrity-lease.test.ts src/state/openclaw-agent-db.integrity-policy.test.ts src/state/openclaw-agent-execution.integrity.test.ts src/state/openclaw-database-verify.test.ts src/state/openclaw-database-verify.process.test.ts src/state/openclaw-database-verify.shutdown.test.ts src/infra/sqlite-wal-checkpoint.test.ts src/infra/sqlite-readonly-worker.model-auth.test.ts src/state/openclaw-agent-db.lease-owner.test.ts src/state/openclaw-database-preflight.startup-integrity.test.ts src/state/openclaw-database-preflight.schema-only.test.ts src/commands/doctor-maintenance.settlement.refusals.test.ts src/state/openclaw-state-db-first-use-column-strict-migration.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/config/sessions/session-transcript-reconcile.lifecycle.test.ts src/config/sessions/session-transcript-reconcile.lease.test.ts src/state/openclaw-agent-execution.integrity.test.ts src/state/openclaw-agent-db.integrity-lease.test.ts src/state/openclaw-agent-db.lease-owner.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/state/openclaw-state-db-schema-additive.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/state/openclaw-agent-execution.integrity.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/state/openclaw-state-lease-existing.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/infra/update-candidate-state.test.ts src/state/openclaw-state-lease-existing.test.ts src/state/openclaw-state-db-existing-write.test.ts src/infra/sqlite-integrity-worker.test.ts --maxWorkers=1
pnpm check:architecture
node scripts/check-changed.mjs --staged --timed

An initial staged gate found 709 counted lease-module lines against a 700-line cap. Moving the existing physical-file comparison into the provenance owner resolved it without suppression or a new module. The first complete gate reported only two size warnings in unchanged Gateway files.

The first staged-gate attempt stopped before validation because serialized Git diff hashes differed despite matching file bytes. Verifying the complete staged Git tree established identical source and allowed the gate to proceed; no source or check was bypassed. A diagnostic command also exited 1 because optional core.abbrev was unset; it ran no tests. Testbox portal indexing occasionally timed out after successful payloads; the command receipts retained exit 0.

The known quarantine-test defect is tracked separately; it was not present in the captured failure log for run 37198741596, and its focused replay passed here without a repair. A passing replay does not establish a fix. The first Testbox workflow was cancelled after 65 minutes during the final-source gate, ending SSH with exit 255 and no compiler/test failure. Architecture, core types, and 21 of 27 test type graphs passed on that final tree. Replacement lease tbx_01m43fexnyrpce08277v3j6136 (workflow) completed the final architecture and staged gates successfully against tree 3eeeb0848ab9852c24497142d4b67aa71ae0d62a. Exact-head CI passed: run 37205606069 on 0892bfd85d6f4aa7bae99872b1ec1012f49d9569, including the architecture check, all selected Node and Windows shards, and the published-driver-to-candidate update. The published-driver job completed successfully in 10m59s. The 5.1 GB measurement was not repeated for this repair.

The repair adds 23 production lines to separate stable identifiers from provenance and preserve maintenance admission for published tables missing that field. It deletes the provenance-bearing ID constructor and moves, rather than duplicates, the integrity primitive. The full PR retains the original growth required for crash provenance, deferred-check selection, and owned off-thread failure confirmation; the exclusion-based full-PR count is 387 additions / 141 deletions, net +246 lines (production TypeScript +244, plus one SQL line and one wrapper inventory entry).

Both task-owned Testbox leases have been stopped. No tests, typechecks, or builds ran on the Mac. No live Gateway or deployment is touched.

Admit same-boot Linux WAL stores after an admitted lease owner dies, using
header, journal and schema checks before the existing background verifier
runs full integrity and foreign-key checks. Keep unknown provenance and
interrupted mandatory admission on the full foreground gate.

Bind provenance to host, boot, PID namespace, version and physical file;
publish completed admission separately from clean-close certification.
Use non-backfilling WAL observation, retain confirmation child custody,
and ignore empty-WAL metadata churn during generation confirmation.

Preserve quarantine and write refusal on confirmed damage. No schema or
configuration migration is required; advisory success remains distinct
from a writer-owned clean-close receipt.
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: XL labels Oct 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. labels Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 4, 2026, 9:33 AM ET / 13:33 UTC (Revision 8).

ClawSweeper review

What this changes

The PR lets narrowly verified Linux crash restarts resume agent database operations before a background integrity scan, while preserving conservative admission and corruption quarantine.

Warning

SQLite table change

This PR modifies persisted SQLite tables in src/state/openclaw-state-schema.sql. Prefer a design that avoids changing persisted SQLite tables. Migration or upgrade compatibility proof is recorded, but maintainers should still confirm that the schema change is necessary.

Merge readiness

⛔ Blocked before merge - 3 items remain

This remains useful work beyond current main, with sufficient native recovery evidence and no concrete introduced correctness finding. The prior corruption-recovery acceptance blocker remains unresolved.

Priority: P2
Reviewed head: 0892bfd85d6f4aa7bae99872b1ec1012f49d9569
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong native recovery evidence supports a coherent repair with no actionable correctness finding; contract acceptance remains separate from patch quality.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Captured Linux evidence exercises production native admission and session operations after SIGKILL, then background verification and corruption-triggered refusal. Final-repair Testbox evidence covers native classification and existing-table maintenance; source and published-reader contracts support compatible nullable-column upgrades. The older large-database benchmark was not repeated for the repair.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Captured Linux evidence exercises production native admission and session operations after SIGKILL, then background verification and corruption-triggered refusal. Final-repair Testbox evidence covers native classification and existing-table maintenance; source and published-reader contracts support compatible nullable-column upgrades. The older large-database benchmark was not repeated for the repair.
Evidence reviewed 10 items Pinned introduced behavior: Reviewed the verified merge-base-to-head delta. Deferral requires completed dead-owner admission, matching boot/version/file provenance, no competing owner, current schema, and supported non-backfilling WAL observation. The supplied stale test merge was not used to infer removal of current-main behavior.
Current main does not supersede this work: Fetched main reuses runtime proof or a matching verification receipt; it has no process-death deferral. The merged listener-time admission change at #164670 retains dirty-open integrity validation and addresses an adjacent startup delay.
Latest-release behavior: GitHub confirms v2026.9.8 is the latest release. Its admission implementation selects reuse from runtime proof or verification receipts and lacks the proposed provenance-based crash deferral. The release blob was inspected through GitHub after local blob retrieval failed.
Findings None None.
Security None None.

How this fits together

Agent databases store OpenClaw sessions and transcripts. Their admission owner checks ownership and consistency before native workers serve operations; background verification can subsequently revoke access and quarantine damaged files.

flowchart TD
  A[Agent database restart] --> B[Lease and file provenance]
  B --> C{Eligible process crash?}
  C -->|No| D[Full admission scan]
  C -->|Yes| E[Header and schema checks]
  D --> F[Session operations]
  E --> F
  E --> G[Background full verification]
  G -->|Confirmed damage| H[Drain actors and quarantine]
Loading

Decision needed

Question Recommendation
Should proven same-boot Linux crashes resume session operations before full verification, using the compatible nullable lease-provenance column? Accept the narrow recovery contract: Link acceptance of the documented eligibility, nullable provenance storage, compatibility evidence, and exposure before corruption detection.

Why: The implementation and proof support the intended behavior, but repository policy reserves schema and corruption-recovery contract acceptance for a recorded maintainer decision.

Before merge

  • Resolve merge risk (P1) - Eligible crash recovery can serve session reads and writes before unrelated database corruption is detected; linked maintainer acceptance must cover that exposure and the additive lease-provenance schema.
  • Complete next step (P2) - Link maintainer acceptance of deferred session access and the nullable lease-provenance contract, or preserve full foreground verification.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +245, Tests +467, Docs +48, Other +1. Total +761 across 36 files.

View PR surface stats
Area Files Added Removed Net
Source 19 386 141 +245
Tests 14 595 128 +467
Docs 2 59 11 +48
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 36 1041 280 +761

Review metrics

Metric Value Why it matters
Persisted contract 1 nullable first-use column; schema version unchanged Legacy rows remain conservative, but the compatible schema addition still falls under the material-contract acceptance policy.

Stored data model

Persistent data-model change detected: database schema: src/infra/sqlite-integrity.ts, database schema: src/state/openclaw-state-schema.sql. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Record acceptance of deferred admission (recommended)
    Link a maintainer decision accepting the narrow crash-recovery exposure and compatible provenance-column contract.
  2. Preserve the full foreground gate
    Remove crash deferral and its provenance storage if admitting operations before full verification is unacceptable.

Technical review

Best possible solution:

Keep one native admission owner with conservative fallback and generation-bound quarantine, under explicitly accepted recovery and lease-schema contracts.

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

Not applicable as an existing-behavior bug reproduction: this is a performance proposal, and the captured native SIGKILL evidence demonstrates the changed recovery path.

Is this the best way to solve the issue?

Yes, conditionally: extending the existing admission and verifier owners is coherent, and the latest repair preserves established identifiers and legacy-state admission.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 306da58672fd.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded restart-performance improvement with demonstrated native recovery behavior.
  • merge-risk: 🚨 session-state: Deferred admission permits session operations before unrelated storage corruption is detected and quarantined.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Captured Linux evidence exercises production native admission and session operations after SIGKILL, then background verification and corruption-triggered refusal. Final-repair Testbox evidence covers native classification and existing-table maintenance; source and published-reader contracts support compatible nullable-column upgrades. The older large-database benchmark was not repeated for the repair.
  • proof: sufficient: Contributor real behavior proof is sufficient. Captured Linux evidence exercises production native admission and session operations after SIGKILL, then background verification and corruption-triggered refusal. Final-repair Testbox evidence covers native classification and existing-table maintenance; source and published-reader contracts support compatible nullable-column upgrades. The older large-database benchmark was not repeated for the repair.

Evidence

What I checked:

  • Pinned introduced behavior: Reviewed the verified merge-base-to-head delta. Deferral requires completed dead-owner admission, matching boot/version/file provenance, no competing owner, current schema, and supported non-backfilling WAL observation. The supplied stale test merge was not used to infer removal of current-main behavior. (src/state/openclaw-agent-db-lease.ts:229, 0892bfd85d6f)
  • Current main does not supersede this work: Fetched main reuses runtime proof or a matching verification receipt; it has no process-death deferral. The merged listener-time admission change at perf(gateway): admit agent databases when the listener binds #164670 retains dirty-open integrity validation and addresses an adjacent startup delay. (src/state/openclaw-agent-db-schema.ts:137, 306da58672fd)
  • Latest-release behavior: GitHub confirms v2026.9.8 is the latest release. Its admission implementation selects reuse from runtime proof or verification receipts and lacks the proposed provenance-based crash deferral. The release blob was inspected through GitHub after local blob retrieval failed. (src/state/openclaw-agent-db-schema.ts:158, fc23bc864e45)
  • Captured proof identity and native recovery: The full live body matches the captured SHA-256 1ab1df653e0edf7267ff425d40abe9e2e9526cfd7a23fa23a4b7f81321493b0a and all 12,071 UTF-16 units were available, including the omitted tail. It records production native admission/session operations after SIGKILL on a 5.1 GB synthetic database, background verification success, and corruption quarantine followed by retained-actor and fresh-open refusal. These observations do not establish full Gateway readiness or a universal speedup ratio; the large benchmark predates the identifier repair. (0892bfd85d6f)
  • Repair and existing-state compatibility: The final-tree Testbox evidence reports passing native crash classification, UUID/provenance checks, rollback/retry, legacy-row preservation, and actual pre-migration maintenance ownership with both old and current lease tables. Source preserves UUID identifiers, adds nullable provenance through the existing first-use owner, leaves user_version unchanged, and sends NULL legacy provenance through full admission. (src/state/openclaw-state-db-schema-additive.test.ts:92, 0892bfd85d6f)
  • Published reader compatibility: The v2026.9.8 persistent schema contract permits compatible additive columns, and its lease reader and writer use named columns. This supports compatibility with the new nullable TEXT column rather than relying solely on a no-version-bump assertion. (src/state/openclaw-state-schema-compatibility.ts:104, fc23bc864e45)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • shakkernerd: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

History

Review history (7 earlier review cycles)
  • reviewed 2026-10-04T09:23:39.757Z sha 84a67c8 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T09:49:02.054Z sha 84a67c8 :: blocked before merge. :: none
  • reviewed 2026-10-04T10:16:32.426Z sha 84a67c8 :: blocked before merge. :: [P2] Update the typed Doctor lease fixture for the new row shape
  • reviewed 2026-10-04T10:39:32.090Z sha 59c5b0b :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T10:49:53.648Z sha 59c5b0b :: blocked before merge. :: none
  • reviewed 2026-10-04T11:24:49.713Z sha 59c5b0b :: blocked before merge. :: none
  • reviewed 2026-10-04T11:31:01.268Z sha 59c5b0b :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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. labels Oct 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Oct 4, 2026
@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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 4, 2026
@steipete
steipete marked this pull request as ready for review October 4, 2026 11:26
@steipete
steipete enabled auto-merge (squash) October 4, 2026 11:31
Restore UUID lease IDs and persist the process binding in the nullable,
first-use agent_database_leases.provenance column. Legacy leases keep the
full integrity gate, and admission revalidates the prepared file binding.
Move header and WAL admission PRAGMAs into the existing SQLite integrity
owner without adding an allowlist exception.

Preserve the transcript reconciliation identifier assertions. Cover
legacy-row preservation, additive-schema rollback, and independent UUID
and provenance checks in the native crash regression.

Keep pre-migration maintenance compatible with published lease tables
that lack provenance, while retaining present-column drift checks. Name
snapshot fixture columns so optional additions preserve its lease data.
@steipete
steipete merged commit 147975c into main Oct 4, 2026
176 of 177 checks passed
@steipete
steipete deleted the steipete/perf-micro-integrity-gate-by-provenance-20260919 branch October 4, 2026 13:46
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…claw#164846)

* perf(state): defer integrity scans after proven process crashes

Admit same-boot Linux WAL stores after an admitted lease owner dies, using
header, journal and schema checks before the existing background verifier
runs full integrity and foreign-key checks. Keep unknown provenance and
interrupted mandatory admission on the full foreground gate.

Bind provenance to host, boot, PID namespace, version and physical file;
publish completed admission separately from clean-close certification.
Use non-backfilling WAL observation, retain confirmation child custody,
and ignore empty-WAL metadata churn during generation confirmation.

Preserve quarantine and write refusal on confirmed damage. No schema or
configuration migration is required; advisory success remains distinct
from a writer-owned clean-close receipt.

* test(doctor): complete active agent lease fixture

* fix(state): keep lease identifiers separate from crash provenance

Restore UUID lease IDs and persist the process binding in the nullable,
first-use agent_database_leases.provenance column. Legacy leases keep the
full integrity gate, and admission revalidates the prepared file binding.
Move header and WAL admission PRAGMAs into the existing SQLite integrity
owner without adding an allowlist exception.

Preserve the transcript reconciliation identifier assertions. Cover
legacy-row preservation, additive-schema rollback, and independent UUID
and provenance checks in the native crash regression.

Keep pre-migration maintenance compatible with published lease tables
that lack provenance, while retaining present-column drift checks. Name
snapshot fixture columns so optional additions preserve its lease data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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