Repository navigation
refactor(sessions): compose incognito private rows and expiry (P7m2, inactive) - #165901
Conversation
Compose shared actor bindings through history, Memory, usage, and reconciliation while production routing stays host-owned. Preserve FIFO read acceptance and reject stale or revoked results after cleanup. Native routes remain for the atomic P7 activation.
Prepare P7m2 shared-binding private presentation, retained lookup, no-disk maintenance exclusions, and all-actor expiry orchestration. Preserve production native routes until atomic activation; fence actor, ACP, durable and placement facts through cleanup without replaying consumers.
Keep child provenance and captured absence authoritative through presentation, and preserve captured incognito paths across environment changes. Validate stored and sharing facts at the same retained boundary; production routing remains inactive.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 11:56 AM ET / 15:56 UTC (Revision 7). ClawSweeper reviewWhat this changesThe branch composes retained incognito session rows, related-session reads, expiry coordination, and disk-maintenance exclusions while preserving native production routing. Merge readiness✅ Ready for maintainer review This remains a distinct, useful inactive prerequisite. The previous integration-evidence request is addressed, and the pinned diff has no actionable correctness or security finding. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway presents session information using stored entries, sharing facts, and worker placement data. This change prepares private session information under its captured in-memory owner and coordinates expiry with the existing deletion lifecycle. flowchart TD
A[Session read request] --> B[Captured private session owner]
B --> C[Prepare rows and related sessions]
D[Sharing and placement facts] --> C
C --> E[Validate and present synchronously]
B --> F[Existing session deadlines]
F --> G[Delete and join cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +717, Tests +596, Docs +27. Total +1340 across 22 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain this staged composition and complete acquisition, deletion, and native-route retirement together in the later atomic activation. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR prepares an internal ownership cutover rather than reporting a remaining current-main bug; its regression scenarios are explicit in the boundary suites. Is this the best way to solve the issue? Yes: the composition reuses existing actor, ordered-read, presentation, deadline, and deletion owners while preserving the documented staged activation boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9e5692852d60. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
Merge current main into the inactive private-row and expiry composition, retaining history encoding and identity repairs, accepted persistence authority, typed ordered-read invalidation, and indexed row lookup. Retry private-row preparation before consumption when an initially missing row acquires a placement; add an actor-boundary regression. Production incognito acquisition remains host-owned.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Keep unbound reads in their original synchronous consumer frame instead of rereading projection readiness after completion. Retain actor-bound preparation and cleanup fences. Add deterministic ready/exact placement regressions; the chat membership product test failed five times on the prior candidate and passed five times on its main baseline, then passed locally with this repair.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge main after P7k landed. Preserve its root-only acquisition authority and expanded claim/store-snapshot operations together with M2 settled snapshots, retained private-row batches, and native synchronous completion. Production actor acquisition remains inactive.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…inactive) (openclaw#165901) * refactor(sessions): compose incognito history and compute facades Compose shared actor bindings through history, Memory, usage, and reconciliation while production routing stays host-owned. Preserve FIFO read acceptance and reject stale or revoked results after cleanup. Native routes remain for the atomic P7 activation. * refactor(sessions): compose inactive private rows and expiry Prepare P7m2 shared-binding private presentation, retained lookup, no-disk maintenance exclusions, and all-actor expiry orchestration. Preserve production native routes until atomic activation; fence actor, ACP, durable and placement facts through cleanup without replaying consumers. * fix(sessions): preserve prepared private row ownership Keep child provenance and captured absence authoritative through presentation, and preserve captured incognito paths across environment changes. Validate stored and sharing facts at the same retained boundary; production routing remains inactive. * style(sessions): avoid shadowing in private row composition * refactor(sessions): reuse captured lookup agent identity * fix(sessions): preserve native row completion before topology changes Keep unbound reads in their original synchronous consumer frame instead of rereading projection readiness after completion. Retain actor-bound preparation and cleanup fences. Add deterministic ready/exact placement regressions; the chat membership product test failed five times on the prior candidate and passed five times on its main baseline, then passed locally with this repair.
## What Problem This Solves Removes dormant migration scaffolding that adds maintenance surface without serving a production caller. ## User Impact No user-visible behavior change. Active UI state owners and projections, native incognito expiry, public SDK/package exports, security checks, storage, and configuration remain intact. ## Why This Change Was Made Delete unadopted Solid projections and their event/lease infrastructure rather than retaining a parallel adapter layer for hypothetical future consumers. The introducing [projection PR](#168405) explicitly describes an internal foundation with no rendered UI change. Delete the inactive actor-specific incognito expiry sidecars and their exclusive tests. Their introducing work ([single-actor](#165454), [topology composition](#165901)) explicitly leaves production on the native sidecar. Its existing real deletion/shutdown tests stay unchanged. Net production reduction: **1,262 lines** (13 added, 1,275 deleted; tests, test support, docs, fixtures and generated code excluded). Every removed module/export was checked against repository-wide references, dynamic loaders, manifests and package exports. The active `projectSource` implementation is unchanged apart from making its unused exported input type private. Remove the stale whole-directory Knip entry exemption now that every retained reactive module has a production caller. Also drop four zero-caller Solid presentation helpers from the preparatory #168576 layer; their live Lit counterparts and all gallery-used helpers remain. ## Best-effort tradeoffs accepted - Unused event-projection replacement/disposal generations, duplicate-listener bookkeeping and async settlement: these only served the unadopted #168405 adapters and synthetic tests, not a human-reported runtime incident. Future event consumers subscribe to the existing owners and retain their ordering/completion contracts. - Unused board/provider lease counting and temporary palette subscriptions: #168405 introduced them for future migration consumers that never arrived. Existing provider/preference owners remain authoritative; a future port must add only the adapter it actually needs. - Unused generic locale-catalog replacement/listener bookkeeping: the wrapper had only its own test as a caller. Actual locale subscriptions and lazy English registration remain; a future replacement API must be integrated with the translation owner rather than kept as a test-only parallel path. - Inactive actor topology capture, incarnation fences, acquisition/retirement reconciliation and actor-only settling checks: #165454/#165901 label this prerequisite inactive, and production still calls the native sidecar. Future activation must implement its actual integration; no live deletion loses authority or shutdown checks. ## Evidence - Independent P0–P2 review: scoped clean; no accepted/actionable findings. - Retained reactive scope plus application-context lifecycle: **27 tests passed in 10 files**. - Retained Solid component scope: **49 tests passed in 10 files**, 83.22 s command wall time. - Changed-file cost run with `--maxWorkers=1`: **20 tests passed in 7 files**, 74.43 s command wall time; individual file test windows were 2–325 ms. No new tests, timers, retries, skips, or suppressions. - Real native incognito sidecar/deletion/shutdown suite: **9 tests passed**, unchanged. - Lint-suppression guard: **3 tests passed**; no new suppressions. - Production Knip: **passed** on the source-capsule-verified Testbox candidate. - Full-tree Knip: no unused files/exports reported; the broader pass reports pre-existing dependency/binary/path metadata outside this diff. Canonical export-only pass is clean. - Change-check proof: all 28 core/test type graphs plus production/UI types, ratchets, formatting, script lint, storage/loader/auth guards passed. The initial run caught README formatting and one unused test import; both are fixed. Completed results were reused while the corrected lint stripe and remaining commands were run through the same changed-scope owner. Final component-only UI types, lint, and style checks passed. - Runtime import cycles: **0**. Madge cycles: **0**. Final production and full-tree export scans both passed on the source-capsule-verified [Testbox run](https://github.com/openclaw/openclaw/actions/runs/38171748378). - [Exact-head CI](https://github.com/openclaw/openclaw/actions/runs/38175521266) passed on `6b35e73d5f9be9cf79ccc4692f0109ce7d2915b3`, including `openclaw/ci-gate`; no failed checks or CI reruns. Workflow wall time was 454 s. The three UI check jobs took 264/304/288 s wall time (including setup), and the UI E2E jobs passed. No live Gateway or real OpenClaw state was used. Every executable proof used isolated HOME, OpenClaw state/config and XDG directories.
) ## What Problem This Solves Removes dormant migration scaffolding that adds maintenance surface without serving a production caller. ## User Impact No user-visible behavior change. Active UI state owners and projections, native incognito expiry, public SDK/package exports, security checks, storage, and configuration remain intact. ## Why This Change Was Made Delete unadopted Solid projections and their event/lease infrastructure rather than retaining a parallel adapter layer for hypothetical future consumers. The introducing [projection PR](openclaw#168405) explicitly describes an internal foundation with no rendered UI change. Delete the inactive actor-specific incognito expiry sidecars and their exclusive tests. Their introducing work ([single-actor](openclaw#165454), [topology composition](openclaw#165901)) explicitly leaves production on the native sidecar. Its existing real deletion/shutdown tests stay unchanged. Net production reduction: **1,262 lines** (13 added, 1,275 deleted; tests, test support, docs, fixtures and generated code excluded). Every removed module/export was checked against repository-wide references, dynamic loaders, manifests and package exports. The active `projectSource` implementation is unchanged apart from making its unused exported input type private. Remove the stale whole-directory Knip entry exemption now that every retained reactive module has a production caller. Also drop four zero-caller Solid presentation helpers from the preparatory openclaw#168576 layer; their live Lit counterparts and all gallery-used helpers remain. ## Best-effort tradeoffs accepted - Unused event-projection replacement/disposal generations, duplicate-listener bookkeeping and async settlement: these only served the unadopted openclaw#168405 adapters and synthetic tests, not a human-reported runtime incident. Future event consumers subscribe to the existing owners and retain their ordering/completion contracts. - Unused board/provider lease counting and temporary palette subscriptions: openclaw#168405 introduced them for future migration consumers that never arrived. Existing provider/preference owners remain authoritative; a future port must add only the adapter it actually needs. - Unused generic locale-catalog replacement/listener bookkeeping: the wrapper had only its own test as a caller. Actual locale subscriptions and lazy English registration remain; a future replacement API must be integrated with the translation owner rather than kept as a test-only parallel path. - Inactive actor topology capture, incarnation fences, acquisition/retirement reconciliation and actor-only settling checks: openclaw#165454/openclaw#165901 label this prerequisite inactive, and production still calls the native sidecar. Future activation must implement its actual integration; no live deletion loses authority or shutdown checks. ## Evidence - Independent P0–P2 review: scoped clean; no accepted/actionable findings. - Retained reactive scope plus application-context lifecycle: **27 tests passed in 10 files**. - Retained Solid component scope: **49 tests passed in 10 files**, 83.22 s command wall time. - Changed-file cost run with `--maxWorkers=1`: **20 tests passed in 7 files**, 74.43 s command wall time; individual file test windows were 2–325 ms. No new tests, timers, retries, skips, or suppressions. - Real native incognito sidecar/deletion/shutdown suite: **9 tests passed**, unchanged. - Lint-suppression guard: **3 tests passed**; no new suppressions. - Production Knip: **passed** on the source-capsule-verified Testbox candidate. - Full-tree Knip: no unused files/exports reported; the broader pass reports pre-existing dependency/binary/path metadata outside this diff. Canonical export-only pass is clean. - Change-check proof: all 28 core/test type graphs plus production/UI types, ratchets, formatting, script lint, storage/loader/auth guards passed. The initial run caught README formatting and one unused test import; both are fixed. Completed results were reused while the corrected lint stripe and remaining commands were run through the same changed-scope owner. Final component-only UI types, lint, and style checks passed. - Runtime import cycles: **0**. Madge cycles: **0**. Final production and full-tree export scans both passed on the source-capsule-verified [Testbox run](https://github.com/openclaw/openclaw/actions/runs/38171748378). - [Exact-head CI](https://github.com/openclaw/openclaw/actions/runs/38175521266) passed on `6b35e73d5f9be9cf79ccc4692f0109ce7d2915b3`, including `openclaw/ci-gate`; no failed checks or CI reruns. Workflow wall time was 454 s. The three UI check jobs took 264/304/288 s wall time (including setup), and the UI E2E jobs passed. No live Gateway or real OpenClaw state was used. Every executable proof used isolated HOME, OpenClaw state/config and XDG directories.
What Problem This Solves
Atomic incognito activation needs private-row presentation, related-session reads, expiry, and maintenance exclusions to retain the same captured actor and physical stores through preparation, consumption, and cleanup.
User Impact
This is an inactive prerequisite. Production incognito acquisition and native routes remain host-owned; this PR cannot activate actors by itself. It changes no schema, stored data, retention, durability, permissions, configuration, environment names, or update behavior.
Why This Change Was Made
Prepare private rows as one retained batch with actor facts, ACP metadata, private relatives, and an ordered durable-relative read. Preserve each child's agent and physical store, including captured absence. Retry stale placement preparation before invoking the synchronous consumer, including when a previously absent session appears during preparation. Revalidate actor-backed results through cleanup without replaying the consumer.
Ordinary unbound reads retain their existing synchronous completion boundary. The landing validation caught and fixed a regression where the new actor cleanup check reread ordinary projection readiness after consumption, turning an unrelated topology publication into an authorization/history failure. Native reads now use the same presenter directly; actor-bound reads retain their cleanup fences.
Compose existing-only all-actor expiry around the current single-actor deadline owner. Capture topology before yielding, refuse replacement incarnations, reconcile healthy actors despite a stale sibling, and join accepted deletion before releasing actors. Preserve no-disk/no-archive exclusions in cold restore, archive inspection, disk-budget maintenance, and page reclamation.
Main was integrated with a merge commit, preserving the merged history/compute parent, history identity and encoding repairs, accepted-persistence authority, typed ordered-read invalidation, and indexed row lookup. Related work: #165890 (merged parent), #165885, P7l deletion, and #162433. Final activation must install actor acquisition and deletion together and retire the native routes below.
Evidence
Current candidate:
3a7e1ade8de46c60bfe51959f796de8dee0ee1a4, integrated main baselined8a62a83f3762c6f6727f6d16449bc63b18af48b.After CI passed on
2eb513b9b56b2, P7k #165885 landed and caused two real conflicts. The merge retains its immutable root-only acquisition assertions and expanded claim/store-snapshot operations, together with M2 settled snapshots and batch cleanup. Fresh full-candidate P2 review, production types, all 27 core test type graphs, cycle/dead-code checks, the worker ratchet, targeted lint, and the refreshed SDK report passed on this head. Exact-head CI passed on its first attempt. Its logs directly confirm 38 cases across actor projection, expiry, placement lifecycle, membership, and actor sessions. The four related actor/SDK suites omitted by selective CI passed locally after the host reboot: 39 tests in 4 files, 34.47 s wall time, with--maxWorkers=1. Combined with CI, all nine integration files are covered on this exact head. The historical proof below is labeled separately.pnpm test <files> --maxWorkers=1.undefinedversusrequested). Both native completion cases failed before their repair and passed afterward. The new lifecycle cases took 18 ms and 6 ms locally and add no Gateway/process fixture; the actor fixture took 9.934 s, and the existing membership product test took 47.392 s in the final local run. Wall times include compilation/import overhead on the loaded host.--maxWorkers=1. The box is stopped. Comparison exit 1 records the expected negative controls, not a passing gate. The original CI failure took 31.207 test seconds. A loaded-host local attempt timed out before this Linux comparison; that timeout was not treated as product evidence.--maxWorkers=1.pnpm deadcode:knippassed;pnpm check:madge-import-cyclesreported 0 cycles. The database-worker ratchet passed against the integrated baseline: no T1 growth. No newOPENCLAW_*names. Targeted lint, formatting, andgit diff --checkpassed.Released SDK source audit compared
v2026.10.1-beta.1: changed callable helpers are internal, and the existing asynchronous public-facing facades retain their contracts. No compatibility adapter is required. The refreshed generated SDK report ford8a62a83f376→3a7e1ade8de4completed successfully: 0 added/removed entrypoints, 0 top-level declaration/kind changes, 130 reachable-only changes, digest5ec9f5693b48460f8ebdcd2602a2d0218fe52f51c1c93866dd5dbc574dc81f46.The earlier current-head local nine-file attempt retained one 90 s membership timeout: Gateway startup reported 98.881 s before completion on the loaded host. Nine other cases passed before that shard stopped. This timeout remains recorded, rather than being called fixed; the same-head Linux CI membership case completed in 46.208 s. The supplemental Testbox attempt (
tbx_01m48m9hgb7sp0wq3hca9besj3, run) timed out during setup before executing tests and is stopped. AWS staging was interrupted by the host reboot and produced no proof; no lease from that attempt remains active. The successful four-file local run closes the missing coverage.Worker-routing audit found no missing host-owner project. Actor projection, expiry, history/compute, and lookup suites use existing host-owned projects; ordinary unbound projection helpers retain their original owner. The expiry proof injects Gateway deletion and exercises the real actor lifecycle kernel; it does not establish final production activation. New grant/validation callbacks add no SQL. Native production routes below remain activation debt.
ClawSweeper completed the exact-head review at 12:52 UTC with no actionable code or security finding. Its only request was completed integration evidence; the current-head results and refreshed SDK report above satisfy it. The original dependency-audit failure was fixed on main by #165902 and is included here; the old PR-context failure was corrected by adopting the required template headings.
Native routes retained until atomic activation
These are intentional production paths, not runtime fallbacks for a failed actor admission. Preserve durable and Doctor/CLI one-shot kernels when retiring them.
src/gateway/session-row-projection-materialize.ts:438,:600,:638,:676src/gateway/session-row-projection-ancestors.ts:61src/gateway/session-row-projection-identities.ts:156src/gateway/session-utils-store-retained.ts:205src/gateway/session-incognito-lifetime.ts:225src/config/sessions/session-cold-storage-status.ts:51,:95,:107src/config/sessions/session-history-eviction.ts:185,:213src/config/sessions/session-accessor.sqlite-maintenance.ts:274src/config/sessions/session-cold-storage.ts:387,:411src/config/sessions/session-accessor.sqlite-page-reclamation.ts:103