kcode-k1-chat-chatend 0.2.0

Append-only boxed Chatend state transitions for K1 chat
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
# Public API

`ActionId` is the canonical call/return identity. It contains a private 12-byte session identity and `u64` sequence; `ActionId::new`, `ActionId::session`, and `ActionId::sequence` construct and inspect it.

`BoxId::get` exposes its private integer. `BoxContent` defines the six canonical values, and `ChatBox::id`, `ChatBox::content`, and `Chatend::boxes` provide immutable access.

`Chatend::new` and `Default` create empty history. `Chatend::accept_system`, `accept_user`, `accept_attachment`, and `accept_async_return` return an assigned ID only when an arrival appends immediately.

`Chatend::start_round` returns the frozen prior frontier. `append_kennedy_text`, `collect_provider_call`, and `complete_provider_output` build the completed Kennedy and ordered `DispatchCall` values.

`Chatend::complete_dispatch` accepts one ordered `DispatchOutcome::Pending` or `DispatchOutcome::Terminal` per call, appends terminal returns before queued arrivals, and leaves pending actions available for `accept_async_return`.

Transition failures are reported by `TransitionError` without partially applying the rejected transition. Operations are constant work apart from retained payload sizes, history growth, ordered maps, returned calls, and queued-arrival draining.