Skip to content

feat: add SyncEndpoint trait + VoiceCalls marker#6

Open
wavekat-eason wants to merge 3 commits into
mainfrom
feat/sync-endpoint-voice-calls
Open

feat: add SyncEndpoint trait + VoiceCalls marker#6
wavekat-eason wants to merge 3 commits into
mainfrom
feat/sync-endpoint-voice-calls

Conversation

@wavekat-eason
Copy link
Copy Markdown
Contributor

Summary

  • Adds SyncEndpoint trait + Client::sync<E> / Client::list<E> so every client→platform sync (calls today; recordings, transcripts, summaries later) ships as a typed marker rather than a fresh HTTP pipeline.
  • First marker: VoiceCalls with wire-stable VoiceCallRecord, direction/disposition/end-reason enums, and a VoiceCallsQuery (cursor + limit).
  • Updates CLAUDE.md so platform sync endpoints belong here by default. The old "only when a second consumer needs it" rule now applies only to one-off endpoints.

Design rationale and full wire contract live in wavekat-voice/docs/21-platform-call-history-sync.md (sibling PR, landing alongside).

Test plan

  • cargo test -p wavekat-platform-client --lib — 27 passed (8 new across sync and voice modules).
  • Manual smoke against platform.wavekat.com once the matching platform PR lands.

🤖 Generated with Claude Code

wavekat-eason and others added 3 commits May 16, 2026 22:27
Generalises the client→platform sync surface so every future resource
(calls today; recordings, transcripts, summaries later) ships as a
typed marker + a Record struct rather than a fresh HTTP pipeline.

- `SyncEndpoint` trait pins the URL segment, Record, and Query types
  for each resource.
- `Client::sync<E>` / `Client::list<E>` are the only two methods
  consumers need.
- First marker: `VoiceCalls` (RESOURCE = "calls"), with wire-stable
  `VoiceCallRecord`, direction/disposition/end-reason enums, and a
  cursor-paginated `VoiceCallsQuery`.

Updates CLAUDE.md: platform sync endpoints belong here, even with one
consumer. The old "only when a second consumer needs it" rule applies
to one-off endpoints only.

Design rationale and the wire contract live in
wavekat-voice/docs/21-platform-call-history-sync.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Makes the version-skew story generic across every sync resource
(calls today; recordings, transcripts later) rather than per-record:

- `SyncEnvelope` carries `schemaVersion` + `extras` on the wire.
  Records embed it via `#[serde(flatten)]` so the two fields sit at
  the top of the JSON object alongside resource-specific columns.
- `HasSyncEnvelope` exposes the envelope so `Client::sync<E>` can
  stamp `schemaVersion = E::CURRENT_SCHEMA_VERSION` automatically.
  Consumers don't manage the version; upgrading the crate dep
  picks up the right number.
- `SyncEndpoint::CURRENT_SCHEMA_VERSION: u32 = 1` for new resources;
  bumped only when a field's meaning changes (rare).
- `VoiceCallRecord` flattens the envelope + impls `HasSyncEnvelope`.
- CLAUDE.md documents the additive-only field policy and the
  envelope pattern every future record adopts.

Designed in wavekat-voice/docs/21 §"Versioning and forward
compatibility".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant