code wiki / _hdl_build / nx_wiki_walkability.nx

nx_wiki_walkability.nx

buildroot/runtime/_hdl_build/nx_wiki_walkability.nx

19004 B462 linesdepth 7pulls 7 transitivereach 0 importersview sourcekind tooltopic wiki
docsdependenciesstructsconstsfunctions

about

nx_wiki_walkability.nx -- IMS arc: MEASURED walkability scorecard over the REAL published wiki link graph (READ-ONLY baseline, no assertions). PURPOSE: produce the honest navigation baseline the operator asked for -- NUMBERS from the link graph, not claims. Over the live corpus it computes: 1. N pages, total internal page-links, avg/min/max OUT-degree + IN-degree. 2. ORPHANS (in==0, excluding root) + DEAD-ENDS (out==0), with slugs. 3. RECIPROCAL page pairs (A->B AND B->A) vs ONE-WAY pairs. 4. Reachability from start: reachable count, max clicks-to-reach (BFS depth), and STRANDED pages (unreachable from start). READ-ONLY BY CONSTRUCTION: reads ONE framed corpus snapshot via sys_read_file (the exact A1 transport) and computes in memory. Writes NOTHING to the corpus -- the only output is the scorecard to stdout + a status log. COMPOSES (DRY -- zero new corpus/link/slug substrate invented): nx_ims_monitor nx_ims_collect_targets (the ONE unified outbound [[wikilink]]+href extractor), nx_ims_slug_eq (the ONE slug resolver), nx_ims_resolve_root, and the NxWikiDocStore it composes -- so this scorecard's notion of "a link/edge" is byte-identical to the orphan/dead-link monitor and the graph builder. nx_syscalls sys_read_file (read-only) + sys_mmap scratch. The adjacency is built ONCE into a dense N*N edge bitmatrix (self-edges dropped -- a page linking itself is not navigation), then every metric is a pure read of that matrix. N is small (corpus cap), so N*N is trivial. Hygiene: M1 out-params; M3 every while hard-capped; M5 bounded indexing; M6 real semantics; M7 named constants; M8 verdicts. ("loop"/"match" reserved.) license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_ims_monitor.nx nx_syscalls.nx nx_wiki_walkability.nx

imports: nx_ims_monitor.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 sys_openat_append wlp sys_write sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_exit wln wlp ↻ sys_mmap ↻ sys_write ↻ nx_wiki_doc_store_init sys_mmap ↻ walk_ingest sys_mmap ↻ walk_is_page_mark walk_parse_int nx_wiki_doc_store_add sys_mmap ↻ nx_wib_pool_alloc nx_ims_resolve_root nx_wiki_doc_store_count sys_mmap ↻ nx_wiki_doc_store_lookup nx_ims_slug_eq sys_mmap ↻ nx_ims_norm_slug nx_ims_strip_frag_query walk_build_adj sys_mmap ↻ nx_wiki_doc_store_lookup ↻ nx_ims_collect_targets sys_mmap ↻ nx_wiki_forward_links nx_ims_href_links

structs

none

consts

34const NX_MAGIC_8192: i64 = 8192
35const NX_MAGIC_16384: i64 = 16384
36const NX_MAGIC_1000000: i64 = 1000000
39const NX_WALK_OK: i64 = 0
40const NX_WALK_BAD_INPUT: i64 = 2760
41const NX_WALK_OVERFLOW: i64 = 2761
44const WALK_MAX_PAGES: i64 = 256 // corpus cap for the dense matrix
45const WALK_MAX_BYTES: i64 = 4194304 // 4 MB snapshot cap
46const WALK_MARK_PAGE_N: i64 = 8 // len("###PAGE ")
47const WALK_MAX_LINKS_PP: i64 = 512 // outbound targets scanned per page

functions

50func wlp(fd: i64, s: *u8) -> i64
called by 3: wlnwln2main calls 1: sys_write
57func wln(fd: i64, v: i64) -> i64
called by 2: wln2main calls 3: wlpsys_mmapsys_write
72func wln2(fd: i64, scaled: i64) -> i64
called by 1: main calls 2: wlnwlp
80func wlb(fd: i64, p: *u8, n: i64) -> i64
called by 1: main calls 1: sys_write
94func walk_parse_int(buf: *u8, off: i64, lim: i64, out_off: *i64) -> i64
called by 1: walk_ingest
110func walk_is_page_mark(buf: *u8, off: i64, lim: i64) -> i64
called by 1: walk_ingest
125func walk_ingest(store: *NxWikiDocStore, buf: *u8, total: i64) -> i64
172func walk_build_adj(store: *NxWikiDocStore, adj: *i64, n: i64) -> i64
234func main() -> i64