Skip to main content

codetether_agent/session/tasks/
mod.rs

1//! # Session Task Log
2//!
3//! Append-only JSONL event log attached to each [`Session`]. Captures the
4//! session's **goal** (objective, success criteria, forbidden behaviors)
5//! and the lifecycle of its **tasks** so goal-governance middleware can:
6//!
7//! - Inject the current objective into per-turn system prompts.
8//! - Detect drift (tool calls / errors since last goal reaffirmation).
9//! - Survive crashes and session resumes without losing intent.
10//!
11//! ## File layout
12//!
13//! Each session gets a sibling file next to its `.json`:
14//!
15//! ```text
16//! <data_dir>/sessions/<session-id>.json        // messages
17//! <data_dir>/sessions/<session-id>.tasks.jsonl // this log
18//! ```
19//!
20//! ## Event shape
21//!
22//! Events are JSON objects, one per line, tagged by `kind`. See
23//! [`TaskEvent`]. The log is append-only; mutations are expressed as new
24//! events (e.g. [`TaskEvent::TaskStatus`] with `status = done`) rather
25//! than in-place edits. [`TaskState::from_log`] folds the stream into
26//! the current goal + open task list.
27//!
28//! [`Session`]: super::Session
29
30mod event;
31mod log;
32mod path;
33mod render;
34mod state;
35
36#[allow(unused_imports)]
37pub use event::{TaskEvent, TaskStatus};
38pub use log::TaskLog;
39pub use path::task_log_path;
40pub use render::governance_block;
41pub use state::TaskState;