trusty_code/prompt/mod.rs
1//! System-prompt assembly layer (parity-spec โ `docs/trusty-code/parity-spec.md`).
2//!
3//! Why: The model-comparison harness must drive the *same* system instruction
4//! surface through every model so a comparison measures the model, not the
5//! scaffolding (parity-spec ยง1). This module owns that surface: the
6//! byte-identical BASE preamble, its version token, and the fixed-order
7//! assembler that merges the BASE preamble with the per-agent prompt, project
8//! `CLAUDE.md` context, and the optional per-tier fallback guidance.
9//! What: Re-exports [`BASE_PREAMBLE`], [`BASE_PREAMBLE_VERSION`],
10//! [`PromptAssembler`], [`assemble_system_prompt`], and (#2059)
11//! [`assemble_system_prompt_for_mode`] โ the `HarnessMode`-branching entry
12//! point `task::executor`/`runner::in_process` call. Its `skills_catalog`
13//! parameter (#2069) is P1B's first token-efficiency layer to actually land:
14//! `DailyDriver` appends the cheap, always-cached skill metadata catalog
15//! (`crate::skills::format_skill_catalog`); `Parity` ignores it.
16//! Test: `prompt::tests::*` (via `assembler.rs`'s inline test include).
17//!
18//! [`BASE_PREAMBLE`]: crate::prompt::BASE_PREAMBLE
19//! [`BASE_PREAMBLE_VERSION`]: crate::prompt::BASE_PREAMBLE_VERSION
20//! [`PromptAssembler`]: crate::prompt::PromptAssembler
21//! [`assemble_system_prompt`]: crate::prompt::assemble_system_prompt
22//! [`assemble_system_prompt_for_mode`]: crate::prompt::assemble_system_prompt_for_mode
23
24mod assembler;
25mod preamble;
26mod version;
27
28pub use assembler::{
29 DISCOVERY_GUIDANCE, PromptAssembler, assemble_system_prompt, assemble_system_prompt_for_mode,
30};
31pub use preamble::BASE_PREAMBLE;
32pub use version::BASE_PREAMBLE_VERSION;