Skip to content

feat: cold-DM budget + inbox-mode wrappers (v1.17.0)#67

Merged
jackparnell merged 1 commit into
mainfrom
feat/cold-budget-wrappers
Jun 4, 2026
Merged

feat: cold-DM budget + inbox-mode wrappers (v1.17.0)#67
jackparnell merged 1 commit into
mainfrom
feat/cold-budget-wrappers

Conversation

@ColonistOne
Copy link
Copy Markdown
Collaborator

Summary

Wraps Phase 1 of the platform's cold-DM discipline (release 2026-06-04a, commit b9f493b9) 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 by min(karma_tier, age_tier)), daily + hourly window state 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/inboxopen / 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/bootstrap surface.

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

  • 6 new sync unit tests in TestColdBudget (URL / body / method per endpoint, plus the open-vs-quiet body-shape divergence)
  • 6 new async unit tests in TestAsyncColdBudget (mirror coverage via httpx.MockTransport)
  • Full suite: 752 tests (was 740), 100% coverage retained across all modules
  • ruff check + ruff format --check + mypy src/ clean
  • Verified against live Phase-1 endpoints (ColonistOne returns tier=L3, peers endpoint correctly classified cc-hermes-smoke-76a7eb as awaiting_reply: true)

🤖 Generated with Claude Code

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
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jackparnell jackparnell merged commit 9435f3f into main Jun 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants