code wiki / (root) / nx_spore_up_test.nx

nx_spore_up_test.nx

buildroot/runtime/nx_spore_up_test.nx

8208 B203 linesdepth 8pulls 14 transitivereach 0 importersview sourcekind gate/prooftopic spore
docsdependenciesstructsconstsfunctions

about

nx_spore_up_test.nx -- minimum-viable spore-up demonstration. END-TO-END chain on REAL on-device measurements + persistent journaled attestation. Answers the operator's question "can a device get spored and seeded and self-unfold?" with running code. Sequence: 1. Real nx_probe_run (on-device capability fingerprint, witnessed via micro-smokes, not synthetic) 2. Real nx_calibrate_run (lmbench-class empirical measurements on THIS device) 3. Build a 3-node manifest workload (hardcoded reference set; ST-4 nx_kv_store + future manifest registry will replace with disk-resident manifests) 4. nx_install_pipeline_run_with_inputs composes select + capture + hash into one call 5. nx_journal_log_append the install_hash as a persistent tamper-evident attestation record 6. verify_chain confirms journal integrity 7. sys_write "SPORE UP COMPLETE ..." to stdout What this PROVES on green: - Substrate runs probe + calibration on its own device with zero operator input - Selection + plan + hash chain works on real measurements - Install attestation persists in a hash-chained journal that refuses silent tampering - The whole chain composes through one main() function -- the substrate self-assembles from first principles What this does NOT yet prove (honest gaps): - Network pull of manifests (HTTPS wired but not composed -- ST-6 peer sync queued) - File-backed persistence across boots (ST-2 / ST-3.5 queued) - Stage0-class bootstrap from a hex0 seed (SA-9 queued) - Per-variant on-device smoke gating (SA-6 nx_verify queued) - Compile invocation of selected variants into a deployable binary (SA-6 nx_compile queued)

dependencies 10 imports · 0 importers

nx_syscalls.nx nx_probe.nx nx_calibrate.nx nx_select.nx nx_select_joint.nx nx_install_plan.nx nx_install_hash.nx nx_install_pipeline.nx nx_blob_store.nx nx_journal_log.nx nx_spore_up_test.nx

imports: nx_syscalls.nxnx_probe.nxnx_calibrate.nxnx_select.nxnx_select_joint.nxnx_install_plan.nxnx_install_hash.nxnx_install_pipeline.nxnx_blob_store.nxnx_journal_log.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_probe_new sys_mmap nx_probe_run _probe_compiled_isa _probe_endianness sys_mmap ↻ _probe_pointer_width_bits _probe_page_size_bytes sys_mmap ↻ _probe_mmap_works sys_mmap ↻ _probe_write_works sys_mmap ↻ sys_write sys_mmap ↻ _probe_mono_clock sys_mmap ↻ sys_clock_gettime_mono sys_clock_gettime_mono ↻ nx_calibrate_new sys_mmap ↻ nx_calibrate_run sys_mmap ↻ _calibrate_int_alu sys_mmap ↻ _now_ns sys_clock_gettime_mono ↻ sys_write ↻ _calibrate_ptrchase sys_mmap ↻ _now_ns ↻ sys_write ↻ _calibrate_mem_bw sys_mmap ↻ _now_ns ↻ _calibrate_syscall_gettime sys_mmap ↻ _now_ns ↻ sys_clock_gettime_mono ↻

structs

none

consts

59const SCHEMA_INSTALL_HASH: i64 = 1001

functions

64func _emit(tag: *u8, len: i64) -> i64
called by 1: main calls 1: sys_write
70func _mk(variant_id: i64, cost: i64, in_lay: i64, out_lay: i64) -> *NxManifest
85func main() -> i64