code wiki / _hdl_build / _wiki_engine_gate.nx
_wiki_engine_gate.nx
buildroot/runtime/_hdl_build/_wiki_engine_gate.nx
about
_wiki_engine_gate.nx -- unit gate PROVING the INTERNAL sovereign wiki
engine SERVES auto-discovered pages, including SUBDIR charters reached
only by the new RECURSIVE walk.
NO mocks, NO live socket: drives the REAL loader + REAL route handler
against the REAL wiki content dir (/mnt/c/Users/elder/nishi-silicon).
1. fresh index builder -> nx_wcl_discover_tree (RECURSIVE walk) ->
assert pages >= 35 (31 top-level + subdir charters)
2. resolve a KNOWN TOP-LEVEL slug (/wiki/nishi-wiki-charter) through
the real nx_wiki_doc_handle route path -> assert HTTP 200 + a
known body substring ("charter") -> toplevel_ok + render_ok
3. resolve a KNOWN SUBDIR slug (/wiki/hdl-hacking, produced by the
recursion for hdl/HACKING.md) through nx_wiki_doc_handle ->
assert HTTP 200 -> subdir_ok (PROVES recursion serves)
4. search "sovereign" -> >=1 hit (search_ok); bogus term -> 0 hits
(search_neg)
5. emit ONE marker line (stdout + knowledge/status/wiki_engine_gate.log):
WIKIENGINE pages=<n> toplevel_ok=.. subdir_ok=.. render_ok=..
search_ok=.. search_neg=.. verdict=GREEN|RED
Judged by the printed WIKIENGINE marker (verdict=GREEN only if EVERY
assertion holds), NOT by $? -- mirrors _wiki_discovery_gate.nx.
LANDMINE (per the engineering rules + nx_wiki_index_builder DEBT note):
the native compiler can desync `let rc = <cross-fn call>` vs an
immediate `rc == const` compare. So EVERY assertion is judged on a
GROUND-TRUTH observable: the doc-store count delta (pages), the bytes
in the response buffer (served HTTP 200), and the query result's
n_rowids_filled (hits) -- never a bare returned status code.
Import set: nx_syscalls + content_loader (discovery) + doc_handler
(the route path; transitively pulls index_builder->search_inverted +
doc_render). Each base module is imported exactly ONCE to avoid the
double-import nxasm rc6 trap.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_wiki_content_loader.nxnx_wiki_doc_handler.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
| 68 | const EG_K_MIN: i64 = 35 // assert: >= 31 top-level + subdir charters |
| 69 | const EG_RESP_CAP: i64 = 1048576 // 1 MiB HTTP response buffer |
functions
| 41 | func eg_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 } |
| 42 | func eg_fn(fd: i64, v: i64) -> i64 |
| 50 | func eg_w2(lfd: i64, s: *u8) -> i64 { eg_fp(1, s); if lfd >= 0 { eg_fp(lfd, s) } return 0 } |
| 51 | func eg_n2(lfd: i64, v: i64) -> i64 { eg_fn(1, v); if lfd >= 0 { eg_fn(lfd, v) } return 0 } |
| 54 | func eg_contains(hay: *u8, hay_n: i64, needle: *u8, needle_n: i64) -> i64 called by 1: eg_serves |
| 75 | func eg_serves(store: *NxWikiDocStore, url: *u8, url_n: i64, |
| 93 | func main() -> i64 |