Skip to content

feat(storage): support read-only PostgreSQL standby inspection - #192645

Merged
roboclaw-bot merged 4 commits into
mainfrom
roboclaw/native-postgres-readonly-20261104
Nov 4, 2026
Merged

roboclaw-bot merged 4 commits into
mainfrom
roboclaw/native-postgres-readonly-20261104

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Rolling Gateway candidates need to inspect an existing PostgreSQL state companion without creating anchors, migrating schemas, or modifying its data.

User Impact

This is an internal prerequisite; it adds no user-facing command or configuration. Existing writer behavior is unchanged. Read-only admission requires existing, current, sealed stores and refuses incompatible or unsealed sources rather than repairing them.

Why This Change Was Made

Carry read-only selection through the existing database and worker owners, separate reader and writer connection reuse, and enforce reader statements inside PostgreSQL read-only transactions. Single-statement extended queries prevent a batch from ending the protected transaction before a mutation. The native transaction owner retains its snapshot and rollback lifecycle. No database schema/version or durability setting changes.

This is the first coherent slice of native rolling handoff, not a claim that rolling release is available yet. The supervisor, durable handoff relationship, companion binding, activation and recovery implementation remain a dependent change.

Original foundation validation

  • Real PostgreSQL 17.11 regressions verify missing-anchor refusal, sealed-schema admission, unchanged metadata, data/DDL mutation refusal, version-change refusal, and an ordinary writer continuing to work beside a reader.
  • Fresh review found that setting only default_transaction_read_only was insufficient. The pre-repair candidate reproduced the defect: changing that default let an INSERT succeed. The repaired source rejects the same mutation, rejects transaction upgrades, and rejects combined writable batches without changing stored rows.
  • Repaired admission plus connection/pool siblings: 39 passing tests. Final direct transaction-upgrade case: all 4 admission tests passed. Earlier current-main split selection/worker/pool run: 27 passed. These runs overlap; they are not a summed unique-test count.
  • Async context, worker handoff, process selection identity and reader/writer pool-key isolation retain focused coverage. Default PostgreSQL conformance discovery includes the new admission test.
  • Independent P0–P2 review of the repair completed two passes with no findings. A supplemental single-pass review received all changed modules plus complete statement-cache/transaction/pool owners and closed the initially missing source-context coverage with no findings.
  • A separate 234-line test allocation covers these distinct contracts; the shared baseline is unchanged.

The disposable database was stopped and removed. This is actual PostgreSQL/native-owner evidence, not a live deployment, model inference, or completed rolling-handoff claim. Full pnpm build passed in 4m 38.8s, including 102 plugins, unified declarations, UI and final package checks. Current core and explicit changed-test-leaf typechecks, typed lint for all14 TypeScript files, formatting, whitespace and the full-PR staged test-line gate passed. The initial temporary test-project rootDir error was corrected in its task-local configuration; only the subsequent successful explicit-leaf run is counted.

Historical integrated native CLI qualification

After publication, the unchanged foundation was exercised by its dependent rolling-handoff candidate through real pnpm openclaw subprocesses in a task-owned container with PostgreSQL 17.11. This is composition evidence, not an assertion that this prerequisite alone exposes a rolling command.

Source binding: the published foundation is c8b40af4b4c0bc3998dbb218b9fbaa22b4b2e1e5; the executed integrated Git tree is 000e15dfcda259a83d10ea632d7fac76d9ee70c5. All 14 foundation source/test files were compared as Git blobs and match exactly. The dependent implementation supplies the CLI/supervisor and companion consumer; it does not replace this PR's database admission or PostgreSQL bridge.

The completed happy-path run started the native predecessor, prewarmed the candidate without creating companion state, used native backup/create and restore, and bound the restored companion in read-only mode. The candidate stayed non-listening while inspecting the real database. It refused writer acquisition before the predecessor yielded and refused activation while the predecessor remained alive. After exact predecessor retirement it acquired writer custody and served readiness. Durable PostgreSQL journal reads verified the recorded owner and lifecycle transitions.

Four additional native CLI runs passed: candidate death after writer preparation with predecessor recovery, both exact processes dying followed by cold recovery, mismatched final-companion plan refusal without writer custody, and supervisor EOF during activation with owned-process settlement. Each recorded exit 0; these are five scenarios, not live inference or an installed cloud release. Initial fixture failures (port/config mismatch and missing unaccent prerequisite) occurred before the product scenarios and remain excluded from passing evidence. Task-owned CLI and PostgreSQL containers are absent after cleanup.

The later invocation-selector/extraction work belongs to the dependent PR and requires its own fresh qualification. This evidence retains the exact earlier executing tree above. The original real PostgreSQL mutation/default-override regressions and current-head CI remain separate evidence for this foundation.

Historical built-SDK proof and transport regression (9c44af6)

The follow-up changes tests only; production remains byte-identical to published c8b40af4b4c0bc3998dbb218b9fbaa22b4b2e1e5. It replaces the helper-key comparison with real PostgreSQL backend checkout/reuse coverage. Writer and reader backend IDs differ; closing/reopening each role reuses its own backend, readers cannot mutate, and a writer update remains readable. Removing only the role bit from the production reuse key makes this test fail at the intended assertion: both roles return backend PID83. The original production file was restored byte-for-byte before final validation. This is an ablation control, not a historical-main execution claim.

Final local validation:

  • Real PostgreSQL17.11 admission/prestart suites: 5 + 8 tests passed, 40.00s total runner time; the actual new reuse case took67ms. After the fixture was corrected to the API's true-or-omitted input shape, the affected case passed again (32.45s including compilation; four unrelated cases intentionally filtered).
  • The actual owning state/logging test typecheck, typed lint on all3 changed TypeScript files, formatting, whitespace and full-PR test-line gate pass. Allocation is234 net lines; the shared baseline stays unchanged. The initial boolean-false fixture type error is fixed, not waived.
  • Fresh final independent P0–P2 review: one complete pass, scoped-clean, zero actionable findings. The earlier review did not substitute for the final owning typecheck.
  • Full pnpm build exited0 in4m35.5s. Nonfatal UI size warnings remain recorded; this is not a claim that those separate size budgets passed.

A separate ordinary Node process consumed the built public package exports, with database work in a real Node worker. It uses no private TypeScript imports, Vitest fixture, mocked database, factory replacement or caller-authority injection. Its package/source is the recorded production revision above; the earlier 9c44af6 follow-up was test-only. The later cached-seal production repair is qualified separately below. The probe refuses a source-only export that does not resolve into dist. This is a built-package SDK consumer, not an installed-npm-package or deployment claim.

The disposable PostgreSQL connection was prepared through the repository's canonical conformance runner. The process was run with a fresh task-only HOME/state/config/temp environment and the two explicit inputs OPENCLAW_STATE_DIR (fresh state directory) and READONLY_PROOF_CONNECTION (owned disposable PostgreSQL). The complete driver and exact observed output follow, so the evidence does not depend on the previously reported unpublished integrated tree.

Complete public-SDK probe
import assert from 'node:assert/strict';
import fs from 'node:fs/promises';
import path from 'node:path';
import { Worker, isMainThread, parentPort, workerData } from 'node:worker_threads';
if (isMainThread) {
  const root = path.resolve(process.env.OPENCLAW_STATE_DIR);
  await fs.mkdir(root, { recursive: true });
  const worker = new Worker(new URL(import.meta.url), { workerData: { root, connection: process.env.READONLY_PROOF_CONNECTION } });
  try {
    const result = await new Promise((resolve, reject) => {
      worker.once('message', resolve); worker.once('error', reject);
      worker.once('exit', code => { if (code !== 0) reject(new Error('SDK worker exited '+code)); });
    });
    console.log(JSON.stringify(result));
  } finally { await worker.terminate(); }
} else {
  const sdk = import.meta.resolve('openclaw/plugin-sdk/database-engine-worker-runtime');
  assert(sdk.includes('/dist/'), 'Consumer must use the built public package export');
  const { openEngineStore, withEngineStoreAdmission } = await import('openclaw/plugin-sdk/database-engine-worker-runtime');
  const { openNodeSqliteDatabase, admitSqliteSchema } = await import('openclaw/plugin-sdk/sqlite-worker-runtime');
  const anchor = openNodeSqliteDatabase(path.join(workerData.root, 'anchor.sqlite'));
  const schema = { id: 'readonly_sdk_probe', version: 1, sqlite: '', postgres: 'CREATE TABLE items (id BIGINT PRIMARY KEY, value TEXT NOT NULL)' };
  const opened = [];
  const result = withEngineStoreAdmission(() => {
    const open = readOnly => {
      const db = openEngineStore({ anchor, schema, input: { connection: workerData.connection, schemaPrefix: 'readonly_sdk', ...(readOnly ? { readOnly: true } : {}) }, reusePostgresConnection: true,
        openSqlite() { throw new Error('Unexpected SQLite fallback'); }, prepareAnchor() {},
        inspectSqlite() { admitSqliteSchema(anchor); return { hasExistingData: false, hasEngineAnchor: anchor.prepare("SELECT name FROM sqlite_schema WHERE name = 'openclaw_engine_anchor'").all().length === 1 }; }
      }); opened.push(db); return db;
    };
    try {
      const writer = open(false);
      writer.exec("INSERT INTO items VALUES (1, 'before')");
      const writerPid = writer.prepare('SELECT pg_backend_pid() AS pid').get().pid;
      writer.close();
      const reader = open(true);
      const readerPid = reader.prepare('SELECT pg_backend_pid() AS pid').get().pid;
      assert.notEqual(readerPid, writerPid);
      assert.deepEqual(reader.prepare('SELECT * FROM items').all(), [{ id: 1, value: 'before' }]);
      assert.throws(() => reader.exec("UPDATE items SET value = 'forbidden'"), /read.only/i);
      reader.exec('SET default_transaction_read_only = off');
      assert.throws(() => reader.exec("INSERT INTO items VALUES (2, 'forbidden')"), /read.only/i);
      reader.close();
      const nextWriter = open(false);
      assert.equal(nextWriter.prepare('SELECT pg_backend_pid() AS pid').get().pid, writerPid);
      nextWriter.exec("UPDATE items SET value = 'after'"); nextWriter.close();
      const nextReader = open(true);
      assert.equal(nextReader.prepare('SELECT pg_backend_pid() AS pid').get().pid, readerPid);
      assert.deepEqual(nextReader.prepare('SELECT * FROM items').all(), [{ id: 1, value: 'after' }]);
      assert.throws(() => nextReader.exec('DELETE FROM items'), /read.only/i);
      nextReader.close();
      const cleanup = open(false); const namespace = cleanup.prepare('SELECT current_schema() AS schema').get().schema; cleanup.exec('DROP SCHEMA "'+namespace.replaceAll('"','""')+'" CASCADE');
      return { result: 'PASS', surface: 'built public database-engine-worker-runtime SDK in a real Node worker', writerPid, readerPid, sameRoleReused: true, crossRoleDistinct: true, readerMutationAndDefaultOverrideRejected: true, persistedRows: [{ id: 1, value: 'after' }], schemaRemoved: true };
    } finally { for (const db of opened) db.close(); anchor.close(); }
  });
  parentPort.postMessage(result);
}

Observed stdout (process exit0):

[postgres] PostgreSQL worker other (thread 1) has no inherited pool; starting its own four I/O services.
{"result":"PASS","surface":"built public database-engine-worker-runtime SDK in a real Node worker","writerPid":102,"readerPid":103,"sameRoleReused":true,"crossRoleDistinct":true,"readerMutationAndDefaultOverrideRejected":true,"persistedRows":[{"id":1,"value":"after"}],"schemaRemoved":true}

The driver SHA-256 is 1c04bdf2fc91e4bea11edb111cc0f849d226073cef15c169798dbc6bcf2095b0; output SHA-256 is 5339eac954f021590233d15b31ae092323f6fa55d6f1f48a0ef1229fb7f699b5. The probe removed its schema, its Node process exited, the task-owned PostgreSQL container was stopped and removed, and the selected loopback port was confirmed closed. No external inference, cloud provisioning, live Gateway change, or released rolling activation is claimed.

Cached schema-seal repair and qualification

Fresh review of 9c44af6dcc1 found a real defect: an existing-version inspection could cache compatible but unsealed physical facts, then a strict read-only open could reuse them without checking the installed seal. This follow-up fixes that production owner; the earlier SDK and dependent CLI runs above remain evidence for their recorded source revisions, not a claim that those complete programs were rerun on this follow-up.

The existing physical-admission facts now retain the matching schema hash returned by the existing verify/record owner. Strict cached readers require that evidence to match requested DDL, the retained catalog and installed dynamic search extensions. Unsealed inspection publishes no seal evidence. Dynamic search publication refreshes the same owner-held fact. No parallel cache, hot-path SQL probe, schema migration, new configuration, read-only metadata repair, or connection-pool change is added.

Executed source-bound evidence:

  • Actual PostgreSQL/openEngineStore regression on base 9c44af6dcc1: refuses cached unsealed inspection facts without modifying metadata failed because no matching-seal rejection occurred. Retained-fact assertions ensure the cache boundary was exercised; this was a product failure, not a setup failure.
  • Frozen repaired source: 24/24 readonly/schema/physical-fact tests; 14/14 context/worker propagation tests. Same-version DDL mismatch is rejected; sealed inspection reuse and unchanged metadata remain covered.
  • Separate isolated PostgreSQL 17.11, actual pgvector 0.8.7, unaccent1.1 and pg_trgm1.6: 6/6 search-extension tests passed through wrapper completion, including dimension refusal, rollback, tamper readmission and dynamic keyword-extension reader reuse.
  • Canonical inventory 10/10, additional routing 12/12, core types, scoped typed lint/format/whitespace, and full-PR 274-line test allocation passed. The parent integrated all eight source files byte-exact and replayed the cumulative allocation gate: 6456997 / 6456997.
  • Fresh independent P0–P2 review, complete 23-module source context: scoped-clean, no actionable findings. It did not execute tests; the execution results above are separate.
Original cached-unsealed regression:
Tests  1 failed | 5 skipped (6)  # five intentionally filtered siblings

Frozen repair:
Test Files  3 passed (3)
Tests  24 passed (24)
[test] passed 1 Vitest shard in 89.71s

Actual pgvector sibling:
Test Files  1 passed (1)
Tests  6 passed (6)
[test] passed 1 Vitest shard in 507.55s

The initial broad sibling run lacked pgvector; the qualified separate database closed that gap. An earlier pgvector attempt passed its assertions but timed out during generation-integrity closeout, so only the subsequent complete wrapper exit0 is counted. An optional broader CI-plan suite timed out and is not claimed green. Owned PostgreSQL servers, container and volume were stopped/removed; no live Gateway or cloud resources were used.

CI allocation correction

The seal repair at cbef96020e2 received overall Platinum4/6, proof Platinum4/6 and patch Diamond5/6, with no actionable findings. The subsequent follow-up changes only the allocation number below; every runtime and test source byte remains unchanged.

The exact CI composition e4717a100d1a5e0074fb49c50d1681f03f56ef65, based on db7e1e06c3a35a29dc13b5faec2d5589727a4ec4, adds 295 test lines. The original274 allowance passed locally using21 lines of available baseline slack. This follow-up allocates the actual295-line PR delta. It changes no shared baseline, test assertion, timeout or ignore rule.

The canonical checker and its input owner are byte-identical across the source/base/CI merge. Running that checker against isolated exact-tree Git indexes showed:

Exact CI base: 6463257 lines; ceiling6463195; over62; delta0.
Exact CI merge: 6463552 lines; ceiling6463469; over83; delta+295.
Same merge with allocation295: 6463552 lines; ceiling6463490; over62; delta+295.
Published-source cumulative check against original merge base:
Test lines OK: 6456997; ceiling6457018; slack21.

Thus the PR-specific21-line shortfall is corrected; the independently demonstrated62-line baseline deficit is retained, not hidden or claimed green. Fresh-head CI still governs current status.

The separate provider-scaffold workflow on the preceding head failed downloading the OpenClaw npm archive. Its one documented failed-job recovery attempt also timed out at the same download. Both attempts are retained as failures; no further manual retry, timeout change, runner change or credential change was made. This is separate from the PostgreSQL/runtime proof.

Current-head CI attribution

Exact head a90edfa7576f00ce1e7eb9f7e95223816f2cc574 has overall Platinum (4/6), proof Platinum (4/6) and patch Diamond (5/6) with no actionable findings.

CI run 41830503705, attempt 1 completed all 80 jobs. The only underlying failure is checks-fast-baseline-ratchets, specifically the test-line budget; all other ratchet subchecks and security-fast passed. The aggregate CI gate and its same-name status remain failed. Provider-scaffold validation passed on this head; older download-timeout attempts remain historical.

The job executed merge 179648ce85874bb2722e716f289155934063e3fa, with baseline d0925efdbb1ec9d3c6f4ef494b7d444ae7e91ebe and this exact PR head. Immutable-index replays using identical canonical checker/helper/loader blobs measured:

Tree Test lines Ceiling Deficit Exit
Exact CI base 6,463,454 6,463,392 62 0
Exact CI merge 6,463,749 6,463,687 62 1

This PR adds 295 lines and exactly 295 allocation. The 62-line deficit is inherited and unchanged. The base returns 0 under the checker's explicit no-growth exception; this is not a claim that the baseline command failed. The informational classification says “new” because scheduled main passed without scope comparison; the exact-tree calculation explains that distinction. Local Node26 differs from CI Node24, but these static totals exactly reproduce CI.

No budget, ignore or baseline waiver was added. The native documented inherited-failure route is being used under the standing scoped land instruction; failed CI is retained, and review, source, attribution and security checks remain enforced. Historical SDK/CLI and later PostgreSQL seal proof retain their original source identities and limits above.

Keep PostgreSQL standby admission noncreating and nonmigrating, isolate reader transports, and enforce reader statements within read-only transactions. Preserve ordinary writer behavior.

Co-authored-by: galiniliev <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. 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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 4, 2026
@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Adds noncreating, nonmigrating PostgreSQL inspection with sealed-schema admission and enforced read-only execution.

Example: Inspect an existing sealed store containing items row 1 with value 'before'.

  • Before: The engine has no enforced read-only admission mode and can enter writable schema preparation.
  • After: The reader returns 'before', rejects INSERT and ALTER statements, and leaves schema metadata unchanged.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused implementation with credible production-entry evidence and distinct regressions; the later seal repair has source-bound PostgreSQL qualification rather than a repeated complete SDK run.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The built public SDK probe exercises actual Node workers and PostgreSQL for reads, role-isolated reuse, rejected mutations, and writer persistence; later source-bound PostgreSQL regressions cover cached unsealed facts and dynamic extensions, without claiming the earlier complete SDK program was rerun.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Rolling Gateway candidates need to inspect existing PostgreSQL companions without creating anchors, migrating schemas, or changing stored data.
Reason: The collaborator-authored direction supplies a bounded prerequisite through existing owners and explicitly leaves rolling activation to dependent work.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR supplies a coherent read-only inspection capability, with no actionable defect found; exact-head CI remains pending.

Priority: P2
Reviewed head: a90edfa7576f00ce1e7eb9f7e95223816f2cc574

Before merge

None.

Findings

None.

Agent review details

How this fits together

Database selection flows through the existing engine opener and worker bridge to PostgreSQL; callers receive admitted connections and query results.

flowchart LR
A[Database selection] --> B[Engine opener]
B --> C[Anchor and schema admission]
C --> D[Role-separated transport pool]
D --> E[PostgreSQL bridge]
E --> F[Read-only transaction]
F --> G[Existing sealed store]
Loading

Technical review

Best possible solution:

Retain this focused foundation in the existing database owners and complete its exact-head CI gates before landing.

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

This is a capability addition; supplied real PostgreSQL and built-SDK evidence exercises the intended reader and rejection paths, and no target code was executed during this review.

Is this the best way to solve the issue?

The change uses the existing admission, transport, transaction, and publication owners without introducing a competing lifecycle or persistent model.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 87495305c729.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned introduction and latest revision: Reviewed merge-base-to-head changes; the latest commit only raises the separate test allocation from 274 to 295, leaving runtime and test sources unchanged from the preceding reviewed head. (config/test-lines-allocations/postgres-readonly-admission.txt:2, a90edfa7576f)
  • Reader enforcement: Reader connections use explicit read-only transactions, establish a snapshot before caller statements, and use single-statement extended queries; writer batching remains unchanged. (src/infra/postgres-sync/bridge.worker.ts:228, a90edfa7576f)
  • Earlier seal finding resolved: Cached strict admission now requires matching verified seal evidence, requested DDL, physical identity, version, and installed search extensions; dynamic extension publication refreshes the same fact owner. (src/infra/database-engine/physical-facts.ts:51, a90edfa7576f)
  • Complete public proof: The full PR body contains a built-public-SDK Node-worker probe and observed PASS output for distinct reader/writer backends, same-role reuse, mutation/default-override rejection, and persisted writer updates; later source-bound PostgreSQL regressions qualify the cached-seal repair separately. (a90edfa7576f)
  • Compatibility and intentional scope: The collaborator-authored direction adds an optional SDK input and deliberately refuses incompatible or unsealed inspection sources; existing callers retain writer behavior, and no persisted schema or version changes. (src/infra/database-engine/types.ts:8, a90edfa7576f)
  • Current main lacks this capability: Fetched main still returns retained physical facts without the new seal binding and sends queries directly through the statement cache without a reader-mode enforcement path. (src/infra/database-engine/physical-facts.ts:47, 87495305c729)

PR surface

Source +108, Tests +296, Other +2. Total +406 across 19 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 12 130 22 +108
Tests 6 302 6 +296
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 19 434 28 +406

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A useful internal storage prerequisite with limited immediate user exposure.
  • merge-risk: 🚨 compatibility: Adds an optional public SDK admission input; the maintainer-authored direction accepts strict reader refusal while omitted inputs preserve existing writer behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 (4 earlier review cycles)
  • reviewed 2026-11-04T08:20:40.501Z sha c8b40af :: needs maintainer review before merge. :: none
  • reviewed 2026-11-04T08:45:11.775Z sha c8b40af :: needs maintainer review before merge. :: none
  • reviewed 2026-11-04T09:09:46.886Z sha 9c44af6 :: needs changes before merge. :: [P2] Require matching seal evidence when reusing physical facts
  • reviewed 2026-11-04T12:32:02.568Z sha cbef960 :: needs maintainer review before merge. :: none

