Skip to content

refactor(storage): make shared-state identities portable (v22) - #170280

Merged
steipete merged 5 commits into
mainfrom
pgprep/p33-pr4b-v22
Oct 13, 2026
Merged

steipete merged 5 commits into
mainfrom
pgprep/p33-pr4b-v22

Conversation

@steipete

@steipete steipete commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Related: #169254, v22 addendum, combined-v22 sequencing, #170059, #170055, #170084.

Prepared-selection authority regression

The failing CI run tested the PR merged with newer main, including #170470. The original PR head passed all 16 selection-authority cases locally; both reported role/alias cases also passed under Node 24. Pre-fix main 2bd6ca195418c5ff269439f02dd4b0b9b7c664b0 independently failed exactly those two cases (14 passed), reproducing CI's missing-revocation assertion.

Schema admission renewed an integrity epoch, replacing the profile authority store while native role/alias publishers retained the old store. Workshop change identity and ordering were unrelated. This branch now incorporates main's c445da4029e17 repair, which separates physical-owner lifetime from renewable schema integrity proof. No additional production code or Workshop change was needed. The existing role/alias cases are the regression tests.

Approved pre-rebase head: 649d54ac75429, merging main through 877301a3af040.

Final merged-head verification: all 46 cases passed across seven suites with --maxWorkers=1: selection authority (16), Workshop (2), v22 parity/upgrade (4), profile authority (7), and ACP writer/cache/resume (17). The existing role/alias cases fail on pre-fix main and pass with the upstream repair. Vitest times: unit 134.54s, infra 936.01s, ACP 94.68s. Compiler verification completed. Exact-head PostgreSQL conformance passed in run 38343100840, on 649d54ac754290a9c5b80d61fc8dfbf31d267984. The broader CI run is not green; failures are recorded below.

All 15 PostgreSQL generator tests and canonical/workboard DDL freshness checks passed; pendingPromotion is empty. Wrapper inventory, formatting, git diff --check, and madge (zero cycles) passed. Core and generator lint passed. Extension lint could not start because plugin-SDK declaration preparation hit its unchanged 300-second timeout twice. Hosted extension lint subsequently passed on the same exact head in job 115118791075, closing the local lint verification gap. No timeout or guard was changed.

The final PR delta remains +169 production/config lines, +544 test lines, +26 documentation lines, and +10 generated lines. This repair adds no PR-specific production code; main's owner repair is +25/-5 production lines. No manual merge resolutions were needed.

Landing candidate and CI

Current head: 94aba42c907dc. The rebase onto current main completed without conflicts. The four PR commits preserve their reviewed implementation; the first commit has generator-context differences, and the other three are patch-identical. The rebased main baseline uses shared-state schema v21.

The one landing fix adapts main's new retained cron-history fixture to v22 by assigning explicit cursor_id values. Its finalization, retention, and duplicate-result assertions remain intact. pnpm test src/cron/store/run-finalization.worker.test.ts --maxWorkers=1 passed: 1 case, 8.126s test time, 906.04s Vitest, 1,021.02s command wall time. Compilation accounts for most of that wall time. A direct check against the canonical v22 DDL reproduces the old fixture's NOT NULL failure and verifies 65 unique cursor identities with the corrected insert. Formatting, lint, whitespace, and a focused Codex review through P2 passed.

pnpm db:postgres:gen produced no output changes. pnpm db:postgres:check passed all 16 generator cases (115.13s Vitest); canonical and Workboard artifacts are current, and pendingPromotion: [].

Exact-head CI run 38359012138 completed: 153 jobs passed, six unrelated jobs failed, and the aggregate CI gate failed. PostgreSQL conformance, security-fast, build artifacts, lint, and the final core shard passed. No job was cancelled by fail-fast, and no wrapper-inventory or eager-import-closure failure was reported. Earlier owner, parity, and upgrade results above remain prior-head proof.

Landing uses the operator-authorized CI exception and head-pinned REST fallback after the native workflow stalled. The workflow's scheduled-main table marked these jobs unknown because it had no matching main shard; the causal-path evidence below supplies the requested attribution. None is described as passing CI.

