Skip to content

[SDK post-0.1] Ship conversational control: create, send, stream, stop, retry, reconcile #42

Description

@BunsDev

Blocked by:

Outcome

After the secure read-only release is validated, add the first bounded mutation authority: canonical conversation creation and idempotent send/stream control, with Cave remaining the sole executor and canonical state owner.

Required surface

  • canonical conversation create/update/delete where approved;
  • send with one caller-visible operation UUID;
  • resumable typed stream with monotonic event IDs;
  • stop;
  • retry of an explicitly failed/cancelled turn with a fresh operation UUID;
  • reconciliation when replay history is unavailable or canonical state moved.

Architectural invariants

  • Cave owns persistent idempotency, execution, stop semantics, canonical mutations, and replay buffers.
  • The SDK exposes constrained typed operations, never arbitrary HTTP paths or private Cave routes.
  • An identical completed mutation may replay its recorded result; a reused key with a different canonical request hash is a conflict.
  • An ambiguous transport completion never causes automatic mutation replay.
  • Initial and resumed streams use the same event translator.
  • Abort closes the current read; it does not retry the send.
  • reconcile_required reloads canonical history rather than fabricating continuity.

Dependencies and blockers

  • Stable released 0.1 read/discovery/pairing foundation
  • Cave Client v1 idempotency and mutation routes
  • Approved stream event contract and replay retention policy
  • Real-authority conformance extension for mutation and restart behavior

Acceptance criteria

  • Persistent idempotency survives authority restart and contains no prompt/attachment/bearer content beyond approved hashes and result metadata.
  • Concurrent duplicate claims execute once.
  • Same key/different request returns conflict.
  • Send returns the operation ID on success and error.
  • Stream resume emits only events after the supplied cursor and suppresses duplicates.
  • Replay gaps produce reconcile_required.
  • Stop and retry operate through canonical Cave services.
  • Retry uses a fresh operation ID and explicit retryOfTurnId.
  • Human/JSON/NDJSON CLI output preserves event order and never leaks private causes.
  • Packed examples and real-authority mutation journeys pass.

Validation

Idempotency fault injection, stream framing/cursor tests, restart/replay conformance, duplicate-send mutations, packed consumer examples, and a separate security review for the new authority level.

Non-goals

Attachments, task handoffs, GitHub mutations, arbitrary tools, offline mutation queues, and private-route bridging remain out of scope.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions