Skip to content

Durable Core PR 6/6: add read-only durable inspection - #111487

Closed
mjnkao wants to merge 26 commits into
openclaw:release/2026.7.1from
mjnkao:codex/durable-core-pr6-operations-v2
Closed

mjnkao wants to merge 26 commits into
openclaw:release/2026.7.1from
mjnkao:codex/durable-core-pr6-operations-v2

Conversation

@mjnkao

@mjnkao mjnkao commented Jul 19, 2026 •

Copy link
Copy Markdown

Durable Core stack context

This is PR 6/6. Its incremental role is to add bounded read-only Gateway and CLI inspection; no new schema, config, recovery owner, or mutation authority.

End state

The series targets infrastructure-level agent silence on supported OpenClaw
7.1 paths. Accepted long-running or delegated work should retain durable
identity, parent/owner attention, recovery state, and replay-safety evidence
across Gateway restart, process interruption, context overflow/compaction,
delayed children, stale claims, and ambiguous handoffs. The intended result is
truthful recovery or an explicit owner-decision/uncertainty state, not silent
loss and not blind replay.

This is not a promise that every agent will always produce a useful response.
It does not resume an arbitrary operating-system process, guarantee exactly-once
external effects, prove delivery through every transport, or replace profile,
skill, prompt, and model quality.

Official 7.1 baseline and residual gap

Official 7.1 already has authoritative lifecycle owners for tasks and task
delivery, Task Flow runs, subagents, outbound and session delivery queues,
leases, sessions, ACP, restart/boot, conversation bindings, audit, diagnostics,
and the shared SQLite schema. This stack keeps those owners authoritative.

The residual gap appears when a fact crosses owners. No single official 7.1
owner can safely answer all of these questions without taking authority from
another owner:

  • which parent, session, or owner must receive attention for accepted work;
  • which task, flow, subagent, session, delivery, and generic execution facts
    refer to the same run;
  • whether a handoff was accepted, consumed, owner-acknowledged, or externally
    delivered;
  • whether work left running after process loss is stale, reclaimable, blocked,
    or uncertain;
  • whether a possible side effect makes automatic replay unsafe;
  • how an operator can inspect those facts without reading or mutating SQLite
    directly.

Durable Core therefore adds only residual cross-owner facts, owner-first
recovery coordination, and bounded inspection. It reuses state_leases for
attempt authority and the existing schema_meta/user_version owner for schema
versioning. It does not add a second task, flow, subagent, delivery, session, or
migration ledger.

Root causes and stack coverage

Root-cause family Stack response
Accepted work exists only in process memory PR2 persistence substrate plus PR4 durable acceptance front doors
Coordinator or parent can go silent after delegation PR3 source-backed wake obligations and persistent session attention
Restart/interruption leaves stale or contradictory state PR3 owner-first recovery, PR4 fenced turn settlement, PR5 expired-claim recovery
Handoff attempt is mistaken for consumption, ACK, or delivery PR3 explicit proof boundaries and PR6 inspection
A side effect may have happened before process loss PR4 uncertainty/replay fence and PR5 operation-specific recovery policy
Operators cannot explain pending or blocked work PR6 bounded read-only Gateway/CLI projections

Six-PR map

PR Incremental role
PR1 #107375 Residual-gap RFC, official 7.1 owner comparison, invariants, and compatibility plan
PR2 #111121 Opt-in shared-state foundation with exactly ten residual tables
PR3 #111278 Owner-first Gateway recovery and persistent session attention
PR4 #111343 Durable agent-turn front doors, liveness, settlement, and uncertain-replay fence
PR5 #111464 Operation-scoped worker, attempt fencing, and expired-claim recovery
PR6 #111487 Bounded read-only Gateway and CLI inspection

Review model

All six PRs target release/2026.7.1 at
0790d9f593ad30c940ed93b5872a8cf6d6f3cf8c, so GitHub displays a cumulative
diff for each later PR. Review and merge order remains PR1 through PR6.
Review the incremental change for this slice at PR6-only compare.

Exact head for this PR: d42d5d856be0a9e981db3b5c62a6e1568cbe6e19.

What Problem This Solves

The durable runtime can preserve and recover work across restart, overflow, and
owner handoff, but operators need a supported way to determine whether the
runtime is healthy, what work remains open, and why a wake or recovery decision
is pending. Reading SQLite directly would bypass redaction, couple support tools
to private schema details, and risk accidental mutation. This slice provides a
bounded read-only Gateway and CLI contract while leaving all retry, replay,
settlement, and source-owner authority with the existing canonical owners.

