Skip to main content

Spec

Struct Spec 

Source
pub struct Spec {
    pub name: String,
    pub description: String,
    pub model: ModelRef,
    pub data_policy: DataPolicy,
    pub read_roots: Vec<PathBuf>,
    pub fetch_prefixes: Vec<String>,
    pub embedding_model: Option<ModelRef>,
    pub warehouse: Option<PathBuf>,
    pub nodes: NodeGraph,
    pub branches: Branches,
}
Expand description

A parsed spec.

Fields§

§name: String

Job name, used to submit against it.

§description: String

Trigger conditions for a calling agent — when to use this, never how it works. A description that summarises the workflow invites an agent to act on the summary instead of reading the real contract.

§model: ModelRef

Which model serves this job’s inference.

§data_policy: DataPolicy

Data-handling policy; see DataPolicy.

§read_roots: Vec<PathBuf>

Directories this job may read beneath. Empty means none.

§fetch_prefixes: Vec<String>

URL prefixes this job may fetch, from Fetch "https://host/path".

An allowlist by prefix, exactly as read_roots is for the filesystem: a corpus that lives on the web is still a corpus, and the capability list has to describe reaching it or it stops being a truthful account of what the job touches. Empty means the job cannot fetch anything, which is the default.

§embedding_model: Option<ModelRef>

The model serving embed, if the spec declares one.

Separate from model on purpose: an embedding model and a chat model are different things, and reusing one field would let a spec ask a chat model for vectors — which either fails or returns something shaped like an embedding that is not one.

§warehouse: Option<PathBuf>

Where to write a medallion warehouse of this job’s results, if anywhere.

Opt-in, and alongside the JSONL projection rather than instead of it: downstream nodes read results_path with open/slice, so replacing it would break every existing spec. A job that just wants an answer pays nothing for a warehouse it never asked for.

Relative paths resolve against the spec’s own directory, like every other path in a spec.

§nodes: NodeGraph

The proc-blocks implementing the job, as a graph of nodes.

Each node’s declared input is typechecked against the nodes feeding it before anything runs. block = "..."; is sugar for a one-node graph — see crate::graph::NodeGraph::single.

§branches: Branches

Conditional dispatch: which branch target fires for each labeled route a branching node produces. Empty when the spec has none.

Implementations§

Source§

impl Spec

Source

pub fn validate_host_read_paths(&self) -> Result<(), SpecError>

Refuse a spec whose host-read paths sit outside its granted roots.

Fan-out manifests and acceptance schemas are read by the host, which is not sandboxed — so nothing would otherwise stop either reading a path the spec never granted. Requiring them inside a declared Read root keeps the capability list a truthful description of everything the job touches, which is the property the whole capability model rests on.

Call this after resolving read_roots, over and schema paths against the spec’s directory, so both sides are absolute and canonical. Comparing them as written cannot work: a spec that grants an absolute root and names a relative manifest is entirely ordinary, and lexically a relative path never starts with an absolute one.

Trait Implementations§

Source§

impl Clone for Spec

Source§

fn clone(&self) -> Spec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Spec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Spec

Source§

fn eq(&self, other: &Spec) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Spec

Auto Trait Implementations§

§

impl Freeze for Spec

§

impl RefUnwindSafe for Spec

§

impl Send for Spec

§

impl Sync for Spec

§

impl Unpin for Spec

§

impl UnsafeUnpin for Spec

§

impl UnwindSafe for Spec

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.