Skip to content

feat: upload workspace evidence for managed pull requests - #176139

Merged
shakkernerd merged 2 commits into
mainfrom
guest-pr-evidence
Oct 18, 2026
Merged

shakkernerd merged 2 commits into
mainfrom
guest-pr-evidence

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A guest can create a managed pull request and inspect screenshots or recordings in its workspace, but cannot upload that evidence through the managed publisher.

User Impact

The PR's original requester can upload an inspected image or video from the current sandbox workspace and use the returned GitHub attachment URL in the PR body. Supported files are PNG, JPEG, GIF, WebP, MP4, MOV and WebM, up to 10 MB. The operation requires the observed PR receipt and head plus the file's SHA-256 and byte count.

Why This Change Was Made

The existing github_publish tool gains upload_evidence, using the current session's managed publisher and recorded repository. The Gateway checks workspace ownership, actual bytes and media type, then rechecks the requester, selected publisher and PR before sending the file. Credentials remain outside the sandbox; other mounts, remote URLs and alternate repository or PR selectors are rejected. Workspace read failures return a safe diagnostic without host paths.

Uploading does not edit the PR body. The requester associates the returned URL through the existing edit action and verifies reviewer access afterward. An interrupted or malformed upload response is reported as unconfirmed because GitHub may already have accepted the file; the operation never retries it automatically.

Evidence

  • After resolving the overlap with guest readiness and re-review, all 174 cases in eight selected publication, scope, tool and protocol files pass (189.80 seconds combined helper wall time). Formatting, lint and affected production/test types pass. The integration retains ready's publication selection and the delayed-input disclosure checks.
  • The registered upload action uses the real sandbox file bridge and session/identity owners with isolated GitHub transport. Its eight cases cover exact bytes and body association, admitted noncreator denial, foreign/unsafe files, changed head or authority, redirects, uncertain responses, and revocation after dispatch. The corrected upload file passes all eight cases in 47.92 seconds, including rejection of a foreign symlink without exposing the workspace root or its parent. Registered tool projection passes 35 cases in the integrated run (51.92 seconds). Related caller results remain applicable.
  • The combined related run hit an existing routing test's 180-second setup timeout. That unchanged file passes separately on both base and candidate (92 cases, 119.48 and 118.06 seconds). The mixed-batch failure remains unreproduced; no routing or timeout change is included.

An ordinary guest uploaded two inspected PNGs through the patched tool, associated the returned references using edit, and completed readiness. Anonymous readback returned HTTP 200 with image/png and exact SHA-256/byte-count matches for both files. The first canonical attachment URL initially returned 404 after body association; the guest changed the body link to append ?raw=1, which returned the expected bytes. No repeat upload was needed. The published evidence contains both references. This proves two PNG uploads and their access recovery on a containing runtime whose upload implementation matches this PR; it does not establish live coverage for every accepted media format.

Independent review closed the filesystem-error disclosure and live-contract findings before the latest draft-option integration. The previous head's full CI passed: 72 successful jobs and 22 skipped, 759 seconds elapsed and 13,569 summed successful job-seconds. The latest integration preserves the upload and authority owners, combines the draft/evidence tool fields, and rejects draft on upload_evidence. Its independent integration recheck is clean. Affected integration checks pass on matching source: the publication group has 165 cases, the protocol 10, the registered tool 35, and the publish tool 9. Formatting, lint and affected compiler graphs pass. That containing-source batch still failed overall on two older database-port diagnostic expectations and a browser file that could not launch without Chromium; those are outside this change and are not claimed green. Current-head CI passed with 72 successful jobs and 22 skipped (596 seconds elapsed; 13,030 summed successful job-seconds). Automated review returned Platinum readiness/proof and Diamond patch quality with no findings.

@clawsweeper

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

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: b3fd0e67093b6be549d76cea68ac7f5651371f3d
  • Maintainer: @shakkernerd
  • Repository role: maintain

These security sensitive changes were made:

  • src/gateway/method-scopes.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 18, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Adds inspected workspace image and video uploads to the existing managed GitHub publication tool.

Example: A guest has inspected proof.png in its sandbox and wants to attach it to its managed PR.

  • Before: The managed publisher cannot upload the file.
  • After: upload_evidence verifies its digest and size, uploads the bytes, and returns an attachment URL for the existing edit action.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent implementation with scoped live PNG evidence and substantive authority-boundary coverage; broader media formats are not claimed as live-proven.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The supplied live report exercises guest PNG upload and PR-body association on matching upload source; the production-path harness exercises allowed access, admitted-noncreator rejection and authority revocation before dispatch through real owners with isolated external I/O.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Guests can inspect workspace media but cannot attach it through their managed PR publisher.
