Skip to content

feat(state): prepare incognito ACP ownership (P6, inactive) - #164727

Merged
steipete merged 6 commits into
mainfrom
dbasync/incogp6
Oct 4, 2026
Merged

steipete merged 6 commits into
mainfrom
dbasync/incogp6

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The staged incognito worker needs ACP metadata composition and shared authorization/lifetime checks before the complete runtime cutover can proceed.

User Impact

There is no user-visible activation in this PR. P6 remains inactive, and production incognito routing stays host-owned until P7. Shared ACP metadata persistence and retention remain unchanged. This adds no schema, durability, retention, configuration, environment variable, worker service, or update behavior change.

Why This Change Was Made

ACP reuses the existing entry kernel and shared metadata worker. The actor borrow exposes lazy ACP operations and retains the promise covering the entire import and operation before yielding, so close joins accepted work and grant callbacks cannot reenter the actor. Canonical entry changes commit before shared metadata publication; Doctor owns legacy-key repair. Compact actor receipts own publication.

Controller grants consume typed transaction-local facts. Board assessments retain an entry and revision fence across policy/reviewer waits. The existing shared-state idle pin remains held through actor loss, accepted work, and failed cleanup until native settlement. Nested grants preserve their outer fence. A shared leaf contract keeps actor and ACP types independent of their implementation modules.

Released SDK audit: the official v2026.9.8 → 04d9659a44c4b4349157bf8fbf917919c45b8fd1 comparison is checked, with acknowledgement digest 99450184 (full digest 994501847d622d2ebdff6d0f9e23a71112cb45ce5b781b03ce1089715ef74ab6). It records the full development-line SDK changes: 1 entrypoint added, 8 removed, and 2,316 affected exports. These totals include earlier changes on main. This PR’s changed actor, worker, and lifecycle callables are internal. The released ACP readers, manager facade, and runtime session-creation signatures remain compatible with v2026.9.8; no new compatibility/deprecation record is needed. Only tests invoke the prepared actor ACP/controller/Board routes. The worker-access reference records the remaining P7 cutover and deprecated synchronous contracts. Complete awaited SessionManager and BoardStore routing remains an activation prerequisite.

Grant audit: the touched ACP currentness chain uses retained identity/admission witnesses; controller fallback reads committed in-memory sharing/publication state. No retained other-owner host-SQL exception was identified in these touched grants. Native incognito control joins remain part of the documented P7 audit.

Related work: #162920 is incorporated, and this PR follows its Doctor-owned canonical ACP design. #160851 overlaps the test routing inventory; its independent changes are preserved.

Evidence

