code wiki / _hdl_build / nx_spore_germ_gate.nx
nx_spore_germ_gate.nx
buildroot/runtime/_hdl_build/nx_spore_germ_gate.nx
about
nx_spore_germ_gate.nx -- V-SPORE-1 PROOF (X-SEED-002): germinate ONE ecosystem piece
from its content-addressed manifest entry and prove it by BEHAVIOR (KAT exit code).
A tampered piece is rejected on the INTEGRITY gate and is NEVER built or run.
Per NISHI_SPORE_SEED_PORTABILITY_CHARTER germination loop (1:1 PROOF, KAT-as-oracle):
1. PACK -- manifest entry = FNV-1a(canonical piece bytes) + kat_expect exit code.
2. INTEGRITY -- received bytes FNV-1a == manifest hash, else REJECT (never run).
3. MATERIALIZE-- write the VERIFIED bytes to runtime/_germ_scratch_<piece>.nx so the
piece's imports resolve via the normal runtime/ tree exactly as the
canonical organ's do. Fully isolated-dir germination needs explicit
import closures (charter [F2]) = the named follow-on V-SPORE-1b.
4. REBUILD -- the SOVEREIGN toolchain rebuilds the materialized bytes via
_offc/nx_sov_build_run.elf (nx_cc_sovereign + nxasm, empty-.s guard).
5. BEHAVIOR -- fork/exec the rebuilt ELF; exit code == manifest kat_expect = 1:1 proof.
ADMIT iff INTEGRITY-clean AND rebuild rc==0 AND kat_exit==kat_expect.
Controls: POSITIVE = intact nx_exit42 piece -> ADMITTED (kat_exit 42).
NEGATIVE = same piece, one byte flipped -> INTEGRITY mismatch -> REJECTED,
build+run NEVER reached (admitted count must remain exactly 1).
RUN FROM the nxc2 cwd (relative _offc/ runtime/ knowledge/ paths).
Build: _offc/nx_sov_build_run.elf nx_spore_germ_gate -> /tmp/nx_spore_germ_gate.sov.elf
Verdict line is appended to knowledge/status/spore_germ.log.
genealogy_id: nishi_spore_seed_portability_charter_2026-05-28 (X-SEED-002 / V-SPORE-1)
lineage_id: spore_germ_proof_v1
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 31 | const GERM_FNV_OFFSET: i64 = 0 - 3750763034362895579 // 0xcbf29ce484222325 |
| 32 | const GERM_FNV_PRIME: i64 = 1099511628211 // 0x100000001b3 |
functions
| 34 | func germ_hash(buf: *u8, len: i64) -> i64 called by 1: main |
| 45 | func germ_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 46 | func germ_puts(s: *u8) -> i64 { sys_write(1, s, germ_slen(s)); return 0 } |
| 47 | func germ_puts_fd(fd: i64, s: *u8) -> i64 { sys_write(fd, s, germ_slen(s)); return 0 } |
| 50 | func germ_putn_fd(fd: i64, v: i64) -> i64 |
| 65 | func germ_puthex_fd(fd: i64, v: i64) -> i64 |
| 82 | func germ_run(path: *u8, argv: *i64, envp: *i64, redir_out: i64, redir_err: i64) -> i64 |
| 97 | func main() -> i64 |