code wiki / wiki / nx_wiki_content_loader.nx

nx_wiki_content_loader.nx

buildroot/runtime/wiki/nx_wiki_content_loader.nx

38497 B861 linesdepth 5pulls 5 transitivereach 6 importersview sourcekind librarytopic wiki
docsdependenciesstructsconstsfunctions

about

nx_wiki_content_loader.nx -- materialize charters into per-site wiki. V-WIKI-CONTENT-LOAD-1 per NISHI_WIKI_CONTENT_INDEX v1.0 §5 + operator cardinal 2026-05-27 *"make sure all this information gets into the wiki"*. At daemon startup, for each canonical charter listed in §1 of NISHI_WIKI_CONTENT_INDEX.md: 1. sys_read_file(<silicon_repo>/<charter_path>) -> bytes 2. nx_wiki_index_builder_add(builder, title, "/wiki/<slug>", body, body_n) Result: each charter becomes a searchable + readable wiki page at nishifamily.com/wiki/<slug>. COMPOSES (per "avoid duplicate primitives" cardinal): wiki/nx_wiki_index_builder doc_store + builder for indexing nx_syscalls sys_read_file for charter content COMPOSED BY: wiki/nx_wiki_https_daemon_mv setup_site calls this after init SCOPE LIMIT (per M6 anti-pretend-stub): V1 ships a HARDCODED charter list per NISHI_WIKI_CONTENT_INDEX §1. V+1 reads the index .md file at startup + parses §1 tables to discover charters dynamically (sys_getdents queued per project-wiki-v1-complete-2026-05-27 honest gap). Hardcoded list below MUST be kept in sync with NISHI_WIKI_CONTENT_INDEX §1 per its §6 update discipline. Operator-side: daemon must run where the silicon repo is readable. Default path /mnt/c/Users/elder/nishi-silicon on WSL; override via NX_WCL_SILICON_ROOT env var (V+1).

dependencies 2 imports · 6 importers

nx_syscalls.nx nx_wiki_index_builder.nx nx_wiki_content_loader.nx _wiki_discovery_gate.nx _wiki_engine_gate.nx _wiki_frontend_gate.nx nx_teacher_wiki_proof.nx nx_wiki_https_daemon_mv.nx nx_wiki_main.nx

imports: nx_syscalls.nxnx_wiki_index_builder.nx

imported by: _wiki_discovery_gate.nx_wiki_engine_gate.nx_wiki_frontend_gate.nxnx_teacher_wiki_proof.nxnx_wiki_https_daemon_mv.nxnx_wiki_main.nx

structs

none

consts

38const NX_WCL_OK: i64 = 0
39const NX_WCL_BAD_INPUT: i64 = 1380
40const NX_WCL_FILE_NOT_FOUND: i64 = 1381 // silicon repo missing or path wrong
41const NX_WCL_INDEX_ADD_FAILED: i64 = 1382
42const NX_WCL_DIR_OPEN_FAILED: i64 = 1383 // V+1 auto-discover: content dir not openable
51const NX_WCL_DIRBUF_BYTES: i64 = 262144 // getdents64 batch buffer (256 KiB)
52const NX_WCL_MAX_DISCOVER: i64 = 1000 // hard ceiling on pages discovered (JPL rule 2)
53const NX_WCL_MAX_NAME_LEN: i64 = 255 // single dir-entry name cap
54const NX_WCL_MAX_SLUG_LEN: i64 = 256 // derived slug cap
55const NX_WCL_MAX_URL_LEN: i64 = 512 // "/wiki/<slug>" cap
56const NX_WCL_FALLBACK_TITLE: *u8 = "(untitled)" as *u8
57const NX_WCL_FALLBACK_TITLE_N: i64 = 10
74const NX_WCL_SILICON_ROOT: *u8 = "/volume1/homes/elderwesto/nishihost/wiki-content/" as *u8
75const NX_WCL_SILICON_ROOT_N: i64 = 49 // length of NX_WCL_SILICON_ROOT
76const NX_WCL_MAX_PATH_LEN: i64 = 512
77const NX_WCL_MAX_CHARTER_BYTES: i64 = 524288 // 512KB; charters cap
384const NX_WCL_MAX_DIRS: i64 = 4096 // pending-dir stack ceiling
385const NX_WCL_ITER_CAP: i64 = 100000 // hard dir-pop ceiling (symlink-loop guard)
386const NX_WCL_DIR_ARENA: i64 = 4194304 // 4 MiB of dir-path bytes for the stack
387const NX_WCL_CHILD_CAP: i64 = 8192 // assembled child-path scratch

functions

83func _wcl_join_path(out: *u8, out_cap: i64,
called by 1: nx_wcl_load_one
115func nx_wcl_load_one(
182func nx_wcl_lc(c: i64) -> i64
189func nx_wcl_is_md(name: *u8) -> i64
207func nx_wcl_slug_from_name(name: *u8, name_n: i64, out: *u8) -> i64
called by 1: nx_wcl_discover_one calls 1: nx_wcl_lc
229func nx_wcl_discover_one(
303func nx_wcl_discover_dir(builder: *NxWikiIndexBuilder, dir_z: *u8) -> i64
396func nx_wcl_slug_from_relpath(path: *u8, path_n: i64, root_len: i64, out: *u8) -> i64
called by 1: nx_wcl_discover_one_path calls 1: nx_wcl_lc
425func nx_wcl_discover_one_path(
484func nx_wcl_discover_tree(builder: *NxWikiIndexBuilder, dir_z: *u8) -> i64
617func nx_wcl_load_full_manifest(builder: *NxWikiIndexBuilder) -> i64
788func nx_wcl_load_full_manifest_or_discover(builder: *NxWikiIndexBuilder) -> i64
806func nx_wcl_load_discover_tree(builder: *NxWikiIndexBuilder) -> i64
819func nx_wcl_load_jasonewest_portfolio(builder: *NxWikiIndexBuilder) -> i64