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.7.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
Command Spec - Agent-facing command contract for safe automation.
- 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. - Agent
Workflow - Agent-facing command contract for safe automation.
- 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. - Autopilot
Config - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Autopilot
Pass - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Autopilot
Run - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Behavior
Command - Dataset and scorer metadata used by optimizer reports.
- Behavior
Command Record - Dataset and scorer metadata used by optimizer reports.
- Behavior
Eval Report - Dataset and scorer metadata used by optimizer reports.
- Behavior
Eval Spec - Dataset and scorer metadata used by optimizer reports.
- 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. - Capability
Gate - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Codebase
Map - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Codebase
MapConfig - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Codebase
Quality Summary - Plan-first refactor and autonomous orchestration records. 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.
- Evidence
Artifact Ref - Measured evidence artifacts used to gate autonomy. Unstable before
1.0. - Evidence
Command Record - Measured evidence artifacts used to gate autonomy. Unstable before
1.0. - Evidence
Metric - Measured evidence artifacts used to gate autonomy. Unstable before
1.0. - Evidence
Run - Measured evidence artifacts used to gate autonomy. Unstable before
1.0. - Evidence
RunConfig - Measured evidence artifacts used to gate autonomy. Unstable before
1.0. - Evidence
Signal - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Evidence
Summary - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - 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
Risk Summary - 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. - MdxAgent
Contract - Agent-facing command contract for safe automation.
- 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. - Policy
Finding Match - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0. - Policy
Rule - Structured project policy records used by v0.4 hardening reports.
- Project
Policy - Structured project policy records used by v0.4 hardening reports.
- Prompt
Variant Record - Experiment budget and ledger records. These are unstable before
1.0. - Refactor
Apply Config - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Apply Run - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Batch Apply Config - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Batch Apply Run - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Batch Candidate Run - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Candidate - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Impact Summary - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Plan - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Plan Config - Plan-first refactor and autonomous orchestration records. 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.
- Source
Snapshot - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Stale
Source File - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - 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.
- Autopilot
Pass Status - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Autopilot
Status - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Codebase
Quality Grade - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Edit
Strategy - Optimizer entrypoint and run records. These are unstable before
1.0. - Evidence
Grade - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Failure
Kind - Trace diagnosis records.
- Hardening
Evidence Depth - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0. - 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. - Policy
Category - Structured project policy records used by v0.4 hardening reports.
- Policy
Severity - Structured project policy records used by v0.4 hardening reports.
- Recipe
Tier - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Apply Mode - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Apply Status - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Batch Apply Status - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Candidate Status - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Recipe - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Refactor
Risk Level - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - Safety
Rejection Kind - Candidate safety pipeline. Direct use is unstable before
1.0. - Test
Coverage Signal - Plan-first refactor and autonomous orchestration records. Unstable before
1.0.
Functions§
- agent_
contract - Agent-facing command contract for safe automation.
- apply_
refactor_ plan_ batch - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - apply_
refactor_ plan_ candidate - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - audit_
agent - Deterministic static audit reports.
- build_
codebase_ map - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - build_
refactor_ plan - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - 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. - load_
latest_ evidence - Measured evidence artifacts used to gate autonomy. Unstable before
1.0. - load_
latest_ evidence_ for_ root - Measured evidence artifacts used to gate autonomy. Unstable before
1.0. - load_
project_ policy - Structured project policy records used by v0.4 hardening reports.
- 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_
autopilot - Plan-first refactor and autonomous orchestration records. Unstable before
1.0. - run_
behavior_ evals - Dataset and scorer metadata used by optimizer reports.
- run_
evidence - Measured evidence artifacts used to gate autonomy. Unstable before
1.0. - 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.
Type Aliases§
- Hardening
Policy Record - Scoped Rust hardening engine for ordinary Rust modules. Unstable before
1.0.