yog 0.0.1

yog: a balls-oriented session manager for lernie loops (egui frontend)
Documentation
//! Tests for the transcript view-model.
//!
//! [`vm`] drives [`super::build`] end-to-end against tempdir-backed
//! `messages/` directories, exercising every origin-classification and
//! forgiving-parse branch through the public API. [`flow`] covers
//! enumeration order, skipping, the in-progress query, and the live tail.
//! [`render`] shape-walks the egui widget headlessly per the git_tree
//! render-test pattern.

use std::path::Path;

mod flow;
mod render;
mod vm;

/// Fixed agent id all fs-backed tests build under.
pub(super) const AGENT: &str = "20260427T120000Z-aaaa";

/// Write one message file into `<ws>/agents/<AGENT>/messages/`.
pub(super) fn write_msg(ws: &Path, name: &str, bytes: &[u8]) {
    let dir = ws.join("agents").join(AGENT).join("messages");
    std::fs::create_dir_all(&dir).unwrap();
    std::fs::write(dir.join(name), bytes).unwrap();
}

/// Write the latest step's `response.json` the live-tail fold reads.
pub(super) fn write_response(ws: &Path, seq: u32, bytes: &[u8]) {
    let dir = ws.join("steps").join(AGENT).join(format!("{seq:03}"));
    std::fs::create_dir_all(&dir).unwrap();
    std::fs::write(dir.join("response.json"), bytes).unwrap();
}