Restrict posting actions to email threads

Closed
IV
2mo ago
+221-64

Summary

hey move, hey trash, and hey ignore now require the exact flag --kind topic. Missing and non-email kinds fail before config, authentication, or any SDK request, while existing bulk-ID behavior stays unchanged.

Fresh main already contains the posting actions from #173, #175, and #176. This rebase drops PR #152's superseded command implementations and applies only the email-thread safety guard to the current commands. The CLI does not manage HEY World posts.

Validation

  • make fmt-check
  • make vet
  • go test ./internal/...
  • make tidy-check
  • make check-surface
  • go test -race -count=1 ./internal/...
  • make build
  • A malformed-config regression proves kind validation runs before root setup
  • Compound Engineering review completed; its id versus topic_id wording finding was fixed and regression-tested

Risk

--kind is a caller-supplied safety assertion, not an authorization boundary. The server remains responsible for rejecting an ID that is invalid for an action.


Summary by cubic

Restricts move, trash, and ignore to email threads and fails fast on non-email kinds. Previously these commands ran with any box item ID; now they require --kind topic and reject world/post and other kinds before config, auth, or any request.

  • Callers must pass --kind topic with box item IDs (id) for hey move, hey trash, and hey ignore. spam and stop-ignoring are unchanged.
  • Adds emailPostingArgs to validate the kind early and return clearer errors, including a specific message for HEY World posts.
  • Updates CLI help, README, .surface, breadcrumbs, and examples to show --kind topic; help notes clarify using id vs topic_id and how to source id from box/label/search JSON.
  • Adds unit tests verifying early kind validation (even with malformed config) and updated help content.