Contracts & rules
Publish immutable contracts and explicitly admit them.
Read as Markdown ↗On this page
Publish then admit
First inspect capabilities.list schema_profile for supported rules. contracts.validate checks a proposed payload schema, file rules and examples without publishing, admitting, or appending anything. It returns schema validity and per-example diagnostics, not permission or proof that assertions are true.
contracts.publish creates an immutable version. ledgers.update admits or removes contract versions and selects the default with an expected_revision check. Publishing alone does not change admission. Retired versions remain available for retained history.
Published, admitted and default are separate states. contracts.list/get shows stored versions and full rules. ledgers.inspect identifies the admitted versions and the default. CLI summaries explain the distinction without fetching additional resources or assuming the caller can read them.
Detailed contract and examplesControl contribution
A contract defines payload_schema and file_rules. Contributors must satisfy the selected admitted contract; write permission does not authorize changing it. Error responses distinguish invalid payloads, unavailable validation context and stale revisions.
Use admission.mode=replace to close the initial permissive path. Adding a restrictive contract or changing the default alone still allows other admitted contracts. Apply the admitted set and default together with the current expected_revision.
Payload validation returns a field and specific guidance only when the caller has contracts.read. An append-only contributor receives a general error without hidden schema details. Validation does not confer permission to change the rules.
Detailed contract and examplesEvolve the rules explicitly
Publish a new version, then choose whether to replace existing admission or add it alongside existing versions. Published versions are immutable. Existing records keep their original contract references and authorized readers can retrieve the earlier rules.
On revision_conflict, read and review the current ledger definition before retrying. An explicitly selected retired version returns contract_not_admitted; a payload that fails an admitted version returns payload_invalid. An uncertain write needs records.outcome before resubmission.
CLI, SDK, MCP and HTTP walkthroughPublish a versionConfigure admission