code wiki / _hdl_build / nx_wiki_walk_metrics.nx

nx_wiki_walk_metrics.nx

buildroot/runtime/_hdl_build/nx_wiki_walk_metrics.nx

19910 B464 linesdepth 9pulls 14 transitivereach 1 importersview sourcekind tooltopic wiki
docsdependenciesstructsconstsfunctions

about

nx_wiki_walk_metrics.nx -- WALKABILITY metrics A-H over the LIVE wiki link graph + the curated wiki_links.tsv. The measured F->toward-S scorecard for the nav-tree arc: dense bidirectional link-tree + learning-path coverage, computed not claimed. REUSE (zero new link/slug/corpus substrate invented): nx_ims_monitor nx_ims_collect_targets ([[wikilink]]+href extractor), nx_ims_slug_eq (slug resolver), nx_ims_resolve_root, and the NxWikiDocStore -- byte-identical edge semantics to the live orphan/dead-link monitor + graph builder + walkability scorecard. nx_wiki_shell sh_links_load / sh_wl_field / sh_wl_row_of / sh_streq -- the curated wiki_links.tsv reader (tree/path/related/tags), shared with the page furniture emitters so "the path" is one truth. nx_syscalls sys_read_file (read-only) + sys_mmap scratch. The corpus path is a PARAMETER so the referee gate can feed healthy / sparse / one-axis fixtures and prove no green is fabricated. outs[] layout (all integers; ratios scaled x100 for fixed-point, NO float): [0] N pages [1] total internal page-link edges [2] A reciprocity % = reciprocal-edges / total-edges * 100 [3] B orphan ratio % = orphans(in==0, excl root) / N * 100 [4] C dead-end ratio % = dead-ends(out==0) / N * 100 [5] D avg shortest path x100 (over reachable ordered pairs from every source) [6] D diameter = max finite shortest-path (clicks) [7] E reachability % = reachable-from-start (<= K hops) / N * 100 [8] F link density x100 = total-edges / N (avg out-degree) [9] G prevnext coverage % = pages whose prev/next slug RESOLVES to a real page / eligible [10] H breadcrumb integrity % = pages whose parent chain resolves to root w/ NO cycle / N [11] orphan count (raw) [12] dead-end count (raw) [13] reciprocal edge count (raw, directed) [14] reachable count (raw, incl start) Hygiene: M1 out-params; M3 every while hard-capped; M5 bounded indexing; M7 named constants; M8 verdicts. ("loop"/"match" reserved.) license_tier: ORIGINAL

dependencies 3 imports · 1 importers

nx_ims_monitor.nx nx_wiki_shell.nx nx_syscalls.nx nx_wiki_walk_metrics.nx nx_wiki_walk_gate.nx

imports: nx_ims_monitor.nxnx_wiki_shell.nxnx_syscalls.nx

imported by: nx_wiki_walk_gate.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap wm_measure sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_wiki_doc_store_init sys_mmap ↻ wm_ingest sys_mmap ↻ wm_is_page_mark wm_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 wm_build_adj sys_mmap ↻ nx_wiki_doc_store_lookup ↻ nx_ims_collect_targets sys_mmap ↻ nx_wiki_forward_links nx_ims_href_links nx_ims_strip_frag_query ↻ nx_ims_slug_eq ↻ sh_links_load sys_mmap ↻ ncfg_open ss_open_cached

structs

none

consts

40const WM_MAGIC_16384: i64 = 16384
43const WM_OK: i64 = 0
44const WM_BAD_INPUT: i64 = 2780
45const WM_READ_FAIL: i64 = 2781
46const WM_OVERFLOW: i64 = 2782
49const WM_MAX_PAGES: i64 = 256
50const WM_MAX_BYTES: i64 = 4194304 // 4 MB snapshot cap
51const WM_MARK_PAGE_N: i64 = 8 // len("###PAGE ")
52const WM_MAX_LINKS_PP: i64 = 512
53const WM_REACH_K: i64 = 64 // E: hop budget (>= corpus diameter)
54const WM_INF: i64 = 1000000 // BFS "unreachable" sentinel
433const WM_LIVE_CORPUS: *u8 = "knowledge/status/ims_live_corpus.txt"
434const WM_LINKS: *u8 = "knowledge/registry/wiki_links.tsv"
435const WM_LOG: *u8 = "knowledge/status/wiki_walk_metrics.log"

functions

57func wm_parse_int(buf: *u8, off: i64, lim: i64, out_off: *i64) -> i64
called by 1: wm_ingest
73func wm_is_page_mark(buf: *u8, off: i64, lim: i64) -> i64
called by 1: wm_ingest
85func wm_ingest(store: *NxWikiDocStore, buf: *u8, total: i64) -> i64
123func wm_build_adj(store: *NxWikiDocStore, adj: *i64, n: i64) -> i64
178func wm_url_is_slug(store: *NxWikiDocStore, rowid: i64, slug: *u8) -> i64
186func wm_slug_present(store: *NxWikiDocStore, n: i64, slug: *u8) -> i64
called by 1: wm_measure calls 1: wm_url_is_slug
197func wm_measure(corpus_path: *u8, links_path: *u8, outs: *i64) -> i64
417func wm_p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 as u8 { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: wm_pctmain calls 1: sys_write
418func wm_num(v: i64) -> i64
called by 2: wm_pctmain calls 2: sys_mmapsys_write
426func wm_pct(label: *u8, scaled: i64) -> i64
called by 1: main calls 2: wm_pwm_num
437func main() -> i64