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 1.0.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 during the v1 beta.
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 during the v1 beta. Summary of the accepted source edit.
- Agent
Command Spec - Agent-facing command contract for safe automation.
- Agent
Pack - Agent runtime manifest and pack records for external coding agents.
- Agent
Pack File - Agent runtime manifest and pack records for external coding agents.
- Agent
Ready Contract Refs - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Agent
Ready Report - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Agent
RunResult - Agent runner result and trace events. These are unstable during the v1 beta. The result of running an agent on a single input, including traces.
- Agent
Runtime Manifest - Agent runtime manifest and pack records for external coding agents.
- Agent
Runtime Tool - Agent runtime manifest and pack records for external coding agents.
- Agent
Runtime Transport - Agent runtime manifest and pack records for external coding agents.
- Agent
Workflow - Agent-facing command contract for safe automation.
- Artifact
Explanation - Agent-facing artifact explanation helpers.
- Audit
Finding - Deterministic static audit reports.
- Audit
Packet - Optimizer entrypoint and run records. These are unstable during the v1 beta. Versioned machine-readable evidence for one accepted optimizer change.
- Audit
Provenance - Optimizer entrypoint and run records. These are unstable during the v1 beta. Provenance fields that identify what inputs and tools produced the change.
- Autonomy
Readiness - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Autopilot
Config - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Autopilot
Pass - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Autopilot
Run - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- 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 during the v1 beta. A proposed improvement generated during an optimization iteration.
- Candidate
Autonomy Decision - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Candidate
Evidence Context - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Candidate
Execution Config - Candidate safety pipeline. Direct use is unstable during the v1 beta.
- Candidate
Execution Context - Candidate safety pipeline. Direct use is unstable during the v1 beta.
- Candidate
Execution Outcome - Candidate safety pipeline. Direct use is unstable during the v1 beta.
- Capability
Gate - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Codebase
Map - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Codebase
MapConfig - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Codebase
Quality Summary - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- 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 during the v1 beta.
- 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 during the v1 beta.
- Evidence
Command Record - Measured evidence artifacts used to gate autonomy. Unstable during the v1 beta.
- Evidence
File Profile - Measured evidence artifacts used to gate autonomy. Unstable during the v1 beta.
- Evidence
Function Profile - Measured evidence artifacts used to gate autonomy. Unstable during the v1 beta.
- Evidence
Metric - Measured evidence artifacts used to gate autonomy. Unstable during the v1 beta.
- Evidence
Run - Measured evidence artifacts used to gate autonomy. Unstable during the v1 beta.
- Evidence
RunConfig - Measured evidence artifacts used to gate autonomy. Unstable during the v1 beta.
- Evidence
Signal - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Evidence
Summary - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Evolution
Scorecard - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Evolution
Scorecard Config - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Experiment
Ledger - Experiment budget and ledger records. These are unstable during the v1 beta.
- Failure
Signal - Trace diagnosis records.
- Hardening
Change Summary - Scoped Rust hardening engine for ordinary Rust modules. Unstable during the v1 beta.
- Hardening
Config - Scoped Rust hardening engine for ordinary Rust modules. Unstable during the v1 beta.
- Hardening
Outcome - Scoped Rust hardening engine for ordinary Rust modules. Unstable during the v1 beta.
- Hardening
Risk Summary - Scoped Rust hardening engine for ordinary Rust modules. Unstable during the v1 beta.
- Hardening
Run - Scoped Rust hardening engine for ordinary Rust modules. Unstable during the v1 beta.
- Hook
Context - Built-in lifecycle hook primitives. These are unstable during the v1 beta.
- Hook
Decision - Built-in lifecycle hook primitives. These are unstable during the v1 beta.
- Hook
Policy - Built-in lifecycle hook primitives. These are unstable during the v1 beta.
- MdxAgent
Contract - Agent-facing command contract for safe automation.
- Model
Provenance - Optimizer entrypoint and run records. These are unstable during the v1 beta.
- Optimization
Run - Optimizer entrypoint and run records. These are unstable during the v1 beta. A single optimization experiment / iteration result.
- Optimize
Config - Optimizer entrypoint and run records. These are unstable during the v1 beta. Configuration for a single optimization run.
- Policy
Finding Match - Scoped Rust hardening engine for ordinary Rust modules. Unstable during the v1 beta.
- 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 during the v1 beta.
- Recipe
Catalog - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Recipe
Spec - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Apply Config - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Apply Run - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Batch Apply Config - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Batch Apply Run - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Batch Candidate Run - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Candidate - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Impact Summary - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Plan - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Plan Config - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- 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 during the v1 beta.
- Score
Provenance - Optimizer entrypoint and run records. These are unstable during the v1 beta. Score evidence for the accepted change.
- Scorer
Metadata - Dataset and scorer metadata used by optimizer reports.
- Security
Audit Report - Deterministic static audit reports.
- Security
Posture Summary - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Source
Snapshot - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Stale
Source File - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Trace
Diagnosis - Trace diagnosis records.
- Trace
Event - Agent runner result and trace events. These are unstable during the v1 beta. 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 during the v1 beta.
Enums§
- Agent
Contract - Agent registry types used by CLI commands. The kind of agent contract detected
- Agent
Ready Status - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Artifact
Kind - Agent-facing artifact explanation helpers.
- Audit
Severity - Deterministic static audit reports.
- Autonomy
Decision - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Autonomy
Readiness Grade - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Autopilot
Pass Status - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Autopilot
Status - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Candidate
Evidence Status - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Codebase
Quality Grade - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Edit
Strategy - Optimizer entrypoint and run records. These are unstable during the v1 beta.
- Evidence
Grade - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Failure
Kind - Trace diagnosis records.
- Hardening
Evidence Depth - Scoped Rust hardening engine for ordinary Rust modules. Unstable during the v1 beta.
- Hardening
Mode - Scoped Rust hardening engine for ordinary Rust modules. Unstable during the v1 beta.
- Hardening
Status - Scoped Rust hardening engine for ordinary Rust modules. Unstable during the v1 beta.
- Hook
Action - Built-in lifecycle hook primitives. These are unstable during the v1 beta.
- Hook
Stage - Built-in lifecycle hook primitives. These are unstable during the v1 beta.
- Optimization
Budget - Experiment budget and ledger records. These are unstable during the v1 beta.
- 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 during the v1 beta.
- Refactor
Apply Mode - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Apply Status - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Batch Apply Status - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Candidate Status - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Recipe - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Refactor
Risk Level - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- Safety
Rejection Kind - Candidate safety pipeline. Direct use is unstable during the v1 beta.
- Test
Coverage Signal - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
Functions§
- agent_
contract - Agent-facing command contract for safe automation.
- agent_
pack - Agent runtime manifest and pack records for external coding agents.
- agent_
runtime_ manifest - Agent runtime manifest and pack records for external coding agents.
- apply_
refactor_ plan_ batch - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- apply_
refactor_ plan_ candidate - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- audit_
agent - Deterministic static audit reports.
- build_
codebase_ map - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- build_
evolution_ scorecard - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- build_
refactor_ plan - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- diagnose_
run - Trace diagnosis records.
- evaluate_
builtin_ hook - Built-in lifecycle hook primitives. These are unstable during the v1 beta.
- execute_
candidate_ edit - Candidate safety pipeline. Direct use is unstable during the v1 beta.
- explain_
artifact - Agent-facing artifact explanation helpers.
- load_
latest_ evidence - Measured evidence artifacts used to gate autonomy. Unstable during the v1 beta.
- load_
latest_ evidence_ for_ root - Measured evidence artifacts used to gate autonomy. Unstable during the v1 beta.
- load_
project_ policy - Structured project policy records used by v0.4 hardening reports.
- mechanical_
score - Optimizer entrypoint and run records. These are unstable during the v1 beta. Very rough mechanical scorer for the example agent. Gives higher score if the output is not the echo fallback.
- recipe_
catalog - Plan-first refactor and autonomous orchestration records. Unstable during the v1 beta.
- run_
agent - Agent runner result and trace events. These are unstable during the v1 beta. 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 during the v1 beta.
- run_
behavior_ evals - Dataset and scorer metadata used by optimizer reports.
- run_
evidence - Measured evidence artifacts used to gate autonomy. Unstable during the v1 beta.
- run_
hardening - Scoped Rust hardening engine for ordinary Rust modules. Unstable during the v1 beta.
- run_
optimization - Optimizer entrypoint and run records. These are unstable during the v1 beta. Placeholder for the full optimization engine. In a real implementation this would orchestrate:
- split_
dataset - Experiment budget and ledger records. These are unstable during the v1 beta.
Type Aliases§
- Hardening
Policy Record - Scoped Rust hardening engine for ordinary Rust modules. Unstable during the v1 beta.