Expand description
Core primitives for the mdx-rust CLI.
mdx-rust-core contains the optimizer, hardening engine, safety pipeline,
registry, evaluation, ledger, and audit primitives used by the mdx-rust
binary.
§Stability contract
The supported product surface for 0.3.x is the mdx-rust CLI. This crate
is published so the CLI can be installed from crates.io and so advanced
users can inspect the internal data structures, but the library API is not
yet stable. Public items may change before 1.0.
The intentionally documented facade is the set of pub use exports below.
Module paths are left public for the CLI and tests, but most modules are
hidden from rustdoc because they are implementation detail for now.
Structs§
- Accepted
Edit Summary - Optimizer entrypoint and run records. These are unstable before
1.0. Summary of the accepted source edit. - Agent
RunResult - Agent runner result and trace events. These are unstable before
1.0. The result of running an agent on a single input, including traces. - Audit
Finding - Deterministic static audit reports.
- Audit
Packet - Optimizer entrypoint and run records. These are unstable before
1.0. Versioned machine-readable evidence for one accepted optimizer change. - Audit
Provenance - Optimizer entrypoint and run records. These are unstable before
1.0. Provenance fields that identify what inputs and tools produced the change. - Candidate
- Optimizer entrypoint and run records. These are unstable before
1.0. A proposed improvement generated during an optimization iteration. - Candidate
Execution Config - Candidate safety pipeline. Direct use is unstable before
1.0. - Candidate
Execution Context - Candidate safety pipeline. Direct use is unstable before
1.0. - Candidate
Execution Outcome - Candidate safety pipeline. Direct use is unstable before
1.0. - Config
- Configuration loading and defaults used by the CLI. Root configuration for an mdx-rust project
- Dataset
Split - Experiment budget and ledger records. These are unstable before
1.0. - Evaluation
Dataset - Dataset and scorer metadata used by optimizer reports.
- Evaluation
Sample - Dataset and scorer metadata used by optimizer reports.
- Experiment
Ledger - Experiment budget and ledger records. These are unstable before
1.0. - Failure
Signal - Trace diagnosis records.
- Hardening
Change Summary - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0. - Hardening
Config - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0. - Hardening
Outcome - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0. - Hardening
Policy Record - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0. - Hardening
Run - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0. - Hook
Context - Built-in lifecycle hook primitives. These are unstable before
1.0. - Hook
Decision - Built-in lifecycle hook primitives. These are unstable before
1.0. - Hook
Policy - Built-in lifecycle hook primitives. These are unstable before
1.0. - Model
Provenance - Optimizer entrypoint and run records. These are unstable before
1.0. - Optimization
Run - Optimizer entrypoint and run records. These are unstable before
1.0. A single optimization experiment / iteration result. - Optimize
Config - Optimizer entrypoint and run records. These are unstable before
1.0. Configuration for a single optimization run. - Prompt
Variant Record - Experiment budget and ledger records. These are unstable before
1.0. - Registered
Agent - Agent registry types used by CLI commands. Represents a registered agent
- Registry
- Agent registry types used by CLI commands.
- Safety
Rejection - Candidate safety pipeline. Direct use is unstable before
1.0. - Score
Provenance - Optimizer entrypoint and run records. These are unstable before
1.0. Score evidence for the accepted change. - Scorer
Metadata - Dataset and scorer metadata used by optimizer reports.
- Security
Audit Report - Deterministic static audit reports.
- Trace
Diagnosis - Trace diagnosis records.
- Trace
Event - Agent runner result and trace events. These are unstable before
1.0. A single trace event captured during an agent run. Made first-class for trace-to-patch optimization. - Workspace
Summary - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0.
Enums§
- Agent
Contract - Agent registry types used by CLI commands. The kind of agent contract detected
- Audit
Severity - Deterministic static audit reports.
- Edit
Strategy - Optimizer entrypoint and run records. These are unstable before
1.0. - Failure
Kind - Trace diagnosis records.
- Hardening
Mode - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0. - Hardening
Status - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0. - Hook
Action - Built-in lifecycle hook primitives. These are unstable before
1.0. - Hook
Stage - Built-in lifecycle hook primitives. These are unstable before
1.0. - Optimization
Budget - Experiment budget and ledger records. These are unstable before
1.0. - Safety
Rejection Kind - Candidate safety pipeline. Direct use is unstable before
1.0.
Functions§
- audit_
agent - Deterministic static audit reports.
- diagnose_
run - Trace diagnosis records.
- evaluate_
builtin_ hook - Built-in lifecycle hook primitives. These are unstable before
1.0. - execute_
candidate_ edit - Candidate safety pipeline. Direct use is unstable before
1.0. - mechanical_
score - Optimizer entrypoint and run records. These are unstable before
1.0. Very rough mechanical scorer for the example agent. Gives higher score if the output is not the echo fallback. - run_
agent - Agent runner result and trace events. These are unstable before
1.0. Run a registered agent with the given input. Currently supports Process contracts (spawns the agent binary and pipes JSON). NativeRust support will be added when we generate harnesses. - run_
hardening - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0. - run_
optimization - Optimizer entrypoint and run records. These are unstable before
1.0. Placeholder for the full optimization engine. In a real implementation this would orchestrate: - split_
dataset - Experiment budget and ledger records. These are unstable before
1.0.