code wiki / _hdl_build / _wiki_discovery_gate.nx
_wiki_discovery_gate.nx
buildroot/runtime/_hdl_build/_wiki_discovery_gate.nx
about
_wiki_discovery_gate.nx -- unit gate for the wiki content loader's
V+1 AUTO-DISCOVERY (nx_wcl_discover_dir).
NO mocks, NO HTTP daemon: drives the real loader functions against
the REAL wiki content dir (/mnt/c/Users/elder/nishi-silicon), then
renders a discovered page via the real nx_wiki_doc_render, then
builds the real inverted index and runs a POSITIVE + NEGATIVE search
control. Judged by the printed WIKIDISCOVERY marker (verdict=GREEN
only if EVERY assertion holds), NOT by $? -- mirrors the gate
convention in runtime/_hdl_build (e.g. _eoe_gate.nx).
PROVES the V+1 TODO is closed: a new .md dropped into the content
dir becomes a page + search hit with ZERO code edit, because the
getdents64 walk enumerates the dir at load time.
Import set mirrors the PROVEN-SAFE composition already shipping in
wiki/nx_wiki_doc_handler.nx (nx_syscalls + index_builder[->search] +
doc_render): import each module exactly ONCE to avoid the
double-import nxasm rc6 trap. nx_wiki_content_loader transitively
pulls nx_wiki_index_builder (doc store + inverted index).
Evidence -> knowledge/status/wiki_discovery_gate.log + stdout.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_wiki_content_loader.nxnx_wiki_doc_render.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
| 56 | const WG_K_MIN: i64 = 10 // assert: discovered at least this many .md pages |
| 57 | const WG_OUT_CAP: i64 = 1048576 // 1 MiB render output buffer |
| 58 | const WG_SCRATCH_CAP: i64 = 1048576 // 1 MiB wikilink-preprocess scratch |
functions
| 29 | func wg_fp(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 30 | func wg_fn(fd: i64, v: i64) -> i64 |
| 38 | func wg_w2(lfd: i64, s: *u8) -> i64 { wg_fp(1, s); if lfd >= 0 { wg_fp(lfd, s) } return 0 } |
| 39 | func wg_n2(lfd: i64, v: i64) -> i64 { wg_fn(1, v); if lfd >= 0 { wg_fn(lfd, v) } return 0 } |
| 42 | func wg_contains(hay: *u8, hay_n: i64, needle: *u8, needle_n: i64) -> i64 called by 1: main |
| 60 | func main() -> i64 |