Molten distributed testing is layered so developers can run the cheapest useful check first and reviewers can tell simulation evidence from VM or live evidence.
The pure simulation layer models peers, channels, virtual time, workflow commands, and explicit fault events. It canonicalizes these inputs into refs for:
- distributed topology;
- scheduler profile;
- deterministic seed;
- fault plan;
- distributed test run receipt.
Fault plans cover delay, drop, duplicate, reorder, partition, rejoin, crash, restart, stale evidence, ambient-state drift, unauthorized transport evidence, corrupted receipts, and resource pressure. Faults target explicit peers, channels, operations, or virtual time windows; host paths, wall-clock time, process ids, real sockets, and ambient randomness are not inputs.
Simulation receipts are regression and review evidence only. They do not grant authority, policy, provenance, resource, source-gate, retention, transport, destructive-operation, deployment, or production-readiness trust.
Named direct fixtures cover benign delay, drop, reorder, rejoin, crash, restart, and duplicate suppression paths, plus deny-before-side-effects coverage for stale-evidence, corrupted-receipt, resource-pressure, unauthorized-transport, ambient-state-drift, and partition quorum faults. Generated-case fixtures bind seed, topology, scheduler, command sequence, fault plan, invariant name, run ref, replay ref, event refs, final-state ref, and diagnostics in generated-distributed-repro-v1; these artifacts are diagnostic-only unless a separate pass/deny gate accepts the claim. The curated composite regression suite binds named cases for duplicate-after-restart, partition-with-stale-evidence, reorder-with-reconcile, crash-during-dispatch, and resource-pressure-during-quorum in composite-fault-suite-v1. Generated failures require promotion metadata with stable refs, profile eligibility, traceability, retry policy, variance declarations, and cost budget before becoming release-review claims. The focused command is cargo test --lib distributed.
Federated-pull replay (src/federation/simulation.rs) consumes immutable records already accepted by the real
cryptographic boundary, explicit logical ticks, receiver-request flags, session events, and checkpoint-resume inputs.
It calls the production molten_core::federation planner and transition laws and emits
federation-deterministic-trace-v1 with canonical input observations, decisions, and metadata-only session states.
Signature rejection remains evidence from the cryptographic boundary; replay cannot mint a verified record or turn
a simulated rejection into signature-verification evidence. The replay trace is regression evidence, not proof of
live networking, remote correctness, or import authority.
planner_campaign checks named no-fault, unsolicited push, stale inventory, malicious peer, partition, retained-rate,
resource-exhaustion, and conflict outcomes against exact production planner decisions. Its recovery case runs the
actual checkpoint codec after fetching starts and checks retry-count preservation, stale-generation fencing,
deadline denial, and unadmitted-commit rejection without state mutation. compare_live_plan requires full equality
with the actual service session and binds the canonical status projection; it is not content-completion evidence.
RecordedRun and compare_recorded_run compare the complete no-fault transition trace through terminal commit.
Callers derive typed events independently from the actual DAG receipt, seven canonical local gate observations,
and actual import receipt, not from the expected final session. Comparison requires every replay event to be
accepted, full terminal-session equality, and canonical status equality. Repeating the actual commit event must
deny as terminal without mutating session or resource reservations. The resulting canonical comparison embeds the
trace; independent real effect receipts remain necessary evidence for the recorded inputs.
The service starts from a caller-owned current admitted Dispatcher, restoring bounded active-session metadata and
the status-ring sequence from its capability-rooted checkpoint. Periodic turns use an admitted timer profile and
persist the next poll before requesting inventory, including failed/partitioned attempts. Query-rate records,
session attempt counts, freshness windows, deadlines, and generation fences survive recovery. Terminal diagnostics
use a closed vocabulary and bounded slots without adapter error text, payload bytes, or secret material.
Content-keyed resource reservations are independent of peer and session identity. The planner consumes explicit
retained history and admits per-head query intervals, retry counts, and cumulative reserved bytes/nodes/chunks
within logical session_ticks windows. The service persists initial reservations before transfer, and fetch retries
reserve again before dispatch. One capability-rooted history record is capped at 4096 heads and 4 MiB; full live
history denies new work rather than silently evicting accounting. Expired entries are removed only through the
pure admission function using its explicit logical tick, never wall-clock pruning or unbounded per-head files.
Replay resumes the same canonical resource codec and the campaign checks that a fresh session with no peer-rate
history still cannot bypass an existing content reservation.
Multinode scenarios are declared with typed Nickel fixtures under docs/multinode-scenario-fixtures/ and the shared contract in docs/multinode-scenario-contracts.ncl. The contract requires explicit topology/profile ids, command surface, artifact kinds, topology/seed/fault-plan refs, receipt refs, variance refs, diagnostic-log refs, unavailable policy, and evidence-only caveats before execution. Valid VM fixture coverage includes smoke, live-control, service/job, restart, fault, three-node quorum, and aggregate scenario surfaces.
Rust validation derives multinode-scenario-metadata-v1 from explicit fixture values only. Missing topology, missing command surface, stale or malformed refs, undeclared variance, unsupported pass claims, and mismatched artifact kinds deny before pass metadata is accepted.
The topology-profile matrix names pairwise transport, control quorum, restart/rejoin, subscriber peer, three-node quorum, and wrong-topology negative profiles. Each profile binds role membership, allowed links, required receipt kinds, and evidence scope. The three-node profile is a bounded platform-integration shape for voter, restarting-member, and subscriber/observer evidence; it is not fleet-scale or WAN evidence. A subscriber cannot satisfy voter membership, and transport-only evidence cannot satisfy authority, policy, quorum, or membership evidence.
multinode-reconciliation-gate-v1 compares per-node summaries against the declared topology, scenario fixture, required receipts, equality classes, and allowed variance refs. Queue, ledger, dispatch, ack, protocol, chunk, or receipt-index refs must match unless a visible variance ref permits the difference. Missing node evidence, stale refs, wrong topology, duplicate semantic commits, divergent queues, and log-only reconciliation deny.
The deterministic track composes three services through the typed facades and one recovery-group declaration: a durable stateful service, a dependent worker ordered after it in the group, and an independent sibling outside the group. One scenario per failure class records what the composition observed, and the property evaluation turns those observations into five named properties: unaffected services continue, stale instances lose influence, durable work is readmitted under a current claim, uncertain external effects are not blindly repeated, and restart storms reach a terminal outcome inside the admitted window.
The scenarios are the member failure with the dependent restart, the delayed pre-restart event delivery, the durable work readmission, the uncertain effect surfacing, the queue overload, the restart storm to escalation, the generation upgrade with stale-work rejection, and CPU saturation under the admitted time-sliced component profile. The saturation scenario drives both modeled fuel-ledger work and a real Wasmtime callback through the admitted FIFO scheduler; the independent sibling completes between callback slices while the callback remains within its fuel budget. Each scenario asserts every property that applies to it, so a regression in one mechanism fails several scenarios.
Three deliberately broken variants keep the property assertions honest. The fencing-removed variant restarts without advancing the incarnation, the group-budget-reset variant clears the restart history on every replacement, and the slicing-disabled variant ignores callback yields until the callback ends, delaying the sibling until after it. The harness must fail the matching property for each; a passing broken variant would mean the property assertion is vacuous. A failing property is evidence against the mechanism that owns it, not a patch inside the composition.
The real-process twin remains open. The outside-in process-fault track has landed, but real molten node processes do
not host the system-extension recovery groups, supervision, durable-work readmission, or generation upgrades needed
for the twin's observations. The deterministic scenarios and the in-process Wasmtime callback are not live-process,
whole-runtime-correctness, production-readiness, or performance evidence.
The local multiprocess harness model has a pure planner that validates node identities, state-root handles, transport handles, command-plan refs, expected receipt refs, and cleanup policy. The shell may spawn processes and collect artifacts, but the plan denies state-root collisions, transport collisions, stale tickets, missing receipts, child timeouts, orphaned children, or missing cleanup before accepting local pass evidence. local-multiprocess-executable-run-v1 binds the shell observations to the pure plan and local run receipt. Local multiprocess receipts are local integration evidence only; they do not replace NixOS VM, WAN/live, authority, policy, provenance, resource, source-gate, retention, deployment, or production-readiness evidence.
molten evidence qualify --source-root <root> --scenario <id> --out <file> runs one fixed scenario of a reviewed
capability in config/capability-report/capabilities.json and writes a capability-runtime-execution-v1 receipt.
The receipt binds the exact subject (source, build, dependency closure, compiled features, execution profile, adapter,
platform, environment), the current signed-source validation, the fixed scenario plan and the runtime artifact. Source
admission runs before any execution; without an independently admitted signed output nothing executes.
Each product scenario is bound to exactly one requirement, one family and one coverage kind, and drives the actual runtime path:
| Capability | Environment / profile | Runtime path |
|---|---|---|
durable-state-recovery |
same-process / native-host-redb-v1 |
Redb durable-state adapter: append and checkpoint, close and reopen, admitted recovery and content-verified restore; mismatched snapshot identity, corrupted payload (quarantine on reopen) and stale generation deny |
effect-uncertainty |
distinct-process / native-process |
live bounded-execution adapter running a /bin/sh child that first creates a start marker in its workspace, then exits without reading its input: the started effect has no definitive completion (unknown, reconciliation required, never published); crossed resolution and spawn failure start no child and stay definite pre-start outcomes. Partial for native_effect_uncertainty: the capability-rooted service host, driven by a producer-owned runtime port around that child effect (not the native supervisor), reports the typed uncertain outcome and keeps delivered durable work unknown across host reopen, never readmitting, redelivering or repeating it |
cross-process-transport |
distinct-process / iroh-cross-process-v1 |
a listener peer process hands off its canonical endpoint descriptor; the producer imports it against an independently derived listener identity and exchanges one bounded Iroh frame; tampered descriptor refs, an unexpected identity and a stale generation deny before dial; a listener that reads the submitted frame (payload ref equal to the client's frame ref) and withholds the acknowledgement leaves it undelivered without automatic retry, while an accept timeout is reported as a distinct no-frame outcome |
world-replay-promotion-restore |
same-process / runtime-spine-committed-turn-v1 |
world replay, logical restore and branch activation under current admission, with stale or revoked facts denied before execution or activation |
control-plane-failover |
distinct-process / live-raft-static-v1 |
three replica peer processes over the live Raft transport: commit survives crash and durable restart, a stale leader is fenced, and observed quorum evidence validates while forged quorum evidence is denied |
Distinct-process peers are the same admitted executable started as molten evidence qualify-peer --role <role> --run-directory <dir>; a peer emits no evidence and the producer kills and reaps it on every exit path. Each product
run reduces what it observed to a deterministic capability-product-observation-v1 record: named invariant checks
(all must hold) plus the canonical receipts the runtime emitted. Scratch paths, ports, process ids, wall-clock time,
error text and elected leader identities never enter it, so the admitted binary's independent re-execution
(--scenario readback) reproduces the same bytes; tools/capability-report.rs accepts a passing receipt only when it
equals that re-execution, so edited observations, flipped checks, relabelled scenarios, swapped plans or widened
environments fail closed. A runtime error is retained as a canonical failure and never promoted.
tests/evidence-matrix.ncl binds each scenario row to the canonical refs of its plan and of its subject-independent
runtime artifact; capability_qualification tests re-execute every scenario and require those exact refs.
scripts/qualify-capability-report.py qualifies each capability under its own subject. This is one-host evidence.
These families stay unqualified (no producer): post-effect-uncertainty-same-process, every *-nixos-vm and
*-cross-host family, and cross-host-transport. Nothing here establishes NixOS VM, cross-host, production or
release qualification. Each scenario's unit test runs it once and must reproduce its checked-in matrix ref; world
and control-plane scenario tests carry a reviewed nextest budget (.config/nextest.toml).
r[impl molten.outside_in.observation] The outside-in tier (tests/outside_in/, nextest profile outside-in) runs ordinary node processes through public entry points over the real Iroh transport and a real local Redb store. The receiver is a node state root driven by molten node init, run, live-peer-admit, and serve --live-iroh. The client is a separate molten node control-ingress-live-send process. The scenario reads histories through molten node control-history. The live control path's Redb store is the receiver's delivery idempotency store, control/idempotency/delivery-idempotency.redb.
Each scenario declares its process, wall-clock, retained-output, and client-operation budgets before it starts (molten_core::outside_in). The harness owns every process and scratch path it creates and tears them down. Node startup admits only a signed producer output, so the live scenarios are ignored in ordinary runs. Select the independently signed output's trust record with MOLTEN_TEST_SOURCE_TRUST (see docs/node-state-filesystem-authority.md); the harness runs that output's molten and installs the record unchanged in the receiver root. Every run and serve start authenticates the full output and re-measures its retained build closures, which can take minutes per process on a loaded host, so a scenario may declare up to 30 minutes. The scenarios cover five profiles:
- No fault: one request is delivered and processed once.
- Kill and restart: at the
listener-awaiting-requestboundary, a listener waiting after a committed request is killed and restarted on the same storage. The committed request must still appear in the post-restart history, and every run must report the same bound endpoint. - Pause and resume: at the same boundary, the listener is stopped with
SIGSTOPwhile a client sends, then resumed. - Partition and heal: at the
transport-between-peersboundary, the client dials a loopback UDP forwarder that carries the real Iroh QUIC datagrams. It drops every datagram during a bounded hold, so the partitioned attempt is denied. After the heal, the retry is delivered once. - Lost response: at the
client-responseboundary, the harness drops the client's response and records the outcome as unresolved. A retry with the same sequence is suppressed by the receiver's idempotency store.
Judgment uses only observed outcomes: client attempts, the per-envelope delivery outcomes, pending requests, and processed requests. No observation carries a time. A result is agreement; a permitted divergence with its reasons (lost response applied, retried after fault, duplicate suppressed); a failure naming the first mismatch; or a typed unsupported, incomplete, startup-failed, budget-exhausted, or rejected-declaration outcome. A scenario passes only if its teardown released everything it owned. Negative fixtures cover a startup failure, each budget exhausted, a fault the host cannot apply, an unreadable history, and a retained scratch path.
The consensus path is excluded: a consensus-path declaration is rejected before any process starts, and the ChaosControl and live consensus campaigns own it. The track complements deterministic simulation and does not replace it: simulation explores fault interleavings deterministically, while this tier exercises real processes, sockets, signals, and stores at a few declared boundaries. Results carry the no-production-admission, no-simulation-replacement, and no-performance non-claims. They are local integration evidence, not VM, WAN, production, or performance evidence.
Cluster lifecycle tests can produce cluster-lifecycle-run-v1 review receipts over explicit observations from cluster init, start, status, and stop workflows. The receipt binds workflow id, manifest ref, ordered node ids, phase decisions, per-node config/identity/startup/health/control/heartbeat/shutdown refs, already-running observations, reverse stop order, diagnostics, and evidence-only caveats. Missing phase receipts, duplicate node summaries, stale manifest refs, wrong stop order, invalid refs, missing required per-phase refs, or stdout-only success deny before pass evidence.
Drift comparison uses a receipt-derived summary rather than rendered terminal output. Summary fields include manifest ref, node order, stop order, phase decisions, per-node lifecycle refs, already-running refs, and caveats; temporary roots, diagnostic logs, and other variance must be declared as explicit drift variance fields. Changed child refs, node ordering drift, field-kind drift, stale variance declarations, ambient state, retry-only success, or rendered-output-only stability remain denial evidence.
Sealed multinode failure repro bundles bind scenario fixture refs, topology refs, scheduler refs, seed refs, fault-plan refs, command refs, node-summary refs, receipt refs, diagnostics, log refs, redaction policy refs, replay status, private attachment refs, reveal receipts, and evidence-only caveats. Simulation bundles may replay deterministically; local multiprocess and VM bundles verify as non-replayable diagnostic evidence unless a separate recorded effect log exists. vm-failure-repro-export-v1 is emitted only for denied, unavailable, or failed-validation VM evidence and remains diagnostic-only. Tampered, unsealed, stale, private-without-reveal, missing-redaction, or diagnostic-only bundles fail closed before private content is materialized or before any pass claim is accepted.
A distributed-test-run-v1 receipt binds the source ref, test binary ref, topology ref, seed ref, scheduler profile ref, fault-plan ref, child workflow refs, emitted event refs, final state ref, replay status, allowed variance refs, diagnostics, and pass or deny decision.
A denial identifies the invariant that failed before side effects, such as missing authority, transport evidence being treated as authority, stale evidence, partitioned quorum, corrupted receipts, or undeclared ambient state.
r[impl molten.testing.ci_workspace_member_coverage] The workspace members are molten, molten-core, molten-node-host, molten-release-policy, and the extracted no_std kernel crates (molten-composition-core, molten-fastpath-core, molten-preserves-core, molten-raft-core, molten-reliability-model-core, molten-runtime-admission-core, molten-wasm-policy-core). This is exactly what each CI rail covers:
| Rail | What runs | Fails closed when |
|---|---|---|
cargo nextest run --profile ci / --profile deterministic |
every test of every member (deterministic also excludes names matching live, vm, dogfood, soak, exploratory); --profile no-std-kernels selects only the kernel crates |
not applicable: this is a local command |
checks.nextest-config |
profile readback | the ci or deterministic filter omits a workspace member (a planted drop of molten-core must deny) |
checks.nextest |
--profile ci over the unit2nix test binaries of every member (kernels under their default feature set; checks.<kernel>-no-std gates their no_std builds), plus the canonical CI run receipt |
any test fails or any member executed no test |
checks.molten-core, checks.molten-node-host, checks.molten-release-policy |
the same runner over one member | any test of that member fails; for molten-core, also when a #[hegel::test] in the crate did not execute and pass, or none exist |
checks.octet-workspace |
the pinned Octet cohort with -p for every member (read from the workspace manifests), compared finding by finding with the baseline |
a finding identity is new (even when it replaces a repaired finding of the same lint in the same file), a recorded identity disappeared without a baseline update, the baseline has duplicate rows or a total that disagrees with its rows or the run, or a package in [workspace.metadata.octet] default_scope gains any finding |
checks.cairn-validate-strict |
the pinned cairn-validator input with its packaged policy export, --strict |
any validation issue (a planted malformed change must deny) |
checks.feature-matrix |
cargo check --all-targets per optional feature over the vendored lock; under the union of self-contained features, every test of every molten test target (library, binaries, integration tests) that does not exist under default features; and the DoltLite oracle test |
a feature fails to compile, a gated test fails, a feature-gated target executes no test without a reviewed entry in config/testing/feature-gated-targets.toml, an integration target gated by required-features or a crate-level #![cfg(feature = ...)] is not built, or [features] and the matrix list disagree |
checks.ci-coverage-audit |
the #[ignore] inventory and Hegel-property presence |
an ignored test is unlisted, has no reason, uses a category its disposition does not allow, or names a rail whose own definition does not select it (text elsewhere in the flake does not count) |
The named semantic profiles (fast-core, harness, cli, distributed-simulation, outside-in, vm-platform, dogfood-soak) stay partitions of package(molten).
Plain cargo octet check uses [workspace.metadata.octet] default_scope (molten, molten-node-host, and the no_std kernels), because the strict source gate and the startup binding deny any warning-only run; molten-core and molten-release-policy stay outside it while they carry reviewed debt. checks.octet-workspace gates that debt through config/testing/octet-workspace-baseline.json and pins every default_scope package at zero. Each baseline row is one finding identity: crate, file, lint, and an anchor with its count. The anchor is the first 16 hex digits of the SHA-256 of the finding's whitespace-normalized line together with its two nearest non-blank lines above and below, then # and that window's ordinal among identical windows in the file. An identity survives unrelated line shifts, but a new violation cannot hide behind a repaired one, even on an identical line elsewhere in the file. To shrink it after a repair, rebuild the findings and rewrite the baseline, then review the diff:
nix build .#octet-workspace-findings
python3 scripts/ci-coverage.py octet-baseline write --artifacts result/workspace \
--scope "$(cargo metadata --no-deps --format-version 1 | jq -r '[.packages[].name] | join(",")')"
git diff --stat config/testing/octet-workspace-baseline.jsonWhen the baseline is empty, default_scope takes every member and the baseline goes away.
Ignored tests are listed in config/testing/ignored-tests.toml. Same-host prerequisites run on rails: checks.tpm2-sealed-identity (swtpm), checks.job-captured-nickel (pinned Nickel and prlimit), checks.feature-matrix (DoltLite), and the object-storage-live workflow (a disposable S3 endpoint). A Nix rail's own flake binding (with the Nix files it imports) must hold the selector and run scripts/ci-coverage.py ignored-rail-evidence --rail nix:<rail>, which fails the rail unless its libtest output shows every inventory test assigned to it passed. A workflow rail must pass the selector to a cargo test ... --ignored command. Signed-source, owner-approved-evidence, NVMe, eBPF-capture, and external-cohort tests are recorded as environment-blocked. Diagnostics and role entrypoints are reviewed exclusions.
These rails establish hermetic build, test, lint, and structural validation for the exact checked candidate. They do not establish cross-host, physical-hardware, or production release qualification.
Release review uses an explicit risk/cost matrix:
| Profile | Command surface | Evidence scope |
|---|---|---|
fast-core |
cargo nextest run --profile fast-core |
pure core/unit/parser/receipt checks; no platform or transport claims |
harness |
cargo nextest run --profile harness |
report, replay, gate, repro, redaction, and failure artifact behavior |
cli |
cargo nextest run --profile cli |
command integration and receipt writing; stdout/stderr are views only |
distributed-simulation |
cargo nextest run --profile distributed-simulation or cargo test --lib distributed |
deterministic simulation and model invariants |
vm-platform |
nix build .#checks.x86_64-linux.nixos-vm-multinode |
two-node NixOS platform and executable VM fault evidence when host support is available |
dogfood-soak |
nix build .#checks.x86_64-linux.dogfood-local-node |
pilot/readiness review only |
Every distributed shard binds metadata for source/tree refs, Nix input refs, test binary/package refs, profile, shard, seed, topology, fault plan, emitted receipts, variance declarations, and diagnostic log refs. Diagnostic logs stay diagnostic-only; canonical receipts and metadata refs are the review surface.
Traceability coverage is required for distributed evidence-bearing requirements. A release or CI gate must include positive evidence and negative evidence, or an explicit exemption. Direct simulation fixture traceability now names positive and negative coverage for molten.testing.distributed_simulation.direct_fault_fixtures, molten.testing.distributed_simulation.fixture_traceability, and molten.testing.distributed_ci.profile_wiring_evidence. Missing positive coverage, missing negative coverage, stale refs, retry-only success, skipped VM support, or undeclared variance denies the distributed evidence gate.
CI/release pass evidence uses zero retries. Exploratory reruns may produce diagnostic or quarantine evidence, but a pass after retry is not deterministic pass evidence unless a separate review artifact accepts the remediation boundary.
Unsupported VM, network, live transport, or soak support records unavailable, skipped, or deny evidence. Network-control support is probed with nixos-vm-network-control-probe-v1 before executable delay, drop, partition, rejoin, or asymmetric-latency fault claims. Unsupported execution never counts as pass evidence for a claim that requires that profile.
Use simulation when changing distributed protocol logic, idempotency, replay, authority separation, or restart behavior and you need fast deterministic feedback before VM checks.
Use NixOS VM checks when the claim depends on platform integration, systemd, filesystem state roots, QEMU networking, service restart behavior, or true cross-node live transport. Shard receipts (nixos-vm-shard-run-v1) localize smoke, live-control, service/job, restart, and fault failures and carry an explicit evidence scope: fixture-metadata for synthetic planning/readback, executable-vm for real VM child receipts, aggregate-index for index-only receipts, and diagnostic-only for unavailable or log evidence. The aggregate receipt (nixos-vm-multinode-aggregate-v1) preserves child scopes without converting fixture metadata, unavailable, denied, stale, or log-only evidence into executable platform pass evidence. Live transport VM evidence must bind send, receive, ingress, queue, dispatch, reconcile, ack, and protocol-gate receipts before artifact export; logs cannot replace a receive receipt. Use live soak/pilot evidence only for scoped operator-readiness review.