Skip to content

fix(gateway): scope session events and mention notifications - #184502

Merged
roboclaw-bot merged 1 commit into
mainfrom
fix/guest-access-04-live-events-20261026
Oct 28, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
fix/guest-access-04-live-events-20261026

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Session-only clients lose targeted Inbox invalidations, while session and presence events must respect invitation membership.

User Impact

Deliver bounded mentions.changed notifications only to intended connections; scope session events and the additive mentions.failed envelope to current readers.

Why This Change Was Made

Reuse canonical sharing projections for presence/events. The keyless invalidation exception requires a targeted, validated payload; it is not a general broadcast exemption.

Stack step 5/17, based on fix/guest-access-03-rpc-reads-20261026. Review and merge in order; each upper PR contains only its own slice against its predecessor.

Previous: recheck access before RPC reads return.

Next: guard collaboration reads and interactions.

Stack order: complete stack.

Evidence

Slice head: 85c7e9427eccd6bbf9ebf9f1c182420a19065aed, on fixed main 5bf0c41a03f1dba03d625460607ed5b959710458. The complete 13-file integration matrix passed 46/46 on pinned Bun at ddc49fd63d3b82e41eb6c74af4ad935a56aebc8f before this main rebase. Main's canonical fixture repairs are preserved and duplicate prerequisite changes removed. Prefixes are not separately built locally; each requires its own current-head hosted CI and review.

The final authenticated TLS/WebSocket integration covers child-only versus parent membership, current viewers/presence, scope preservation, and a text event already queued behind a held send. Removing membership before queue drain prevents disclosure. Event payloads are synthetic; recipient projection, broadcaster, queue and transport are real. Existing targeted Inbox, malformed-envelope and serialization regressions remain.

The stack evidence ledger records runtime results, prior build/upgrade proof and limits. Integration tests are owned by the final activation PR. Current-head hosted CI and review remain required before landing.

Current-head qualification

At 85c7e9427eccd6bbf9ebf9f1c182420a19065aed, hosted CI and the required openclaw/ci-gate passed. The current-head ClawSweeper review reports no findings or required rank-up moves. Maintainer review and the documented stack order still apply.

Change size

Production +49/-7; tests +55/-2; generated +6094/-6066.

Session event authorization and bounded targeted Inbox notifications share the canonical membership projection.

The large generated diff is predicate renumbering from the additive mention-failure event; protocol version is unchanged.

Test-line allowance

config/test-lines-baseline.txt: 6,283,321 → 6,283,374 (+53). Covers targeted Inbox envelopes and session-event authorization. The ceiling equals this prefix's measured 6,283,374 test lines; no spare allowance is added. This is a bounded baseline exception under the repository testing workflow, not a functional-test waiver. No runtime assertion, SDK budget or required CI check is weakened. Change-size test counts include the baseline metadata edit.

Current landing qualification — October 28

This section supersedes prior-head qualifications retained above. Current head: 4c0830b, restacked only the event slice onto main 27a0be4. Main's existing UI lint repair is preserved. The prerequisite #186308 was closed as superseded, not merged: main c8df2834 / #186330 independently fixes the shared-observer startup failure, and latest scheduled-main evidence shows the exact case passing in 69 ms and all 18 tests in that file passing (the aggregate job has other failures).

The ceiling is 6,293,290, exactly the canonical test-line total of verified GitHub merge candidate e3967fab8aa77007824707bcdaa6f8d4eaebb942, whose parents are the pre-counter-correction head ad889b64b4825441a3848454206f79f36d0a3bce and main d249181: zero candidate slack. The head-only count is 6,293,049; 241 existing main test lines explain the difference. No tests are deleted and no future allowance is added. Current-head CI’s baseline ratchet passes.

Local validation and review

  • Six focused owner suites: 71/71, all six files passing; 50.02s Vitest / 53.40s wrapper. This includes the formerly failing shared-observer fixture now repaired on main.
  • tsgo:core, scoped typed lint (11 core/package inputs and the presence performance consumer), changed-file formatting, protocol-validator check and git diff --check pass.
  • Regenerated TypeBox protocol outputs with pnpm gateway:validators:gen. The bulk is still generated predicate renumbering, not hand-written “other” code. Current main's added session-row fields remain intact; no protocol-version bump.
  • Fresh independent local autoreview: Codex GPT-6.1 Sol, P0–P2, all three complete committed-range passes clean with no findings. Reviewed head 6306e107be906c6add4fb934bba9d09a59f29700; both later changes are only test-line counter corrections. No project code was executed by the reviewer.

