From 7f82ae80edd3369c66e0c61875b5ad97c91d62be Mon Sep 17 00:00:00 2001 From: vex <223968222+vex0209-bt@users.noreply.github.com> Date: Tue, 14 Jul 2026 01:27:13 +0000 Subject: [PATCH 1/2] feat: add leoma preflight + smoke for the testnet dress rehearsal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Launching is gated on pins that fail safe-but-silent — an unpinned seed or corpus, or an eval box on a stale chain.toml, all burn to UID 0 rather than crown, with no single place that says why. `leoma preflight` is that place: it verifies every readiness pin and exits non-zero (naming the failure) so it can gate a launch script. `leoma smoke` reads a validator's dashboard.json and confirms the rehearsal actually exercised each outcome — a genuine crown, a fair rejection, a quarantined broken model, a copy rejection, a freeze-cheat rejection — so a green run means the subnet did the right thing, not that someone eyeballed it. Both decision cores are pure and unit-tested; a runbook ties them to the full pre-mainnet sequence. --- docs/TESTNET_RUNBOOK.md | 134 ++++++++++++++++++++++++++ leoma/app/preflight.py | 178 +++++++++++++++++++++++++++++++++++ leoma/app/smoke.py | 140 +++++++++++++++++++++++++++ leoma/delivery/commands.py | 115 ++++++++++++++++++++++ tests/unit/test_preflight.py | 106 +++++++++++++++++++++ tests/unit/test_smoke.py | 106 +++++++++++++++++++++ 6 files changed, 779 insertions(+) create mode 100644 docs/TESTNET_RUNBOOK.md create mode 100644 leoma/app/preflight.py create mode 100644 leoma/app/smoke.py create mode 100644 tests/unit/test_preflight.py create mode 100644 tests/unit/test_smoke.py diff --git a/docs/TESTNET_RUNBOOK.md b/docs/TESTNET_RUNBOOK.md new file mode 100644 index 0000000..407f119 --- /dev/null +++ b/docs/TESTNET_RUNBOOK.md @@ -0,0 +1,134 @@ +# Testnet dress-rehearsal runbook + +A repeatable rehearsal that proves the subnet does the right thing **before** mainnet. +Every step ends in an assertion, not an eyeball — `leoma preflight` gates the launch, +and `leoma smoke` confirms each scenario was actually exercised and handled correctly. + +Run this on testnet with at least one validator + one eval box (a GPU) and a handful of +miner hotkeys you control. + +--- + +## 0. Prerequisites — pin the consensus surface + +The subnet deliberately burns 100% to UID 0 until these are pinned. This is not optional. + +1. **Pick the base-model revision** and pin `chain.toml [seed].seed_digest` (the genesis + king). Choose the exact Wan2.1-I2V-14B-480P revision you will run. +2. **Build and publish the corpus:** + ```bash + leoma corpus build-manifest --corpus-id leoma-testnet-v1 # decides windows, hashes truth + leoma corpus publish-manifest manifest.json # prints the digest + ``` + Paste the printed digest into `chain.toml [corpus].manifest_digest`. +3. **Verify each eval box** decodes the corpus byte-identically to the manifest: + ```bash + leoma corpus verify --sample 4 + ``` + A box that fails this must not duel — its distances would not be reproducible. + +## 1. Calibrate `delta_threshold` (the load-bearing measurement) + +This is the single largest open consensus risk. On **each GPU type** in the fleet: + +```bash +leoma calibrate generate --gpu