Skip to main content

mdx_rust_core/
lib.rs

1//! Core primitives for the `mdx-rust` CLI.
2//!
3//! `mdx-rust-core` contains the optimizer, safety pipeline, registry,
4//! evaluation, ledger, and audit primitives used by the `mdx-rust` binary.
5//!
6//! ## Stability contract
7//!
8//! The supported product surface for `0.2.x` is the `mdx-rust` CLI. This crate
9//! is published so the CLI can be installed from crates.io and so advanced
10//! users can inspect the internal data structures, but the library API is not
11//! yet stable. Public items may change before `1.0`.
12//!
13//! The intentionally documented facade is the set of `pub use` exports below.
14//! Module paths are left public for the CLI and tests, but most modules are
15//! hidden from rustdoc because they are implementation detail for now.
16
17#[doc(hidden)]
18pub mod config;
19#[doc(hidden)]
20pub mod eval;
21#[doc(hidden)]
22pub mod hooks;
23#[doc(hidden)]
24pub mod ledger;
25#[doc(hidden)]
26pub mod llm;
27#[doc(hidden)]
28pub mod optimizer;
29#[doc(hidden)]
30pub mod registry;
31#[doc(hidden)]
32pub mod runner;
33#[doc(hidden)]
34pub mod safety_pipeline;
35#[doc(hidden)]
36pub mod security;
37#[doc(hidden)]
38pub mod trace;
39
40/// Configuration loading and defaults used by the CLI.
41pub use config::Config;
42/// Dataset and scorer metadata used by optimizer reports.
43pub use eval::{EvaluationDataset, EvaluationSample, ScorerMetadata};
44/// Built-in lifecycle hook primitives. These are unstable before `1.0`.
45pub use hooks::{
46    evaluate_builtin_hook, HookAction, HookContext, HookDecision, HookPolicy, HookStage,
47};
48/// Experiment budget and ledger records. These are unstable before `1.0`.
49pub use ledger::{
50    split_dataset, DatasetSplit, ExperimentLedger, OptimizationBudget, PromptVariantRecord,
51};
52/// Optimizer entrypoint and run records. These are unstable before `1.0`.
53pub use optimizer::{
54    mechanical_score, run_optimization, AcceptedEditSummary, AuditPacket, AuditProvenance,
55    Candidate, EditStrategy, ModelProvenance, OptimizationRun, OptimizeConfig, ScoreProvenance,
56};
57/// Agent registry types used by CLI commands.
58pub use registry::{AgentContract, RegisteredAgent, Registry};
59/// Agent runner result and trace events. These are unstable before `1.0`.
60pub use runner::{run_agent, AgentRunResult, TraceEvent};
61/// Candidate safety pipeline. Direct use is unstable before `1.0`.
62pub use safety_pipeline::{
63    execute_candidate_edit, CandidateExecutionConfig, CandidateExecutionContext,
64    CandidateExecutionOutcome, SafetyRejection, SafetyRejectionKind,
65};
66/// Deterministic static audit reports.
67pub use security::{audit_agent, AuditFinding, AuditSeverity, SecurityAuditReport};
68/// Trace diagnosis records.
69pub use trace::{diagnose_run, FailureKind, FailureSignal, TraceDiagnosis};