Skip to content

fix(state): preserve schema proof across repeated publication - #170194

Merged
steipete merged 1 commit into
mainfrom
dbasync/redmain-schema-proof-publication
Oct 12, 2026
Merged

steipete merged 1 commit into
mainfrom
dbasync/redmain-schema-proof-publication

Conversation

@steipete

@steipete steipete commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Repeated publication of an unchanged admitted schema invalidated the proof already held by workers. A worker returning an earlier receipt could therefore fail admission even though the database had not changed. The unconditional revocation was introduced in #165680.

Reuse the live schema validity cell when the same owner republishes its admitted facts. Real DDL still revokes that cell, and fresh admission then creates its replacement. Physical replacement, corruption, identity, and schema-admission guards remain intact. A receipt captured before an unchanged republication intentionally stays valid; no extra check or handshake is added.

The existing symlink/receipt regression now covers delayed publication, and the DDL cases verify that actual mutations still revoke the shared proof after republication. The obsolete test requiring healthy republication to revoke proof is removed. This changes two files (+13/−27), with no stored-schema, migration, durability, public API, or update behavior change. It adds no SQL or worker request path.

Validation:

  • pnpm test src/state/openclaw-agent-db-validation-cache.test.ts --maxWorkers=1: 53/53 passed; 204.95 seconds in Vitest, 471.16 seconds including the wrapper.
  • Production-only reversal with candidate tests retained: 1 expected failure and 52 passes; 149.32 seconds in Vitest, 307.14 seconds including the wrapper. The receipt regression fails at the shared validity cell identity assertion before delayed publication. The checkout was restored cleanly with no surviving test processes.
  • Codex review: scoped-clean, no actionable findings; original review retained.
  • Composed-head CI passed production types, state test types, lint, source contracts, Knip, Madge, and the T1/dialect ratchets.

Runtime proof used 8d087040fefe324e5ff7fa76faf497fadb542c08: the test and changed publisher body are exact. That head also contained separate stale-error diagnostics, excluded from this change, which did not alter acceptance predicates. No claim is made that this independently resolves the previously observed Gateway/UI admission failure. A published-driver update cell is not applicable to this in-memory receipt fix.

Both final publication file blobs exactly match the reviewed source after integrating main. Direct-main pushes were refused by the repository ruleset, so this emergency repair uses the authorized head-pinned PR squash fallback.

The focused schema-admission sibling also passed all 27 cases on the same composition (194.55 seconds in Vitest, 272.05 seconds including the wrapper), with a clean checkout and no surviving test processes.

Reuse the live schema validity cell when the admitted owner republishes unchanged facts. Delayed worker receipts remain valid, and actual DDL still revokes the same cell for every borrower before fresh admission.

Extend existing alias and DDL regressions and delete the test that required redundant publication to revoke healthy proof. Physical replacement and corruption guards stay unchanged. No schema, stored data, update behavior, or additional SQL changes.

Focused format, lint, and isolated Codex review pass. Runtime owner tests are delegated to the shared red-main test queue and remain pending. This repairs the source-proven redundant-publication defect; attribution of the observed UI admission failure remains unverified.
@clawsweeper

clawsweeper Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete merged commit 9e7aaff into main Oct 12, 2026
54 of 57 checks passed
@steipete
steipete deleted the dbasync/redmain-schema-proof-publication branch October 12, 2026 20:00
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…aw#170194)

Repeated publication of an unchanged admitted schema invalidated the proof already held by workers. A worker returning an earlier receipt could therefore fail admission even though the database had not changed. The unconditional revocation was introduced in openclaw#165680.

Reuse the live schema validity cell when the same owner republishes its admitted facts. Real DDL still revokes that cell, and fresh admission then creates its replacement. Physical replacement, corruption, identity, and schema-admission guards remain intact. A receipt captured before an unchanged republication intentionally stays valid; no extra check or handshake is added.

The existing symlink/receipt regression now covers delayed publication, and the DDL cases verify that actual mutations still revoke the shared proof after republication. The obsolete test requiring healthy republication to revoke proof is removed. This changes two files (+13/−27), with no stored-schema, migration, durability, public API, or update behavior change. It adds no SQL or worker request path.

Validation:

- `pnpm test src/state/openclaw-agent-db-validation-cache.test.ts --maxWorkers=1`: 53/53 passed; 204.95 seconds in Vitest, 471.16 seconds including the wrapper.
- Production-only reversal with candidate tests retained: 1 expected failure and 52 passes; 149.32 seconds in Vitest, 307.14 seconds including the wrapper. The receipt regression fails at the shared validity cell identity assertion before delayed publication. The checkout was restored cleanly with no surviving test processes.
- Codex review: scoped-clean, no actionable findings; original review retained.
- [Composed-head CI](https://github.com/openclaw/openclaw/actions/runs/38298120555) passed production types, state test types, lint, source contracts, Knip, Madge, and the T1/dialect ratchets.

Runtime proof used `8d087040fefe324e5ff7fa76faf497fadb542c08`: the test and changed publisher body are exact. That head also contained separate stale-error diagnostics, excluded from this change, which did not alter acceptance predicates. No claim is made that this independently resolves the previously observed Gateway/UI admission failure. A published-driver update cell is not applicable to this in-memory receipt fix.

Both final publication file blobs exactly match the reviewed source after integrating main. Direct-main pushes were refused by the repository ruleset, so this emergency repair uses the authorized head-pinned PR squash fallback.

The focused schema-admission sibling also passed all 27 cases on the same composition (194.55 seconds in Vitest, 272.05 seconds including the wrapper), with a clean checkout and no surviving test processes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant