code wiki / _hdl_build / nx_brief_publish.nx

nx_brief_publish.nx

buildroot/runtime/_hdl_build/nx_brief_publish.nx

13740 B251 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_brief_publish.nx -- ONE CALL publishes a research brief: VALIDATE -> WRITE -> VERIFY, or REFUSE. Closes the last leg of the publish arc (task #13). Before this, publishing a brief was four manual steps -- hand-write HTML, write it to the docroot, hand-edit the index, eyeball it -- and step 3 was routinely skipped, so the index silently disagreed with the library it indexed. nx_brief_publish check <src> validate only, exit 0 ok / 3 REFUSED (dry run) nx_brief_publish publish <src> <slug> validate -> write sites/nishifamily/code/<slug>.html -> read back THE CONTRACT IT ENFORCES (the /code/research bar, made mechanical instead of remembered): R1 exactly one <h1> -- one document, one subject R2 a <time datetime= -- machine-readable date, not prose R3 >=3 'http' source links -- claims carry sources R4 an UNVERIFIED section -- a brief with no declared gaps did not look for them R5 a lineage marker -- 'Forks off' or rel='parent' or 'lineage:' (library, not a pile) R6 balanced <main>/</main> -- catches a truncated write BEFORE it reaches the docroot REFUSAL IS THE POINT: a brief that fails any rule is never written, so the docroot cannot hold a page that violates the standard. Verification is a READ-BACK of the bytes actually on disk (never a status string) -- the ecosystem law is verify by artifact bytes. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_brief_publish.nx

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

main bp_puts sys_write sys_exit sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close bp_num sys_mmap ↻ sys_write ↻ bp_validate bp_count bp_vlen bp_has bp_count ↻ bp_report bp_rule bp_puts ↻ bp_vlen ↻ sys_openat_wr sys_write ↻ sys_close ↻

structs

none

consts

22const BP_CAP: i64 = 1048576
23const BP_PATH: i64 = 1024
24const BP_EXIT_USAGE: i64 = 2
25const BP_EXIT_REFUSED: i64 = 3
26const BP_EXIT_IO: i64 = 4
27const BP_MIN_SRC: i64 = 3

functions

29func bp_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: bp_rulemain calls 1: sys_write
30func bp_num(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
39func bp_vlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: bp_countmain
41func bp_count(buf: *u8, n: i64, needle: *u8) -> i64
called by 2: bp_hasbp_validate calls 1: bp_vlen
54func bp_has(buf: *u8, n: i64, needle: *u8) -> i64 { if bp_count(buf,n,needle)>0 { return 1 } return 0 }
called by 1: bp_validate calls 1: bp_count
57func bp_validate(buf: *u8, n: i64, v: *i64) -> i64
called by 1: main calls 2: bp_countbp_has
74func bp_rule(name: *u8, ok: i64) -> i64
called by 1: bp_report calls 1: bp_puts
79func bp_report(v: *i64) -> i64
called by 1: main calls 1: bp_rule
90func bp_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, a6: *u8, a7: *u8, a8: *u8,
120func main(argc: i64, argv: *i64) -> i64