nishi code wiki / SOTA rung plan
The SOTA Rung Plan
How this ecosystem climbs from organically-grown to state-of-the-art, one measured rung at a time. Every number here was measured on 2026-07-31, not asserted.
An unmeasured coverage fraction always drifts toward zero on the surfaces nobody looks at. Gates prove a thing works. Almost nothing here proves what fraction of the live surface has a gate at all — so the uncovered fraction is invisible, and every recurrence lives there.
The seven recurrence classes
Each row is a real failure observed on 2026-07-31, traced to the coverage gap that permitted it.
| # | class | the guard | what it did NOT cover | evidence |
|---|---|---|---|---|
| 1 | Primitive vs callers | cloexec gate proves the shared listen helper | daemons that never call it | 3 gateways bind by raw syscall; rebuilding fixes nothing |
| 2 | Lib fix vs deployed binary | the fix is in the library | binaries built before it | a lib fix reaches an organ only on its next rebuild |
| 3 | Deploy plane vs fleet | validate → health → auto-rollback | 10 of 15 running services | coverage 5/15, measured |
| 4 | Declared vs real | the inventory route | the allowlist actually read | inventory claims 2 targets the allowlist lacks |
| 5 | Liveness vs readiness | port-accept check | whether it serves | :18098 accepted and never sent a ServerHello; 3 instruments said UP/GREEN |
| 6 | Remediation vs its own trigger | wedge-kill fires on a detected wedge | whether a wedge was really there | 87% of fires kill nothing — a noisy detector, not (as first filed) an impotent killer |
| 7 | Instrument vs its own subject | the gate itself | whether it can fail, or even see | a deploy organ failing 127 on both legs; a scanner pid-capped below every daemon it existed to find |
Class 7 is the multiplier. An instrument that cannot fail makes every class above it invisible. Two independent lanes hit it on the same day.
Why coverage stalled — the design cause, not the discipline cause
When extending coverage costs code, coverage stops at the last urgent thing. Make it cost data.
This is the classic failure mode of organically-grown platforms: they end up held together by point-to-point connections, and more time goes into maintaining integrations than building capability. The industry answer is a golden path — one paved road that turns deployment from an act of heroics into a routine capability.
The ladder
Each rung has an exit criterion measured by an instrument. A rung is not climbed because it feels done; it is climbed when its instrument says so. Rungs are ordered by leverage: each one is the precondition for the next.
Exit: exactly one answer to “what exists, what kind is it, where is it deployed”. The inventory route is derived from the allowlist, not hand-authored. The organ-kind reader points at a file that exists.
Now: the inventory route derives its list by reading the same allowlist the deploy path reads — 16 targets, declared and real coverage identical by construction. The hand-authored list it replaced had drifted: it advertised two targets the allowlist did not contain, telling callers a fix could be landed that could not. The organ-kind reader is live too, pointing at the surviving declaration file — it had been correct in source for some time but could never ship, because the module did not compile.
An error message is part of the API, and a stale one misdirects every reader. A message that outlives its defect is worse than no message, because a reader trusts it and stops.
A file that does not compile blocks every lane that touches it, silently, until someone builds it.
Exit: each plane publishes a coverage fraction to a durable record. The headline is the MIN across planes, never the mean — a mean lets a strong plane hide a dead one.
Done. Four planes now write a measured line every time the beat runs, and the beat runs on the clock:
| plane | measured |
|---|---|
| deploy | 10 of 15 running services deployable — 5 uncovered, named |
| gates | 107 of 414 ruler-readable — the MIN, so the headline |
| sockets | 130 socket fds, 5 listeners, 3 without CLOEXEC — named |
| supervisor | 1 root, 1 forked keeper |
Each is derived at run time and each carries a non-vacuity tooth that goes RED when the scan reaches nothing — because an unread plane and a clean plane must never render the same.
Exit: adding a deployable is one row — name, artifact, health port, rollback — with no bespoke handler. Onboarding a legacy service is allowed to be partial: a service may join with a partial scorecard rather than being excluded until perfect.
Now: the root cause is located exactly. cmd_deploy() takes no parameters — it is hardcoded to one set of path constants and to killing one named process. It has a generic name but is the deployer for a single service, which is why every other target needs its own copy. The cost is counted: 15 deploy functions and 12 rollback twins — 27 near-duplicate implementations of one atomic-publish-and-restart pattern.
Done, and proven end-to-end. hc_deploy_one() now carries all four hard-won lessons in one place — refuse-before-destroy, print the real rc, accept either staged name, consume both on success — and gdeploy@<row> reads its live-path and kill-name from the same row the deploy API already reads, so there is no second file to keep in sync.
The proof: two daemons with no deploy path at all were deployed through the sanctioned API — validate → promote → health → auto-rollback → DEPLOYED-GREEN — by adding rows and zero code. Rollbacks banked, both services back up, and the coverage gate measured its own improvement: 333‰ → 666‰, doubled.
readlink /proc/PID/exe reveals.Exit: coverage and gates run on a beat that nobody has to remember. Drift is treated as a rate over a window, not a series of one-off surprises.
Done, and watched. nx_coverbeat is registered with the consolidated tickless scheduler and fired on its own — no human involved — writing one line that carries its own evidence: attempted=3 reaped=3 unrunnable=0 worst=0 VERDICT=GREEN. An operator can tell ran 3, all green from ran 0, reported green without opening anything else.
It is proven in both directions: with the gates present it exits 0; run where they do not exist it exits 3 and says reaped ZERO instruments. And it uses the scheduler that already existed rather than adding a parallel one — the adoption law applied to scheduling.
Exit: every gate carries (a) a negative control — a case that must fail, and fails today — and (b) a did-I-measure-anything tooth that goes RED when the scan reached nothing. Verdicts are cross-checked against what was logged, not just what was printed.
Now: the pattern is proven and adopted in this session's gates — all verified AGREE by an independent verifier that runs them and compares printed against logged. The fleet-wide half is now measured rather than guessed: of 413 promoted gates, 127 carry a parseable pass ratio, 181 carry a durable log path, and only 106 carry both — 256‰. Three quarters of the gate fleet is correct but invisible to any rollup.
A scan bound is a claim about the population — take it from the system, never from a round number.
Exit: remediation targets the actual holder of a resource (the kernel's FD table), never an expected name. A remediation that changes nothing escalates. Recovery tooling is reachable when the control plane is down.
Proven end to end, on a real fault, with no human in the path. The beat fired on the clock and went RED. The singleness gate named three supervisor roots — all three ppid=1, so three independent trees, not a parent and its children. The sentinel had already detected it and was correctly suppressing under its cooldown, because a remedy that runs every minute becomes the churn. At t+240s the cooldown expired, it reconciled, and roots went 3 → 1.
The circularity is broken too: four recovery caps are pre-minted and exercised, so diagnosis no longer depends on the control plane being up.
And the instrument earned its keep by staying quiet: an earlier version falsely called a healthy supervisor-plus-keeper a duel, and two debts were filed on that misreading before anyone checked parentage. A detector that cries wolf on the healthy shape is worse than none.
A control plane's recovery tooling must not be gated by the control plane. If the only way to get authority to fix X is through X, then X has no remedy.
Exit: the proven count moves off zero against oracles we did not author — published test vectors, external reference implementations, signed third-party attestation.
Now: 0 of 41 — and it is structurally guaranteed, not a shortage of evidence. The signer registry attest_keys.conf does not exist, and the attestation loader states the rule in its own source: an absent registry means every key is unregistered, therefore every attestation is refused. That is the correct fail-closed direction, but it means no amount of new testing moves the number.
The real shape is better than the headline: 7 domains are already MECH-OK — quorum, provenance and freshness all hold, awaiting only a second independent method class. And genuinely independent mechanical evidence already exists: byte-exact agreement with a published NIST FIPS-203 vector, RFC5903, and a TLS-WG vector — oracles authored by people who never saw this implementation.
This rung cannot be climbed by the agent doing the work. Creating the signer registry and signing its own rows would be a system granting itself attestation authority, which makes the number meaningless by construction. Deciding who is authorised to attest is an operator act — and the fact that it is blocked here is the control working, not failing.
What good looks like, per dimension
Mapping the ladder onto the five dimensions the platform-engineering field uses to score maturity.
| dimension | ad-hoc (where organic growth lands) | target | our rung |
|---|---|---|---|
| Investment | whoever is on fire this week | a standing owner per plane | R3 |
| Adoption | capabilities exist; nothing points at them | the paved road is the easy road | R2 |
| Interfaces | bespoke handler per target | one declarative contract | R2 |
| Operations | restart and hope | remediation targets reality; no-ops escalate | R5 |
| Measurement | green dashboards over a dead service | coverage per plane, headline = MIN | R1, R4 |
The adoption trap
Concretely: a gate proven correct but not wired at the live chokepoint is the baseline, not the improvement.
How to read this page
Rung status is deliberately harsh: five GREEN, one AMBER, one RED — on a system that demonstrably works and ships. That is not a contradiction — it is the point. The ecosystem is capable and under-measured, and the second fact is what makes the first fragile. Every RED here is a known, named, filed gap with an instrument that can confirm when it closes.