Skip to content

feat(session-share): authorize device-granted session reads - #201074

Merged
vincentkoc merged 2 commits into
mainfrom
feat/session-share-device-source-20261118
Nov 18, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
feat/session-share-device-source-20261118

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Source operators need to publish a limited set of sessions to a specifically approved reader device, not every device or a caller-selected person.

User Impact

Gateway publication is off by default. Operators must opt in, grant exact device IDs, and configure both session groups and a canonical person. Paired-node commands retain their existing behavior.

Why This Change Was Made

Uses the preceding host admission, then applies source-owned grants and group-and-person selection. Results are consumed inside the native final source guard. Wire parameters cannot choose a person or grant. Current source, identity and token authority remain required through disclosure.

Includes a real signed WSS source fixture using isolated state and a test-owned identity; the outbound catalog adapter follows separately.

Evidence

The source-only candidate passed 23 tests across four files, plus two signed-WSS cases with roles enabled/disabled, before the outbound adapter was added. Scoped types, lint and configuration checks passed. The explicit package-local check passed with emitted SDK declarations and Node 26/ES2024 libraries.

The stock ES2023 library check reports Promise.withResolvers in unchanged session-catalog.ts. Session Share has no opt-in package-boundary tsconfig; the standard selector compiled no source-only packages and ran its negative canary. No configuration was changed to suppress that limitation. Independent exact-slice review accepted publication.

The WSS fixture uses test-owned identities, pinned local TLS and synthetic Access-shaped headers. This is not live Cloudflare Access validation. No live enrollment, credentials, configuration or deployment changed.

No steering or reader write privilege is included. No live deployment was performed.

Exact revision and proof entry points
  • Reviewed head: a46ba4cfd4b5c84a544ad587e3ad0f0716403b2e
  • Reviewed base: 9791bcc978653f1ddb25beef5bf49c93e4327269
  • Tree: 74cd5c2962ef52b9a38651362a33f15321b16bdb
  • Delta: 12 files, +621/−43.

Focused runs used node scripts/run-vitest.mjs with isolated repository-suite configurations, maxWorkers: 1 and file parallelism disabled, selecting:

  • extensions/session-share/src/node-commands.test.ts
  • test/plugins/session-share-gateway.integration.test.ts
  • test/plugins/session-share-filters.integration.test.ts
  • test/plugins/session-share.integration.test.ts
  • Separately: test/plugins/session-share-publication.gateway.test.ts under the isolated Gateway suite.

Stack order

2/4. Depends on the preceding PR (feat/session-share-reader-host-20261118). Merge prerequisites before retargeting/revalidating this exact diff; do not merge this stack out of order.

Depends on #201073.

@clawsweeper

clawsweeper Bot commented Nov 18, 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 plugin: session-share size: L labels Nov 18, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 18, 2026 07:46
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR adds device-granted Gateway reads for sessions selected by source-owned group and person filters.

Example: The source grants device reader-01 access to Team sessions involving profile person-42.

  • Before: Session Share publishes through paired-node commands without this device-granted Gateway RPC path.
  • After: reader-01 can list and read the selected cohort through session-share.list and session-share.read without acquiring person-42's private access.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation has a coherent ownership boundary, but required runtime and upgrade evidence is incomplete.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Operators need to publish a selected session cohort to an explicitly approved reader device without granting a person's private access.
Reason: The maintainer-authored direction supplies a concrete least-privilege use case, preserves paired-node sharing, and keeps publication disabled by default.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this useful maintainer-authored feature is absent from current main, but the RPC recovery message and introduced test-budget failure need correction.

Priority: P2
Reviewed head: a46ba4cfd4b5c84a544ad587e3ad0f0716403b2e

Before merge

  • Give persistent transcript failures actionable source-side guidance (P2) - An authorized read of a session containing an entry over the 8 MiB raw-read bound reaches readCatalogHistoryPage, which explicitly tells the user to inspect that session on the source Gateway. This catch replaces the recovery instruction with “Refresh the catalog,” although refreshing cannot resolve the oversized entry. Keep raw source failures redacted, but give a safe next action that directs persistent failures to the source operator or source session.
  • Bring the added tests within the enforced test-line budget (P2) - This diff adds 406 counted test/helper lines with no allocation, exceeding the 400-line allowance in scripts/check-test-lines-ratchet.mts. The exact-head test-lines check fails while the prerequisite's baseline-ratchet check passes. Consolidate coverage to fit the allowance or add the justified allocation required by the existing budget without weakening the guard.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Give persistent transcript failures actionable source-side guidance — extensions/session-share/src/gateway-methods.ts:58-60
  • [P2] Bring the added tests within the enforced test-line budget — test/plugins/session-share-publication.gateway.test.ts:374

Tests

  • Missing end-to-end proof: Provide a redacted trace from a separately running shipped Gateway showing an approved device listing and reading its selected cohort while an ungranted device is denied.
Agent review details

How this fits together

The Session Share plugin receives authenticated Gateway requests, checks source-configured device grants, and uses the existing native session selection and transcript owners to return read-only catalog pages.

flowchart LR
  A[Signed reader device] --> B[Gateway admission]
  B --> C[Session Share RPC adapter]
  D[Source configuration] --> C
  C --> E[Shared session selection]
  E --> F[Native transcript reader]
  F --> G[Read-only response]
Loading

Technical review

Best possible solution:

Keep the existing selection and transcript owners, with a narrow device-grant adapter that returns safe, actionable recovery guidance.

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

This is a new capability rather than a reported existing bug; source inspection establishes the missing main-branch RPC path, and no runtime reproduction was executed.

Is this the best way to solve the issue?

Reusing native selection and disclosure owners is appropriate for this source-only slice, and the separate outbound-reader PR accounts for the remaining transport work.

Full review comments:

  • [P2] Give persistent transcript failures actionable source-side guidance — extensions/session-share/src/gateway-methods.ts:58-60
    An authorized read of a session containing an entry over the 8 MiB raw-read bound reaches readCatalogHistoryPage, which explicitly tells the user to inspect that session on the source Gateway. This catch replaces the recovery instruction with “Refresh the catalog,” although refreshing cannot resolve the oversized entry. Keep raw source failures redacted, but give a safe next action that directs persistent failures to the source operator or source session.
    Confidence: 0.97
  • [P2] Bring the added tests within the enforced test-line budget — test/plugins/session-share-publication.gateway.test.ts:374
    This diff adds 406 counted test/helper lines with no allocation, exceeding the 400-line allowance in scripts/check-test-lines-ratchet.mts. The exact-head test-lines check fails while the prerequisite's baseline-ratchet check passes. Consolidate coverage to fit the allowance or add the justified allocation required by the existing budget without weakening the guard.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 74e5127c0c3d.

Provenance checked

  • Canonical person selection and final source disclosure keeps the original intent (c147613: Select sessions by exact groups and canonical owner or participant while retaining native source guards through disclosure.)
  • Existing paired-node sharing and optional plugin configuration keeps the original intent (5278a8f: Publish selected native sessions read-only while retaining source ownership and excluding unrelated execution capabilities.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +162, Tests +407, Docs +9, Generated 0. Total +578 across 12 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 5 202 40 +162
Tests 4 407 0 +407
Docs 1 9 0 +9
Config 0 0 0 0
Generated 2 3 3 0
Other 0 0 0 0
Total 12 621 43 +578

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Configuration additions 2 optional settings share.gateway defaults to false; share.gatewayDeviceIds grants exact device IDs without changing existing paired-node settings.
RPC additions 2 read-only methods session-share.list and session-share.read use the singleton publication-read scope and independent profile access.

Labels

Label changes:

  • add P2: This optional collaboration feature has a bounded scope and no demonstrated urgent regression in existing sharing.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This optional collaboration feature has a bounded scope and no demonstrated urgent regression in existing sharing.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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.

Reviewed November 18, 2026, 3:04 AM ET / 08:04 UTC.

Base automatically changed from feat/session-share-reader-host-20261118 to main November 18, 2026 09:08
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive guard cleared

Current revision: c7ecb5d284c1a387693c24935aa48b72194491eb

This PR no longer changes files in the maintainer security-review tier.

Separate CODEOWNERS requirements still apply to security policy and enforcement files.

@vincentkoc
vincentkoc force-pushed the feat/session-share-device-source-20261118 branch from a46ba4c to c7ecb5d Compare November 18, 2026 09:17
@vincentkoc
vincentkoc merged commit 6448314 into main Nov 18, 2026
127 checks passed
@vincentkoc
vincentkoc deleted the feat/session-share-device-source-20261118 branch November 18, 2026 09:36
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…#201074)

* feat(session-share): authorize device-granted session reads

* fix(session-share): clarify source failures and consolidate proof

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. plugin: session-share rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant