@suss/intent-ir
v0.3.2
Published
Intent IR for suss — the team-authored side of the loop. PRD (outcome) intent and system intent, in shapes that pair against derived behavioral summaries.
Downloads
1,213
Readme
@suss/intent-ir
The team-authored side of the loop: what the code was meant to do, in shapes that pair against the derived BehavioralSummary of what it does.
What this package is
Two citizens, discriminated by kind, both built on @suss/ir-core so intent and behaviour describe boundaries the same way:
- System intent (
kind: boundary): what one boundary should do, as named outcomes. The boundary is REST or function-call; each outcome is aresponse(status + body), areturns(a function/handler return value), or athrows(an error). The function-call form is what lets suss check its own non-HTTP surface. - Outcome intent (
kind: prd): humanwhen/expectscenarios, each with an optionallinkto a system-intent outcome (<intent-name>.<outcome-id>). A scenario with nolinkis a valid pending-link state: fully readable, not yet machine-linked.
import { IntentDocSchema, intentDocToSummary } from "@suss/intent-ir";
const doc = IntentDocSchema.parse(/* parsed YAML / JSON */);
const summary = intentDocToSummary(doc); // normalised, checker-readyschema.ts is the authoring surface (friendly to write); summary.ts is the normalized shape the checker consumes (boundaries as ir-core BoundaryBindings, bodies as TypeShapes, one flat outcome list) plus the transform between them. source provenance (author / inferred / inferred, curated) rides along for the inference path.
The design is documented in docs/internal/proposals/intent-specs.md.
Where it sits in suss
Peer to @suss/behavioral-ir; both build on @suss/ir-core. Readers (e.g. @suss/contract-intent) parse files into IntentDoc and call intentDocToSummary; the checker pairs the result against derived code summaries.
Status
v0: REST + function-call system intent, PRD outcome intent with optional links. The checker integration and reader migration build on this.
Coverage
License
Apache-2.0