Candidate 04d9659a44c4b4349157bf8fbf917919c45b8fd1 incorporates main’s preview and native formatter repairs. Both integrations preserve the reviewed P6 patch exactly. The final released-SDK report is complete, and exact-head CI attempt 1 passed with no failed or cancelled jobs. ClawSweeper completed its review of this head with no code or security findings; its remaining SDK-report prerequisite is fulfilled by the recorded comparison above.

  • The complete changed-file sweep passed at 6663bac175fcba157a8064646b0e2ef2add7396e: production and test types, formatting, ratchets, all unused-export scans, core/script lint, database ownership, and the remaining guards. Runtime value cycles and static Madge cycles are both 0; the compiled-wrapper inventory passes. The P6 production modules and test cases are byte-identical after integration; wrapper and test-routing inventories preserve main’s additions. Codex autoreview is scoped-clean through P2; its complete P6 patch remains identical after integration.
  • The complete actor/controller/Board, existing ACP writer, and native incognito batch passed 44 tests, with 1 platform skip before the final lazy-loading fence correction. The import/build/wrapper batch passed 28 tests. No import edges changed in the later fence correction.
  • The expanded nested-grant regression first failed with exactly the two ACP refusals missing, then passed after the owner retained work before lazy loading. The corrected actor file passed all 10 cases. Successful actor CI also passed all ten, including the expanded grant fence in 519ms; ACP CI passed all five ACP cases (set/link/clear in 5.532s). Both ran the CI merge containing a7563da. The subsequent repair changes type-only imports/contracts and incorporates the same tested main snapshot.
  • A corrected-candidate local actor/ACP pair passed 13 cases but hit the unchanged 120-second deadline in the ACP snapshot case; the next policy case then missed its publication gate. This is retained as an unresolved local timing/fixture failure, not a passing retry or a claimed fix. Exact-head CI run 37176865489 subsequently passed all five ACP cases in isolated job 111361375119, including snapshot/policy refusal, disclosure, and retention. That validates the behavior on Linux; it does not claim the local timing failure was repaired.
  • A targeted run of the real mock-factory scanner accepts the documented synthetic model-mock isolation and detects the original unannotated factory. No baseline allowance was added.
  • Main’s suppression-inventory, large-ratchet-buffer, preview publication, and native duration-formatter fixes are incorporated. CI for 4b3a0b58 completed with only the UI test type error and its aggregate gate failing. The identical mcp-app-bridge.cursor.test.ts:13 TS2559 is independently recorded on scheduled main CI, in untouched UI files. Main subsequently fixed that fixture in 42b9aee33a7b03, and final-head CI passes the test-type gate. Skipped jobs are not claimed as passing coverage.
  • An earlier CI attempt failed the cleanup-exhaustion test’s global fake-timer count after its cleanup-state assertions passed. Its direct ordinary-session path does not enter P6’s prepared actor/controller route, and seven direct lifecycle/fixture owners match the tested main parent. The original assertion passed in all five candidate and five baseline whole-file runs. The single diagnostic Linux job rerun also passed it in 113ms using the same original tested merge. The cause remains unattributed; these non-reproductions are not a claimed fix. Both local heads separately reproduced an unchanged cold detached-cleanup timeout on their first run, then passed all 211 tests in each of four warm runs. Local proof used macOS/Node 26; CI used Linux/Node 24.
Original-head proof and test-cost context

The original f1cfb3c candidate had 44 passing cases and one platform skip on isolated Linux AWS Crabbox (154.65s command wall; 110.67s suite wall). Its four negative controls reproduced missing lifetime pins, nested-grant fencing, and revoked-policy persistence. These results are historical, not final-head proof.

Original single-file timings with pnpm test <file> --maxWorkers=1: actor owner 308.56s; actor sessions/controller/Board 164.96s; ACP actor 408.80s. Cold compiled-worker preparation dominated the loaded-host runs. These cases require real worker/SQLite ownership, native settlement and loss; mocks cannot establish those boundaries. Current CI timings and final isolated results will be recorded before landing.

Preserve shared ACP metadata persistence and sequencing while preparing actor entry commands, transaction-local controller guards, board snapshots, and shared idle-pin lifetime. Keep production host-owned until P7 and document the remaining synchronous SDK and caller cutover requirements.

Validation: 44 tests passed with one platform skip on isolated Linux; four pre-fix negative controls reproduced missing pins, grant reentrancy, and revoked-policy persistence. Changed-file checks, database-worker ratchet, zero-cycle checks, and Codex review through P2 passed. T1 remains 915; no new environment names.
@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: XL labels Oct 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 3:09 AM ET / 07:09 UTC (Revision 9).

ClawSweeper review

What this changes

Prepare private-session workers to coordinate external coding-agent metadata, controller authorization, Board approval snapshots, and database lifetime without activating production routing.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main lacks the prepared ACP composition, and the related Doctor migration does not replace it. The earlier canonical-storage finding is resolved; no actionable correctness or security findings remain.

Priority: P2
Reviewed head: 04d9659a44c4b4349157bf8fbf917919c45b8fd1

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused ownership composition, explicit negative controls, resolved prior feedback, and successful final-head validation provide strong review evidence.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The recorded Linux production-path harness exercises actual actor/shared workers and SQLite for set/link/clear, revoked-policy rejection before metadata publication, stale snapshots, and native-loss recovery; source assertions match those scenarios and final-head CI succeeds. Board model assessment is mocked, while its actor revision boundary is real. P6 remains inactive and introduces no stored-data format or retention change. Raw linked job logs were inaccessible through the artifact redirect.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The recorded Linux production-path harness exercises actual actor/shared workers and SQLite for set/link/clear, revoked-policy rejection before metadata publication, stale snapshots, and native-loss recovery; source assertions match those scenarios and final-head CI succeeds. Board model assessment is mocked, while its actor revision boundary is real. P6 remains inactive and introduces no stored-data format or retention change. Raw linked job logs were inaccessible through the artifact redirect.
Evidence reviewed 8 items Pinned patch ownership: Reviewed the introduced delta from dac9277 to the exact checkout/head. The raw head records the two supplied parents. The supplied test merge is stale and was not used to infer removal of current-main behavior.
Inactive production boundary: The documentation explicitly reserves activation for P7. Call-site searches show the prepared ACP methods, actor-backed controller selection, and Board snapshot parameter exercised by tests; production ACP mutation retains its native incognito branch. Current-main comparison still contains the unique P6 additions.
Authorization at shared metadata commit: The prepared ACP composition retains an actor revision and session claim, checks caller and shared-store currentness, and invokes session authorization at transaction and commit admission. Entry changes precede metadata publication; confirmed receipts retain publication ownership.
Findings None None.
Security None None.

How this fits together

Incognito sessions keep conversation entries in volatile agent storage, while ACP metadata for external coding agents belongs to shared state. This preparation coordinates those owners and carries current authorization through asynchronous reads and writes.

flowchart TD
  A[Private session request] --> B[Retained session worker]
  B --> C[Current session and authorization facts]
  C --> D[Canonical entry mutation]
  D --> E[Shared ACP metadata worker]
  E --> F[Confirmed publication]
  C --> G[Controller and Board assessment]
  G --> H[Currentness check after waits]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +473, Tests +526, Docs +66, Other +6. Total +1071 across 20 files.

View PR surface stats
Area Files Added Removed Net
Source 14 666 193 +473
Tests 4 526 0 +526
Docs 1 66 0 +66
Config 0 0 0 0
Generated 0 0 0 0
Other 1 6 0 +6
Total 20 1264 193 +1071

Review metrics

Metric Value Why it matters
Production versus test growth production +666/-193 (net +473); tests +525/-0 Production growth is explained by staged cross-owner composition and authorization/lifetime handling; existing metadata grant logic is extracted rather than duplicated.

Technical review

Best possible solution:

Retain this staged composition and complete the documented caller and synchronous-contract cutover before activating worker-owned incognito routing.

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

Not applicable: this PR prepares an inactive internal capability rather than reporting a current user-facing defect; its worker-boundary failure scenarios are explicitly covered.

Is this the best way to solve the issue?

Yes: composing the existing entry and shared metadata owners preserves sequencing and avoids a competing persistence implementation or premature activation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5f656752e404.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is bounded internal ownership preparation with production activation deferred and no demonstrated urgent user-facing regression.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The recorded Linux production-path harness exercises actual actor/shared workers and SQLite for set/link/clear, revoked-policy rejection before metadata publication, stale snapshots, and native-loss recovery; source assertions match those scenarios and final-head CI succeeds. Board model assessment is mocked, while its actor revision boundary is real. P6 remains inactive and introduces no stored-data format or retention change. Raw linked job logs were inaccessible through the artifact redirect.
  • proof: sufficient: Contributor real behavior proof is sufficient. The recorded Linux production-path harness exercises actual actor/shared workers and SQLite for set/link/clear, revoked-policy rejection before metadata publication, stale snapshots, and native-loss recovery; source assertions match those scenarios and final-head CI succeeds. Board model assessment is mocked, while its actor revision boundary is real. P6 remains inactive and introduces no stored-data format or retention change. Raw linked job logs were inaccessible through the artifact redirect.

Evidence

What I checked:

  • Pinned patch ownership: Reviewed the introduced delta from dac9277 to the exact checkout/head. The raw head records the two supplied parents. The supplied test merge is stale and was not used to infer removal of current-main behavior. (04d9659a44c4)
  • Inactive production boundary: The documentation explicitly reserves activation for P7. Call-site searches show the prepared ACP methods, actor-backed controller selection, and Board snapshot parameter exercised by tests; production ACP mutation retains its native incognito branch. Current-main comparison still contains the unique P6 additions. Public docs: docs/reference/database-schemas/worker-access.md. (docs/reference/database-schemas/worker-access.md:280, 04d9659a44c4)
  • Authorization at shared metadata commit: The prepared ACP composition retains an actor revision and session claim, checks caller and shared-store currentness, and invokes session authorization at transaction and commit admission. Entry changes precede metadata publication; confirmed receipts retain publication ownership. (src/acp/runtime/session-meta-worker-mutation.ts:235, 04d9659a44c4)
  • Native boundary and forbidden-state coverage: The ACP fixture uses actual actor and shared-state workers with SQLite. Injected publication delays prove changed snapshots and revoked policy reject before metadata persistence; a separate case rejects disclosure after policy revocation. Actor tests terminate the real owning worker and verify lifetime pins survive accepted work and failed cleanup. Board tests mock model assessment while exercising actor revisions across policy/reviewer waits. (src/state/openclaw-agent-execution-incognito.acp.test.ts:137, 04d9659a44c4)
  • Re-review continuity: The previously reported canonical ACP issue is resolved by reusing the entry kernel and canonical metadata mutation owner; retired runtime alias handling is not restored. The body records the completed v2026.9.8 SDK comparison with acknowledgement digest 99450184. Searches of SDK surfaces found no export of the newly changed internal actor, controller, or Board callables. (src/acp/runtime/session-meta-write.ts:161, 04d9659a44c4)
  • Final-head validation: GitHub reports run https://github.com/openclaw/openclaw/actions/runs/37181774926 completed successfully on the exact reviewed head, attempt 1. The supplied body records real worker scenarios, negative controls, and Linux ACP/actor results; later integrations preserve the inspected production modules and tests from 6663bac. No target code was executed during this review. Retrieving the earlier linked job log was blocked at GitHub's Azure artifact redirect, so raw log contents were not independently inspected. (04d9659a44c4)

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 (8 earlier review cycles)
  • reviewed 2026-10-04T03:10:59.938Z sha f1cfb3c :: needs changes before merge. :: [P1] [P1] Update the actor adapter to canonical ACP contracts
  • reviewed 2026-10-04T03:16:37.776Z sha f1cfb3c :: needs changes before merge. :: [P1] [P1] Update the actor adapter to canonical ACP contracts
  • reviewed 2026-10-04T04:29:16.958Z sha a7563da :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T05:10:24.257Z sha 6663bac :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T05:17:04.350Z sha 6663bac :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T05:51:33.840Z sha 4b3a0b5 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T06:10:37.644Z sha 04d9659 :: needs changes before merge. :: none
  • reviewed 2026-10-04T06:27:53.846Z sha 04d9659 :: needs maintainer review before merge. :: none

@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Merge current main to consume the Doctor-owned ACP migration contract. Keep P6 inactive, remove retired runtime legacy-key and cleanup calls, consolidate ACP composition in its existing mutation owner, and complete the compiled wrapper dependency inventory. Preserve entry-before-metadata ordering and update the focused sequence proof.
Merge main to include its suppression-inventory fix. Expose ACP operations through the inactive actor borrow, retaining the full lazy-load and operation promise before any await. Extend the nested-grant regression to both ACP methods; the unguarded binding fails this control. Document intentional model-mock isolation without expanding its baseline. Production incognito routing remains native until P7.
@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 Oct 4, 2026
Merge main CI ratchet fixes and move shared ACP input/result shapes into a leaf contract. Remove static implementation-type cycles while preserving lazy runtime loading inside actor custody. Production incognito routing remains inactive and released Plugin SDK call signatures remain compatible.
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. label Oct 4, 2026
@clawsweeper clawsweeper Bot added the rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. label Oct 4, 2026
@steipete
steipete merged commit 2790429 into main Oct 4, 2026
203 checks passed
@steipete
steipete deleted the dbasync/incogp6 branch October 4, 2026 07:14
@steipete

steipete commented Oct 4, 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 5, 2026
…#164727)

Preserve shared ACP metadata persistence and sequencing while preparing actor entry commands, transaction-local controller guards, board snapshots, and shared idle-pin lifetime. Keep production host-owned until P7 and document the remaining synchronous SDK and caller cutover requirements.

Validation: 44 tests passed with one platform skip on isolated Linux; four pre-fix negative controls reproduced missing pins, grant reentrancy, and revoked-policy persistence. Changed-file checks, database-worker ratchet, zero-cycle checks, and Codex review through P2 passed. T1 remains 915; no new environment names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts 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