Skip to content

Stable JSON contracts

colibri-contracts holds the stable, language-agnostic wire shapes shared between Colibri (Rust) and Clawdie agents (TypeScript). It owns schemas and (De)serialize, not business logic.

  • Prevent duplicated definitions between Rust and TypeScript lanes.
  • Keep committed manifests in manifests/ parseable by both sides.
  • Centralize schema strings, field renaming aliases, and backward-compat defaults.
SchemaRust structPurpose
clawdie.interagent.run-manifest.v1RunManifestRecords a build/test run — role, agent, artifacts, summary.
clawdie.runtime-version-inventory.v1RuntimeInventoryHost runtime snapshot — OS, package versions, npm/node/zot/pi.
clawdie.provider-smoke.result.v1ProviderSmokeResultDeepSeek cache-hit probe result and token accounting.

Schema constants and structs live in crates/colibri-contracts/src/lib.rs.

  • The crate carries no logic — only serde structs and schema constants.
  • New fields are normally optional with #[serde(default)] so old manifests still parse.
  • RuntimeInventory.pi is optional because not every host installs pi or zot.
  • HostStatus.raw is a catch-all serde_json::Value so hostile collector output can be captured without forcing a schema bump.

crates/colibri-contracts/tests/golden.rs parses every committed manifest in manifests/ and asserts round-trip equality. The fixtures are intended to be cross-platform — if a manifest produced on Linux differs from one produced on FreeBSD 15, the difference must be understood and documented before it is merged.

  • cost-model — how the provider-smoke result feeds cache-hit metering.
  • runtime-inventory — where the runtime inventory is produced.