Repository navigation
Add artifacts share, shares and revoke - #391
Conversation
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 ReviewRound 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: 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 findingsJudge'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
|
|
Held per policy 0006. foreman will not enqueue this PR at Failing conditions (
To keep foreman from ever merging this PR, add the |
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
|
@greptileai review |
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 ARTIFACTandpepper 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,ArtifactSharesdataclasses with# MIRROR:markers forsrc/pepper/api/artifacts.py::ArtifactShare,::ArtifactShareRoom,::ArtifactSharesResponse(all already in the vendoredcontracts/api-v1.openapi.json), a parser that ignores unknown fields and defaults a missinglevelsto["read"], andlist_artifact_shares,share_artifact,unshare_artifactoverGET/POST /api/v1/artifacts/{id}/sharesandDELETE /api/v1/artifacts/{id}/shares/{room_id}.cli.py: three leaves underartifacts.sharesprints one line per room on stdout (Room (can read)), or that it is shared with none.shareresolves--room, and sendslevelonly when--levelwas 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.revokeis aDESTRUCTIVEverb in the conformance table, so it takes--yesand asks on a terminal, likeskills 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; theartifact-grantsrollout answers 404), 403 not in that room, 409 the room already owns it.tests/test_cli_conformance.py:sharesadded toVERBS(an object's list, likeruns OBJECT),artifacts sharesadded toROOM_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.mdcommand table updated.SKILL.mdnot changed: it documents what an agent token can do, and these routes take a personal access token only.Where to look hardest
sanitize_line. Room and artifact names from the server are sanitized orrepr'd before printing.share --levelmakes one extra GET. Without--levelit 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).Checklist (repo-specific)
uv run ruff format --checkanduv run ruff checkclean (no new lint ignores)uv run ty check src/pepper_cli/cleanuv run pytestpasses; coverage floor in.claude/maintainerd.jsonnot lowered/api/v1usage stays additive-only,# MIRROR:comments added, unknown fields still toleratedSKILL.mdunchanged because these routes are not open to agent tokenshelp/cli.mdupdated, inside rollout markersGenerated by Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Adds
artifacts share,artifacts shares, andartifacts revokeusing the existing server routes.Reviews (1) · Last reviewed commit: "Read the shared level back whatever case..." · Reviewed by Greptile