Failed job Cases and causal-path classification
checks-ui-e2e (1/7) Dark/light reader-position and keyboard-jump timeouts in chat-position-rail.e2e.test.ts. Unrelated: mocked Gateway UI tests execute no changed database owners, and this PR has no UI changes.
checks-ui-e2e (2/7) Reply-source navigation click timeout in chat-reply-preview-recovery.e2e.test.ts. Unrelated: mocked Gateway UI test and owners are outside the PR.
checks-ui-e2e (5/7) Screenshot timeout in chat-collapsed-reply-reveal.e2e.test.ts. Unrelated: browser capture in unchanged mocked Gateway UI proof.
checks-node-changed-extensions-bundle-29 Nine OpenAI embedding/realtime fixture cases fail with Auth profile credential writes require an admitted worker. Unrelated: the unchanged auth-profile worker-custody guard rejects fixture setup before the v22 migration path.
checks-node-changed-extensions-bundle-20 Two Alibaba profile-precedence fixture cases hit the same auth worker-custody guard. Unrelated for the same reason; no provider or auth-profile owner is changed by this PR.
checks-node-changed-extensions-bundle-22 Three memory queued-publication/interrupted-rebuild assertions fail in manager-search-reindex-backoff.test.ts and manager-session-delta.test.ts. Unrelated: failing memory-index tests, tables, and owners are outside this PR's changes.

The generic admission helper's only PR change is exporting catalog capture and defaulting its revision argument; existing call behavior is retained. The failing test files and their owners are outside the 55-file PR delta. All six failed job logs were inspected once and retained as landing evidence.

The previous approved-head run 38344756340 completed with these failures:

Failure Classification and evidence
run-finalization.worker.test.ts: cron_run_receipts.cursor_id NOT NULL Fixed fixture incompatibility in this candidate. CI failed at the fixture's raw insert; the production writer was not the failing path.
doctor-maintenance.requester-authority.test.ts: missing expected revocation error Inherited: the same case failed on scheduled main run 38343322520, job 115119179148. This is not the Doctor schema-upgrade/orphan-repair case.
loader.trust-diagnostics.test.ts: runtime config not prepared Inherited: matching main cases in run 38343322520, job 115119178771; also previously verified in run 38331230273.
bundled-provider-auth-literal-parity.2.test.ts: llama-cpp local auth Unrelated under the authorized causal-path rule: the provider-auth test and executed provider owners are outside this PR's changes.
Telegram ingress E2E job Unrelated under the authorized causal-path rule: its nine planned files are disjoint from this PR. It reached the job deadline after repeated test/hook timeouts, rather than being cancelled by fail-fast.

The current required CI failures are admitted under the operator-authorized unrelated-failure exception above. Failed checks remain failed.

The earlier run 38343100840 also reported session-reconnect, exec-approval, and node-worker-launch E2E timeouts. Main-side comparison attempts on pinned main 5ac63514950809ba05512c161264ec0bc0945639 were inconclusive: setup and outer harness watchdog failures returned no usable case-level result. The latest attempt retained the cases' own timeouts and assertions, with a longer outer startup budget. These cases are not claimed inherited or passing; the comparison remains an explicit verification gap.

What Problem This Solves

ACP resume indexes and shared-state receipt cursors depended on SQLite JSON expressions and implicit rowid identities, preventing equivalent PostgreSQL storage.

Behavior and Ownership

The typed ACP metadata owner uses one identity binding for runtime writes and Doctor identity rewrites. It trims only string resume IDs and writes both promoted columns in the same upsert as identity_json. Missing and non-string IDs become NULL. The v22 migration uses SQLite's guarded json_type and json_extract, preserving native first-duplicate-key behavior for historical rows. Resume lookup compares the indexed columns directly, without parsing identity JSON or applying a post-filter. The scalar/number parser has been deleted. JSON stays canonical; receipts and the accepted cohort-cache lifetime are unchanged.

Approvals, cron receipts, execution decision facts, and Skill Workshop changes receive unique cursor_id columns. Migration preserves original rowids, including gaps, and existing opaque cursor formats. Writers allocate max(cursor_id) + 1 inside their existing transactions. Legacy approval repair recognizes a pinned pre-v22 schema and supplies the cursor column during its rebuild. One migration kind declares all five affected tables. PostgreSQL generation has an empty pendingPromotion list.

Existing resume results, cursors, and insertion ordering survive the v21-to-v22 upgrade. Older builds refuse v22; rollback restores the verified pre-upgrade backup with its matching build. No configuration, retention, or authorization change is introduced.

Accepted Edges

  • A lone-surrogate resume ID may not round-trip, so that session does not resume.
  • cursor_id = max(cursor_id) + 1 re-issues the cursor of a deleted top row, as implicit rowid did. A reader paging > N can miss a new row N. This is rare because retention prunes the oldest rows.

PostgreSQL text still cannot hold NUL; data-port preflight owns that limitation. This change proves schema conformance, not full PostgreSQL runtime support.

Pre-rebase evidence

Current verification with --maxWorkers=1: all four v22 parity/upgrade tests, all three wrapper-inventory tests, both resume tests, and the selected Doctor ownership/identity rewrite regression passed. The six-suite ACP infra run passed 39 of 40 cases; the independent clear-writer child hit its unchanged 60-second process timeout after reporting imports ready and write start. It never reported write settlement. That clear branch and its test/process harness are unchanged by this reduction; its isolated replay passed with the same timeout and assertions (102.33s case, 339.35s Vitest). That passing replay does not establish a timing fix; the original timeout remains documented.

The other receipt/cohort, metadata read, memory, write, control, and reset cases passed. The full multi-project command took 1,988.29s; the resume command took 206.75s, and the selected Doctor command took 593.82s. The final parity body took 426ms, including exhaustive whitespace verification. All 14 PostgreSQL generator tests and both generated-DDL freshness checks passed. Type-aware lint, formatting, whitespace, and madge (zero cycles) passed. The dialect guard remains shrink-only (design 34→32, engine-maintenance 25→25); pendingPromotion remains empty.

The string parity test exercises the actual metadata writer against migration SQL for trimmed/untrimmed text, the complete whitespace set, Unicode, empty-after-trim strings, and missing/non-string fields. It checks every Unicode code point against the exact 25-character SQL whitespace set. Native migration cases cover invalid JSON and duplicate keys. The Doctor regression verifies that normalizing duplicate-key JSON refreshes the promoted resume column through the same binding. Runtime and Doctor v21 upgrade tests preserve cursor gaps, opaque cursor decoding, ordering, and resume results.

Retained proof for unchanged cursor owners: 51 tests across six suites, six legacy approval migration tests, three historical upgrade regressions, and version/refusal plus publication/restart migration enumerations passed. The prior local Doctor orphan-repair test timed out at its unchanged 120-second limit; a following repair case also failed. These earlier failures remain unresolved and are not counted as passing proof.

Pre-rebase final-head Codex autoreview was clean. The landing rebase retains that reviewed implementation.

Net production/config lines: +169; tests +549; docs +26; generated output +10. No reserved owner file changed.

Rowid inventory and schema-bump coverage
Site Disposition
operator-approval-store.receipts.ts / approval writer Explicit operator_approvals.cursor_id; existing wire rowId retained.
execution-owner-lifecycle-receipts.ts / cron writer Explicit cron_run_receipts.cursor_id; same timestamp/cursor ordering.
execution-decision-facts.ts Explicit execution_decision_facts.cursor_id; existing receipt-key ordering and wire selectors retained.
skills/workshop/changes.kernel.ts Explicit skill_workshop_changes.cursor_id; preserves insertion-order ties and pruning.
openclaw-state-db-schema-v22-columns.ts, openclaw-state-db-operator-approval-migration.ts Keep rowid only as the one-time historical backfill source.
openclaw-state-db-schema-additive.ts Keep historical diagnostic-event sequence backfill; runtime already uses explicit sequence.
doctor-session-incognito-key-repair-state.ts Keep SQLite-only offline repair's row address within its owning transaction; no exposed cursor.
openclaw-state-db-task-delivery-recovery.ts Keep SQLite-only preservation/export identity for orphan recovery; no runtime cursor.
update-database-restore-source.ts Keep lossless SQLite backup restoration, including original physical rowids.
openclaw-migration-witness.ts, snapshot/git-backup-codec.ts Keep SQLite physical-data witness/backup addressing; no shared-state runtime cursor.
SQLite infrastructure (sqlite-integrity, sqlite-strict, sqlite-schema-contract-assembly, kysely-sync) Keep native SQLite diagnostics, physical rebuild semantics, and adapter internals.
Message receipt rowId / audit sequence Already derives from explicit sequence/stage keys; no implicit rowid.
Agent transcript/FTS, session projection, and context-engine outbox owners Agent database, outside this shared-state migration.

No still-reserved owner files were changed. Schema-bump coverage includes the typed migration-to-tables map, runtime/Doctor migration registration, native version limit, version-constant assertions, publication/restart migration enumerations, raw-SQL migration markers, eager wrapper import inventory, generated types, and regenerated PostgreSQL fragments.

Earlier landing candidate: 754ff2fd53f6709a0808862962272c15a42baf9a. Rebased onto main after #170266 and regenerated PostgreSQL artifacts into its single runtime DDL form. All four v22 preservation/parity/upgrade cases passed on the rebased implementation (pnpm test src/state/openclaw-state-db-schema-v22-columns.test.ts --maxWorkers=1: 422.33s command wall time, 370.91s Vitest). pnpm db:postgres:gen and pnpm db:postgres:check passed, including all 15 generator cases, canonical/workboard freshness, and pendingPromotion: []. The previously reviewed schema-owner reuse and Doctor migration descriptions are preserved.

The pre-rebase head passed PostgreSQL conformance, while CI run 38327468439 reported Knip/runtime-config failures and unresolved node-worker lifecycle/launch assertions. These are prior-head evidence, not passing CI for the landing head; final-head attribution remains pending.

Landing CI classification and fixture repair

The rebased CI run 38331192286 completed with four failed test jobs. The two schema-fixture failures are repaired in this head; production code is unchanged by the repair. Focused validation passed for both cases: the legacy Doctor fixture (274.89s command wall time) and the older-reader decision/reopen fixture (329.16s through the repository Node test wrapper). Targeted lint, formatting, and Codex autoreview are clean.

Failure Classification and evidence
openclaw-state-db.test.ts: migrate operator approvals to system-agent records Fixed stale fixture. It now uses the frozen pre-v22 DDL instead of synthesizing a legacy table from v22 DDL. The actual Doctor repair passes.
operator-approval-store.execution-identity.test.ts: older reader write/reopen Fixed obsolete physical-schema assertion. The historical row reader still proves decoding, decision writes, schema-version preservation, and companion identity through the current database owner; an old binary admitting v22 is not the contract.
loader.trust-diagnostics.test.ts: runtime config not prepared Inherited: matching cases fail on main run 38331230273, job 115081408121. The failing code is unchanged from main; all 22 recorded files in the PR job are disjoint from this PR.
telegram-ingress-coalescing.e2e.test.ts: test/hook and no-output timeouts Unrelated under the authorized causal-path rule: all nine planned files in the failed job are disjoint from this PR. No timeout was raised and no production Telegram change is included.

If the two unrelated failures recur, landing uses the authorized native admin exception with exact-head evidence; neither is reported as passing CI.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts commands Command implementations size: XL labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR introduces schema v22 with indexed ACP resume columns and explicit receipt and Workshop cursor identities.

Example: An approval has rowid 30 and an issued cursor a:100:30.

  • Before: Receipt paging identifies the approval through SQLite's implicit rowid.
  • After: Migration preserves 30 in cursor_id, keeping the issued cursor valid.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation follows the accepted design with meaningful migration coverage; release-upgrade compatibility remains unproven and the existing documentation finding remains open.
Proof confidence 🦐 gold shrimp (3/6) Ordinary contributor proof is exempt for this maintainer-authored PR; reported harness runs cover writer parity and migration behavior, but fresh-install, published-release upgrade, and restore evidence remain absent from the complete body and discussion.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: SQLite-specific resume indexes and implicit receipt identities prevent equivalent shared-state storage on PostgreSQL.
Reason: The maintainer-authored change implements an accepted design and limits its claim to storage preparation rather than PostgreSQL runtime support.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open: it implements the accepted storage-portability design and remains distinct from main, with one previously reported documentation defect.

Priority: P2
Reviewed head: 649d54ac754290a9c5b80d61fc8dfbf31d267984

Before merge

  • Keep the schema 22 row inside the history table (P3) - The blank line terminates the Markdown table, so schema 22 renders as a pipe-delimited paragraph instead of a version entry. Remove the blank line before this row. This previously reported finding remains unchanged at the reviewed head.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P3] Keep the schema 22 row inside the history table — docs/reference/database-schemas/state-schema-history.md:46-47

Tests

  • Missing end-to-end proof: Provide fresh-install and v2026.10.2-to-candidate upgrade evidence through shipped entry points, preserving settings, data, resume results, and cursors, with older-build refusal and backup restoration.
Agent review details

How this fits together

Existing shared-state writers persist ACP metadata and receipts; resume lookups and audit pages consume their derived identities, while the PostgreSQL generator translates the canonical schema.

flowchart LR
  A[ACP metadata writers] --> C[Shared state owner]
  B[Receipt and Workshop writers] --> C
  C --> D[Schema v22 migration]
  D --> E[SQLite shared state]
  E --> F[Resume and receipt readers]
  G[Canonical schema] --> H[PostgreSQL DDL generator]
Loading

Technical review

Best possible solution:

Preserve canonical JSON, resume matches, issued cursors, and backup-based rollback through the existing storage owners.

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

This is a portability refactor rather than a runtime bug report; source confirms the SQLite-specific constructs it replaces, and no target code was executed.

Is this the best way to solve the issue?

The implementation follows the approved design by maintaining derived identities in existing writers and replacing the expression-index and runtime rowid paths together.

Full review comments:

  • [P3] Keep the schema 22 row inside the history table — docs/reference/database-schemas/state-schema-history.md:46-47
    The blank line terminates the Markdown table, so schema 22 renders as a pipe-delimited paragraph instead of a version entry. Remove the blank line before this row. This previously reported finding remains unchanged at the reviewed head.
    Confidence: 0.99

Overall correctness: patch is correct
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1fe1e63fe00d.

Provenance checked

  • ACP resume lookup keeps the original intent (0237767: Indexed resume selection avoids synchronous session scans while preserving string matching, backend scope, and ownership checks.)
  • Audit and approval receipt identities keeps the original intent (562391b: Owner-native receipts retain exact execution bindings and bounded opaque selectors; changing their physical identity source preserves that boundary.)
  • Cron lifecycle cursors keeps the original intent (2e9c8f8: Lifecycle receipts project authoritative cron records through exact context and execution bindings rather than correlation by run ID.)
  • Legacy approval repair keeps the original intent (62407b3: Recognizing narrowly enumerated historical schemas repairs startup wedges without accepting arbitrary schema drift.)
  • Workshop ordering keeps the original intent (cfee851: The Workshop owner records changes and orders equal timestamps by insertion identity.)
  • PostgreSQL generation keeps the original intent (050e315: Generation preserves canonical constraints and lazy fragments while explicitly recording ACP indexes pending promotion.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit ac4c248 adds src/acp/runtime/session-meta-write.kernel.ts:21 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ac4c248d7789; files: src/acp/runtime/session-meta-write.kernel.ts)
  • Josh Avant: Raw commit 562391b adds src/audit/execution-decision-facts.ts:234 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 562391b9af3c; files: src/audit/execution-decision-facts.ts)

PR surface

Source +191, Tests +544, Docs +24, Config 0, Other -10. Total +749 across 54 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 27 295 104 +191
Tests 20 630 86 +544
Docs 4 37 13 +24
Config 1 1 1 0
Generated 0 0 0 0
Other 2 2 12 -10
Total 54 965 216 +749

Review metrics

Metric Value Why it matters
Persistent contract Schema 21 → 22; four cursor columns and two ACP projections The accepted design coordinates migration, writers, readers, native version admission, and generated PostgreSQL DDL.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is approved storage preparation without an established urgent user-facing regression.
  • merge-risk: 🚨 compatibility: Schema 22 deliberately fences older builds; the accepted rollback contract restores the verified backup with its matching build.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-12T23:21:58.364Z sha c5525b1e387e33a0f2548b016718afcee6c5adee :: blocked before merge. :: none
  • reviewed 2026-10-13T00:37:25.820Z sha 6541630478581106acf2045c8bfe5a0b58fc0850 :: blocked before merge. :: none
  • reviewed 2026-10-13T00:53:46.021Z sha 6541630478581106acf2045c8bfe5a0b58fc0850 :: blocked before merge. :: none
  • reviewed 2026-10-13T01:32:21.935Z sha ff3bf5b :: blocked before merge. :: [P2] Adapt the older-reader assertion to the v22 boundary | [P2] Build the legacy repair fixture from historical DDL | [P3] Keep the schema 22 row inside the history table
  • reviewed 2026-10-13T02:02:22.470Z sha 754ff2f :: blocked before merge. :: [P3] Keep the schema 22 row inside the history table
  • reviewed 2026-10-13T02:27:33.625Z sha 754ff2f :: blocked before merge. :: [P3] Keep the schema 22 row inside the history table
  • reviewed 2026-10-13T03:05:16.187Z sha 754ff2f :: blocked before merge. :: [P3] Keep the schema 22 row inside the history table
  • reviewed 2026-10-13T03:39:47.133Z sha 649d54a :: blocked before merge. :: [P3] Keep the schema 22 row inside the history table

