Skip to content

Add pepper hubs - #393

Merged
allenhutchison merged 6 commits into
mainfrom
claude/hubs-commands
Nov 26, 2026
Merged

allenhutchison merged 6 commits into
mainfrom
claude/hubs-commands

Conversation

@allenhutchison

@allenhutchison allenhutchison commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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, leave and notify. A hub is named by its name or its id. Refs Vycari/pepper#7090.

Human required

  • Merge only after Vycari/pepper#7168 (merged 2026-11-26) has deployed to prod. Until then every pepper hubs command 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, HubDetail with # MIRROR: markers for src/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 a standing of owner, taken or offered for the J3 envelope.
  • cli.py: the hubs noun and its 14 leaves.
    • _need_hub resolves HUB: 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 is not_found (exit 2); more than one is ambiguous and lists the ids. Both happen before any write.
    • add/remove take exactly one of --room and --item (argparse mutually exclusive, required). --item takes a number from the last artifacts list or an id.
    • delete, remove, revoke and leave are DESTRUCTIVE verbs: --yes, a prompt on a terminal, a usage error otherwise.
    • share with no --level reads the hub and keeps the level it is already shared at (else view), so sharing again never lowers a level by accident. With --level it makes no extra request.
    • notify sends room_id only 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.
  • No client-side rollout gate: the server decides (hubs, hub-sharing, hub-notifications), per the repo rule and like the other gated commands here.
  • tests/test_cli_conformance.py: hubs in NOUNS; new verbs add, pin, unpin, notify with the reason each is needed (take already existed); ROOM_NA for the 11 leaves where a room flag means nothing; JSON cases and fake routes for all 14.
  • help/cli.md: three entries inside the hubs, hub-sharing and hub-notifications rollout markers. README.md command table updated.
  • Bundled SKILL.md not changed: these routes take a personal access token, not an agent token.

Where to look hardest

  • _hub_change resolves --item before _hub_act runs, so a bad item is refused with no request; cmd_hubs_add/remove catch the _BadInputError it raises outside _with_api.
  • Every server string printed goes through one_line (the view) or sanitize_line (status lines). test_server_text_cannot_write_to_the_terminal covers an escape sequence and markup in a hub name.
  • JSON for the three 204 routes is {"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.
  • Full suite before the merge of main: 4194 passed, 2 skipped, 2 failed, both in tests/test_api_contract.py because 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.
  • Coverage on the full run: 96% (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 (see above); 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 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.RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; both previous findings are fixed and no new blocking issues were found.

Summary

Adds pepper hubs commands, API methods, formatted output, JSON results, and help.

  • People can gather their rooms and their own notes and files in hubs.
  • Hub owners can share hubs, and recipients can take or leave them.
  • People can set notification levels for every room in a hub or one room.

Reviews (2) · Last reviewed commit: "hubs: refuse an empty --room or --item i..." · Reviewed by Greptile

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-review

vycari-review Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Vycari Review: Vycari Review did not publish a review of 988df5f: it could not be reviewed in time (the daily review budget is spent, so Vycari Review did not run on this commit). See the check run for what happens next; a new push starts a new round.
Results below are from round 1 on b1b4486.

Vycari Review

Round 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: 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 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

  • P1 · VR-508850f2 · Name lookup treats a truncated hub list as complete, so a name can resolve to the wrong hub · src/pepper_cli/cli.py lines 11281–11295
P2s, judge's notes and closed findings

Open P2 findings

  • P2 · VR-13d738ba · HubDetail docstring says an unknown role is treated as view; the CLI prints it verbatim · src/pepper_cli/api_client.py lines 2375–2384
  • P2 · VR-234c896c · Share without --level can lower a hub's level another writer just raised · src/pepper_cli/cli.py lines 11485–11486
  • P2 · VR-fe057f92 · A 404 on an item add or remove is reported as hubs being off for the account · src/pepper_cli/cli.py lines 11249–11265

P2s with no reply yet

  • P2 · VR-13d738ba · HubDetail docstring says an unknown role is treated as view; the CLI prints it verbatim · src/pepper_cli/api_client.py lines 2375–2384
  • P2 · VR-234c896c · Share without --level can lower a hub's level another writer just raised · src/pepper_cli/cli.py lines 11485–11486
  • P2 · VR-fe057f92 · A 404 on an item add or remove is reported as hubs being off for the account · src/pepper_cli/cli.py lines 11249–11265

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.

@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 988df5f50580 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.size: 7 files, 1212 lines
  • C2.human-required: - [x] Merge only after Vycari/pepper#7168 (merged 2026-11-26) has deployed to prod. Until then every 'pepper hubs' command answers "No such hub, or hubs are not turned on".

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

Comment thread src/pepper_cli/cli.py Resolved
Comment thread src/pepper_cli/cli.py Resolved
Comment thread src/pepper_cli/cli.py Resolved
Comment thread src/pepper_cli/api_client.py Resolved
…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
@vycari-review

vycari-review Bot commented Nov 26, 2026

Copy link
Copy Markdown

@greptileai review

Comment thread src/pepper_cli/cli.py Resolved
Comment thread src/pepper_cli/cli.py Resolved
@allenhutchison

Copy link
Copy Markdown
Contributor Author

@greptileai review

Both findings are fixed in 988df5f and answered on their threads.


Generated by Claude Code

@allenhutchison
allenhutchison added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit db07c66 Nov 26, 2026
5 checks passed
@allenhutchison
allenhutchison deleted the claude/hubs-commands branch November 26, 2026 21:24
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