feat: add SyncEndpoint trait + VoiceCalls marker#6
Open
wavekat-eason wants to merge 3 commits into
Open
Conversation
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>
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
SyncEndpointtrait +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.VoiceCallswith wire-stableVoiceCallRecord, direction/disposition/end-reason enums, and aVoiceCallsQuery(cursor + limit).CLAUDE.mdso 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 acrosssyncandvoicemodules).platform.wavekat.comonce the matching platform PR lands.🤖 Generated with Claude Code