kcode-k1-chat-thread-rust-code-session 0.1.4

Own one K1 chat thread's Rust code integration session
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
# K1 chat-thread Rust code session 0.1.4

`RustCodeSession` is the one-consumer Session Actor owner for one conversation's Rust code authorization mirror, selector-and-revision-aware recovered task state, FIFO execution lane, retained completion, durable output correlation, and restart replacement.

The exact recognized names remain `RustCodeCreate`, `RustCodeDocs`, `RustCodeOpen`, `RustCodeOverwrite`, `RustCodeCheck`, and `RustCodePublish`. Recovery scans canonical history without service calls and restores the V1 published or unpublished selector, exact unpublished revision, source message IDs, and known check state. It accepts no legacy RustCode contract.

`accept_user` changes the mirror only after durable acceptance. The mirror retains the exact `AccessContext` and backend-selected Profile authority; authority is never model input. `enqueue` requires that mirror and exactly one matching canonical Tool Call, then carries both values unchanged into the RustCode lane.

`receive` retains one completion. `persist_completion` accepts ordered canonical Tool Messages and one Tool Result v2, including the exact Rust editor-state metadata, exactly once; it correlates their durable box IDs and commits task state only afterward. Buffered output remains retained until canonical boxes materialize. Partial persistence, malformed correlation, or lane-commit failure aborts the session and is not retried.

`restart` recovers replacement state directly from durable boxes before the durable restart transition. Failure leaves the existing session unchanged. Success installs the supplied authorization mirror and aborts the old lane. A recovered source under a different authority remains visible in history but is rejected for editing by RustCode Tasks.

The session performs no provider launch, actor selection, service retry, migration, HTTP, deployment, or telemetry. Full actor integration and live behavior remain downstream responsibilities.