Skip to main content

trusty_code/session/
mod.rs

1//! Daemon-owned session model + attach/detach protocol (#2054, vision spec
2//! Axiom 4 / §4.3-4.4 / §12).
3//!
4//! Why: "The Daemon OWNS Sessions; CLI Attaches Over the API" — a running
5//! session is a first-class object living inside `tcode serve`, not a tmux
6//! pane the CLI scrapes. This module is the whole vertical slice: the
7//! domain type, its in-memory registry + ring buffer + attach bookkeeping,
8//! and the `session.*` JSON-RPC methods built on top of the existing
9//! `crate::jsonrpc::Router` — reachable identically over STDIO and HTTP
10//! (`crate::serve`), reusing the SAME method surface both transports
11//! dispatch through.
12//! What: [`model::Session`]/[`model::SessionStatus`] (the domain type),
13//! [`registry::SessionRegistry`] (storage + ring buffer + attach/detach +,
14//! since #2056, execution tracking), [`transcript::TranscriptRecord`]
15//! (#2058's `session.get_transcript` response DTO), and [`protocol::register`]
16//! (wires `session.create`/`list`/`status`/`send`/`attach`/`detach`/`cancel`/
17//! `get_transcript` onto a `Router`).
18//! Test: `model::tests::*`, `registry::registry_tests::*`,
19//! `protocol::tests::*`; end-to-end over the real daemon in
20//! `tests/session_e2e.rs` and (#2058) `tests/task_e2e.rs`.
21
22pub mod model;
23pub mod protocol;
24pub mod registry;
25pub mod transcript;
26
27pub use model::{Session, SessionStatus};
28pub use registry::SessionRegistry;
29pub use transcript::TranscriptRecord;