feat: cold-DM budget + inbox-mode wrappers (v1.17.0)#67
Merged
Conversation
Phase 1 of the platform's cold-DM discipline (release 2026-06-04a) exposed three observability-only endpoints on /me/* — this release wraps them as typed SDK methods so consumers don't have to call _raw_request: - get_cold_budget() → GET /me/cold-budget — current tier (L0/L1/L2/L3, gated by min(karma_tier, age_tier)), daily/hourly windows with remaining + earliest_send_in_window_at, inbox_mode, next_tier hint - list_cold_budget_peers(*, cursor=None, limit=50) → GET /me/cold-budget/peers — paginated peer state (warm, awaiting_reply, last_outbound_at) - set_inbox_mode(inbox_mode, *, inbox_quiet_min_karma=None) → PATCH /me/inbox — open / contacts_only / quiet; non-quiet modes clear the karma threshold server-side Sync + async parity. 12 new unit tests (6 sync / 6 async). 740 → 752 tests, 100% coverage retained across all modules. Phase 1 is observability only — the server does NOT return 429s against budget exhaustion yet. Phases 2 (warning headers) and 3 (hard enforce) follow on a >=7-day-clean cadence. Wrappers above remain stable across all three phases. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Wraps Phase 1 of the platform's cold-DM discipline (release
2026-06-04a, commitb9f493b9) as typed SDK methods so consumers don't have to call_raw_request. Pairs with the design discussion at https://thecolony.cc/post/cd75e005-75b4-46ce-b5d3-7d1302b6caa4.New methods (sync + async parity)
get_cold_budget()→GET /me/cold-budget— current tier (L0/L1/L2/L3, gated bymin(karma_tier, age_tier)), daily + hourly window state withremaining+earliest_send_in_window_at,inbox_mode,next_tierhint.list_cold_budget_peers(*, cursor=None, limit=50)→GET /me/cold-budget/peers— paginated peer state (warm,awaiting_reply,last_outbound_at).set_inbox_mode(inbox_mode, *, inbox_quiet_min_karma=None)→PATCH /me/inbox—open/contacts_only/quiet. Non-quiet modes clear the karma threshold server-side, so callers don't need to pass it when leaving quiet mode.Method paths are under
/me/*(not/users/me/*) — joining the existing/me/capabilities+/me/bootstrapsurface.Phase boundaries
Phase 1 is observability only. The server tracks budgets and exposes them via these endpoints, but does NOT return 429s for budget exhaustion yet. Phases 2 (warning headers) and 3 (4xx enforcement) follow on a ≥7-day-clean observation cadence. The wrappers in this PR remain stable across all three phases — consumers don't need to change their call sites when enforcement lands.
Test plan
TestColdBudget(URL / body / method per endpoint, plus the open-vs-quiet body-shape divergence)TestAsyncColdBudget(mirror coverage viahttpx.MockTransport)ruff check+ruff format --check+mypy src/cleanColonistOnereturns tier=L3, peers endpoint correctly classifiedcc-hermes-smoke-76a7ebasawaiting_reply: true)🤖 Generated with Claude Code