Skip to content

refactor(sessions): compose incognito domain entry points and message-tool outcomes (P7l, inactive) - #165895

Merged
steipete merged 3 commits into
mainfrom
dbasync/incogp7l
Oct 6, 2026
Merged

steipete merged 3 commits into
mainfrom
dbasync/incogp7l

Conversation

@steipete

@steipete steipete commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The inactive incognito actor adapters still require per-call bindings at domain entry points, and message-tool run outcomes have no actor operation. This is the P7l composition prerequisite for the single atomic incognito worker cutover.

User Impact

No production routing change: ordinary incognito acquisition remains host-owned. This PR does not activate the worker owner, delete native routes, change schemas or retention, add configuration/environment names, or change shared ACP persistence.

Why This Change Was Made

Domain entry points capture the existing shared actor binding before yielding and reuse the existing adapters. This covers collaboration, categories, suggestions, reactions, heartbeat outcomes, progress cards, reports/outbox, Board, pending input, ACP reads/writes/startup preparation, and deletion/reset/fork composition. Deferred outbox delivery retains the actor across the engine callback and acknowledgment without holding its writer FIFO. Gateway deletion refreshes full entries after cleanup; locked plugin-owned deletion uses the existing authoritative owner validation.

Message-tool outcomes now have a bounded actor command using the durable backend's recording transaction. Canonical actor admission supplies the schema. Transaction/commit grants check the captured generation, and the existing actor receipt publishes committed facts; a lost reply never authorizes replay.

The remaining acquisition/authority work belongs to P7k, and history/private-display work to P7m. ACP control retains its shared mutation-facts owner and requires P7k's actor facts/grant integration. The full reset service's pre-helper native acquisition/guards remain part of atomic activation. No end-to-end activation proof is claimed here.

Related: #162433 (standing incidental overlap), #165185 (reset cleanup), #165819 (entry/lifecycle owner). Sibling lanes: dbasync/incogp7k, dbasync/incogp7m; shared binding validation uses the same physical-root correction as P7k. The second landing must reconcile overlapping hunks.

Evidence

Pinned comparison base: ab2e92694e635beb25ebc9808756728897d11356. Original source head: 8ff82b7f86195d7a1c7b25a6a4eb9cd36975b41d. Production +699 / −150 / net +549 (849 changed lines) across 40 production files, plus nine test files and two docs. Inventory: T1 846 → 846, 629 files / 2,543 counted calls; 0 new OPENCLAW_* names.

All focused commands used pnpm test … --maxWorkers=1. Measured local wall times include cold imports and compiled-worker preparation on the loaded host.

Proof Result Wall time
Actor domain/lifecycle/Board/outbox/message-outcome group Six files initially green; ACP/pending failures repaired and covered below 296.90 s
Final full ACP, progress-card and pending-input actor suites 52 passed 173.65 s
Gateway deletion/reset and repaired ACP/pending cases 5 passed; existing Gateway cases separately passed 130.02 s
Durable callers, plugin startup, close order and import closures (31 files / 9 projects) 267 passed 1,551.27 s
P2 Codex autoreview Full implementation and subsequent lint-only delta scoped clean; no actionable P0–P2 findings —
Full pnpm build Passed, including runtime/SDK declarations, plugin exports, UI and postbuild checks 1,554.33 s
Full changed-file gate against pinned base Passed: all typechecks, three zero-entry dead-export scans, lint, ratchets and policy guards 1,853.64 s
Production Knip Passed 121.80 s
Madge 0 cycles 93.08 s
Exact-tree SDK API comparison 128 reachable-closure deltas; no changed top-level declarations or added/removed entrypoints 575.95 s

The shared-registry gate includes test/scripts/runtime-process-build-graph.test.ts, reply/history/reconcile import closures, shared-state worker imports, and worker admission imports. Importer routing was audited: changed actor suites already use the host-owned core project, while durable config/Gateway/plugin callers use existing fork projects. No routing changes or worker pins were added.

The real server-close regression proves accepted staging, release and interruption settle after scheduler abort before actor transport teardown. Actor-bound tests prove zero caller SQL for moved operations, exact generation rejection, committed publication after lost replies, and no replay. The new outcome operation uses the same backend whose durable row contents and 10,000-row bound are tested in the caller group.

Validation caught and fixed a progress-card inference cycle, a native cleanup-generation read, missing captured lifecycle revisions, and private ACP result disclosure after borrower release. Four ACP release cases demonstrably failed before the fence repair (disclosed=true despite the retained parent's later rejection); all pass afterward. Fixture ordering/canonical-entry mistakes were also corrected. The original Gateway file run passed its 17 existing cases (556.95 s including the initial actor-case failure); the two actor deletion/reset cases pass after repair. An early test preparation was rejected because it overlapped package output generation; subsequent build/test work was serialized. The first changed-file pass also found a missing QA Lab → Crabbox workspace link from the filtered Gateway setup. Installing its already-declared dependency set fixed both extension typechecks without source or lockfile changes. The next changed-file pass reached lint after all typechecks/dead-export scans passed and found parameter-reassignment/shadowing violations; the mechanical cleanup preserves every public parameter name and was independently reviewed. No failure was hidden by weaker guards or retries.

SDK digest 32f31d6a was inspected: the closure deltas reflect the new inactive outcome command, optional lifecycle owner/outbox custody/parent-key fields, narrower internal actor requirements, and the prepared ACP reader. Existing public entry-point declarations are unchanged; the additive preparer is on the existing JS-local ACP facade. The v2026.9.8 Gateway runtime and shared request-context types were inspected; no synchronous context service method was replaced. Build, functional suites, Knip, cycle, and exact-tree SDK evidence cover implementation commit de68fd50ab6bb142c4771a406b43c823772a4603; the later reviewed cleanup only replaces reassigned parameters with local constants and removes variable shadowing, preserving signatures and behavior. The full changed-file gate passed on the final source tree; runtime import-cycle validation also reported zero cycles. Original CI timing was unavailable at publication; current landing proof is recorded below.

These are real worker/Gateway boundary suites, so existing process startup and storage-owner fixtures exceed the five-second test target. The added cases reuse suite owners; no new per-case Gateway boot, real sleep, serial configuration, or test-only production module was added.

Native routes the atomic activation must retire

Line references are to this candidate; counts estimate deleted production lines, not whole files. Retain worker kernels and named durable SDK/maintenance contracts.

Native route Candidate location Estimated deletion
Collaboration native dispatch and callback plumbing src/config/sessions/session-sharing-store.async.ts:188; src/config/sessions/session-metadata-write.async.ts:29 30
Category native prepare/apply src/config/sessions/session-group-categories.ts:81 22
Member/suggestion native reads src/config/sessions/session-sharing-store.ts:60; src/config/sessions/session-suggestion-store.read.ts:39 17
Reaction native transaction src/config/sessions/session-reaction-store.ts:110 19
Heartbeat native transaction src/infra/heartbeat-outcome-store.ts:222 23
Progress-card native get/put selection src/gateway/progress-card-store.ts:136,189 32
Native report helper and dispatch src/config/sessions/session-accessor.sqlite-transcript-reports.ts:248,530,581,645 73
Outbox native transaction/schema bookkeeping src/agents/harness/context-engine-turn-outbox-store.ts:46 23
Board native incognito existence/write/read selection src/boards/sqlite-board-store.ts:137,247,492 43–48
Pending source native arm src/config/sessions/session-pending-input-source.ts:70 23
Pending store native read/mutation selection src/config/sessions/session-pending-input-store.ts:230,284 15–18
Pending history native helper/selection src/config/sessions/session-pending-input-history.ts:159,211 50
Pending receipt native selection src/config/sessions/session-pending-input-receipts.ts:51 7
ACP native entry join and mutation selection src/acp/runtime/session-meta-read.ts:139; src/acp/runtime/session-meta-write.ts:121 25
Fork/lifecycle native-incognito selection and bound-only sync guard src/config/sessions/session-parent-fork.ts:62; src/config/sessions/session-accessor.sqlite-parent-session.ts:181; src/config/sessions/session-accessor.sqlite-lifecycle.ts:125,552; src/acp/runtime/session-meta.ts:137 3–7
Message-tool outcome native schema/transaction arm src/infra/message-tool-run-outcome-store.ts:97 16–20

Estimated total: 421–437 lines, plus newly unused imports. Gateway deletion's durable alternative calls stay; their transitive incognito host-selection arms belong to P7k. The full reset service still has pre-helper native selection/guards at src/gateway/session-reset-service.ts:569,697,777,1049 that must be switched during atomic integration, not deleted wholesale. Startup reconciliation's native reads remain for durable contracts. Shared ACP live metadata checks in src/acp/runtime/session-meta-control.ts:227–252 are retained other-owner authority debt, not incognito DB routes. Preserve withdrawal's unsupported-incognito refusal, offline lifecycle/fork kernels, the released opaque Board write contract, and durable synchronous pending completion.

Landing validation

Integrated main 98262d8b5fdaf4b1be499fc10c7426a0f2be5b6e through merge commit 924a698c542a724b73e9a995184a3e9e3497d974, with no conflicts or production activation. The only overlap was the worker-access documentation. Session-authority B1 and native creation writes preserve host-owned incognito acquisition. P7k remains an independent pending prerequisite; the second landing must still integrate it.

The original security-fast failure was the independently reproduced source-map-js advisory GHSA-68fv-2mgg-jv7q. Main fixed it in 9c66e8f40532; that fix is included, and the production dependency audit now passes. No dependency fix was authored in this PR. The old run's fail-fast cancellations remain unrun historical coverage, not passing results.

Post-integration proof on 924a698c542a724b73e9a995184a3e9e3497d974:

Check Result Local wall time
Focused suites, pnpm test <25 explicit files> --maxWorkers=1 233 tests passed in 25 files / 7 projects 2,276.85 s
pnpm tsgo:core Passed 70.68 s
pnpm tsgo:core:test All 27 shards passed 1,074.91 s
pnpm tsgo:extensions Passed 70.48 s
pnpm tsgo:extensions:test Passed 70.61 s
pnpm check:madge-import-cycles Zero cycles 106.50 s
pnpm deadcode:knip Passed 163.37 s
Exact-tree SDK API comparison against integrated main 130 reachable type-closure deltas; no top-level declaration changes or added/removed entrypoints; digest 36ef17b6 2,153.33 s
Fresh P2 Codex autoreview of the integrated delta Scoped clean; no actionable P0–P2 finding —

Focused coverage includes the nine modified suites, the real Gateway deletion/reset flow, B1 prepared/reply authority, entry patch/publication owners, ACP storage/control readers and writers, durable message-tool outcomes/outbox, Discord and Telegram startup reconciliation, runtime-process build graph, and reply/history/reconcile/shared-state import closures. No source repair was needed after integration. Released ACP signature checks against v2026.10.1-beta.1 and v2026.9.8 remain valid: the public reader keeps its one-argument Promise contract.

A host restart interrupted the first validation attempt and wiped its temporary logs. The completed P2 review and core production typecheck were observed before interruption; unfinished checks were rerun with durable logs. The interrupted core-test owner retained a checkout-local build lock; its exact owner and descendants were verified absent before documented recovery. No other process or lock was terminated or recovered.

ClawSweeper's original exact-head review found no actionable code defect. Its automated Board data-model warning was inapplicable: that file's complete PR diff changes imports and type annotations, not SQL, tables, serialization, or runtime expressions. The new outcome command reuses the existing admitted table and recording transaction. Fresh review and CI must bind the published integration head.

Capture actor bindings through domain, Board, pending-input, ACP and lifecycle entry points. Reuse the durable message-tool outcome transaction on the incognito actor and preserve accepted settlement and private result disclosure fences. Production acquisition remains host-owned until atomic P7 activation.
@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: telegram Channel integration: telegram gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 6, 2026
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 6, 2026, 3:01 AM ET / 07:01 UTC (Revision 3).

ClawSweeper review

What this changes

The PR carries captured Incognito worker bindings through session operations, retains them during asynchronous cleanup and outbox delivery, and adds worker-backed message-tool outcome recording.

Warning

SQLite table change

This PR modifies persisted SQLite tables in src/boards/sqlite-board-store.ts. Prefer a design that avoids changing persisted SQLite tables. If the change is necessary, verify migration and upgrade compatibility against an existing database before merge.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this remains useful, distinct prerequisite work, with no actionable introduced defect found. The previous data-model compatibility warning is cleared by the inspected diff; activation remains separately scoped.

Priority: P2
Reviewed head: 924a698c542a724b73e9a995184a3e9e3497d974

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent prerequisite refactor with meaningful boundary coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The verified trusted author is exempt from the external-contributor proof gate. Reported final-head Gateway and real-worker boundary suites cover the changed owners; inspected revocation and release guards leave no specific unresolved authority-proof requirement. Stored schemas, formats, retention, and durable recording behavior remain unchanged, clearing the prior migration warning.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The verified trusted author is exempt from the external-contributor proof gate. Reported final-head Gateway and real-worker boundary suites cover the changed owners; inspected revocation and release guards leave no specific unresolved authority-proof requirement. Stored schemas, formats, retention, and durable recording behavior remain unchanged, clearing the prior migration warning.
Evidence reviewed 9 items Pinned introduction and clean checkout: Reviewed the host-pinned base-to-head introduction. The original head merges the pinned base; the supplied test merge is stale and was not used to infer what merging would remove. The checkout remained clean and diff whitespace checks passed.
Complete captured discussion body: Read the complete PR body, including the previously omitted landing-validation tail. Its 13,207 UTF-16 units and SHA-256 1cdad669f44b246c62b708e4d982bbe3b82a3901f280c9b0061d63b8e4e4a5ce match the supplied snapshot. The author reports final-head boundary validation and explicitly excludes activation proof.
Prior compatibility warning resolved: The complete Board production diff changes imports and actor type annotations only. It introduces no SQL, serialization, schema, migration, or runtime-expression change; the earlier upgrade warning does not establish a remaining blocker.
Findings None None.
Security None None.

How this fits together

Incognito sessions keep private session state in a process-lifetime database. Session, Gateway, and plugin entry points send operations to its worker owner, which checks authority and publishes committed results.

flowchart TD
  A[Session and Gateway requests] --> B[Capture private session binding]
  B --> C{Binding available}
  C -->|Yes| D[Existing Incognito worker]
  C -->|No| E[Existing storage route]
  D --> F[Check authority and generation]
  F --> G[Commit and publish results]
  E --> G
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +549, Tests +606, Docs +26. Total +1181 across 51 files.

View PR surface stats
Area Files Added Removed Net
Source 40 699 150 +549
Tests 9 932 326 +606
Docs 2 28 2 +26
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 51 1659 478 +1181

Review metrics

Metric Value Why it matters
Production and test growth production net +549 lines; tests net +606 lines Production growth is justified as inactive domain composition and retained lifecycle custody, with a documented subsequent native-route retirement.
SDK capability addition 1 prepared-reader export; 2 bundled consumers The documented helper extends the existing ACP facade while preserving the released reader signature.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/boards/sqlite-board-store.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep this composition inactive until the planned atomic cutover installs acquisition authority and retires the documented native routes together.

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

Not applicable: this is an inactive internal refactor, and no concrete introduced failure was established during read-only inspection.

Is this the best way to solve the issue?

Yes: composing the existing actor and domain owners preserves one storage responsibility, while the documented atomic activation owns the eventual routing cutover.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0c6af8bb3e8c.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is bounded internal session-worker preparation with production activation explicitly deferred.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The verified trusted author is exempt from the external-contributor proof gate. Reported final-head Gateway and real-worker boundary suites cover the changed owners; inspected revocation and release guards leave no specific unresolved authority-proof requirement. Stored schemas, formats, retention, and durable recording behavior remain unchanged, clearing the prior migration warning.

Evidence

What I checked:

  • Pinned introduction and clean checkout: Reviewed the host-pinned base-to-head introduction. The original head merges the pinned base; the supplied test merge is stale and was not used to infer what merging would remove. The checkout remained clean and diff whitespace checks passed. (924a698c542a)
  • Complete captured discussion body: Read the complete PR body, including the previously omitted landing-validation tail. Its 13,207 UTF-16 units and SHA-256 1cdad669f44b246c62b708e4d982bbe3b82a3901f280c9b0061d63b8e4e4a5ce match the supplied snapshot. The author reports final-head boundary validation and explicitly excludes activation proof. (924a698c542a)
  • Prior compatibility warning resolved: The complete Board production diff changes imports and actor type annotations only. It introduces no SQL, serialization, schema, migration, or runtime-expression change; the earlier upgrade warning does not establish a remaining blocker. (src/boards/sqlite-board-store.ts:108, 924a698c542a)
  • Existing outcome storage contract reused: The new actor command invokes the existing recording backend, whose synchronous transaction checks admission at transaction and commit and retains the existing 10,000-row bound. The outcome table already exists in the canonical agent schema; no stored format or retention change is introduced. (src/config/sessions/session-incognito-side-data.worker.ts:144, 924a698c542a)
  • Authority and settlement coverage: Inspected changed boundary cases for transaction/commit revocation, single execution after lost replies, ACP disclosure refusal after borrower release or metadata change, and retained outbox acknowledgment. These exercise production worker owners; this reviewer did not execute tests. (src/state/openclaw-agent-execution-incognito.side-data.test.ts:90, 924a698c542a)
  • Plugin boundary and released reader compatibility: The additive prepared-reader export has two bundled consumers and documented lifecycle semantics. The existing public asynchronous reader retains its one-argument Promise contract. The v2026.9.8 facade was read through GitHub after local historical blob retrieval failed. (src/plugin-sdk/acp-runtime.ts:36, 924a698c542a)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-06T01:25:20.287Z sha 8ff82b7 :: blocked before merge. :: none
  • reviewed 2026-10-06T01:44:14.209Z sha 8ff82b7 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Oct 6, 2026
Integrate the production dependency audit repair and session authority/creation owners while preserving inactive, host-owned incognito acquisition. P2 autoreview of the integrated delta is clean; post-integration checks are running before publication.
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit ca43d19 into main Oct 6, 2026
175 checks passed
@steipete
steipete deleted the dbasync/incogp7l branch October 6, 2026 07:37
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
…-tool outcomes (P7l, inactive) (openclaw#165895)

* refactor(sessions): compose inactive incognito domain entry points

Capture actor bindings through domain, Board, pending-input, ACP and lifecycle entry points. Reuse the durable message-tool outcome transaction on the incognito actor and preserve accepted settlement and private result disclosure fences. Production acquisition remains host-owned until atomic P7 activation.

* style(sessions): keep captured bindings in local constants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord channel: telegram Channel integration: telegram docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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