Reviewed November 4, 2026, 7:41 AM ET / 12:41 UTC (Revision 5).

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 4, 2026
Replace the implementation-coupled key assertion with real backend reuse, role separation, persistence and mutation checks.

Co-authored-by: galiniliev <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 4, 2026
Retain matching installed seal evidence on the existing physical admission owner and refresh it after dynamic search extension publication. Refuse unsealed inspection facts and incompatible same-version DDL without adding hot-path SQL probes.

Co-authored-by: galiniliev <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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 Nov 4, 2026
The exact CI composition adds 295 lines. The earlier 274-line allowance relied on 21 lines of baseline slack. Allocate only the full PR delta; preserve the separately reproduced 62-line baseline deficit.

Co-authored-by: galiniliev <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@roboclaw-bot
roboclaw-bot merged commit cf50d4a into main Nov 4, 2026
149 of 152 checks passed
@roboclaw-bot
roboclaw-bot deleted the roboclaw/native-postgres-readonly-20261104 branch November 4, 2026 15:42
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

steipete added a commit that referenced this pull request Nov 4, 2026
Limit prompt history baselines by estimated bytes as well as session count. Release Tokenjuice compiled rules after bounded distinct workspace contexts while preserving stable-working-set reuse and project rule precedence.

Add 103 regression-test lines for retained-history growth, packaged rule retention, and concurrent failure cleanup. Focused tests pass and Codex autoreview is clean through P2. check:changed fails only on baseline unused exports introduced in #192645 and #192766. Measured eviction and first-cleanup latency tradeoffs are recorded for owner acceptance in the PR.
steipete added a commit that referenced this pull request Nov 4, 2026
…192944)

Limit prompt history baselines by estimated bytes as well as session count. Release Tokenjuice compiled rules after bounded distinct workspace contexts while preserving stable-working-set reuse and project rule precedence.

Add 103 regression-test lines for retained-history growth, packaged rule retention, and concurrent failure cleanup. Focused tests pass and Codex autoreview is clean through P2. check:changed fails only on baseline unused exports introduced in #192645 and #192766. Measured eviction and first-cleanup latency tradeoffs are recorded for owner acceptance in the PR.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 5, 2026
…law#192645)

* feat(storage): support read-only PostgreSQL standby inspection

Keep PostgreSQL standby admission noncreating and nonmigrating, isolate reader transports, and enforce reader statements within read-only transactions. Preserve ordinary writer behavior.

Co-authored-by: galiniliev <[email protected]>

* test(storage): verify PostgreSQL reader and writer transport reuse

Replace the implementation-coupled key assertion with real backend reuse, role separation, persistence and mutation checks.

Co-authored-by: galiniliev <[email protected]>

* fix(storage): bind cached read-only admission to verified schema seals

Retain matching installed seal evidence on the existing physical admission owner and refresh it after dynamic search extension publication. Refuse unsealed inspection facts and incompatible same-version DDL without adding hot-path SQL probes.

Co-authored-by: galiniliev <[email protected]>

* test(storage): account for all read-only admission test lines

The exact CI composition adds 295 lines. The earlier 274-line allowance relied on 21 lines of baseline slack. Allocate only the full PR delta; preserve the separately reproduced 62-line baseline deficit.

Co-authored-by: galiniliev <[email protected]>

---------

Co-authored-by: galiniliev <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 5, 2026
…penclaw#192944)

Limit prompt history baselines by estimated bytes as well as session count. Release Tokenjuice compiled rules after bounded distinct workspace contexts while preserving stable-working-set reuse and project rule precedence.

Add 103 regression-test lines for retained-history growth, packaged rule retention, and concurrent failure cleanup. Focused tests pass and Codex autoreview is clean through P2. check:changed fails only on baseline unused exports introduced in openclaw#192645 and openclaw#192766. Measured eviction and first-cleanup latency tradeoffs are recorded for owner acceptance in the PR.
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
)

* fix(plugins): portable plugin-state keys for PostgreSQL

Use an exclusive SQL lower bound for Doctor pagination instead of a NUL-suffixed cursor. Reject new NUL keys in test-only plugin-state fixtures while retaining legacy SQLite adoption reads.

Add real PostgreSQL Doctor regression coverage and register it in conformance and database-worker lanes. Refs openclaw#184862 openclaw#188642.

* test: account for rebased plugin-state coverage

* test(clickclack): import legacy revocations before adoption

(cherry picked from commit 395cac7)

Release adaptation: Only exclusive SQL lower bound in kernel and Doctor pagination; preserve legacy SQLite keys and public validation. Regression exercises real Doctor paging and inspected executed SQL bindings; no NUL-key fixture policy, schema or unrelated tests.

