@@ -62,16 +62,17 @@ their 30-day expiry.
6262After session work admission succeeds, OpenClaw validates and freezes
6363one bounded identity envelope, immediately offers it to the existing audit
6464writer queue, and continues the run without waiting for writer readiness,
65- SQLite, or persistence. The worker initializes schema and HMAC-key state,
65+ SQLite, or persistence. The queue drain initializes schema and HMAC-key state,
6666pseudonymizes raw references, constructs the immutable context, validates its
67- canonical bytes, and persists it. An accepted envelope can therefore be
68- temporarily unavailable to inspection while queued work finishes.
67+ canonical bytes, and persists it through the process-owned shared-state
68+ connection. An accepted envelope can therefore be temporarily unavailable to
69+ inspection while queued work finishes.
6970
70- Persistence remains best-effort. Queue saturation, worker or storage failure,
71- and process crashes can lose evidence; they log only a bounded operational
72- warning and never abort the run. Normal Gateway and direct-local CLI shutdown
73- flushes accepted work when the writer lifecycle permits, but abrupt termination
74- can still lose queued evidence.
71+ Persistence remains best-effort. Queue saturation, storage failure, shutdown
72+ timeout, and process crashes can lose evidence; they log only a bounded
73+ operational warning and never abort the run. Normal Gateway and direct-local
74+ CLI shutdown flushes accepted work when the writer lifecycle permits, but
75+ abrupt termination can still lose queued evidence.
7576
7677When identity collection is enabled, restart recovery stores only the safe
7778execution/context/run ids and timestamp with its existing private recovery
@@ -321,8 +322,9 @@ Message records intentionally omit both.
321322Execution identity contexts use the same installation-local key owner with a
322323separate HMAC domain. Raw runtime, invoker, ingress-source, assurance, grant,
323324and child-delegation references exist only in bounded private admission
324- carriers. The deeply frozen worker message is capped at 16 KiB and 16 entries
325- in each bounded evidence array. The worker replaces raw references with keyed
325+ carriers. The deeply frozen queue payload is capped at 16 KiB and 16 entries
326+ in each bounded evidence array. A structured clone strips prototypes at the
327+ queue boundary. The queue drain replaces raw references with keyed
326328pseudonyms before persistence; they are never stored, exported, inspected, or
327329logged. Configured agent ids plus context, execution, and run ids remain
328330operator-visible.
@@ -343,8 +345,9 @@ what was recorded, not as proof of what happened:
343345- ** Absence of a row proves nothing.** Pre-admission inbound drops, sends from
344346 plugin-local or direct-send paths that bypass shared durable delivery, a
345347 dropped admission envelope, and crash-lost queued work can leave no record.
346- - Writes go through a bounded background worker; worker failure or queue
347- saturation drops records and logs one operational warning.
348+ - Writes go through a bounded asynchronous process-owned queue; queue
349+ saturation, storage failure, or a bounded shutdown timeout can drop records
350+ and log one operational warning.
348351- Crash-ambiguous outbound sends are recorded as ` unknown ` rather than
349352 invented outcomes.
350353
@@ -357,8 +360,9 @@ compliance archive; if you need one, use an external system fed by
357360Records live in the shared state database (` state/openclaw.sqlite ` ) and are
358361written off the delivery hot path. Queries never return records older than 30
359362days, and the ledger is capped at 100,000 rows; expired rows are pruned during
360- startup, hourly maintenance, and later writes. Retention maintenance keeps
361- running even when collection is disabled.
363+ startup, hourly maintenance, and later writes. Each ledger or progress cleanup
364+ transaction deletes at most 1,024 expired rows and schedules more work until
365+ settled. Retention maintenance keeps running even when collection is disabled.
362366
363367Outbound ` queued ` and ` platform-started ` records live in the narrowly owned
364368` outbound_message_progress ` table. The table is created idempotently only on
@@ -385,7 +389,9 @@ additive table is created lazily on first use without a schema-version bump.
385389Fresh and upgraded installations do not populate identity contexts until an
386390operator enables collection.
387391First-use schema creation, HMAC-key access, canonical context construction, and
388- all SQLite work happen in the audit worker, never in agent admission.
392+ SQLite persistence happen in the process-owned audit queue drain, never in
393+ agent admission. Lock attempts fail fast and retry asynchronously with bounded
394+ backoff so SQLite contention does not synchronously wait on the Gateway thread.
389395Contexts are retained for 30 days and capped at 100,000 rows. Exact-execution
390396inspection and run discovery never return a context, candidate, or admission
391397decision after that context is older than 30 days, even if physical cleanup
@@ -412,7 +418,7 @@ first generic fact write, retains facts for 30 days, caps the table at 250,000
412418rows, and prunes at most 1,024 rows per write or maintenance tick. Approval
413419paths never write this table. Its facts and approval rows are authoritative for
414420their recorded decisions. Delivery to the generic table uses the bounded audit
415- worker and remains best-effort until persisted; approval-owner writes do not
421+ queue and remains best-effort until persisted; approval-owner writes do not
416422depend on that queue. The activity ledger cannot recreate either source after
417423loss.
418424
0 commit comments