Skip to content

Repository map

Mint has four Rust crates. The dependency direction is one way.

CrateDepends onOwns
mint-coreWorkspace dependencies onlyPure declarations, policy, custody, audit, scanning, and release logic.
mint-brokermint-coreHTTP authentication, policy enforcement, forwarding, scrubbing, and readiness.
mint-climint-core and mint-brokerOperator commands and process startup.
mint-mcpmint-coreRead-only JSON-RPC inspection.

The broker imports the core. The CLI assembles the broker. MCP does not import the broker.

[!NOTE] A module name is a source ownership boundary. It is not a promise that every symbol is a stable public API.

mint-core forbids network access. mint-broker is the data plane. mint-cli and mint-mcp are entry points.

The core is deterministic. It contains no network client. OS access is limited to custody adapters and guarded file operations.

ModuleResponsibilityKey invariantTests and change landing zone
lib.rsDeclares modules and re-exports the product spine.Non-test builds forbid unsafe code.Add public exports here only with API tests. Source · Tests
adoption.rsLoads evidence and derives consumer posture.A parked declaration cannot hide brokered, mixed, or missing evidence.adoption_inventory.rs. Source · Tests
alias.rsParses aliases and finds bounded placeholders.Alias grammar is strict. Prose that resembles a placeholder is not a match.Embedded alias tests and config_scan.rs. Source · Tests
audit.rsBuilds audit events and delegates to the hash-chained ledger.Prepared effects need a terminal record before readiness is green.Embedded audit tests and broker audit-gate tests. Source · Tests
call_guard.rsEnforces actor and service call windows.Limits are separate from semantic policy and fail closed on malformed windows.Embedded call-guard tests. Source · Tests
capability.rsIssues, stores, authenticates, and revokes capability declarations.Disk stores only a SHA-256 digest. The raw token is returned once.mint-cli capability tests and embedded tests. Source · Tests
config_scan.rsScans structured and raw files for credential findings.Findings never render matched values. Unknown credential shapes fail closed.config_scan.rs. Source · Tests
credential_boundary.rsParses custody, principals, launch surfaces, scan paths, and exact OAuth exceptions.Native OAuth matches identity, schema, fields, owner, mode, and destination exactly.credential_boundaries.rs. Source · Tests
cutover.rsValidates name-based migration manifests and environment files.Cutover checks compare names and metadata, not secret values.cutover_manifest.rs. Source · Tests
discovery.rsFinds known launcher homes and credential-bearing surfaces.Findings carry no credential content. Absent launchers stay silent.Embedded discovery tests and CLI adoption tests. Source · Tests
error.rsDefines structured errors for core operations.Errors carry paths and causes without secret values.Update the owning module test when adding an error. Source · Tests
ledger.rsAppends, verifies, rotates, migrates, and reconciles audit records.Hash-chain tampering, unsafe migration, and unresolved effects fail closed.Embedded ledger tests and release activation tests. Source · Tests
local_cutover.rsPersists the local cutover journal and severance receipt.Transitions are monotonic. Journal and receipts are value-free and owner-private.local_cutover.rs tests in core and CLI. Source · Tests
policy.rsParses first-match policy rules and evaluates proxy or tool requests.Default deny, exact alias binding, placeholder requirements, and no stale authority fields.Embedded policy tests and broker deploy-policy tests. Source · Tests
redact.rsDetects and scrubs known or credential-shaped content.Scrubbing preserves ordinary content and never passes detected credentials through.Embedded redaction tests and broker response-scrub tests. Source · Tests
release.rsPreflights bundles and activates immutable releases.The candidate binary owns preflight. Activation is atomic and rollback restores the expected target.release_activation.rs. Source · Tests
secret_store.rsDefines custody adapters for OS key stores, environment stores, and private directories.Secret values stay behind the SecretStore boundary. Paths, modes, symlinks, and timeouts are checked.Embedded secret-store tests. Source · Tests
typed_action.rsDescribes the bounded typed-action registry and input validation.Action IDs, HTTPS URLs, prompt size, and unknown fields are bounded.Embedded typed-action tests and broker typed-effect tests. Source · Tests

The broker depends on mint-core. It authenticates a caller, evaluates policy, resolves a placeholder inside the broker, forwards the request, scrubs the response, and writes terminal audit state.

ModuleResponsibilityKey invariantTests and change landing zone
lib.rsBuilds shared state, routes, declaration snapshots, and health checks.Policy and authentication reload as one generation. Request body size stays bounded.reload.rs, audit_gate.rs, and typed_effect.rs. Source · Tests
audit_gate.rsCoordinates prepared effects, terminal audit records, readiness, and shutdown.No new effect starts while admission is stopped or the audit sink is unresolved.audit_gate.rs and embedded gate tests. Source · Tests
auth.rsAuthenticates capability headers and exposes the caller identity.Shared-secret authentication is loopback-only. Invalid credentials fail before resolution.auth_boundary.rs and embedded auth tests. Source · Tests
breaker.rsTracks per-host upstream failure state.Server failures open independently per host. Client errors do not open the breaker.breaker.rs and breaker_indeterminate.rs. Source · Tests
canary.rsSends bounded operational health and error signals.Disabled or unreachable telemetry never delays the caller and carries no payload values.canary.rs and embedded reporter tests. Source · Tests
canary_audit.rsQueues sanitized audit envelopes for operational shipping.Prepared audit phases never ship. The outbox deduplicates and survives restart.Embedded envelope tests. Source · Tests
config.rsParses broker environment configuration and defaults.Explicit paths fail when missing. Secret backend selection never silently falls back.Embedded config tests. Source · Tests
doctor.rsRuns bounded readiness checks and returns named results.Checks use scratch state and redact values. A failed check makes the report unhealthy.Embedded doctor tests and CLI doctor tests. Source · Tests
proxy.rsImplements the HTTP proxy request path and response handling.Auth, policy, placeholder, SSRF, audit, forwarding, and scrubbing order is fail closed. An unpermitted placeholder mention in a request body or query is inert forwarded text; the same mention in a header still denies the call.exfil.rs, response_scrub.rs, ingress_boundary.rs, inert_unpermitted_placeholder.rs, and leak.rs. Many helpers are pub(crate) and are not stable APIs. Source · Tests
stream.rsDecodes bounded compressed bodies and scrubs streaming frames.Encoded or oversized responses fail closed. Split secrets are scrubbed across chunks. This module is internal.Embedded streaming tests and response_scrub.rs. Source · Tests
tailnet.rsResolves peer identity and authenticates by observed peer address.Client-supplied identity headers are ignored. Unresolved or slow identity checks deny.tailnet_identity.rs. Source · Tests
typed_effect.rsRuns the bounded typed-action route.Input validation and policy happen before resolution. Cleanup runs after an effect attempt. This module is an internal route implementation.typed_effect.rs. Source · Tests

mint-cli builds the mint binary from one source module.

ModuleResponsibilityKey invariantTests and change landing zone
main.rsParses commands, assembles configuration, runs broker startup, and exposes policy, audit, alias, capability, adoption, release, doctor, and cutover commands.CLI paths use the same parsers as runtime paths. Failed checks return non-zero without printing credential values.cli.rs, capability.rs, local_cutover.rs, and unit_migration.rs. Source · Tests

CLI helper functions and command enum variants are implementation details unless the CLI reference documents them as commands.

mint-mcp is a read-only JSON-RPC surface. It reads aliases, policy, and audit records through core loaders.

ModuleResponsibilityKey invariantTests and change landing zone
lib.rsDefines tool metadata, JSON-RPC dispatch, and read-only tool handlers.No tool resolves a secret. Tool schemas are valid JSON and unknown tools fail as errors.Embedded MCP tests. Source · Tests
main.rsReads one JSON-RPC request per non-empty stdin line and writes one response line.Notifications produce no response. Invalid JSON is reported on stderr and does not crash the loop.Exercise the binary and update mint-mcp lib tests for behavior. Source · Tests
  1. Change the deepest owning module first.
  2. Add a focused test at the same boundary.
  3. Update a crate re-export only when the symbol is a deliberate public surface.
  4. Keep broker helpers marked pub(crate) out of API promises.
  5. Keep CLI and MCP behavior in their entry-point tests.

Source and test links in this page pin the immutable commit that introduced or last changed the described code. The module declarations are mint-core lib.rs, mint-broker lib.rs, mint-cli main.rs, and mint-mcp lib.rs, all pinned at f82276b. Test anchors appear in each table row.

The map covers Rust source files only. It does not publish deployment inventories, private paths, credential identities, or runtime receipts.