Repository navigation
Add pepper hubs - #393
Add pepper hubs#393
Conversation
The hub commands over /api/v1/hubs: list, show, create, edit, delete, add and remove a room or one of your items, pin and unpin, share and revoke, take and leave, and notify. The server decides what a person may see and which rollouts apply; a 404 is said plainly. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNDehAT3jg2ayAQiFhyrRg
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNDehAT3jg2ayAQiFhyrRg
# Conflicts: # src/pepper_cli/api_client.py # tests/test_cli_conformance.py
Vycari ReviewRound 1 on b1b4486. 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 1 · P2 3 · disputed 0 · confirmed fixed 0 · withdrawn 0 Hand-off: Not handed to Greptile yet: 1 P0/P1 finding(s) open with no reply (round 1 of 3). Open P0 and P1 findings
P2s, judge's notes and closed findingsOpen P2 findings
P2s with no reply yet
Judge's notes One P1: hub name lookup ignores the server's flag that the list may be incomplete, so take or leave by name can act on the wrong hub. It is narrow and easy to fix by refusing or warning when the list is short. The other findings are P2: an owner racing their own sharing change, 404 errors that name the wrong cause, docstring drift, and the missing entry in the agent skill. |
|
Held per policy 0006. foreman will not enqueue this PR at Failing conditions (
To keep foreman from ever merging this PR, add the |
…ewrites one A hub list the server marks incomplete may be missing another hub of the same name, so a name is refused there and the id is asked for. hubs share with no --level leaves an already shared hub untouched instead of writing its level back. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNDehAT3jg2ayAQiFhyrRg
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNDehAT3jg2ayAQiFhyrRg
|
@greptileai review |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNDehAT3jg2ayAQiFhyrRg
|
@greptileai review Both findings are fixed in 988df5f and answered on their threads. Generated by Claude Code |
Human overview
Hubs shipped on the web and in chat, and Vycari/pepper#7168 added the client API for them. This adds the CLI side:
pepper hubs list,show,create,edit,delete,add,remove,pin,unpin,share,revoke,take,leaveandnotify. A hub is named by its name or its id. Refs Vycari/pepper#7090.Human required
pepper hubscommand answers "No such hub, or hubs are not turned on".AI reviewer
Details for agents: what the diff does, invariants, verification, checklist
What the diff does
api_client.py:HubSummary,SharedHub,Hubs,HubRoom,HubItem,HubDetailwith# MIRROR:markers forsrc/pepper/api/hubs.py::HubSummary,::SharedHubSummary,::HubsResponse,::HubRoom,::HubItem,::HubDetail(in the snapshot since chore(contract): sync from Vycari/pepper @ 3e622062 #392). Parsers ignore unknown fields and default the optional ones. Methods for every route under/api/v1/hubs.hubs_view.py(new): renders the list and one hub, and flattens the list response into rows with astandingofowner,takenorofferedfor the J3 envelope.cli.py: thehubsnoun and its 14 leaves._need_hubresolvesHUB: a UUID is used as it is (lower-cased); otherwise an exact name match, any case, across the caller's own hubs, the ones they took and the ones on offer. No match isnot_found(exit 2); more than one isambiguousand lists the ids. Both happen before any write.add/removetake exactly one of--roomand--item(argparse mutually exclusive, required).--itemtakes a number from the lastartifacts listor an id.delete,remove,revokeandleaveareDESTRUCTIVEverbs:--yes, a prompt on a terminal, a usage error otherwise.sharewith no--levelreads the hub and keeps the level it is already shared at (elseview), so sharing again never lowers a level by accident. With--levelit makes no extra request.notifysendsroom_idonly with--room._report_hub_error: 404 "No such hub, or hubs are not turned on for your account" (the server does not tell those apart), 403, 409 and 503 print the server's own sentence, sanitized.hubs,hub-sharing,hub-notifications), per the repo rule and like the other gated commands here.tests/test_cli_conformance.py:hubsinNOUNS; new verbsadd,pin,unpin,notifywith the reason each is needed (takealready existed);ROOM_NAfor the 11 leaves where a room flag means nothing; JSON cases and fake routes for all 14.help/cli.md: three entries inside thehubs,hub-sharingandhub-notificationsrollout markers.README.mdcommand table updated.SKILL.mdnot changed: these routes take a personal access token, not an agent token.Where to look hardest
_hub_changeresolves--itembefore_hub_actruns, so a bad item is refused with no request;cmd_hubs_add/removecatch the_BadInputErrorit raises outside_with_api.one_line(the view) orsanitize_line(status lines).test_server_text_cannot_write_to_the_terminalcovers an escape sequence and markup in a hub name.{"ok": true, "id": ...}; the rest print the hub the server answered.Verification (actual results)
uv run ruff format --check,uv run ruff check: clean.uv run ty check src/pepper_cli/: clean.tests/test_api_contract.pybecause the snapshot did not have the hub schemas yet. After merging main (which has chore(contract): sync from Vycari/pepper @ 3e622062 #392):tests/test_api_contract.py,tests/test_cli_conformance.py,tests/test_cli_hubs.py,tests/test_cli_account.py,tests/test_docs_push.py: 370 passed. The full suite after the merge is left to CI.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 (see above); 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 markers🤖 Generated with Claude Code
https://claude.ai/code/session_01QNDehAT3jg2ayAQiFhyrRg


Confidence Score: 5/5
The PR appears safe to merge; both previous findings are fixed and no new blocking issues were found.Summary
Adds
pepper hubscommands, API methods, formatted output, JSON results, and help.Reviews (2) · Last reviewed commit: "hubs: refuse an empty --room or --item i..." · Reviewed by Greptile