nx_spore.nx
buildroot/runtime/nx_spore.nx
about
nx_spore.nx -- drift unit; positive mycelium-class networking bootstrap.
Per META-CARDINAL feedback-forest-meta-vision-drift-lifecycle: the
tiniest viable Nishi-stack capsule that, when planted on an operator-
consented device of any size, bit-by-bit builds the device's ability
to talk to other Nishi peers -- like a fungal spore germinates and
reaches out with first hyphae, NOT like a botnet/zombie/parasite.
Per existing NISHI_SPORE_ROADMAP.md: this primitive handles the
LIFECYCLE STATE MACHINE + form-factor classification. The actual
bootable-artifact emission (ISO 9660 / GPT / qcow2 / etc.) lives in
nx_spore_emit (queued); the cell-supervisor bring-up at first-boot
lives in nx_germinate (queued). This primitive is the lifecycle
substrate that other spore primitives compose against.
V1 ships:
- sealed enum of form factors (ISO / RAW_DISK / SD / QCOW2 / VMDK /
VHDX / NETBOOT / NISHI_SILICON)
- sealed enum of germination states (PACKED / TRANSPORTED / LANDED /
VERIFIED / NETWORKING_UP / READY_FOR_SEED / FAILED)
- state machine transitions per [[feedback-self-surfacing-
intelligence-staged-autonomy]] operator gates
- positive-network discipline predicate (operator-consent required;
never covert)
Composes:
nx_methyl -- spore artifact carries Ed25519-signed methyl marker
nx_chromatin -- next-stage chromatin block fetch (post-germination)
nx_attest_silicon -- silicon-trust verdict before sovereignty-critical
cell assembly
nx_niche -- germinated spore probes niche before seed assembly
nx_provenance_chain -- every state transition chain-logged
Gap list (V1 honest perf verdict):
- state machine logic only; actual ISO/qcow2/etc. emission lives
in nx_spore_emit (queued)
- <50KB target documented in roadmap; current substrate doesn't yet
measure spore artifact size
- operator-consent flag is operator-attested (V2 composes with
nx_covenant for landowner/installer consent chain)
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_spore_test.nx
structs
| 98 | struct NxSporeRecord |
consts
| 61 | const NX_SF_HYBRID_ISO: nx_int = 0 |
| 62 | const NX_SF_RAW_DISK_IMG: nx_int = 1 |
| 63 | const NX_SF_SD_CARD: nx_int = 2 |
| 64 | const NX_SF_QCOW2: nx_int = 3 |
| 65 | const NX_SF_VMDK: nx_int = 4 |
| 66 | const NX_SF_VHDX: nx_int = 5 |
| 67 | const NX_SF_NETBOOT_PXE: nx_int = 6 |
| 68 | const NX_SF_NISHI_SILICON_RV64: nx_int = 7 |
| 69 | const NX_SF_N_FORMS: nx_int = 8 |
| 73 | const NX_GS_PACKED: nx_int = 0 // freshly emitted; not yet deployed |
| 74 | const NX_GS_TRANSPORTED: nx_int = 1 // on target media (USB stick, etc.) |
| 75 | const NX_GS_LANDED: nx_int = 2 // booted on target hardware |
| 76 | const NX_GS_VERIFIED: nx_int = 3 // Ed25519 + BLAKE3 attestation passed |
| 77 | const NX_GS_NETWORKING_UP: nx_int = 4 // peer-mesh discovery active |
| 78 | const NX_GS_READY_FOR_SEED: nx_int = 5 // niche probed; ready for nx_seed |
| 79 | const NX_GS_FAILED: nx_int = 6 // terminal failure state |
| 80 | const NX_GS_N_STATES: nx_int = 7 |
| 84 | const NX_SP_OK: nx_int = 0 |
| 85 | const NX_SP_ERR_INVALID_FORM: nx_int = 1 |
| 86 | const NX_SP_ERR_INVALID_TRANSITION: nx_int = 2 |
| 87 | const NX_SP_ERR_OPERATOR_CONSENT_MISSING: nx_int = 3 |
| 88 | const NX_SP_ERR_VERIFICATION_FAILED: nx_int = 4 |
| 89 | const NX_SP_ERR_NULL_INPUT: nx_int = 5 |
| 90 | const NX_SP_N_VERDICTS: nx_int = 6 |
| 109 | const NX_SP_REC_BYTES: nx_int = 64 |
functions
| 113 | func nx_sf_form_is_valid(f: nx_int) -> nx_int |
| 121 | func nx_gs_state_is_valid(s: nx_int) -> nx_int |
| 129 | func nx_sp_verdict_is_valid(v: nx_int) -> nx_int called by 1: main |
| 137 | func nx_gs_state_is_terminal(s: nx_int) -> nx_int |
| 145 | func nx_gs_state_is_active(s: nx_int) -> nx_int called by 1: main |
| 156 | func nx_sf_is_bootable_artifact(f: nx_int) -> nx_int |
| 168 | func _sp_transition_allowed(from: nx_int, to: nx_int) -> nx_int |
| 201 | func nx_sp_record_new(form_factor: nx_int, |
| 221 | func nx_sp_record_set_operator_consent(r: *NxSporeRecord, called by 1: main |
| 234 | func nx_sp_record_transition(r: *NxSporeRecord, called by 2: nx_sp_record_mark_verifiedmain calls 3: nx_sf_form_is_validnx_gs_state_is_valid_sp_transition_allowed |
| 261 | func nx_sp_record_mark_verified(r: *NxSporeRecord, |
| 274 | func nx_sp_record_set_silicon_trust(r: *NxSporeRecord, called by 1: main |
| 283 | func nx_sp_record_is_ready_for_seed(r: *NxSporeRecord) -> nx_int called by 1: main |