Expand description
System-prompt assembly layer implementing the parity spec.
Why: The cross-model comparison harness must assemble the same fixed
instruction surface for every model so the comparison measures the model,
not the scaffolding (docs/trusty-code/parity-spec.md §1). This module owns
that surface: the byte-identical BASE preamble, its version token, and the
fixed-order assembler that merges BASE + agent prompt + project CLAUDE.md
context + optional per-tier fallback guidance (the #1023 seam).
What: BASE_PREAMBLE, BASE_PREAMBLE_VERSION, PromptAssembler, and
assemble_system_prompt.
Test: prompt::tests::*.
System-prompt assembly layer (parity-spec — docs/trusty-code/parity-spec.md).
Why: The model-comparison harness must drive the same system instruction
surface through every model so a comparison measures the model, not the
scaffolding (parity-spec §1). This module owns that surface: the
byte-identical BASE preamble, its version token, and the fixed-order
assembler that merges the BASE preamble with the per-agent prompt, project
CLAUDE.md context, and the optional per-tier fallback guidance.
What: Re-exports BASE_PREAMBLE, BASE_PREAMBLE_VERSION,
PromptAssembler, assemble_system_prompt, and (#2059)
assemble_system_prompt_for_mode — the HarnessMode-branching entry
point task::executor/runner::in_process call. Its skills_catalog
parameter (#2069) is P1B’s first token-efficiency layer to actually land:
DailyDriver appends the cheap, always-cached skill metadata catalog
(crate::skills::format_skill_catalog); Parity ignores it.
Test: prompt::tests::* (via assembler.rs’s inline test include).
Structs§
- Prompt
Assembler - Assembles the parity system prompt from its constituent sections.
Constants§
- BASE_
PREAMBLE - The BASE protocol preamble (spec §2a) — identical for every model slug.
- BASE_
PREAMBLE_ VERSION - Semantic version of the
crate::prompt::BASE_PREAMBLEconstant. - DISCOVERY_
GUIDANCE - DailyDriver-only discovery guidance (PR A, #2689) appended as a trailing
section, mirroring the
skills_catalogpattern.
Functions§
- assemble_
system_ prompt - Assemble the parity system prompt in the spec’s stable, fixed order.
- assemble_
system_ prompt_ for_ mode - Mode-aware prompt assembly — the CONSUMPTION POINT #2059 wired up for P1B’s token-efficiency work; #2069 is the first arm to actually land in it (progressive-disclosure skill loading).