Fresh AWS behavior proof

The range from the original tested main 91e8cd0 to the new base touched event/sharing/mention owners, so the earlier AWS run was not simply carried over. A fresh AWS openclaw-check c7a.2xlarge lease (observed 8 CPUs, 16,371,785,728 bytes RAM) ran the complete four-build/six-scenario comparison. AWS doctor passed; secretless execution used Node 24.22.1, pinned pnpm, no hydration or instance-IAM credentials, isolated synthetic state/free ports, signed real WebChat devices, trusted-proxy authentication, exact proxy scope caps, protocol 4, and no admin scopes. Connections started only after /readyz reported ready.

Runtime-tested and published head: 4c0830b, versus main 27a0be4. A new baseline-only merge conflict was resolved under existing landing authority. The newly integrated main range changes session-row preparation/presentation and sharing-related tests, so another fresh lease reran the entire proof rather than carrying over the preceding run. Both previously completed fresh proof leases were already independently verified released.

All stages passed: main/head original builds, each proof-enabled build, main/head × view/none/invited, generated-hash checks, exact proof-diff guards, comparison and source restoration. All six Gateway processes and their process groups exited cleanly; all WebSockets closed, without forced cleanup.

  • view/none: session-event, presence and valid targeted mentions.changed behavior is identical on main/head, including narrow session readers.
  • invited: members receive shared-session events, watched-session presence and targeted Inbox invalidations; unrelated connections get no shared-session data. Public membership removal on existing live sockets stops the next session events, presence references and targeted session-bearing failure notifications.
  • targeting/keyless bounds: mentions.failed reaches only the selected authorized target. Valid keyless invalidation targets only the selected connection; narrow readers receive no keyless broadcast; malformed extra-field invalidations are rejected. General-read clients retain their existing broad grant.
  • Main negative controls: invited member presence lacks the watched-session reference; main accepts the malformed targeted invalidation that head rejects. Main has no mentions.failed registration.

Synthetic plugin ingress uses the real request-context broadcaster; public RPCs own session creation, membership, subscriptions, viewers and label mutations. No authorization predicate, projection, client or transport is mocked. This proves delivery, not Inbox ingestion/persistence or inference. Ancestor recaps were absent for both owner/member in the real label-event scenario, so no live ancestor-recap claim is made.

Compute release was independently verified at 2026-10-28T01:47:08.613Z: released, no host, not ready, cleanup complete, and no possible provisioning resource remaining. Evidence was downloaded before release and re-read afterward with matching SHA-256. Archive digest: f2b45b26f01a27328fb7e3b3b3e6f6d6405dec3e2bc87432a1a40c74eca79128. Raw identities, keys, endpoints, state and logs are not published.

Main owner-path changes requiring the fresh run
src/gateway/session-row-child-activity.ts
src/gateway/session-row-child-visibility.ts
src/gateway/session-row-event-parity.test.ts
src/gateway/session-row-placement-projection.lifecycle.test.ts
src/gateway/session-row-prepared-read.ts
src/gateway/session-row-presentation.test.ts
src/gateway/session-row-presentation.ts
src/gateway/session-row-projection-context.ts
src/gateway/session-row-projection-record.ts
src/gateway/session-row-projection.test-support.ts
src/gateway/session-row-projection.ts
src/gateway/session-sharing.test.ts
src/config/sessions/session-membership-facts.ts
src/gateway/event-web-push.ts
src/gateway/server-connection-state.ts
src/gateway/mention-inbox-targets.ts
src/gateway/mention-inbox.sharing-target.test.ts
src/gateway/server-broadcast.live-text.test.ts
src/gateway/session-event-projection.ts
src/gateway/session-row-delta-fields.test.ts
src/gateway/session-row-delta-fields.ts
src/gateway/session-row-placement-projection.ts
src/gateway/session-row-prepared-read.ts
src/gateway/session-row-projection-ancestors.ts
src/gateway/session-row-projection-catalog.test.ts
src/gateway/session-row-projection-catalog.ts
src/gateway/session-row-projection-refresh.ts
src/gateway/session-row-projection.archived.test.ts
src/gateway/session-row-projection.list-page.test.ts
src/gateway/session-row-selection.retained.test.ts
src/gateway/session-sharing-preparation.test.ts
src/gateway/session-sharing-preparation.ts
Exact proof-only enablement — never pushed

