Skip to main content

spec_driven_docs/
lib.rs

1//! Spec-driven documentation: current specs, immutable decision records, and
2//! executable gates kept coherent for people and coding agents.
3//!
4//! This crate is the canon's distribution: the `sdd` binary installs, verifies,
5//! upgrades, and gates instances, and carries the whole payload — spec seeds,
6//! templates, lint configs, and the method chapters — embedded at compile
7//! time. The method itself lives in the repository's
8//! markdown, not here; this crate only ships and enforces it.
9//!
10//! Major modules:
11//! - [`domain`] — pure types and invariants: manifest, profiles, rule and gate
12//!   identifiers, marker-block splicing, versions.
13//! - [`embedded`] — every compile-time embedded asset and its accessors.
14//! - [`gates`] — the delivered gate implementations and their registry.
15//! - [`services`] — install, verify, upgrade, and hook-rendering orchestration.
16//! - [`adapters`] — filesystem I/O at the edges.
17//! - [`candidate`] — the one pure projection of every byte a landing writes.
18//! - [`landing`] — the checks, the lock, and the order a landing writes in.
19//! - [`stage`] — the persistent workbench one candidate is rendered into.
20//! - [`self_depend`] — how a consumer pins this tool and keeps the pin
21//!   fresh.
22//! - [`transaction`] — the lock and the same-directory replacement a write
23//!   runs through.
24//! - [`cli`] / [`commands`] — clap parse shapes and their handlers.
25//! - [`error`] — [`error::AppError`] and the exit-code matrix.
26//!
27//! # The supported target
28//!
29//! Linux is the only target this crate supports
30//! (ADR-linux-is-the-only-supported-target). The refusal below states that
31//! boundary to the compiler rather than to a reader, because the source is
32//! otherwise portable enough that a build elsewhere would succeed and then
33//! keep promises nothing here proves. The guard names the operating system
34//! and not the architecture: no source in this crate varies by
35//! architecture, and `dist-workspace.toml` states which architecture the
36//! release builds.
37
38#[cfg(not(target_os = "linux"))]
39compile_error!(
40    "spec-driven-docs supports Linux only. Its permission, path, and \
41     filesystem behavior is written and tested against one target, and a \
42     build for another would carry promises this project does not keep. \
43     See _docs/decisions/ADR-linux-is-the-only-supported-target.md."
44);
45
46pub mod adapters;
47pub mod candidate;
48pub mod cli;
49pub mod commands;
50pub mod context;
51pub mod domain;
52pub mod embedded;
53pub mod error;
54pub mod gates;
55pub mod landing;
56pub mod logging;
57pub mod output;
58pub mod payload_roots;
59pub mod probes;
60pub mod self_depend;
61pub mod services;
62pub mod stage;
63pub mod transaction;