Nishi Consolidation Library

Object-oriented helper extraction across the sovereign organ corpus - full-scale, evidence-hardened, never-brick-safe. Debt line D001.

What this is

Single-responsibility shared libraries plus a self-verifying delegation toolchain that removes copy-pasted helper functions across the whole _hdl_build organ tree - without losing behavior and without ever touching firmware / never-brick organs (cardinal rule 26).

The shared library (single-responsibility, rule 15)

LibraryProvidesNotes
nx_g_puts_libg_putsgate stdout string writer
nx_g_pn_libg_pninteger writer (superset - handles negatives)
nx_g_check_libg_check2-arg PASS/FAIL emitter
nx_gate_emit_libg_puts + g_pn + g_checkbundle facade (283 prior consumers)
nx_ge_str_lib, nx_ag_lib, nx_sitegate_emit_libstring / atoi-itoa / site-gate helpersearlier extractions

Single-helper libs exist because NishiLang import overrides a same-name local definition (proven by nx_shadow_probe) - a bundled import would silently clobber a retained local variant, so per-helper delegation requires per-helper libs.

The tooling

Full-scale sweep - measured, not asserted

Ran over all 2,592 organ source files in _hdl_build:

HelperDelegatedVariants refusedFirmware refusedErrors
g_puts (completeness re-run)0 (already complete)11870
g_pn6321870
g_check17291870

62 variants were refused - files a naive name-based tool would have silently mis-substituted. The self-check caught every one. 187 firmware / never-brick organs were refused by construction. Zero errors.

Never-brick proof (rule 26)

The never-brick genesis gate - the cardinal-26 enforcement mechanism - re-run after consolidation:

registry: 16 nodes (10 hardware-write-axis); genesis verdict=GREEN

End-to-end behavior proof: nx_quic_aead_test had its full helper trio delegated, compiles, and its gate stays GREEN with byte-identical RFC-9001 vectors (nonce fa044b2f42a3fd3b46fb255e, HP mask 437b9aec36).

Rigor findings

RACI (consolidation workstream)

RoleTeam roleScope
R - Responsiblearchitectowns the atlas / consolidation lane, nx_gate_base, decision DEC020
A - Accountableoperatorsets the rigor bar; accepts or rejects
C - Consultedwarden, refereenever-brick (rule 26) and gate verdicts
I - Informedlibrarian, engineer teamlibrary docs; downstream consumers of the shared libs

Related sovereign work

This toolchain converges with and extends the ecosystem's gate-base consolidation (nx_gate_base.nx - gw x399, g_slen; architecture decision DEC020, shared-base-consolidation-oracle). Both lines independently proved that an import shadows a same-signature local definition - so build-success alone is an unsafe oracle for extraction. This line's additions: a fully API-first (zero-shell) self-checking delegator that verifies body-equivalence before every substitution, and never-brick firmware refusal by construction.

Sovereign Nishi ecosystem · built and verified API-first (zero shell) · converges with DEC020 / nx_gate_base · 2026-07-21