Generated with pnpm config:schema:gen and pnpm config:docs:gen; pnpm config:docs:check passed. Only the enum and generated hash file changed; both restored after proof. Diff SHA-256: ff868bcacf47b9b12e6a5e0acc6705189ff3b696dc4e6d0fff2973e4fda93923.

diff --git a/docs/.generated/config-baseline.sha256 b/docs/.generated/config-baseline.sha256
index 7e582aa080f..1d7b06c8f0c 100644
--- a/docs/.generated/config-baseline.sha256
+++ b/docs/.generated/config-baseline.sha256
@@ -1,4 +1,4 @@
-52fb00650f4bbfba174bdc9a70a0cf0145fa533a51c4bfcb20f5ea728dab2f0c  config-baseline.json
-a4ffaa84a09639fc7e567cf5ddc7122896bc94f68509ded84e1df0411bd004b8  config-baseline.core.json
+d4ac815f178084d8ab2caf12a3e0dcbf9da376d81f790ffea962a75b95635980  config-baseline.json
+ac8922cbb5a6e506bf040e32afe50b21864cfb6cd5e5255c46bd036fbb3bb336  config-baseline.core.json
 ccce9721e1f520082677f456154916ea67d33e9168ec3d533c21172f7377a756  config-baseline.channel.json
 736eb9f45be0179b91ecc61abe75980bea420bcaa1357d7681aecbc564fa9bec  config-baseline.plugin.json
