Skip to main content

Crate kitchen_contract

Crate kitchen_contract 

Source
Expand description

The neuro-kitchen pipeline contract, as Rust types: the waist every app, the runtime, a generated interface and an agent agree on (standard).

ModuleStandardHolds
types§1Type (shared and app:name), Format, matching, the shared types
params§2.1ParamSpec, ParamValue, check_params
ops§2OpSpec (version, ports, params, Margin, source, finish, effects, availability)
catalog§2.2, §6.1Catalog: an app’s ops, by family, by type, fillable by a screen’s offers
pipelines§4Pipeline and its check: every problem at once, or a Plan
documents§2.2documents on disk as JSON or TOML, the same id either way
results§3ContentId, canonical_json, ResultRecord, RunRecord, RunKey

Depends on nothing of ours, does no I/O and draws nothing: cargo xtask check-layers keeps it so. Every document carries CONTRACT_VERSION; its JSON Schemas are generated into standard/schemas/ (a test fails when they are stale).

Re-exports§

pub use catalog::Catalog;
pub use ops::Language;
pub use ops::Margin;
pub use ops::OpSource;
pub use ops::OpSpec;
pub use ops::PortSpec;
pub use params::ParamKind;
pub use params::ParamSpec;
pub use params::ParamValue;
pub use params::check_params;
pub use pipelines::Edge;
pub use pipelines::Endpoint;
pub use pipelines::Node;
pub use pipelines::PIPELINE_VERSION;
pub use pipelines::Pipeline;
pub use pipelines::Plan;
pub use pipelines::Problem;
pub use results::ContentId;
pub use results::OpRef;
pub use results::ResultRecord;
pub use results::RunKey;
pub use results::RunRecord;
pub use results::RunStatus;
pub use results::canonical_json;
pub use types::Axis;
pub use types::Format;
pub use types::Type;
pub use types::TypeDescription;

Modules§

catalog
Every op an app offers, by id: its own, the shared ones, its tools’, and the script ops and recipes in its folders (standard §2.2). Another app’s ops are not in it. The Operations menu, the search, the pipeline check and the runtime’s ops call read it; it holds descriptions only (the runtime holds what runs).
documents
Documents on disk, as JSON or TOML, in every app (standard §2.2, decision 0017): pipelines, recipes, op descriptions, settings. TOML is easier to write by hand (dsp-kitchen’s pipelines were the first to take it); JSON is what tools write. Either reads into the same document, and a document’s content id is the hash of its canonical JSON (content_id), so the format a person chose never changes an id.
ops
Ops: one operation each, described as data (standard §2).
params
What an op is tuned with (standard §2.1, params).
pipelines
A pipeline as data: sources, nodes, edges, outputs (standard §4). JSON, versioned; the same file is what the Pipeline screen edits, what a headless run reads, and what a recipe is made from. A pipeline lives in one app’s workspace and holds only that app’s ops; a chain across apps is the orchestrator’s.
results
Results and run records (standard §3).
types
Types: what flows between ops and what is stored (standard §1).

Constants§

CONTRACT_VERSION
The contract’s version, MAJOR.MINOR (standard §7): 0.x until the first public release, when anything may still change. Confirmation joins in 0.2 (decision 0016).