Skip to content

fix: allow session-scoped shared publication reads - #162984

Merged
shakkernerd merged 1 commit into
mainfrom
fix/guest-publication-reads
Oct 1, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/guest-publication-reads

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Refs #162916.

What Problem This Solves

Fixes shared GitHub publication options and status reads for people with session-scoped access. Ordinary shared publication already accepts operator.sessions.write, but its discovery and receipt methods independently required general read permission. This prevented the surrounding chat flow from using an otherwise supported capability.

User Impact

Verified session-scoped readers can inspect shared publication data for sessions they may view. Hidden sessions and personal account data remain protected. A narrow caller receives a shared publisher option only for a current managed worktree or repository workspace with a supported GitHub remote; an unavailable target does not remove existing shared receipts. Broad readers and trusted internal callers retain their existing account-discovery behavior.

This is the backend contribution. The separate UI contribution enables the corresponding shared Publish action. Personal publication, confirmation, workflow changes, foreign-session mutations, and administrator permissions retain their existing requirements.

Why This Change Was Made

The read methods use the existing session-scope admission mechanism and retain current request, profile, role, grant, connection, and session visibility checks across awaited work. Personal discovery and receipt preparation remain separate from shared reads. The existing response shape is unchanged.

Target discovery reuses registered workspace ownership and repository identity checks without preparing a publication or calling the GitHub repository API. It preserves the managed fingerprint/rebind boundary. The repository reader now distinguishes a missing origin from an actual Git read failure, so an unexpected failure is not presented as an unavailable target.

Evidence

The registered-router regression rejects six permitted reads on the original production code at b66471a with missing scope: operator.read. The corrected guest, target, and Git-owner cases pass, alongside existing broad/personal-reader controls. These use isolated profile/session state, real local Git repository facts, and synthetic GitHub service responses; no live publication is claimed.

Remote validation passed on the exact committed tree: full formatting, lint and structural checks; production, test and consumer TypeScript checks; package-boundary compile and canary checks; generated plugin assets; runtime and UI builds; and the native CI affected-test selection. The affected run selected 194 files: 191 passed and 3 were already skipped, with 2,985 passing tests and 13 existing skips. It includes 7 E2E files with 9 passing tests.

The five directly affected test files also passed individually, totaling 69 cases. This includes the final trusted-internal-caller compatibility check. Measured wall time on the retained Linux runner for pnpm test <file> --maxWorkers=1:

Test file Remote command wall CI test cases
src/gateway/server-methods/sessions-github-read.test.ts 49.931s 14.056s
src/gateway/server-methods/sessions-github-read.guest.test.ts 42.578s 9.435s
src/gateway/server-methods/sessions-github-read.target.test.ts 34.363s 6.270s
src/gateway/server-methods/github-personal-authorization.test.ts 24.332s 0.011s
src/agents/worktrees/service.canonical-paths.test.ts 31.049s 4.860s

These wall times include runner startup and transforms. The registered-router and real Git cases protect admission, current authority, visibility, and target ownership across asynchronous work; mocked helper-only coverage would miss those boundaries. CI test-case time is the sum of the reported passing case durations, excluding startup and transforms, from CI run 36922860783. Exact-head CI passed, and ClawSweeper rated the patch Platinum with no findings. No live GitHub publication or deployment is claimed.

@clawsweeper

clawsweeper Bot commented Oct 1, 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 agents Agent runtime and tooling size: XL labels Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 636db201e8d14d118f1fbef927ec75cfafb82040
  • Maintainer: @shakkernerd
  • Repository role: maintain

These security sensitive changes were made:

  • src/gateway/server-methods/github-personal-authorization.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/shared/session-method-scopes-base.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@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 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 4:41 PM ET / 20:41 UTC.

ClawSweeper review

What this changes

Allow session-scoped callers to discover shared GitHub publication options and read receipts for visible sessions while preserving personal-account restrictions and validating repository ownership.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still blocks the documented session-scoped shared-publication reads, and this branch provides a focused backend repair. No concrete introduced correctness or security defect was found; the separate UI repair remains necessary.

Priority: P2
Reviewed head: 636db201e8d14d118f1fbef927ec75cfafb82040

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful router and repository-boundary regressions and no supported blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from ordinary external-contributor proof. Its reported registered-router regressions exercise allowed, hidden-session, and revoked-reader responses with real isolated profile/session state and mocked receipt services; target cases use real local Git facts. Source review found no material unresolved authority violation requiring the scoped proof exception. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from ordinary external-contributor proof. Its reported registered-router regressions exercise allowed, hidden-session, and revoked-reader responses with real isolated profile/session state and mocked receipt services; target cases use real local Git facts. Source review found no material unresolved authority violation requiring the scoped proof exception. No stored-data contract changes.
Evidence reviewed 9 items Pinned introduced change: Reviewed the merge-base-to-head changes, preserving the distinction between PR introduction and base drift. The original head records b66471a as its parent.
Current-main necessity: Fetched main retains the synchronous preparation helper requiring broad operator.read and lacks the two publication reads in the session-read classifier. This branch's central backend repair is still absent.
Latest-release check: The v2026.9.7 session-read classifier also omits sessions.github.options and sessions.github.status; the inspected release does not contain this admission repair.
Findings None None.
Security None None.

How this fits together

The Gateway receives publication discovery and status requests from chat clients. It checks current caller authority, session visibility, and repository ownership before returning shared publisher options or publication receipts.

flowchart TD
  A[Chat client request] --> B[Gateway scope admission]
  B --> C[Current identity and session visibility]
  C --> D[Shared publication receipts]
  C --> E[Registered repository target]
  C --> F[Personal account permission]
  D --> G[Revalidated response]
  E --> G
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +135, Tests +484, Docs +11. Total +630 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 6 188 53 +135
Tests 6 628 144 +484
Docs 1 12 1 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 828 198 +630

Review metrics

Metric Value Why it matters
Authorization admission 2 existing read methods; 0 new scope names The repair reuses session scopes while leaving publication and confirmation requirements intact.
Production and regression growth production +135 net lines; tests and support +484 net lines Production growth has a stated purpose in current-authority checks and repository qualification; regression growth exercises router and ownership boundaries.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #162916
Summary: This PR is the backend candidate for the canonical issue; the issue also requires a complementary UI action repair.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Use the existing session-read authorization owner for shared discovery and receipts, and complete the complementary UI action repair without widening personal or publication-mutation authority.

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

Yes, from source: a verified session-only caller reaches both a broad-read admission barrier and a broad-read preparation check on current main. The PR reports failing baseline router regressions; this review did not execute them.

Is this the best way to solve the issue?

Yes, this is a focused backend repair using the existing session authorization and repository ownership boundaries. It preserves stronger personal-account checks and leaves the complementary UI change separately scoped.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a documented shared-publication workflow for restricted session callers with limited blast radius.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from ordinary external-contributor proof. Its reported registered-router regressions exercise allowed, hidden-session, and revoked-reader responses with real isolated profile/session state and mocked receipt services; target cases use real local Git facts. Source review found no material unresolved authority violation requiring the scoped proof exception. No stored-data contract changes.

Label justifications:

  • P2: This repairs a documented shared-publication workflow for restricted session callers with limited blast radius.
  • 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 MEMBER-authored PR is exempt from ordinary external-contributor proof. Its reported registered-router regressions exercise allowed, hidden-session, and revoked-reader responses with real isolated profile/session state and mocked receipt services; target cases use real local Git facts. Source review found no material unresolved authority violation requiring the scoped proof exception. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the merge-base-to-head changes, preserving the distinction between PR introduction and base drift. The original head records b66471a as its parent. (636db201e8d1)
  • Current-main necessity: Fetched main retains the synchronous preparation helper requiring broad operator.read and lacks the two publication reads in the session-read classifier. This branch's central backend repair is still absent. (src/gateway/server-methods/github-personal-authorization.ts:95, a6ee7e12d29c)
  • Latest-release check: The v2026.9.7 session-read classifier also omits sessions.github.options and sessions.github.status; the inspected release does not contain this admission repair. (src/shared/session-method-scopes-base.ts:7, c074824a27c9)
  • Current authority and personal separation: Preparation retains router-owned request authority, binds profile and access-grant identity, prepares current role facts, and rechecks session visibility and lifecycle. Personal eligibility independently requires broad read permission; narrow status reads skip personal receipt preparation. (src/gateway/server-methods/github-personal-authorization.ts:109, 636db201e8d1)
  • Repository ownership boundary: Narrow discovery uses the registered workspace owner or worker-read worktree record, validates repository fingerprint and path, and rereads ownership after Git inspection. Unsupported targets suppress the publisher option without suppressing existing receipts; unexpected Git failures propagate. (src/gateway/github-publication-availability.ts:301, 636db201e8d1)
  • Forbidden and revoked reader coverage: Registered-router tests assert rejection before a successful response for hidden foreign sessions and for scope, role, profile, grant, connection, visibility, or lifecycle loss during awaited receipt reads. Personal services remain uncalled for narrow readers. Receipt services are mocked; these are boundary regressions, not live GitHub proof. (src/gateway/server-methods/sessions-github-read.guest.test.ts:79, 636db201e8d1)

Likely related people:

  • shakkernerd: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • 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.

@shakkernerd shakkernerd self-assigned this Oct 1, 2026
@shakkernerd
shakkernerd merged commit 92b4421 into main Oct 1, 2026
155 checks passed
@shakkernerd
shakkernerd deleted the fix/guest-publication-reads branch October 1, 2026 20:52
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: session-scoped guests can read shared GitHub publication options and status without general read access.

vincentkoc added a commit that referenced this pull request Oct 1, 2026
* origin/main:
  fix(gateway): report approved-but-narrowed scope upgrades truthfully (#162951)
  fix: allow session-scoped shared publication reads (#162984)
  refactor(sessions): share session creation orchestration (#161336)
  perf(gateway): show the first chat sooner after a Gateway start (#162936)
  refactor(scripts): share npm verification command execution (#162978)
  fix(browser): clear MCP runtime cache after profile tests (#162982)
  fix(test): checkout fixture tests fail healthy runs on loaded macOS hosts (#162888)
  ci: bound PR extension lint to direct owners and smoke packages
  fix(ci): await native declaration discovery teardown
  feat(qa): drive forwarded text+photo bursts in Telegram userbot scenarios (#162906)
  build(macos): pin the app runtime to OpenClaw Bun 17c9ecf9eb (#162570)
  fix(test): frozen admission test fails with spawn ETXTBSY when a sibling test forks during the native parser copy (#162969)
  fix(ci): give direct published-driver callers the CI cell envelope (#162837)
  test(gateway): remove low-value tests (batch d136) (#162921)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
Allow verified session-scoped callers to read shared GitHub publication options and receipts while preserving current authority, visibility, and personal account boundaries.

Refs openclaw#162916.
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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed 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