heartbit_core/codegen/mod.rs
1//! Code-generation harness — a domain-specific agent harness for writing and
2//! **verifying** code, mirroring [`browser`](crate::browser) but for the code
3//! domain.
4//!
5//! The browser harness needed an LLM judge because page state is not reducible
6//! to a boolean. Code is different: a build/test command's **exit code is the
7//! ground truth**. So this harness centers on one primitive the rest of the
8//! framework lacked — a structured, *configured*, gate-able verification tool —
9//! and otherwise composes existing machinery (`AgentRunner`, `GoalCondition`'s
10//! independent-judge repair loop, builtins rooted at a workspace, guardrails).
11//!
12//! - [`VerifyCommandTool`] runs the harness-configured verify command(s) and
13//! emits a machine-greppable `VERIFY_RESULT:` sentinel (PASS/FAIL + exit code).
14//! Its two reasons to exist over raw `bash`: the command is *configured* (the
15//! agent never guesses it) and the result is *structured and gate-able*.
16//! - [`parse_latest_verify`] reads that sentinel back out of a transcript — the
17//! seam for a deterministic completion gate.
18//!
19//! See `tasks/codegen-harness-2026-06-02.md` for the full design + non-duplication
20//! rationale (what we deliberately do NOT build from `claw-code`).
21
22pub mod builder;
23pub mod verify;
24
25#[cfg(test)]
26mod live;
27
28pub use builder::{CODE_SYSTEM_PROMPT, CodeAgentBuilder, code_goal, code_tools};
29pub use verify::{VerifyCommandTool, VerifyOutcome, parse_latest_verify, render_verify_result};