Follow-up dispositions: 8253356 fix: preserve child results after source lifecycle changes (openclaw#202708); f3f89c7 fix: show saved child results when completion delivery fails (openclaw#202664); c45faa8 fix: align CI tests with admitted tool calls (openclaw#202655); 5c9389a fix: make channels add report required plugin install failures (openclaw#202091); 52b9188 fix: show hosted model details in `models list` without a Gateway (openclaw#202490); d248a76 fix: show an outcome when kept child chats return no answer (openclaw#202423); 5148804 fix(discord): check a queued message's access again when its turn starts (openclaw#202330); 2470d62 fix: let setup use account models with a fresh catalog (openclaw#202019); 9fa0b92 fix: let PostgreSQL Gateways start with plugin-backed secrets (openclaw#201063); c180824 fix(plugins): Talk and plugin-loading requests fail on PostgreSQL Gateways (openclaw#201976); cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 17c5fb0 fix(state): PostgreSQL state created before Template bootstrap deferral is refused as schema drift (openclaw#197425); b5c1277 fix: let resumed parents collect children stopped by restart (openclaw#201460); f920a7e chore(postgres): qualify cron completion during graceful shutdown (openclaw#201246); 1680f54 fix(openai): new ChatGPT subscription models missing until an OpenClaw release (openclaw#201130); 0d8820a fix(media): image descriptions use the ChatGPT OAuth route when OpenAI has no API key (openclaw#199299); ee3e16e test(agents): trim and fold low-value regression suites (openclaw#198916); b8029b4 test(agents): qualify PostgreSQL simple-completion acquisition (openclaw#200956); 703c82d fix(sessions): record queued input end causes and recover them across crashes (openclaw#200533); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); d565e17 fix(ci): retire deleted session fork test from inventory (openclaw#200611); 4cf12c6 chore(postgres): qualify prompt refresh and rebalance CI (openclaw#200488); d460273 fix(templates): release earlier Template-managed agents (openclaw#200303); ff75829 fix(update): --no-restart update fails when the Gateway restarts itself during Doctor's stop (openclaw#200181); 0b2ad60 chore(postgres): cover compaction watched-session prompts (openclaw#200117); b90c573 test: consolidate redundant coverage (198795 recut) (openclaw#198943); a042363 test: consolidate redundant coverage (198793, part 2) (openclaw#198936); 9bfad2b test: consolidate suites while retaining recovery owners (openclaw#198933); 4e9812c test: consolidate redundant coverage (198789, part 2) (openclaw#198932); 90814f5 fix(subagents): stops a finished sub-agent's chat being deleted before its parent reads the result; 799bc0b fix(ci): stabilize hourly fixtures and retire unused exports (openclaw#199851); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); a4cc2ad fix: undo cold-session compaction CPU and latency regressions (openclaw#199561); 55fec79 fix(agents): stop divergent mid-turn overflow recovery (openclaw#199636); 2c4413a fix: reduce Gateway stalls under filesystem pressure (openclaw#197510); 37d977f fix: output reducers are skipped in headless and Code Mode runs (openclaw#199434); c9ee264 fix(compaction): concurrent sessions wait for each other's summaries during compaction (openclaw#196550); 2471ddc feat: let agents review generated images before delivery (openclaw#198227); 21f7dc6 fix(github): publication fails with PostgreSQL session or state stores (openclaw#193749); 63d9e57 fix(ci): new PostgreSQL suites are omitted from conformance (openclaw#198390); 466a4b6 fix(telegram): steered answers quote the wrong input (openclaw#178124); 87b6f52 fix(delivery): resend routed Telegram finals after an ambiguous network failure (openclaw#192779); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); cff99b2 fix(agents): keep provider history append-only across runs (openclaw#197874); 8a328bf feat: add an opt-in usage-ranked tool index (openclaw#197128); 097e648 fix(ci): plan only executable infra tests (openclaw#197911); 76385fd fix(models): discovered models become "Unknown model" after restart or an ended sign-in (openclaw#197784); 89d4177 fix(plugin-state): guarded calls fail until Gateway restart after an unknown write outcome (openclaw#197790); baca36e fix(sessions): commit selected invitations with original messages (openclaw#184512); 699e538 fix(sessions): drain passive notices on sessions_send resumes; d6ded18 chore(ci): drop retired test-lines allocation records (2/3) (openclaw#197656); e0dd020 fix(agents): collect process results at suspended-run capacity; 4897740 feat(auth): preserve delegated OCE user profiles and permissions (openclaw#196856); 7197ce1 feat(templates): install bundled plugins through native management (openclaw#196349); 9c6ee9b feat: let Template automations start paused for onboarding (openclaw#196323); 79a6214 fix(message): retain local final replies in conversation history (openclaw#187795); caa978c feat(templates): open durable chat before verified setup (openclaw#196392); 78e73aa fix(sessions): cold PostgreSQL conversations fail after idle readers close (openclaw#189991); b6ed907 perf(sessions): persist active transcript facts for hydration (openclaw#193682); 1595dd2 feat(plugins): reauthorize accepted session work (openclaw#176886); b43ad0a fix(models): avoid reloading plugins on catalog refresh (openclaw#193903); 0947d02 fix(ci): avoid unrelated PostgreSQL runs and admit owned tests (openclaw#193870); 428ca7d feat(openclaw-id): add Gateway membership authority and publication behind the Labs flag (openclaw#192335); c718583 fix(update): repair refuses forever after a verified update fails a later step (openclaw#193132); 3f64174 fix: deliver background replies after a reload retires the turn registry (openclaw#193130); 982f3b1 fix(imessage): report Automation failures after Gateway updates (openclaw#186117); 31b28e9 fix(agents): wait for a peer OAuth refresh before failing request auth (openclaw#192906); cf50d4a feat(storage): support read-only PostgreSQL standby inspection (openclaw#192645); 82fd4e6 fix(agents): retain stale session target refusal reasons (openclaw#192681); 8ac4e19 fix(worktrees): reserve capacity on PostgreSQL (openclaw#192537); 718b349 fix: reduce session startup stalls under storage contention; 08f4a19 refactor(skills): move Skill Workshop into its bundled plugin (openclaw#192471); 837402a fix(clawrouter): keep upstream credit failures off the shared key (openclaw#192575); f38495f fix(plugins): reject late routing from canceled runs (openclaw#192492); dc5d61a improve(sessions): reduce unnecessary maintenance query rows (openclaw#192023); c4bf0dc fix(sessions): avoid extra maintenance scans for embedded archives (openclaw#184507); e44b3d6 fix(team-reports): recover after database connection loss (openclaw#192020); 991fb33 fix(logbook): recover after database connection loss (openclaw#192011); e6d0d2e fix(test): include omitted PostgreSQL conformance suites (openclaw#191962); da5ff0f fix(codex): reject native hooks from a previous run (openclaw#191788); 09f0b0b feat(plugins): add skill usage runtime for plugins (openclaw#191661); 00b2ff4 fix: parent sessions miss child approvals with a custom session store (openclaw#189827); be44b10 fix: stop completed session writes retaining request data (openclaw#191197); d40aa7c fix(sessions): replay creation requests across Gateway restarts (openclaw#190862); d894035 fix: await Doctor shared-state repair preparation (openclaw#190875); b515cc7 feat: fork threaded conversations with Telegram support (openclaw#190783); def6349 feat(plugins): plugins can run a hidden forked turn of a session with their own tools (openclaw#190950); d983e34 feat(plugins): plugin commands can continue the agent with a replacement prompt, on every channel (openclaw#190908); ea3f0b8 fix(ci): provision Node test prerequisites and retain Baseten routing (openclaw#191050); 29503e1 fix(update): Gateway stays stopped after the updater process dies mid-update (openclaw#188497); fc8c2d0 fix(update): preserve unfinished handoff artifacts (openclaw#190571); 7c26e8c fix(ci): cover PostgreSQL managed update handoffs (openclaw#190336); 4913d41 fix(ci): prevent truncated PostgreSQL target listings (openclaw#189509); 8925f62 fix(gateway): start restored PostgreSQL homes on the first attempt (openclaw#190291); 177fe32 feat(models): preserve inference capabilities in opt-in catalog v3 (openclaw#189678); 7faf32d feat: retain repository disk authority through recovery (openclaw#189106); a658df3 feat(database): capture externally quiesced SQLite migrations; 0f9e7f7 feat(database): capture exact SQLite migration capsules; 4fb684e feat(backup): add PostgreSQL local companion checkpoints; c89a101 fix(doctor): migrate auth profiles on PostgreSQL stores (openclaw#189639); 799de09 fix(ci): split oversized workspace and setup files (openclaw#189356); 21ee847 fix(acp): keep completed run conversations resumable (openclaw#189273); fce0e56 perf(sessions): open cold history without restoring archives (schema 39) (openclaw#188397)

Validation: Baseline1 NUL-binding assertion failure/21passing; candidate22/22passes (188693-green.log). Real SQLite Doctor path and generated SQL proved; no native PostgreSQL server execution claimed.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 0895146d8c1493146f5c6461eee0b10c329bdd1e)
(cherry picked from commit f8ccaa70bc9773d6bbb569bc0e275eee0c544ead)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. size: M 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