Skip to main content

kernel/
lib.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4// Copyright (c) 2026 2youg1 and the sprawling contributors
5
6//! Pure decision functions: values in, verdicts out. Zero internal deps.
7//! Holds no I/O handles, no clock, no global state (ARCHITECTURE.md paragraph 1).
8//! The entry `crates/kernel/Spec.lean` specifies this crate, and each module
9//! names the part under `crates/kernel/spec/` that specifies it.
10//!
11//! **This file is an index, and the modules are the library.** Every
12//! module is public and a caller reaches a decision through the module
13//! that owns it — `gate::domain`, `discard::decide`, `approval::may_answer`
14//! — so the module name says which authority answered. What the root
15//! re-exports is the vocabulary those signatures are written in: the
16//! value types a caller names in its own fields and arguments. A
17//! function is never re-exported here, and nothing is renamed on the
18//! way out, because a second spelling of one name is the defect
19//! `xtask lexicon` exists to catch.
20
21pub mod address;
22pub mod approval;
23pub mod backpressure;
24pub mod blockage;
25pub mod budget;
26pub mod change;
27pub mod completion;
28pub mod config;
29pub mod consts_external;
30pub mod consts_policy;
31pub mod degradation;
32pub mod delegation;
33pub mod discard;
34pub mod error;
35pub mod event;
36pub mod gate;
37pub mod goal;
38pub mod idem;
39pub mod keep_warm;
40pub mod layout;
41pub mod ledger;
42pub mod locator;
43pub mod model;
44pub mod node_id;
45mod origin;
46pub mod plan;
47pub mod policy_limit;
48pub mod pursuit;
49pub mod reach;
50pub mod registry;
51pub mod release;
52pub mod repair;
53pub mod retries;
54#[cfg(feature = "schema")]
55pub mod schema;
56pub mod secret;
57pub mod share;
58pub mod spine;
59pub mod stall;
60pub mod taint;
61pub mod tool;
62pub mod version;
63pub mod write_domain;
64
65pub use address::{Address, GIT_METADATA, PROTECTED_METADATA, RESERVED_PREFIX};
66pub use address::{ReadVerdict, SessionName};
67pub use approval::{AnswerVerdict, Answerer, ApprovalClass, ApprovalId, ApprovalItem};
68pub use approval::{Autonomy, ClusterKey, Ruling};
69pub use backpressure::{Admission, ItemMeta, QueueStats, ShedReason};
70pub use blockage::{Blockage, Notice, RedNode};
71pub use budget::{BudgetUse, ByteLen, Tokens, UsdMicros};
72pub use change::{FileChange, How, Lines};
73pub use completion::{Completion, Evidence, PlannedProgress, Progress, UnplannedProgress};
74pub use config::{ClockStampGranularity, ClockZone, FrozenConfig};
75pub use config::{EnvVarName, LayeredValue, LiveConfig, SandboxLimits};
76pub use config::{McpServer, McpTransport, SecondThreshold};
77pub use delegation::{Delegate, DelegateKind, DelegationVerdict, Delegator, Depth};
78pub use discard::Restoration;
79pub use discard::{DenyReason, Discard, DiscardForecast, DiscardRequest, DiscardVerdict};
80pub use error::{AxCode, AxError, Carrier, ErrorDraft, GateRefusal, ProviderFailureKind, Retry};
81pub use event::record::InputKinds;
82pub use event::{EventDraft, EventKind, EventRecord, EventRef, Payload};
83pub use event::{RunId, Seq, TimeMs, WindowClass};
84pub use gate::GateOutcome;
85pub use gate::{ConnectorCall, DOORS, DoorId, EgressAllowlist, EgressOutcome, EgressTarget};
86pub use goal::{GoalEntry, GoalId, GoalResource, GoalVerdict};
87pub use idem::{Duplicate, IDEM_DERIVE_V, IdemGuard, IdemKey};
88pub use keep_warm::KeepWarm;
89pub use ledger::{GENESIS_PREV, Ledger};
90pub use locator::{B3Hash, GitOid, Locator, Range};
91pub use model::{AdmissionRequirement, LandingPolicy, Mode, RunPolicy, Window};
92pub use model::{BuildingPolicy, Ceiling, ChatMessage, ChatRequest, ChatResponse, ContentBlock};
93pub use model::{DialectKind, EarlyCalls, Effort, ImageRef, ImageType};
94pub use model::{Increment, Increments, MessageBreakpoint, Model};
95pub use model::{ModelRequest, ModelReturn, ModelTag, ModelUsage, Role, StopReason};
96pub use model::{SystemBlock, ToolDef};
97pub use node_id::{NODE_DEPTH_MAX, NodeId};
98pub use origin::Origin;
99pub use plan::{Held, PLAN_WHOLE_PPB, PlanExit, PlanNode, PlanTree, StopCause};
100pub use pursuit::{Pursuit, PursuitState, PursuitVerdict};
101pub use reach::{Answered, Connected, Named, Proxying, Reach, Through};
102pub use registry::{Artifact, Claim, RegisterVerdict, Registry, ResidentId};
103pub use release::{Maturity, Release, ReleaseVerdict};
104pub use repair::RepairVerdict;
105pub use retries::Retries;
106pub use secret::{Sealed, SecretRef, SecretSpan};
107pub use share::{Share, WHOLE_PPB};
108pub use spine::{EvidenceCell, NewChild, ROADMAP_COLUMNS};
109pub use spine::{ROADMAP_FILE, ROADMAP_STATUS_SPELLINGS, RoadmapRow, RoadmapShape};
110pub use spine::{RoadmapStatus, ScopeChange, WriteMoment};
111pub use stall::{ActionFingerprint, StallVerdict};
112pub use taint::{TaintSet, TaintSource, Tainted};
113pub use tool::writes::Writes;
114pub use tool::{CostTier, Effect, ExecArm, GateSubject, RenderIntent, ServerLabel};
115pub use tool::{Temporal, TimeoutMs};
116pub use tool::{Tool, ToolCall, ToolMeta, ToolName, ToolOutcome};
117pub use version::{Version, VersionVerdict};
118pub use write_domain::{DocumentReason, DomainPrefixes, DomainVerdict, EditSample};
119pub use write_domain::{EditWarVerdict, WriteDomain, WriteLimit};