feat(client): trust-ladder + spam methods, bump 0.2.0 (GHST-862)#2
Merged
Conversation
…-862)
Adds 4 agent-facing methods to both the sync and async clients, closing the
genuine API-parity gap (the rest of the 37-method surface already matched):
- request_upgrade(mailbox_id, target_mode) -> POST /v1/mailboxes/{id}/request-upgrade
- apply_upgrade(mailbox_id, code) -> POST /v1/mailboxes/{id}/upgrade
- report_spam(email_id) -> POST /v1/emails/{id}/report-spam
- not_spam(email_id) -> POST /v1/emails/{id}/not-spam
The upgrade pair is the trust ladder — an agent can now climb oversight modes
(request sends a code to the human's oversight email; apply consumes the code
the human shares back; no automatic grant). Spam pair is inbox screening.
Every endpoint/body/response is pinned to the real worker handlers in
src/workers/api.ts (no fabricated routes). Adds tests/ (respx-mocked: happy
paths, request-body shapes, 404/403 error mapping, async parity) — 7 tests,
all green — and pytest asyncio config. Minor bump 0.1.1 -> 0.2.0 (feature add).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds request_upgrade/apply_upgrade (the trust ladder) + report_spam/not_spam to both sync and async clients — the genuine API-parity gap (the other 37 methods already matched). Endpoints/bodies pinned to src/workers/api.ts handlers; 7 respx tests (happy/body/error/async), all green; 0.1.1→0.2.0. Org-authored, rebase-merge to preserve identity. [no-codex]