Skip to main content

ossctl_core/
lib.rs

1//! Core library for `ossctl` — the deterministic engine behind the `/oss-*`
2//! Claude Code skill family.
3//!
4//! All logic that must be exact and identical for every caller lives here so it
5//! is unit-testable without spawning the binary. The `ossctl-cli` crate is a
6//! thin clap + I/O shell over this library (ADR-0001 §2).
7//!
8//! The founding architecture is fixed by the accepted ADRs under `docs/adr/`;
9//! this crate realizes their module layout. At founding these are **module
10//! stubs** — the compiling shape, no domain logic yet:
11//!
12//! - [`contract`] — `OSS-RELEASE.md` schema + normalizer (port of
13//!   `check-oss-release.py`); [`contract::schema`] is the ONE canonical serde
14//!   model (ADR-0003).
15//! - [`facts`] — deterministic repo-fact detector (port of
16//!   `infer-repo-facts.py`), behind the repo ports.
17//! - [`audit`] — readiness scoring over the normalized contract + facts.
18//! - [`dist`] — the deterministic cargo-dist `dist-workspace.toml` generator
19//!   (renders the binary-release infra from the contract's `distribution` block).
20//! - [`release`] — the resumable per-ecosystem release-cut engine (ADR-0002):
21//!   sealed plan, phase-barrier coordinator, event-sourced journal, reconcile.
22//! - [`protocol`] — the versioned public JSON/JSONL envelopes + DTOs (§10/§12),
23//!   versioned independently of the internal domain types.
24//! - [`ports`] — the injected effect seam (`CommandRunner`, `Clock`, `IdGen`,
25//!   `RegistryQuery`, `Fs`, `GitRepo`) so each domain is testable without
26//!   touching the real filesystem, git, network, or clock.
27//!
28//! `ossctl-core` is the canonical library surface, so public items must carry
29//! doc comments (`#![warn(missing_docs)]`); level policy otherwise lives in the
30//! workspace `[workspace.lints]` table.
31#![warn(missing_docs)]
32
33pub mod audit;
34pub mod contract;
35pub mod dist;
36pub mod facts;
37pub mod ports;
38pub mod protocol;
39pub mod release;
40pub(crate) mod vcs;
41
42pub use protocol::{SCHEMA_VERSION, SUPPORTED_SCHEMAS};