Reason: The maintainer-authored direction fills a concrete gap through the existing tool and preserves credential isolation.

Merge readiness

✅ Ready for maintainer review

This PR adds a useful capability missing from current main, and I found no actionable introduced defect. The earlier conflict is resolved; current-head CI remains pending.

Priority: P2
Reviewed head: b3fd0e67093b6be549d76cea68ac7f5651371f3d

Before merge

None.

Findings

None.

Agent review details

How this fits together

The agent tool passes inspected file facts and its private sandbox context to the Gateway, which checks current publication authority, reads bounded workspace bytes, and uploads through the selected GitHub identity.

flowchart LR
  A[Guest conversation] --> B[GitHub publication tool]
  B --> C[Gateway publication owner]
  C --> D[Current requester and publisher]
  C --> E[Sandbox filesystem bridge]
  E --> F[Bounded inspected media]
  F --> G[GitHub attachment upload]
  G --> A
Loading

Technical review

Best possible solution:

Keep the upload within the existing publication authority and filesystem owners, with explicit attachment association and uncertain-write handling.

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

Current-main source confirms the missing upload action; this is a new capability, and no target code was executed during review.

Is this the best way to solve the issue?

The implementation extends the existing publication owner, reuses bounded filesystem and guarded-network contracts, and introduces no competing publication state.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Managed PR action authority keeps the original intent (bf90074: Broker PR actions through Gateway-held credentials while retaining current requester, publisher and session authority.)
  • Own-publication preparation keeps the original intent (16d0f91: Permit narrowly scoped author preparation without granting arbitrary comments, targets or privileged landing actions.)
  • Base-refresh integration coverage keeps the original intent (23173ed: Prove saved-work preservation, conflict recovery and base ancestry through the registered action.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced change and current-main boundary: The pinned introduction adds upload_evidence to the existing tool, protocol and action owner; fetched main offers readiness and re-review but no evidence upload. (src/agents/tools/github-publish-tool.ts:42, b3fd0e67093b)
  • Final upload authority: The existing requester, session and publisher owners remain authoritative; guarded fetch invokes their synchronous assertion immediately before dispatch, with redirects disabled and capture suppressed. (src/gateway/github-publication-evidence.ts:150, b3fd0e67093b)
  • Nearest forbidden principal and revocation coverage: The registered-action harness uses real session, identity and filesystem owners; an admitted noncreator, changed role, deselected publisher and archived session are rejected before the fetch boundary. (src/gateway/github-publication-evidence.test.ts:284, b3fd0e67093b)
  • Supplied live upload evidence: The author reports two ordinary-guest PNG uploads, body association and anonymous byte verification on matching upload source; the resulting attachments appear in fix: identify Claws Add button targets to screen readers #176184. Coverage is limited to PNG, and the initial attachment-access recovery is disclosed.
  • Preserved test coverage: The extracted base-refresh test body is byte-identical to its merge-base version; the shared fixture supports the existing action suite and the new upload suite. (src/gateway/github-publication-base-refresh-actions.test.ts:36, b3fd0e67093b)
  • Re-review state: Live GitHub metadata confirms the reviewed head is mergeable; the previous conflict instruction no longer applies, while current-head checks are still running. (b3fd0e67093b)

Likely related people:

  • Shakker: Raw commit 16d0f91 adds src/agents/tools/github-publish-tool.ts:39 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 16d0f91a97af; files: src/agents/tools/github-publish-tool.ts)
  • Peter Steinberger: Raw commit 78d72c9 adds src/agents/tools/github-publish-tool.ts:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 78d72c97a85c; files: src/agents/tools/github-publish-tool.ts)

PR surface

Source +339, Tests +421, Docs +20. Total +780 across 15 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 6 347 8 +339
Tests 8 1278 857 +421
Docs 1 20 0 +20
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 1645 865 +780

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Adds a bounded, useful evidence-publication capability for managed conversations without an urgent existing-runtime regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 (1 earlier review cycle)
  • reviewed 2026-10-18T08:12:22.392Z sha 91562e1 :: needs changes before merge. :: none

Reviewed October 18, 2026, 7:45 AM ET / 11:45 UTC (Revision 2).

@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 18, 2026
@shakkernerd
shakkernerd merged commit f663437 into main Oct 18, 2026
179 of 180 checks passed
@shakkernerd
shakkernerd deleted the guest-pr-evidence branch October 18, 2026 11:53
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Added: creators of managed pull requests can upload inspected workspace evidence without receiving publisher credentials.

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

Allow creators of managed pull requests to upload inspected workspace images and videos through the existing publisher, with current authority checks and truthful upload uncertainty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui 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: 🐚 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