What changed

  • Seven operator.read Gateway methods:
    • durable.health.get
    • durable.coordination.get
    • durable.obligations.list
    • durable.wakes.list
    • durable.wakes.inspect
    • durable.uncertainty.list
    • durable.deliveryAttempts.list
  • Read-only openclaw durable CLI commands.
  • Explicit allowlist projections, bounded TypeBox requests/results, safe diagnostic redaction, and bounded unavailable errors.
  • A dedicated CLI startup policy that avoids plugin loading, config-guard side effects, CLI-path repair, and network proxy initialization before inspection.
  • Doctor health contribution for durable status.

Boundary

Relative to PR5, this slice adds:

  • no database schema;
  • no configuration key;
  • no public mutation API;
  • no retry, resume, replay, resolve, acknowledge, or abandon authority;
  • no new recovery owner.

Canonical source owners remain authoritative. Inspection does not repair or replay work.

Evidence

Exact head: d42d5d856be0a9e981db3b5c62a6e1568cbe6e19

  • pnpm build passed, including plugin SDK declaration/export guards.
  • pnpm tsgo:all passed.
  • 12 focused Vitest files, 364 tests passed.
  • 2 bundled-protocol Vitest files, 188 tests passed.
  • pnpm protocol:check passed after regenerating JSON and Swift models and
    confirming no generated artifact drift.
  • Focused type-aware Oxlint and Oxfmt passed for the final CLI startup/config changes.
  • git diff --check passed.
  • Runtime version: OpenClaw 2026.7.1 (d42d5d8).
  • Delta from PR5: 29 files, 4,487 additions, 16 deletions.

Upstream CI correction

The initial submitted head passed source tests and the full build, but upstream
checks-fast-bundled-protocol correctly found that the generated Swift Gateway
model was stale. Its bundled tests passed 188/188; the job failed only when
protocol:check regenerated
apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift and found
an uncommitted diff. The repository's own pnpm protocol:gen:swift output is
now committed without manual editing, and corrected exact head
d42d5d856be0a9e981db3b5c62a6e1568cbe6e19 passes the full generation and
git diff --exit-code guard.

Built CLI zero-write and privacy proof

A built-binary harness verified:

{
  "head": "d42d5d856be0a9e981db3b5c62a6e1568cbe6e19",
  "proof": "built-cli-zero-write-and-redaction",
  "checks": {
    "disabled": true,
    "uninitialized": true,
    "invalidConfig": true,
    "seededReadOnly": true
  },
  "disabledFiles": [],
  "uninitializedFiles": [],
  "invalidFiles": [],
  "exposed": [],
  "seededDatabaseUnchanged": true,
  "seededChangesAreReadSidecars": true
}

The seeded main SQLite file retained the same byte length and SHA-256 hash. In
WAL mode, a read-only SQLite connection may update standard -shm/-wal
coordination sidecars; this exact-head trace observed a 32 KiB -shm sidecar
hash/mtime change while the main database stayed byte-identical. The
implementation does not use immutable=1, because that can ignore an active
WAL and expose stale production state.

Exact-head loopback proof

The built Gateway reached ready state on an isolated loopback fixture and served all seven public methods through real WebSocket calls. The fixture included a durable run, a failed wake/delivery attempt, unresolved uncertainty, raw metadata marker DO_NOT_EXPOSE, a private idempotency key, file URI, local path, and private endpoint.

Observed:

  • health: enabled, non-authority, ready;
  • coordination: bounded running projection with Inspect [path] via [endpoint];
  • obligations: pending wake plus unresolved uncertainty;
  • wake list/inspect: bounded wake, target, attempt, uncertainty, and source;
  • uncertainty list: one unresolved fact;
  • delivery attempts: one failed attempt;
  • no injected private marker or private persisted value appeared in any response;
  • Gateway shut down cleanly on SIGINT.

Safety notes

This PR intentionally provides inspection only. It does not claim exactly-once external effects, automatic semantic replay, external-channel delivery guarantees, or operator mutation authority.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 19, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 19, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 19, 2026
@clawsweeper clawsweeper Bot added 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 Aug 4, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 14, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Aug 24, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Sep 1, 2026
@mjnkao mjnkao closed this Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant