@tuned-tensor/pipeline-contract
v1.1.0
Published
Portable ordered Pipeline v1 contract for Tuned Tensor local and cloud runtimes
Maintainers
Readme
@tuned-tensor/pipeline-contract
Portable, versioned Pipeline v1 contract shared by Tuned Tensor's local and hosted execution boundaries.
This repository is deliberately contract-only. It defines parsing, normalization, dependency validation, canonical hashing, a JSON Schema, and golden fixtures. It does not contain local execution, AWS Step Functions states, Lambda ARNs, billing behavior, artifact transfer, or arbitrary plugin loading.
Pipeline v1
{
"version": 1,
"name": "default-cloud",
"target": "cloud",
"steps": [
{
"id": "baseline",
"uses": "evaluate",
"with": { "model": "base", "evaluator": "behavior" }
},
{ "id": "train", "uses": "train" },
{
"id": "candidate",
"uses": "evaluate",
"with": { "model": { "from": "train.model" }, "evaluator": "behavior" }
},
{
"id": "compare",
"uses": "compare",
"with": {
"before": { "from": "baseline.report" },
"after": { "from": "candidate.report" }
}
}
]
}Bounded vocabulary
trainproducesmodel.evaluateconsumes"base"or a priormodelreference and producesreport.compareconsumes two distinct priorreportreferences and producescomparison.- The adapter evaluator is
"behavior". Foundation evaluators are"bpb","chat", and"inference". - Documents contain 1–16 ordered steps.
- Adapter v1 permits at most one
trainstep because LoRA artifacts are run-scoped. - Optional
runtime.engine: "foundation"selects the from-scratch engine. Those documents addtokenize,pretrain,finetune, andrluses, atokenizerartifact, and are local-only. Absentruntimekeeps the original adapter vocabulary. - References must point backward to a compatible producer output.
- Steps resolve to
localorcloudplacement during normalization.
The portable contract permits mixed placement so the CLI can plan explicit boundaries. validateCloudPipeline() rejects every local step and every foundation document; hosted execution must never silently reinterpret placement. Consumers should pin 1.1.0 for foundation documents; existing 1.0.0 adapter hashes are unchanged.
API
import {
canonicalJson,
canonicalPipeline,
parsePipeline,
PIPELINE_STEP_CAPABILITIES,
pipelineHash,
validateCloudPipeline,
} from "@tuned-tensor/pipeline-contract";
const plan = parsePipeline(input);
const identity = pipelineHash(plan);
const hostedPlan = validateCloudPipeline(input);
const defaultPlan = canonicalPipeline("cloud");parsePipeline() is pure: it performs no network, storage, billing, quota, or execution actions.
Executor compatibility remains separate from document validity. A valid Pipeline v1 document may still be unsupported by a particular deployed executor, which must reject it before side effects.
Installation
npm install @tuned-tensor/pipeline-contractThe package is published to npm under the @tuned-tensor scope. Consumers should pin an exact version (for example 1.0.0) rather than tracking a moving range, so contract changes only land through a reviewed release.
Published artifacts
- Runtime and TypeScript exports: package root
- JSON Schema:
@tuned-tensor/pipeline-contract/schema - Golden test vectors:
@tuned-tensor/pipeline-contract/fixtures/* - Stable expected hashes:
fixtures/hashes.json
Development
npm ci
npm run typecheck
npm test
npm run build
npm run package:lint
npm run pack:check
npm run pack:testRelease discipline
- The document's
versionfield tracks breaking schema semantics. - Package SemVer tracks implementation, fixture, and additive API changes.
- Golden normalized documents and SHA-256 hashes must remain stable within Pipeline v1.
- Execution-specific policies stay in the owning CLI, app, or hosted runner.
Licensed under Apache-2.0.
