code wiki / _hdl_build / nx_docstage.nx
nx_docstage.nx
buildroot/runtime/_hdl_build/nx_docstage.nx
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
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
structs
| none |
consts
| 33 | const DS_DIRBUF: i64 = 65536 // getdents64 batch -- LOOPED until 0; ONE CALL IS NOT A LISTING |
| 34 | const DS_PATH: i64 = 1024 // one path cell |
| 35 | const DS_MAXDIRS: i64 = 8192 // directory stack; overflow sets the cap flag (never silent) |
| 36 | const DS_MAXFILES: i64 = 131072 // file table; overflow sets the cap flag |
| 37 | const DS_MAXROOTS: i64 = 64 // configured doc roots |
| 38 | const DS_CONFCAP: i64 = 65536 // roots conf read reserve |
| 39 | const DS_SHOW: i64 = 24 // hits PRINTED; the COUNT is always complete and says so |
| 51 | const DS_MAXFILE_DEFAULT: i64 = 4194304 |
| 52 | const DS_EQ: i64 = 61 // ASCII '=' -- a conf line with one is a SETTING, not a root |
| 53 | const DS_OUT: i64 = 262144 |
| 54 | const DS_SLASH: i64 = 47 // ASCII '/' |
| 55 | const DS_DOT: i64 = 46 // ASCII '.' |
| 56 | const DS_NL: i64 = 10 // ASCII newline |
| 57 | const DS_HASH: i64 = 35 // ASCII '#' -- conf comment |
| 58 | const DS_SP: i64 = 32 // ASCII space |
| 59 | const DS_TAB: i64 = 9 // ASCII tab |
| 60 | const DS_UND: i64 = 95 // ASCII '_' -- an identifier byte, so NOT a token boundary |
| 61 | const DS_A_UP: i64 = 65 |
| 62 | const DS_Z_UP: i64 = 90 |
| 63 | const DS_A_LO: i64 = 97 |
| 64 | const DS_Z_LO: i64 = 122 |
| 65 | const DS_D0: i64 = 48 |
| 66 | const DS_D9: i64 = 57 |
| 67 | const DS_DT_DIR: i64 = 4 // linux dirent DT_DIR |
| 68 | const DS_DT_UNKNOWN: i64 = 0 // linux dirent DT_UNKNOWN -- probed, never assumed |
| 69 | const DS_EXIT_DOC: i64 = 0 |
| 70 | const DS_EXIT_UNDOC: i64 = 1 |
| 71 | const DS_EXIT_UNMEASURED: i64 = 3 |
functions
| 73 | func ds_cell(base: *u8, idx: i64, cell: i64) -> *u8 { return ((base as i64) + idx * cell) as *u8 } |
| 74 | func ds_ident(c: i64) -> i64 called by 1: ds_scan |
| 81 | func ds_isdir(path: *u8, pbuf: *u8) -> i64 |
| 90 | func ds_walk(root: *u8, parena: *u8, nf0: i64, wcx: *i64) -> i64 |
| 160 | func ds_scan(sym: *u8, conf: *u8, d: *u8, cx: *i64) -> i64 |
| 351 | func main(argc: i64, argv: *i64) -> i64 |