Skip to content

Add artifacts share, shares and revoke - #391

Merged
allenhutchison merged 2 commits into
mainfrom
claude/artifact-share-commands
Nov 26, 2026
Merged

allenhutchison merged 2 commits into
mainfrom
claude/artifact-share-commands

Conversation

@allenhutchison

@allenhutchison allenhutchison commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Human overview

Sharing a note or file with a room by grant shipped in Pepper on the web and in chat, but the CLI could not do it. This adds pepper artifacts share ARTIFACT --room R [--level read|comment|write], pepper artifacts shares ARTIFACT and pepper artifacts revoke ARTIFACT --room R. The server routes already exist and are deployed, so there is no server dependency. Refs Vycari/pepper#7090.

AI reviewer

Details for agents: what the diff does, invariants, verification, checklist

What the diff does

  • api_client.py: ArtifactShare, ArtifactShareRoom, ArtifactShares dataclasses with # MIRROR: markers for src/pepper/api/artifacts.py::ArtifactShare, ::ArtifactShareRoom, ::ArtifactSharesResponse (all already in the vendored contracts/api-v1.openapi.json), a parser that ignores unknown fields and defaults a missing levels to ["read"], and list_artifact_shares, share_artifact, unshare_artifact over GET/POST /api/v1/artifacts/{id}/shares and DELETE /api/v1/artifacts/{id}/shares/{room_id}.
  • cli.py: three leaves under artifacts.
    • shares prints one line per room on stdout (Room (can read)), or that it is shared with none.
    • share resolves --room, and sends level only when --level was given, so the server keeps the level a room already holds. With --level, it first reads the levels the server offers the caller and refuses one that is not offered before posting, naming the ones that are.
    • revoke is a DESTRUCTIVE verb in the conformance table, so it takes --yes and asks on a terminal, like skills revoke. Nothing is deleted on the server.
    • _report_share_error: 404 is "no such note or file you can share, or sharing is not turned on for your account" (the server does not tell those apart; the artifact-grants rollout answers 404), 403 not in that room, 409 the room already owns it.
  • No client-side rollout gate: the server decides, per the repo rule, and the commands follow the existing pattern of other rollout-gated commands here (a 404 said plainly).
  • tests/test_cli_conformance.py: shares added to VERBS (an object's list, like runs OBJECT), artifacts shares added to ROOM_NA, JSON cases and fake routes for the three leaves.
  • help/cli.md: two entries inside <!-- rollout: artifact-grants --> and <!-- rollout: artifact-grant-levels --> so the public docs leave them out until those rollouts are public. README.md command table updated.
  • Bundled SKILL.md not changed: it documents what an agent token can do, and these routes take a personal access token only.

Where to look hardest

  • Level words in output come from a fixed map; a level the client does not know is printed as sent, through sanitize_line. Room and artifact names from the server are sanitized or repr'd before printing.
  • share --level makes one extra GET. Without --level it makes none (asserted in the test).

Verification (actual results)

  • uv run ruff format --check, uv run ruff check: clean.
  • uv run ty check src/pepper_cli/: clean.
  • uv run pytest -n auto --cov: 4167 passed, 2 skipped; coverage 95.5% (floor 88, unchanged).
  • Not run against a live server from here.

Checklist (repo-specific)

  • uv run ruff format --check and uv run ruff check clean (no new lint ignores)
  • uv run ty check src/pepper_cli/ clean
  • uv run pytest passes; coverage floor in .claude/maintainerd.json not lowered
  • Server-contract changes: /api/v1 usage stays additive-only, # MIRROR: comments added, unknown fields still tolerated
  • No token or credential is logged, printed, or put in a fixture
  • README updated; bundled SKILL.md unchanged because these routes are not open to agent tokens
  • Help: help/cli.md updated, inside rollout markers

Generated by Claude Code

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Adds artifacts share, artifacts shares, and artifacts revoke using the existing server routes.

  • Artifact listings show each room and its access level.
  • You can share an artifact with a room at a chosen access level.
  • You can revoke a room’s access without deleting the artifact.

Reviews (1) · Last reviewed commit: "Read the shared level back whatever case..." · Reviewed by Greptile

Share one of your notes or files with a room by grant, see which rooms
have it, and stop sharing, over the existing /api/v1/artifacts/{id}/shares
routes. A level the server does not offer the caller is refused before
anything changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QNDehAT3jg2ayAQiFhyrRg
@vycari-review

vycari-review Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Vycari Review

Round 2 on e89195e. The verdict is the Vycari Review check run, and each open finding is an inline thread. Reply on every P0 and P1 thread: Fixed in <sha>, or Disputed: with a reason. P2s are the author's call: fix one, or reply Deferred: #<issue> (the PR's one follow-up issue) or Declined: with a reason, and VR stops re-raising it. From round 2 on, VR raises no new P2s: it checks the fixes and looks for P0s and P1s.

Open: P0 0 · P1 0 · P2 0 · disputed 0 · confirmed fixed 1 · withdrawn 0

Hand-off: Greptile requested on e89195e.

No open findings this round.

P2s, judge's notes and closed findings

Judge's notes

The fix for the prior finding (the share message named the wrong level when the room id was typed in capitals) is confirmed: room ids are now compared without regard to case, and the message no longer guesses a level. No new candidates survived this round, so nothing is left open.

Confirmed fixed

  • VR-3371a5ee · Share success message can name the wrong level when the room is given as an uppercase UUID

@vycari-foreman vycari-foreman Bot added the auto:held-merge foreman withheld an automatic merge — see its comment for the failing condition label Nov 26, 2026
@vycari-foreman

vycari-foreman Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Held per policy 0006. foreman will not enqueue this PR at e89195e406b9 while any condition below fails. It re-reads the PR every tick and edits this comment in place; nothing here needs a reply.

Failing conditions (docs/design/automerge-auto-pr.md §2-§5 in Vycari/foreman):

  • ejected: removed from the merge queue. Until ejection routing ships (M6) foreman does not re-queue: a person merges or re-queues it
  • C2.paths:docs: README.md
  • C2.paths:docs: help/cli.md
  • C2.html-comment: <!-- rollout: artifact-grants -->
  • C2.html-comment: <!-- rollout: artifact-grant-levels -->

To keep foreman from ever merging this PR, add the auto:no-merge label.

Comment thread src/pepper_cli/cli.py Resolved
A room id passed in capitals did not match the server's lower-case echo, so
the confirmation fell back to "can read" whatever the room held. Match
without case, and state no level when the answer names none.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QNDehAT3jg2ayAQiFhyrRg
@vycari-review

vycari-review Bot commented Nov 26, 2026

Copy link
Copy Markdown

@greptileai review

@allenhutchison
allenhutchison added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 80cb0c1 Nov 26, 2026
5 checks passed
@allenhutchison
allenhutchison deleted the claude/artifact-share-commands branch November 26, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto:held-merge foreman withheld an automatic merge — see its comment for the failing condition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants