Skip to main content

Pack

Trait Pack 

Source
pub trait Pack: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn register(&self, host: &Arc<Host>, registry: &mut Registry);
    fn preamble(&self, ctx: &PackContext) -> Vec<Message>;

    // Provided method
    fn build_registry(&self, host: &Arc<Host>) -> Registry { ... }
}
Expand description

A faithful reproduction of one harness: its real toolset + its base prompt, selected whole via --harness (ADR-0012). One pack is active per run.

The pack — not a per-tool field — is the unit of harness identity (contrast Grok Build, which tags every tool with a namespace because it co-locates all harnesses’ tools in one registry; we build a fresh registry per pack, so no tag is needed).

Required Methods§

Source

fn name(&self) -> &'static str

The --harness selector and the report-envelope harness value.

Source

fn register(&self, host: &Arc<Host>, registry: &mut Registry)

Register this pack’s tools into registry, each under its harness’s real wire name (Tool has no name of its own — the name is assigned here). Tools are constructed here holding an Arc<Host> (the only OS seam; ToolCtx is too small to carry it). A duplicate name is a wiring bug and panics inside Registry::register.

Source

fn preamble(&self, ctx: &PackContext) -> Vec<Message>

The pack’s base preamble: the ordered, role-tagged System/Developer messages that seed the conversation (ADR-0013). Each pack maps its harness onto our roles faithfully — a single System message, or System + Developer, etc. The wire (Task 12) places each role in the right slot. Task 8 ships a scaffold; the real content lands in Task 13.

Provided Methods§

Source

fn build_registry(&self, host: &Arc<Host>) -> Registry

Convenience: a fresh Registry holding exactly this pack’s tools, over host.

§Panics

If the pack’s Pack::register assigns the same wire name twice.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§