Reviewed October 12, 2026, 11:46 PM ET / October 13, 2026, 03:46 UTC (Revision 11).

@openclaw-barnacle openclaw-barnacle Bot added the channel: voice-call Channel integration: voice-call label Oct 12, 2026
@steipete
steipete marked this pull request as ready for review October 13, 2026 00:45
@clawsweeper

clawsweeper Bot commented Oct 13, 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.

@steipete
steipete force-pushed the pgprep/p33-pr4b-v22 branch from 6541630 to ff3bf5b Compare October 13, 2026 01:14
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 13, 2026
@steipete
steipete marked this pull request as draft October 13, 2026 02:49
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 13, 2026
@steipete
steipete marked this pull request as ready for review October 13, 2026 04:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T06:55:27.657531Z 94aba42 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 649d54ac75

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// same row. New writes subsequently allocate max(cursor_id) + 1.
// sqlite-allow-raw -- One-time v22 rowid preservation, inside schema maintenance.
db.exec(`CREATE TABLE ${temporary} (cursor_id INTEGER NOT NULL, ${create.slice(create.indexOf("(") + 1)};
INSERT INTO ${temporary} (rowid, ${columns}, cursor_id) SELECT rowid, ${columns}, rowid FROM ${name} ORDER BY rowid;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude generated columns from the migration copy

When a v21 database has a generated column on any affected cursor table, normal runtime/Doctor admission makes readTableColumns() use parsed admitted schema facts, which include generated columns. This INSERT consequently names those columns as write targets and SQLite rejects the upgrade with cannot INSERT into generated column, rolling back the schema migration. The preservation test does not expose this because its raw DatabaseSync is not admitted, so the helper falls back to PRAGMA table_info, which omits generated columns; derive the copy list from writable columns (for example, table_xinfo entries with hidden = 0).

AGENTS.md reference: AGENTS.md:L81-L81

Useful? React with 👍 / 👎.

Use typed string bindings for ACP identity writes and native SQLite string extraction during the v22 backfill. Read resume columns directly and remove the scalar conversion parser.
Restore the schema-owner reuse and Doctor migration description from the reviewed merge commits flattened during the rebase. The migration sources match the previously approved PR head.
Build the legacy kind-repair fixture from the frozen pre-v22 schema. Keep the older-reader proof on row decoding and decision writes through the current database owner instead of asserting the pre-v22 physical schema.
Adapt the retained cron history fixture to the shared-state v22 cursor contract. Preserve main's finalization and retention assertions.
@steipete
steipete force-pushed the pgprep/p33-pr4b-v22 branch from 649d54a to 94aba42 Compare October 13, 2026 06:50
@steipete
steipete merged commit 1f0deff into main Oct 13, 2026
244 of 255 checks passed
@steipete
steipete deleted the pgprep/p33-pr4b-v22 branch October 13, 2026 07:18
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…law#170280)

Promote shared-state receipt cursors and ACP resume selectors to explicit portable columns while preserving historical identities, opaque cursors, and v21 upgrade behavior. Keep promoted resume values in the existing ACP metadata writer.

Adapt the retained cron-history fixture to the v22 cursor contract.

Validation: exact-head PostgreSQL conformance, canonical/Workboard generation, focused cron finalization proof, formatting, lint, and Codex review. CI is admitted under the documented unrelated-failure exception for mocked UI timeouts, provider credential fixture admission, and memory-index assertions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: voice-call Channel integration: voice-call commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant