code wiki / _hdl_build / nx_docstage.nx

nx_docstage.nx

buildroot/runtime/_hdl_build/nx_docstage.nx

18345 B363 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_docstage.nx -- DID THE THING WE SHIPPED GET WRITTEN DOWN ANYWHERE? (DM8, devmgmt rung.) The adoption gap this closes is not "no docs" -- it is that NOBODY MEASURES whether a shipped symbol ever reaches a surface another seat can retrieve. A capability that exists and is unfindable is a retrieval failure, and the estate's own record says the same doctrine got written four times because nobody looked first. DOCUMENTED = the symbol appears as an EXACT TOKEN in at least one file under the configured doc roots (compare matrix / plan / watch rows, the doc library, or -- when a caller passes its own roots -- a memory tree). EXACT TOKEN, NOT SUBSTRING, AND THAT IS THE WHOLE BAR. The accept rule is ZERO FALSE DOCUMENTED, and a substring search reports `nx_dora` as documented because `nx_dora_page` is mentioned somewhere. So a hit counts only when the character before AND after are non-identifier bytes. This is deliberately NOT a fork of nx_absent: that organ answers "is this substring absent, and was the search complete", which is a DIFFERENT QUESTION -- and a ruler whose subject does not match the question it is asked is the defect this estate finds most often. The coverage half of nx_absent's contract is reproduced here honestly instead: every cap sets a flag and the flag decides the verdict. THREE STATES, because presence and absence do not need the same evidence: DOCUMENTED -- at least one exact-token witness. ONE WITNESS IS ENOUGH, so this verdict stands even when coverage was partial. UNDOCUMENTED -- zero witnesses AND coverage_complete=1. An absence claim needs the whole corpus. UNMEASURED -- zero witnesses and coverage was NOT complete, or no root could be read at all. "I could not look" is not "it is not written down", and collapsing those two is how a reporting stage starts lying in the safe-sounding direction. Exit: 0 DOCUMENTED, 1 UNDOCUMENTED, 3 UNMEASURED. Callers that are report-only IGNORE the code and print the line -- a pre-flight that can refuse gets disabled, one that only informs survives. nx_docstage <symbol> [roots-conf] license_tier: ORIGINAL Read-only. No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_sovjson_lib.nx nx_syscalls.nx nx_docstage.nx

imports: nx_sovjson_lib.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sj_puts sys_write sys_exit sj_vlen sys_mmap nxa_die sys_write ↻ sys_exit ↻ nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ ds_scan sj_vlen ↻ sys_mmap ↻ sys_openat_rd sys_read sys_close sj_le sj_lit_eq sj_atoi_span ds_cell sj_cat ds_walk sys_mmap ↻ ds_cell ↻ sj_cat ↻ sys_openat_rd ↻ sys_getdents64 dirent_name dirent_type sj_vlen ↻

structs

none

consts

33const DS_DIRBUF: i64 = 65536 // getdents64 batch -- LOOPED until 0; ONE CALL IS NOT A LISTING
34const DS_PATH: i64 = 1024 // one path cell
35const DS_MAXDIRS: i64 = 8192 // directory stack; overflow sets the cap flag (never silent)
36const DS_MAXFILES: i64 = 131072 // file table; overflow sets the cap flag
37const DS_MAXROOTS: i64 = 64 // configured doc roots
38const DS_CONFCAP: i64 = 65536 // roots conf read reserve
39const DS_SHOW: i64 = 24 // hits PRINTED; the COUNT is always complete and says so
51const DS_MAXFILE_DEFAULT: i64 = 4194304
52const DS_EQ: i64 = 61 // ASCII '=' -- a conf line with one is a SETTING, not a root
53const DS_OUT: i64 = 262144
54const DS_SLASH: i64 = 47 // ASCII '/'
55const DS_DOT: i64 = 46 // ASCII '.'
56const DS_NL: i64 = 10 // ASCII newline
57const DS_HASH: i64 = 35 // ASCII '#' -- conf comment
58const DS_SP: i64 = 32 // ASCII space
59const DS_TAB: i64 = 9 // ASCII tab
60const DS_UND: i64 = 95 // ASCII '_' -- an identifier byte, so NOT a token boundary
61const DS_A_UP: i64 = 65
62const DS_Z_UP: i64 = 90
63const DS_A_LO: i64 = 97
64const DS_Z_LO: i64 = 122
65const DS_D0: i64 = 48
66const DS_D9: i64 = 57
67const DS_DT_DIR: i64 = 4 // linux dirent DT_DIR
68const DS_DT_UNKNOWN: i64 = 0 // linux dirent DT_UNKNOWN -- probed, never assumed
69const DS_EXIT_DOC: i64 = 0
70const DS_EXIT_UNDOC: i64 = 1
71const DS_EXIT_UNMEASURED: i64 = 3

functions

73func ds_cell(base: *u8, idx: i64, cell: i64) -> *u8 { return ((base as i64) + idx * cell) as *u8 }
called by 2: ds_walkds_scan
74func ds_ident(c: i64) -> i64
called by 1: ds_scan
81func ds_isdir(path: *u8, pbuf: *u8) -> i64
90func ds_walk(root: *u8, parena: *u8, nf0: i64, wcx: *i64) -> i64
160func ds_scan(sym: *u8, conf: *u8, d: *u8, cx: *i64) -> i64
351func main(argc: i64, argv: *i64) -> i64