code wiki / _hdl_build / nx_brief_publish.nx
nx_brief_publish.nx
buildroot/runtime/_hdl_build/nx_brief_publish.nx
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
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
| 22 | const BP_CAP: i64 = 1048576 |
| 23 | const BP_PATH: i64 = 1024 |
| 24 | const BP_EXIT_USAGE: i64 = 2 |
| 25 | const BP_EXIT_REFUSED: i64 = 3 |
| 26 | const BP_EXIT_IO: i64 = 4 |
| 27 | const BP_MIN_SRC: i64 = 3 |
functions
| 29 | func 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 } |
| 30 | func bp_num(v: i64) -> i64 |
| 39 | func bp_vlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 41 | func bp_count(buf: *u8, n: i64, needle: *u8) -> i64 |
| 54 | func bp_has(buf: *u8, n: i64, needle: *u8) -> i64 { if bp_count(buf,n,needle)>0 { return 1 } return 0 } |
| 57 | func bp_validate(buf: *u8, n: i64, v: *i64) -> i64 |
| 74 | func bp_rule(name: *u8, ok: i64) -> i64 |
| 79 | func bp_report(v: *i64) -> i64 |
| 90 | func bp_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, a6: *u8, a7: *u8, a8: *u8, |
| 120 | func main(argc: i64, argv: *i64) -> i64 |