feat(people): add people clients add/remove/invite/enable/disable

Merged
JE
3mo ago
+2159-22

What

Surfaces the client-admission API basecamp/bc3#13098 added — the client-side
counterpart of people add/people remove — as a people clients group:

basecamp people clients enable  --in <project>
basecamp people clients list    --in <project>
basecamp people clients add     <id|email|name>... --in <project>
basecamp people clients invite  <invitee>...       --in <project> [--company NAME] [--title TITLE]
basecamp people clients invite  -                  --in <project>   # one invitee per line on stdin
basecamp people clients remove  <id|email|name>... --in <project>
basecamp people clients disable --in <project>
  • add / remove grant and revoke existing client users through
    PUT /projects/:id/people/client_users.json, resolving ids, emails, or names
    the way people add does. The endpoint silently drops an ineligible id (a
    team member's, or someone already on the project), so the ids it did not
    echo back in granted/revoked are reported as a diagnostic notice rather
    than lost.
  • invite creates new clients by email through the same endpoint's
    create list. An invitee is a bare address or "Name <email>" (RFC 5322
    mailbox form via net/mail, so a quoted display name works); - alone reads
    one invitee per line from stdin. --company applies to every invitee;
    --title names one person's role and so takes exactly one invitee.
  • enable / disable drive POST/DELETE /projects/:id/client_enablement.json.
  • list is the project roster narrowed to client: true; people list
    now also carries each person's client flag.

A separate group rather than a --client flag on people add: bc3 keeps the
two kinds of access apart on the wire (the team endpoint drops a client's id,
the client endpoint rejects a team member's — neither cross-grades), and the
CLI mirrors that split instead of hiding it behind a mode flag. The verbs
honor the configured default project (.basecamp/config.json) as SKILL.md
promises; people add/remove still read only the flag, unchanged here.

Error mapping

The endpoint's refusals become verdicts, structured in --json/--agent
output:

ServerCLI
403 (clients off, or no permission — same empty body)forbidden (4). The project is read back once: with clients_enabled: false the message says so and the hint is basecamp people clients enable --in <project>; otherwise it is a permission message.
422 {errors:[{email_address, messages}]}validation (9), each rejected row named in the hint (the SDK branch folds the row-keyed body into FieldErrors by address); nobody was invited.
429 (new addresses exceed the account's user limit)limit_exceeded (10), retryable: false. This 429 carries no Retry-After and waiting cannot change it, so it is not reported as throttling; a 429 that does name a Retry-After still converts as a rate limit. The SDK branch declares the operation retry_on: [503], so it surfaces on the first attempt.
403 on disable while clients remainforbidden, with the roster read back so the hint is the exact remove command.

Dependency — pinned to the SDK release

Depends on basecamp/basecamp-sdk#847, which shipped in
basecamp-sdk v0.17.0.
go.mod pins github.com/basecamp/basecamp-sdk/go v0.17.0 (tag go/v0.17.0,
6e73a06f4262) via make bump-sdk REF=v0.17.0, the mechanism #677 used; the
vendored MCP model is re-synced from that tag (scripts/sync-mcp-model.sh,
PROVENANCE.json ref go/v0.17.0) and the Nix vendorHash recomputed and
build-verified (make update-nix-hash). No replace directive.

The branch is rebased onto main (#681, #688, #686). The only conflicts were
the pin-generated files — go.mod, go.sum, PROVENANCE.json,
sdk-provenance.json, nix/package.nix — resolved by taking main's side and
re-running the flip; .surface regenerated to main + the people clients
additions (no removals against main).

Tests

  • people_clients_test.go: request shapes for grant/revoke/invite (resolved
    ids, the create rows, --company/--title placement, name omitted when
    blank), stdin invitees, the unaffected-id notice, and each error mapping
    (403 both ways, per-row 422, bare 429 vs Retry-After 429, disable while
    clients remain).
  • e2e/people.bats: offline usage errors (missing project, non-address
    invitee, - with an empty pipe, - mixed with other invitees, --title
    with several invitees).
  • Catalog, .surface, SKILL.md, API-COVERAGE, and the smoke-coverage entries
    updated. Every bin/ci target run locally: fmt, vet, lint, lint-actions,
    e2e (458 bats), naming, surface, skill drift, bare groups, lint lockstep,
    smoke coverage, SDK provenance, and go mod tidy green; the MCP catalog
    (provenance, snapshot, served count 256 → 259) and the Nix flake
    (vendorHash recomputed and build-verified) too. The Go unit run is green
    except TestBareBasecampNeverReportsASetupError,
    TestExplicitSetupStillRefuses,
    TestDeleteConfirmableFollowsTheAudienceNotTheDevice and the
    TestIsInteractive* cases in appctx/cli, which fail identically on
    pristine main in this non-TTY shell (as #677 noted).

I'm babysitting the review loop on this PR through to convergence.

Release note: Features (enhancement).