Skip to main content

Crate planarian_gym

Crate planarian_gym 

Source
Expand description

planarian-gym: runs catalog entries (SPEC §15).

planarian-gym list [–catalog FILE] planarian-gym run [–catalog FILE] –harness fake [–id ID …] [–all] planarian-gym show-reconciliation –harness fake –id ID planarian-gym verification [–write-baseline] [–gate] d:a, trust and bypass report (§17a, §17b)

The fake harness runs the real daemon core, executor, kernel and watchdog logic against the in-memory machine (planarian-fake). The VM harness is the flake’s NixOS tests (nix flake check, checks.vm-runtime).

Modules§

catalog 🔒
The fault catalog on disk: a directory of TOML files (00-format.toml, then one file per family), read in filename order and concatenated into one TOML document, or a single file. Ids are unique across the files.
check 🔒
Judging an entry’s required_post (SPEC §15: on required_post and intent cases, never on the absence of errors). Keys the fake harness cannot judge are reported, and make the result PARTIAL rather than PASS.
conformance 🔒
fake-assumptions-conformance (SPEC §17a, §18.12): the fake backend as a second implementation of every docs/assumptions.md entry.
evidence 🔒
What a run left behind, in the form the judge reads (check.rs). The fake harness fills it from the simulated machine (Sim::evidence); the VM harness fills it from a real one: the journal, the executor log, the daemon’s notices and a status sampler (live.rs).
live 🔒
The VM harness’s in-VM half. nix/tests/gym-vm.nix boots a NixOS VM with the gym fixtures and a Planarian built with gym-hooks, then drives one catalog entry through these commands:
metrics 🔒
The metrics §15 asks the gym to report, over a run of the catalog: repair rate, unnecessary interventions, disruption incurred, time to repair, restarts per target, and RecoveryFailed count.
serve 🔒
planarian-gym serve: the daemon core over the fake machine, answering the real socket protocol, with a short history worth looking at. For trying the console (and the CLI) without a NixOS machine, and for checking that the console draws what the daemon reports.
sim 🔒
The fake harness: a fake machine, the real daemon core, and a watchdog process, driven tick by tick by a catalog entry’s steps.
site 🔒
planarian-gym site: the guarantees site (SPEC §17c). Every page is computed from the repository at one commit: the invariant table (§7), docs/verification-ratio.toml, docs/assumptions.md, docs/bypasses.md, the gym catalog and a run’s results, docs/spec-history.md and the source tree. It writes an mdBook (book.toml, src/); mdbook build turns it into the site. The build is the check: any reference it cannot resolve fails it.
verification 🔒
planarian-gym verification: the verification ratio d:a (discharged to assumed obligations), the trust count |𝒯| and the internal-unproven count (SPEC §17a), from docs/verification-ratio.toml, checked against the source and docs/assumptions.md, and held to the recorded baseline; and the bypass register, docs/bypasses.md (§17b): its format, and its open rows by severity. --gate also fails on an open High row (every gate does).

Structs§

Run 🔒

Enums§

Result_ 🔒

Constants§

DEFAULT_CATALOG 🔒

Statics§

CATALOG 🔒
The catalog being run, for entries that run others (the conformance matrix).

Functions§

harness_waivers 🔒
The “Harness waivers” table of docs/deviations.md (§15 harness contract): (entry, harness) pairs. nix/gym/harness-contract.py reads the same table for the VM runners.
load 🔒
The catalog’s entries (a directory or one file), ids unique; exits 2 if not.
main 🔒
run_entry 🔒
steps 🔒
window