---
name: spt-verification-gates
description: "Pre-\"done\" gates for spt-core waves — workspace clippy form, real-binary rebuild, real-terminal verify, shared-tree hygiene"
metadata: 
  node_type: memory
  type: feedback
  originSessionId: 73618172-412e-4954-b8aa-e2c8955dfd49
  modified: 2026-08-01T08:46:46.549Z
---

Before declaring an spt-core wave/fix done (doyle gates each wave), pass these — `cargo build` and per-crate clippy are NOT enough:

1. **EXACT CI clippy form:** `cargo clippy --workspace --all-targets -- -D warnings`. A per-crate `cargo clippy -p spt` or a `cargo build` MISSES workspace lints — e.g. adding a param pushed `establish_perch` to 8 args → `clippy::too_many_arguments` → CI red, invisible to build. Run the workspace form before "done."
2. **`cargo test`/`clippy` ≠ rebuilding the installed binary.** They build the lib + test targets, not `target\debug\spt.exe`. To verify/ship the REAL binary (e.g. an operator capture): `cargo build -p spt --bin spt`. Never clobber a running daemon's `spt.exe` (Windows file lock) — daemon stop or the release path.
3. **Terminal-input fixes must be verified on the REAL terminal** (operator HITL re-capture). Unit/clippy never exercise the live key path — the W7 VT-input fix passed unit+clippy but backfired live (Windows Terminal → win32-input-mode, broke ctrl-b detach).
4. **The working tree is SHARED** with doyle/CI/operator. Never leave it mid-edit — commit/park, or do WIP in a `git worktree`. `cfg(test)`/`tests/` edits are build-excluded (safe); only non-test impl mid-edit breaks others' builds.
5. **`cargo test -p spt --bin spt` runs ONLY the bin's inline unit tests — it SKIPS `crates/spt/tests/*.rs` integration files** (contract_e2e, the e2e suite). A change to REGISTRATION / install / any behavior an integration test exercises MUST run the full crate target (`cargo test -p spt`) or at least the touched `--test <file>` (`cargo test -p spt --test contract_e2e`). REMOTE-TRUTH F-5: I ran `--bin spt` (330 green) + targeted, pinged doyle a floor-enforcement sha done → his full-workspace gate went RED on contract_e2e (registers the repo's own mock adapter, whose decorative "1.0.0" floor my new gate correctly refused = the A-1 fixture-ripple class). Corollary: enforcing a previously-DECORATIVE field (a floor/flag the old code never read) ALWAYS ripples pre-existing fixtures that carry an untrue value — grep every fixture of that field, fix by INTENT ("no constraint" → an honest low value), scope to the PRODUCTION-REACHABLE (register-flowing) set, not the from_toml_str parse-only fixtures. Same class as [[liveness-aware-derivation-fixture-ripple]].

6. **A pipe MASKS the exit code, and a text fix must be RENDERED, not re-read.** `cargo build … | tail -3` reports the PIPE's status, so a failed build surfaces as exit 0 — on 2026-08-01 this hid a `libsqlite3-sys` in-place corruption ([[libsqlite3-sys-artifact-corruption]], fix: `cargo clean -p libsqlite3-sys`) and I nearly read a STALE binary's `--help` as proof of a help-text fix. Caught only because verification was a render. doyle's W4 lane chain took the SAME hit the same day (tail swallowed a wrong-target lane's exit; caught by reading counts) — 2-for-2 in one day, now in his gate-craft bank as render-not-read + pipefail-or-count-check. Apply: redirect to a log and capture `EXIT=$?` explicitly, then `tail` the FILE; and verify any user-visible string by running the rebuilt binary and reading its OUTPUT — checking a literal by reading the literal is the same error as checking a test by reading the test ([[instrument-soundness-guards]]).

**Why:** all six are real misses (doyle caught 1–5; 6 bit us both). **How to apply:** run gate 1 + (for binary-facing changes) gate 2 + (for registration/behavior changes an e2e touches) gate 5 before pinging doyle a wave is done; gate 3 for any rc/terminal change; gate 4 always. `spt-daemon --lib` FULL deadlocks on the live host ([[daemon-lib-tests-deadlock-on-live-host]]) — a SINGLE named `--lib <test>` is safe; the full daemon-lib suite is doyle's re-gate authority. See [[delegate-tests-to-spt-test-engineer]] for who writes the tests.