diff --git a/src/config/zod-schema.gateway.ts b/src/config/zod-schema.gateway.ts
index 3131f6a07bf..465b8d8a6bf 100644
--- a/src/config/zod-schema.gateway.ts
+++ b/src/config/zod-schema.gateway.ts
@@ -82,7 +82,7 @@ const GatewayGitHubEndpointSchema = z
 export const GatewayOperatorRoleDefinitionSchema = z.strictObject({
   sessions: z.strictObject({
     /** Maximum access to another person's sessions without explicit membership. */
-    others: z.enum(["none", "view", "suggest", "write"]),
+    others: z.enum(["none", "invited", "view", "suggest", "write"]),
   }),
   /** Require sandbox isolation for newly created sessions, or inherit agent policy by default. */
   sandbox: z.enum(["inherit", "required"]).optional(),

Current CI attribution

Prior run 40605493581 also failed Android Play: NodeRuntimeAgentSelectionTest.failedDiscoveryRetryInitializesChatEvenWhenTheMainKeyIsUnchanged, assertFalse(history.isCompleted), line 1062 (3,634 tests, one failure). The Android source tree is unchanged between the passing scheduled-main Android Play job, this head, and that failing merge parent. Its fixture uses an in-process synthetic Gateway, so this TypeScript event patch is not exercised. This is an unrelated flaky result, not a proven deterministic defect; no Android code, assertions or timeouts were changed and no CI rerun/dispatch was requested. The current metadata correction repairs the actual ratchet defect and legitimately triggers new exact-head CI. ci-gate success, clean exact-head ClawSweeper and CLEAN merge state remain mandatory; no inherited-failure bypass is selected.

Exact-head CI

Run 40613787535 is green for 4c0830b, including the baseline ratchet and Android lanes. No CI rerun, dispatch or empty green-only push was used. This remains separate from required exact-head ClawSweeper and CLEAN merge state.

@vincentkoc vincentkoc self-assigned this Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 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 app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts size: S labels Oct 26, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR applies session membership to presence and ancestor events, validates targeted Inbox invalidations, and registers mention-failure notifications.

Example: An invited reader watches agent:main:shared.

  • Before: Presence filtering ignores the reader's membership and omits the watched-session reference.
  • After: The reader receives the reference while membership remains valid, and loses it after removal.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused owner-level repair with shipped Gateway evidence, meaningful negative controls, and no actionable findings; pending CI remains a separate landing gate.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The fresh built-Gateway report exercises public RPCs and real authenticated WebSockets for allowed members, unrelated recipients, malformed invalidations, and live membership revocation; the linked production-path TLS coverage additionally exercises ancestor filtering and queued-text revocation, while the latest live label-event run explicitly makes no ancestor-recap claim.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Invited readers can miss authorized presence and ancestor updates, while session-only Inbox delivery needs a narrowly defined invalidation exception.
Reason: The maintainer-authored direction repairs the existing invitation and scoped-reader contracts using established sharing and delivery owners.

Merge readiness

✅ Ready for maintainer review

This PR provides a useful, maintainer-approved authorization repair with no actionable findings; exact-head CI is still pending.

Priority: P2
Reviewed head: 4c0830b74554d7b2b05cce12efe5b6af6737c503

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway broadcaster receives session, presence, and Inbox events, applies current recipient scopes and sharing authority, and sends projected frames over each connection.

flowchart LR
  A[Session and Inbox producers] --> B[Gateway broadcaster]
  C[Current profiles and memberships] --> D[Recipient projections]
  B --> D
  D --> E[Scope and delivery checks]
  E --> F[WebSocket recipients]
Loading

Technical review

Best possible solution:

Land this focused event slice through the existing sharing owners once required exact-head checks pass.

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

Current main explicitly supplies no membership to presence filtering and uses a membership-blind ancestor filter; the supplied main/head Gateway comparison independently demonstrates the presence and malformed-invalidation differences.

Is this the best way to solve the issue?

The patch is the smallest coherent repair: it supplies existing membership facts to existing projections, replaces the broad invalidation exemption, and adds the bounded failure-event contract without another state owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 189e653d99ad.

Provenance checked

  • Presence projection keeps the original intent (c817021: Move presence onto committed sharing facts while preserving recipient visibility; later audience sharing retained per-recipient authorization.)
  • Ancestor event projection keeps the original intent (124ddc0: Bind prepared publications to current projection facts; later presentation sharing preserved recipient visibility and connection-specific ancestor history.)
  • Targeted guest Inbox invalidation keeps the original intent (68cd29b: Allow eligible session-only readers to receive their own targeted Inbox revision notifications without granting conversation access.)
  • Generated protocol predicates keeps the original intent (f52fb07: Generate fixed-schema validators ahead of runtime; reversing identifier renumbering leaves only the additive mention-failure schema and exports.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced change: The pinned introduced range contains the focused event changes; unrelated base-only changes are outside this PR's ownership. (4c0830b74554)
  • Membership-aware presence: Presence now obtains membership from the resident projection and uses the existing sharing owner's target check; publication caches retain their existing sharing-revision invalidation. (src/gateway/presence-projection.ts:101, 4c0830b74554)
  • Ancestor authorization: Ancestor envelopes resolve the physical sharing target and check current membership before presentation, while hidden ancestors retain the existing reference-forgetting path. (src/gateway/session-event-projection.ts:225, 4c0830b74554)
  • Targeted invalidation boundary: The keyless session-read exception requires a targeted plain mentions.changed envelope containing only gatewayInstanceId and a nonnegative safe-integer revision; session-bearing events retain the broadcaster's current-access check. (src/gateway/server-broadcast-scopes.ts:128, 4c0830b74554)
  • Fresh runtime evidence and source correspondence: The full PR body records real built Gateway comparisons for view, none, and invited roles, including unrelated-recipient denial, malformed invalidation rejection, and membership removal on live sockets. GitHub's tested-commit file blobs match the reviewed runtime files, including generated validators. (4ce337460f78)
  • Linked production-boundary coverage: The integration source in feat(auth): enable guests to access sessions through selected mentions #184515 exercises parent versus child membership, ancestor removal, presence filtering, and revocation before retained text drains through real TLS transport; it wraps the real connection owner rather than replacing authorization. (src/gateway/server.guest-events.test.ts:8, 47b8b4485615)

PR surface

Source +67, Tests +53, Other +3. Total +123 across 16 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 11 6140 6073 +67
Tests 2 54 1 +53
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 5 2 +3
Total 16 6199 6076 +123

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded repair to shared-session event visibility and targeted Inbox delivery, without evidence of an urgent widespread 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.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (5 earlier review cycles)
  • reviewed 2026-10-26T10:52:05.970Z sha ce0d080 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-27T11:54:01.893Z sha 03f7a08 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-27T13:14:37.626Z sha 85c7e94 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-28T00:42:08.120Z sha 4ce337460f78d3b16f1af00777cee1c29aa7d200 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-28T00:50:01.075Z sha 4ce337460f78d3b16f1af00777cee1c29aa7d200 :: needs maintainer review before merge. :: none

Reviewed October 27, 2026, 9:19 PM ET / October 28, 2026, 01:19 UTC (Revision 6).

@vincentkoc
vincentkoc force-pushed the fix/guest-access-04-live-events-20261026 branch from ce0d080 to a04d554 Compare October 27, 2026 08:16
@vincentkoc
vincentkoc force-pushed the fix/guest-access-03-rpc-reads-20261026 branch from 3a63dc4 to 44c5b6d Compare October 27, 2026 08:16
@vincentkoc
vincentkoc marked this pull request as ready for review October 27, 2026 08:19
@vincentkoc
vincentkoc force-pushed the fix/guest-access-04-live-events-20261026 branch from a04d554 to d639c52 Compare October 27, 2026 09:29
@vincentkoc
vincentkoc force-pushed the fix/guest-access-03-rpc-reads-20261026 branch from 44c5b6d to 3f6a519 Compare October 27, 2026 09:29
@roboclaw-bot
roboclaw-bot force-pushed the fix/guest-access-03-rpc-reads-20261026 branch from 3f6a519 to 4f8b756 Compare October 27, 2026 10:50
@vincentkoc
vincentkoc force-pushed the fix/guest-access-04-live-events-20261026 branch from d639c52 to 0db3b01 Compare October 27, 2026 11:28
@vincentkoc
vincentkoc force-pushed the fix/guest-access-03-rpc-reads-20261026 branch from 3037b45 to 0430e19 Compare October 27, 2026 11:28
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Oct 27, 2026
@roboclaw-bot
roboclaw-bot force-pushed the fix/guest-access-04-live-events-20261026 branch from 85c7e94 to 04e7cc8 Compare October 27, 2026 20:47
@openclaw-barnacle openclaw-barnacle Bot removed the docs Improvements or additions to documentation label Oct 27, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@roboclaw-bot
roboclaw-bot force-pushed the fix/guest-access-04-live-events-20261026 branch 3 times, most recently from 58ef39f to 35b285e Compare October 28, 2026 00:30
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@roboclaw-bot
roboclaw-bot force-pushed the fix/guest-access-04-live-events-20261026 branch from 35b285e to 4ce3374 Compare October 28, 2026 00:35
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Oct 28, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@roboclaw-bot
roboclaw-bot force-pushed the fix/guest-access-04-live-events-20261026 branch from 4ce3374 to ad889b6 Compare October 28, 2026 01:12
@roboclaw-bot
roboclaw-bot force-pushed the fix/guest-access-04-live-events-20261026 branch from ad889b6 to 4c0830b Compare October 28, 2026 01:14
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@roboclaw-bot
roboclaw-bot merged commit beb12fa into main Oct 28, 2026
139 checks passed
@roboclaw-bot
roboclaw-bot deleted the fix/guest-access-04-live-events-20261026 branch October 28, 2026 01:49
roboclaw-bot added a commit that referenced this pull request Oct 28, 2026
Resolves the test-line ceiling conflict with #184502: main at beb12fa counts
6,293,568 test lines against its ceiling of 6,293,290, and this PR adds 74,
so the ceiling is the merged total of 6,293,642 with no extra slack.

Co-authored-by: jalehman <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
…#184500)

## What Problem This Solves

Direct session reads can cross asynchronous preparation while a guest's membership or committed role policy changes.

## User Impact

History, metadata, session descriptions, progress cards, legacy search and in-process reads use current session access at publication.

## Why This Change Was Made

Carry retained membership facts through the existing read owners and repeat authorization after awaited preparation. Legacy search selects requests using the committed policy in the synchronous publication frame. Unrestricted retired-store searches retain copied-transcript deduplication; role-filtered reads still reject ambiguous metadata.

Preserves the concurrent [publication-policy follow-up](openclaw@3037b45) with its authorship.

Stack step **4/17**, based on [fix/guest-access-runtime-fixtures-20261027](https://github.com/openclaw/openclaw/tree/fix%2Fguest-access-runtime-fixtures-20261027). Review and merge in order; each upper PR contains only its own slice against its predecessor.

Previous: [repair fixtures and refresh worker inventory](openclaw#185780).

Next: [scope live events and Inbox notifications](openclaw#184502).

Stack order: [complete stack](openclaw#184515 (comment)).

## Evidence

Slice head: `3b7709a811b1d7902321dd77ae1eb8c568579f91`, on fixed main `2a97a1e02a3085cded2db1cb0f971bd99d918252`. The complete 13-file integration matrix passed 46/46 on pinned Bun at `ddc49fd63d3b82e41eb6c74af4ad935a56aebc8f` before this main rebase. Main's canonical fixture repairs are preserved and duplicate prerequisite changes removed. Prefixes are not separately built locally; each requires its own current-head hosted CI and review.

The final integration exercises authenticated metadata reads and the production subagent transport. An unrelated guest receives no private result and sends no provider request; membership enables both. Removing membership after metadata or real DNS/SSRF preparation rejects publication/dispatch. The provider case uses the production runtime caller and a loopback HTTP provider, not the authenticated WebSocket fork entry point. The four-file RPC regression set also passed 29/29 on Node and pinned Bun at `5cd3488508bfbd52b4c59ad7736f84831e60ed22`.

The [stack evidence ledger](openclaw#184515 (comment)) records runtime results, prior build/upgrade proof and limits. Integration tests are owned by the final activation PR. Current-head hosted CI and review remain required before landing.

### Current-head qualification

At `3b7709a811b1d7902321dd77ae1eb8c568579f91`, [hosted CI](https://github.com/openclaw/openclaw/actions/runs/40508432889) and the required `openclaw/ci-gate` passed. The [current-head ClawSweeper review](openclaw#184500 (comment)) reports no findings or required rank-up moves. Maintainer review and the documented stack order still apply.

## Change size

Production **+174/-80**; tests **+620/-8**.

Current membership is rechecked at retained/asynchronous read publication, using the existing authorization owner.

### Test-line allowance

`config/test-lines-baseline.txt`: **6,282,239 → 6,283,321** (**+1,082**). Retained-read and committed-policy regressions require 612 added test lines. This first test-growing slice also accounts for the fixed main's existing 472-line overage, less the prerequisite's two-line reduction. The ceiling equals this prefix's measured 6,283,321 test lines; no spare allowance is added. This is a bounded baseline exception under the repository testing workflow, not a functional-test waiver. No runtime assertion, SDK budget or required CI check is weakened. Change-size test counts include the baseline metadata edit.


## Final-head AWS qualification — October 27, 2026

This section supersedes the earlier head-specific qualification and test-line numbers above; the original stack description, credit, and complete-stack evidence are retained. Final candidate: `a020f29e47fba3cf4e86741bdcaab6966f709a49`, rebased on main `868c09e1a1b618cc898be1545084f23e0504952a`. The three existing slice commits were retained patch-identically apart from resolving the measured ceiling; the additional follow-up fixes the independently reproduced search-publication gap described below. A later main update conflicted only in the global ceiling; the four product/test patches remained unchanged through that restack, confirmed by range-diff. The complete fresh AWS matrix below was repeated on this exact resulting head rather than relabeling the earlier successful run. Prerequisite openclaw#185780 is merged, and this PR now targets main.

### Final-effect regression and local checks

A real legacy, unfiltered search handler regression failed on `bebf096d87566de82f727b780161770b91d1ee6b`: changing the session from shared to draft after the final metadata worker read still returned its private snippet plus indexing/truncation/archive metadata. The fix checks the existing projection owner's committed sharing facts with the existing access-change predicate, synchronously before selection/publication. The cap-downgrade companion and draft-transition regression now both pass. This preserves Vincent's unrestricted retired-store deduplication behavior; no new authorization owner, config option, schema, or protocol is shipped.

- Final candidate: **100 tests passed across 9 scoped files**, including the new regression and affected read, metadata, scoped-search, and in-process consumers.
- The focused search set passed **25/25 across 3 files**; the draft case was red on the prior candidate. Earlier base-red member-admission evidence remains distinct from this additional red/green result.
- **Core typecheck, scoped typed lint (10 files), formatting, and diff whitespace checks passed.** Fresh independent P0–P2 review of the repair was scoped-clean. Canonical local autoreview also reviewed the final committed range (main `868c09e1a1b618cc898be1545084f23e0504952a` → candidate `a020f29e47fba3cf4e86741bdcaab6966f709a49`) through P2: one complete frozen-input pass, exit 0, scoped-clean, with no actionable findings. The reviewer did not run code; runtime and test evidence are reported separately.
- Final diff against the pinned main base: production **+181/-79**, regression tests **+628/-7**, plus the ceiling metadata **+1/-1**.
- Canonical ratchet: **6,287,068 test lines; ceiling 6,287,068; zero slack**. The ceiling is 665 above the base's recorded 6,286,403: 621 new test lines and the base's existing 44-line overage. The invited-membership regressions guard a security boundary, and offsetting them by deleting other tests would remove coverage. This is the exact measured final-tree allowance authorized for this stack, not a test waiver.
- Final-head hosted CI: [40566580413](https://github.com/openclaw/openclaw/actions/runs/40566580413). Its required ci-gate and exact-head review remain required before landing.

### Fresh AWS behavior proof

AWS doctor passed before a fresh `openclaw-check` / `c7a.2xlarge` lease (measured **8 CPUs, 15,613 MiB RAM**). The trusted secretless bootstrap verified that the instance-role credentials endpoint returned 404. Independent runtime builds used the exact candidate and its pinned main base, then booted real isolated Gateways with synthetic state. All reads crossed authenticated **WebSocket protocol 4**, trusted-proxy identities, and only `operator.read` / `operator.write` scopes—**no admin scope**. No Team Gateway, real conversation, or real model credential was used.

The seven RPCs were `chat.history`, `chat.startup`, `chat.metadata`, `sessions.describe`, `sessions.get`, `sessions.preview`, and `sessions.search`. Content reads asserted the synthetic canary, not just success flags.

| Scenario | Disclosing reads | Result |
|---|---:|---|
| Existing view / none policies, owner/member/unrelated, before and after membership removal | Identical normalized content/authorization results on base and head | Pass |
| Invited head, member | 7/7 | Pass |
| Invited head, unrelated principal | 0/7 | Pass |
| Invited head, member immediately after real membership removal | 0/7 | Pass |
| Main negative control with the same proof-only enum enablement, member | 0/7 | Pass |

A disposable plugin also drove the real public SDK `subagent.forkSession` path from the authenticated WebSocket caller to a local HTTP model fixture. An admitted member caused real inference I/O; a nonmember caused none. The next member fork was held in the model response, and another member fork reached the real subagent queue after retained-read preparation. Membership was then removed through the real RPC. **Both active and queued responses were withheld; the queued request made no model call: request count 2 → 2.** The queue observation used public diagnostics, not mocked authorization or inference.

**Wrapper result: exit 0, succeeded**, with both protocol phases and the final AWS proof assertion passing. The corrected idempotent held-response finalizer completed cleanly. Candidate/base build times were 144.29 / 131.00 seconds; invitation-variant builds were 107.39 / 117.37 seconds.

### Proof-only enablement and cleanup

Invitation config activation still belongs to the final stack slice. Only in disposable, unpushed proof variants of **both** candidate and main, the enum was enabled as follows:

```diff
- others: z.enum(["none", "view", "suggest", "write"]),
+ others: z.enum(["none", "view", "suggest", "write", "invited"]),
```

The canonical `pnpm config:docs:gen` regenerated the two affected hashes in `docs/.generated/config-baseline.sha256`; these were the only additional tracked proof-variant changes. Normal commit hooks ran. Neither enablement variant was pushed.

After collecting the sanitized summaries, source/tree identities and both enablement diffs, blocking release and an independent inspection confirmed **released, no host, not ready, cleanup complete, no provisioning resource remaining** at **2026-10-27T19:30:13.175Z**. The collected archive was readable with the same SHA-256 after release: `e63aa15f834bcf74a74253880db6003cbdcd2560627897a94d56dca397c295ed`. Lease identifiers, principal/session IDs, addresses, keys and endpoints are omitted from this public evidence.

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui 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.

2 participants