Object-oriented helper extraction across the sovereign organ corpus - full-scale, evidence-hardened, never-brick-safe. Debt line D001.
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).
| Library | Provides | Notes |
|---|---|---|
nx_g_puts_lib | g_puts | gate stdout string writer |
nx_g_pn_lib | g_pn | integer writer (superset - handles negatives) |
nx_g_check_lib | g_check | 2-arg PASS/FAIL emitter |
nx_gate_emit_lib | g_puts + g_pn + g_check | bundle facade (283 prior consumers) |
nx_ge_str_lib, nx_ag_lib, nx_sitegate_emit_lib | string / atoi-itoa / site-gate helpers | earlier 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.
nx_map_remove_func - variant-agnostic delegator. For each consumer it finds a helper by name, verifies its body is byte-equivalent (modulo whitespace) to the library's, and only then removes it and adds the single-lib import. Refuses variants; refuses firmware / never-brick organs by content marker.nx_sweep_dir - single-responsibility directory enumerator (dir to path-list) so the delegator runs full-scale with no context round-trip.Ran over all 2,592 organ source files in _hdl_build:
| Helper | Delegated | Variants refused | Firmware refused | Errors |
|---|---|---|---|---|
g_puts (completeness re-run) | 0 (already complete) | 1 | 187 | 0 |
g_pn | 6 | 32 | 187 | 0 |
g_check | 17 | 29 | 187 | 0 |
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.
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).
| Role | Team role | Scope |
|---|---|---|
| R - Responsible | architect | owns the atlas / consolidation lane, nx_gate_base, decision DEC020 |
| A - Accountable | operator | sets the rigor bar; accepts or rejects |
| C - Consulted | warden, referee | never-brick (rule 26) and gate verdicts |
| I - Informed | librarian, engineer team | library docs; downstream consumers of the shared libs |
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