printobserver-oneharness 0.16.2

oneharness adapter for printobserver.
Documentation
//! `printobserver-oneharness`.
//!
//! Owns: the oneharness adapter — the one implementation of
//! `printobserver-supervisor-api` that drives an agentic coding harness through
//! `OneHarness`'s own Rust crate API, in process.
//!
//! May depend on: `printobserver-types` and `printobserver-supervisor-api`,
//! plus whatever it needs to drive oneharness. Never another implementation
//! crate, and never `printobserver-core`.
//!
//! # In process, and never by spawning a command
//!
//! Every turn goes through [`oneharness_core::io::run::run_supervised`], which
//! returns the report to this process. Nothing here builds a command, and
//! nothing here names the `oneharness` program: a check over this crate's own
//! sources refuses any use of a process-spawning interface at all, whatever
//! executable it would name. Processes still exist during a turn — `OneHarness`
//! spawns the harness itself — and [`TurnSeam::processes`] is where a caller
//! sees each one.
//!
//! # Nothing about a live session is held in memory
//!
//! A print's session is a file under the configured state directory, and so is
//! `OneHarness`'s own session store. That is what lets the supervisor be
//! restarted between two events of one print and have the second event continue
//! the first's conversation: this port rebuilt from the state directory alone
//! continues exactly where it left off.
//!
//! # What a prompt may say is one committed file
//!
//! The system prompt is the prose of the `PrintObserver` skill — the Agent
//! Skill's `SKILL.md` with its frontmatter split off by [`skill_prose`] — read
//! from the configured path when the port is built, followed by this crate's
//! [`TOOL_FRAMING`]; it replaces the harness's own system prompt rather than
//! being appended to it. The prompt for a turn is the committed template at
//! [`SupervisorConfig::prompt_template_path`] with its five slots filled — the
//! triggering event, the situation the turn began in, the print's facts, the
//! context command, the agent's own actor and the usage of the commands it may
//! run — and nothing else. The check's
//! image is attached to the prompt as an image rather than named in it. This
//! port composes no sentence of its own, so what a prompt may say is one small
//! file a person reads.
//!
//! # The answer is constrained by the generated schema
//!
//! [`SupervisorConfig::assessment_schema`] names the assessment schema the
//! contracts generate, and the path is what reaches `OneHarness`: this crate
//! carries no schema of its own and embeds none, so the constraint the agent
//! answers under is the one the types declare. `OneHarness` hands it to the
//! harness natively, beside the check's image, and asks again for an answer
//! that does not conform; this port asks for no schema in its prompt.

mod config;
mod ledger;
mod prompt;
mod sign_in;
mod skill;
mod turn;

/// The committed prompt template this crate ships, as bytes in the built
/// artifact.
///
/// The port reads its template from a *path*, because editing it on a running
/// host is a restart rather than a rebuild. An installed program has no
/// checkout to read that path out of, so the composition root writes this
/// constant to a file under its state directory and points the port at it.
/// It is `include_str!` of this crate's own committed asset rather than a copy,
/// so the file `just check-repo`'s supervisor checks read and the bytes an
/// installed program runs are one thing.
///
/// The skill is not carried here: it is an Agent Skill an operator installs
/// with `gh skill install`, and the port reads it from the path it is
/// configured with.
pub const DEFAULT_TURN_PROMPT: &str = include_str!("../assets/turn-prompt.md");

pub use config::{
    AgentCommand, AssessmentSchema, ConfigError, EnvAssignment, HarnessIdentity, ModelName,
    RunReportObserver, RunRequestObserver, SupervisorConfig, TurnSeam, TurnTimeout,
};
pub use ledger::{
    CallUsage, CompactionEnd, LedgerFormat, RecordedCompaction, RecordedTurn, SESSIONS_DIRECTORY,
    SessionName,
};
pub use prompt::{
    ACTOR_SLOT, COMMANDS_SLOT, CONTEXT_COMMAND_SLOT, EVENT_SLOT, FACTS_SLOT, PromptTemplate,
    SITUATION_SLOT, SLOTS, TemplateError,
};
pub use sign_in::{HARNESS_DIRECTORY, HarnessSignIn, SIGN_INS};
pub use skill::{UnclosedFrontmatter, skill_prose};
pub use turn::{
    ANSWER_CUT, ANSWER_EXCERPT_CHARS, ANSWER_SAID, HARNESS_SESSIONS_DIRECTORY,
    OneharnessSupervisor, TOOL_FRAMING, TURN_TOOL_SET, TurnReport,
};