Repository navigation
perf(sqlite): reuse clean-close proof across app versions - #176909
Merged
steipete merged 5 commits intoOct 19, 2026
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
steipete
marked this pull request as ready for review
October 19, 2026 04:22
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
steipete
force-pushed
the
steipete/perf-micro-integrity-seal-version-binding-20260919
branch
from
October 19, 2026 04:27
611dbd5 to
9478deb
Compare
steipete
force-pushed
the
steipete/perf-micro-integrity-seal-version-binding-20260919
branch
2 times, most recently
from
October 19, 2026 04:49
d464819 to
95eca36
Compare
Bind restart proof to the loaded SQLite build, Node/Bun runtime, family schema version and SQL, and explicit integrity policy instead of the app version. Legacy seals require one full verification; file, journal, expiry, quarantine, and write invalidation checks remain unchanged.
steipete
force-pushed
the
steipete/perf-micro-integrity-seal-version-binding-20260919
branch
from
October 19, 2026 05:00
95eca36 to
05c51d6
Compare
steipete
deleted the
steipete/perf-micro-integrity-seal-version-binding-20260919
branch
October 19, 2026 05:24
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 20, 2026
…76909) * perf(sqlite): reuse clean-close proof across app versions Bind restart proof to the loaded SQLite build, Node/Bun runtime, family schema version and SQL, and explicit integrity policy instead of the app version. Legacy seals require one full verification; file, journal, expiry, quarantine, and write invalidation checks remain unchanged. * fix(bench): revoke admitted facts when refreshing integrity proof * fix(sqlite): separate native runtime from file admission * fix(sqlite): keep seal schema versions dependency-free * chore(sqlite): prune retired assertion allowance
This was referenced Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
A release-number-only upgrade discards clean-close integrity proof and scans every page of large agent databases again, even when their storage stack is unchanged.
User Impact
Compatible application upgrades reuse clean-close proof. SQLite/runtime changes, family schema changes, policy changes, unknown identity, malformed seals, and legacy app-version-bound seals still require full validation. Existing seals incur one full scan on the first upgrade to this policy. No database schema, retention, configuration, quarantine, or write-authority contract changes.
Why This Change Was Made
The old app version was a broad compatibility fence. The existing policy already requires a revision for code-only migrations, validation rules, or serialized facts. Bind that policy and the family SQL/schema version to the actual loaded SQLite version, source ID, compile options, and Node/Bun runtime versions instead. The native runtime owner collects the additional identity in its existing one-time in-memory probe, including shared-library builds; unknown identity disables seal reuse/publication.
The seven-day full-verification limit, physical file metadata, empty journals, additive-column prerequisites, and quarantine checks remain intact. The old version argument and artifact-version expectation are removed. Runtime production change is +52 lines across seven files: the growth records the actual storage contract and fails closed when it is unavailable. There is no additional cache layer or alternate admission path. Native library loading/probing now lives in a leaf module, so file admission can consume its identity without importing the file-opening adapter. The existing node-sqlite facade retains its public exports, backed by that single implementation.
Evidence
PRAGMA integrity_checkexecution for legacy, malformed, and unknown-policy seals. The identity tests cover SQLite and family schema/version changes and preserve unrelated-family reuse.pnpm tsgo:core, changed-file oxfmt and lint pass. Export-name collision guard and both closure files pass (22 tests).05c51d63f6e6741fe481ed261faa9ef0368118af.Measurement acceptance rule (recorded before A/B measurement)
Use the committed
scripts/perf/seal-version-restart.tswith two separately generated synthetic agent databases of at least 2 GiB. In each checkout, fully verify/clean-close under app version 2026.10.4, change only package version to 2026.10.5, then measure the next cold-process owner open. Run two concurrent A/B pairs under the exclusive benchmark lock, swapping the 16-core CPU halves between pairs, and record outside CPU load. Seeding is sequential, paced, and stops at 2 GiB Linux Dirty memory; databases are never copied or vacuumed.Acceptance: baseline performs one full scan per version-only bump; candidate performs zero and preserves the seal fast path. Compare paired candidate-minus-baseline gate and owner-open latency; no regression beyond noise. This measures the real database admission owner, not full Gateway readiness or cold OS page cache. Results (each database 2,169,942,016 bytes, Node 26.8.2, synthetic canonical-schema cache rows):
The paired results meet the acceptance rule: every version-only baseline restart scans; neither candidate restart scans; admission improves in both pairs. Starts differed by 0 ms and 1 ms. Sampled CPU busy time across CPUs 96–127 was 5.62% and 6.10%; load/page-cache variation explains why absolute times are not a stable service-latency prediction. Two pairs establish the scan-removal result, not a latency distribution. Candidate seal lookup was 5.10 ms and 6.09 ms. These final pairs were repeated after the native-runtime extraction, using the original synthetic databases.
Seeding took 113.1 s and 117.0 s sequentially. Peak observed Dirty memory was 1,096,839,168 bytes, below the 2 GiB limit. No production data, database copies, or Gateway restarts were used. Measurement ran against base 049f5f9 with the final native-runtime and seal-identity implementation; the subsequent main rebases add no seal/schema/SQLite changes.
The first attempted pair stopped during reseal setup: deleting a seal intentionally retains process-local validation facts. The benchmark now uses the existing admission-revocation API for
--refresh-proof; that one-line correction received a separate clean P0–P2 review. The reported pairs were rerun after the correction.The isolated benchmark sandbox was removed after retaining its results.