decision_forum/lib.rs
1// Copyright 2026 Exochain Foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at:
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// SPDX-License-Identifier: Apache-2.0
16
17//! # decision-forum
18//!
19//! EXOCHAIN decision.forum — the USER-FACING governance application that
20//! orchestrates all lower-level exochain primitives into a complete
21//! constitutional decision governance system.
22//!
23//! ## Modules
24//!
25//! - [`decision_object`] — Core domain type with 14-state BCTS lifecycle
26//! - [`constitution`] — Per-tenant machine-readable constitutional corpus
27//! - [`authority`] — Forum authority verification
28//! - [`authority_matrix`] — Real-time delegated authority matrix (GOV-003)
29//! - [`human_gate`] — Human oversight enforcement (GOV-007, TNC-02)
30//! - [`contestation`] — Structured contestation and reversal (GOV-008)
31//! - [`emergency`] — Emergency action protocol (GOV-009)
32//! - [`quorum`] — Quorum management (GOV-010, TNC-07)
33//! - [`accountability`] — Accountability mechanisms (GOV-012)
34//! - [`self_governance`] — Recursive self-governance (GOV-013)
35//! - [`tnc_enforcer`] — Trust-Critical Non-Negotiable Controls (TNC-01–10)
36//! - [`metrics`] — Production monitoring metrics (M1–M12)
37//! - [`workflow`] — Syntaxis workflow integration
38//! - [`terms`] — Terms & conditions management
39//! - [`error`] — Error types
40
41#![cfg_attr(test, allow(clippy::expect_used, clippy::unwrap_used))]
42
43pub mod accountability;
44pub mod authority;
45pub mod authority_matrix;
46pub mod constitution;
47pub mod contestation;
48pub mod decision_object;
49pub mod emergency;
50pub mod error;
51pub mod fiduciary_package;
52pub mod human_gate;
53pub mod metrics;
54pub mod quorum;
55pub mod self_governance;
56pub mod terms;
57pub mod tnc_enforcer;
58pub mod workflow;
59
60#[cfg(test)]
61mod audit_tests {
62 fn production_source(source: &str) -> &str {
63 source.split("#[cfg(test)]").next().unwrap_or(source)
64 }
65
66 #[test]
67 fn scope_r1_constructors_do_not_fabricate_identity_or_clock_metadata() {
68 for (module, source) in [
69 ("decision_object", include_str!("decision_object.rs")),
70 ("contestation", include_str!("contestation.rs")),
71 ("accountability", include_str!("accountability.rs")),
72 ("emergency", include_str!("emergency.rs")),
73 ("self_governance", include_str!("self_governance.rs")),
74 ("workflow", include_str!("workflow.rs")),
75 ] {
76 let production = production_source(source);
77 assert!(
78 !production.contains("Uuid::new_v4"),
79 "{module} production code must not fabricate UUIDs"
80 );
81 assert!(
82 !production.contains("HybridClock::new()"),
83 "{module} production code must not fabricate HLC clocks"
84 );
85 }
86 }
87}