Skip to main content

ossctl_core/protocol/
mod.rs

1//! Versioned public protocol surface (`AGENTS-AI-FIRST-CLI.md` §10/§12).
2//!
3//! Every `--json` payload and every `--output=jsonl` event carries a
4//! `schema_version`. This module owns that contract and the public
5//! JSON/JSONL DTOs that ride on it. DTOs are versioned **independently** of the
6//! internal domain types (`contract::schema`, `facts`, `audit`, `release`) so
7//! `ossctl-core` can refactor internals without a wire break (ADR-0001 §2).
8//!
9//! At founding this holds only the envelope schema version; the concrete DTOs
10//! (contract document, facts report, audit gap-report, release events) land
11//! with their owning units and each becomes a hot file under the migration rule
12//! (bump `SCHEMA_VERSION` on a breaking change, never silently).
13
14pub mod audit;
15pub mod contract;
16pub mod facts;
17pub mod journal;
18pub mod plan;
19pub mod reconcile;
20pub mod release;
21
22/// Current envelope/DTO schema version for `ossctl`'s public JSON output.
23///
24/// Monotonic integer. Breaking changes (removing/renaming fields, changing
25/// types or enum semantics, tightening nullability, changing event ordering)
26/// bump this; additive changes (new optional fields) do not.
27pub const SCHEMA_VERSION: u32 = 1;
28
29/// The set of envelope schema versions this binary can emit and understand.
30///
31/// Surfaced by `ossctl version --json` so a caller can detect drift between its
32/// trained expectations and the running binary (`AGENTS-AI-FIRST-CLI.md` §10).
33pub const SUPPORTED_SCHEMAS: &[u32] = &[SCHEMA_VERSION];