Boundary Contract
BoundaryContract is the package-level declaration for claim-bearing
extensions.
Vocabulary owned event kind prefixes and event vocabularyAuthority effectAuthorityRef values and per-authority material requirementsMaterial top-level MaterialRequirement declarationsSettlement terminal claim vocabulary and symbolic proof constraintsProjection derived-from-ledger reader contractThese axes must be independently checkable. Effect authority requirements must
be subsets of the top-level material axis. factOwnerRef is not part of the
authority axis; it comes from packageId at the commit boundary and cannot be
set by claim authors.
Invariants
Section titled “Invariants”- Event kinds stay inside the package-owned prefix.
- Claim slots are event-local. Non-claim extension facts declare no claim slot.
- Request-time
preevents are not terminal events. - Terminal lived/rejected claims validate against the package settlement contract.
- Claim
effectAuthorityRefvalues must be declared byeffectAuthorityContracts; declaration does not grant fact ownership. - Projections are derived from ledger facts and do not write shadow truth.
- Cleanup is settlement vocabulary until release becomes an independent cross-package contract axis.
Minimal Shape
Section titled “Minimal Shape”import { defineBoundaryContract } from "@agent-os/kernel/boundary-contract";import { defineSettlementContract } from "@agent-os/kernel/settlement-contract";
const settlement = defineSettlementContract({ settlementId: "@agent-os/example", anchorKinds: ["carrier_proof"], rejectionKinds: ["provider_rejected"],});
export const boundary = defineBoundaryContract({ packageId: "@agent-os/example", kindPrefixes: ["example."], roles: ["resolver", "reader"], effectAuthorityContracts: [], materialRequirements: [], events: { "example.requested": { payloadSchema: { type: "object", properties: { subjectRef: { type: "string" } }, required: ["subjectRef"], additionalProperties: false, }, claim: { key: "claim", phase: "pre" }, }, "example.recorded": { payloadSchema: { type: "object", properties: { proofRef: { type: "string" } }, required: ["proofRef"], additionalProperties: false, }, claim: { key: "claim", phase: "lived", anchorKinds: ["carrier_proof"] }, }, "example.failed": { payloadSchema: { type: "object", properties: { reason: { type: "string" } }, required: ["reason"], additionalProperties: false, }, claim: { key: "claim", phase: "rejected", rejectionKinds: ["provider_rejected"] }, }, }, settlement, projection: { derivedFromLedger: true, shadowState: false },});Use validateBoundaryContract in tests when adding or changing a boundary.