code wiki / _hdl_build / nx_wiki_walk_metrics.nx
nx_wiki_walk_metrics.nx
buildroot/runtime/_hdl_build/nx_wiki_walk_metrics.nx
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
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
structs
| none |
consts
| 40 | const WM_MAGIC_16384: i64 = 16384 |
| 43 | const WM_OK: i64 = 0 |
| 44 | const WM_BAD_INPUT: i64 = 2780 |
| 45 | const WM_READ_FAIL: i64 = 2781 |
| 46 | const WM_OVERFLOW: i64 = 2782 |
| 49 | const WM_MAX_PAGES: i64 = 256 |
| 50 | const WM_MAX_BYTES: i64 = 4194304 // 4 MB snapshot cap |
| 51 | const WM_MARK_PAGE_N: i64 = 8 // len("###PAGE ") |
| 52 | const WM_MAX_LINKS_PP: i64 = 512 |
| 53 | const WM_REACH_K: i64 = 64 // E: hop budget (>= corpus diameter) |
| 54 | const WM_INF: i64 = 1000000 // BFS "unreachable" sentinel |
| 433 | const WM_LIVE_CORPUS: *u8 = "knowledge/status/ims_live_corpus.txt" |
| 434 | const WM_LINKS: *u8 = "knowledge/registry/wiki_links.tsv" |
| 435 | const WM_LOG: *u8 = "knowledge/status/wiki_walk_metrics.log" |
functions
| 57 | func wm_parse_int(buf: *u8, off: i64, lim: i64, out_off: *i64) -> i64 called by 1: wm_ingest |
| 73 | func wm_is_page_mark(buf: *u8, off: i64, lim: i64) -> i64 called by 1: wm_ingest |
| 85 | func wm_ingest(store: *NxWikiDocStore, buf: *u8, total: i64) -> i64 |
| 123 | func wm_build_adj(store: *NxWikiDocStore, adj: *i64, n: i64) -> i64 called by 1: wm_measure calls 4: sys_mmapnx_wiki_doc_store_lookupnx_ims_collect_targetsnx_ims_slug_eq |
| 178 | func wm_url_is_slug(store: *NxWikiDocStore, rowid: i64, slug: *u8) -> i64 |
| 186 | func wm_slug_present(store: *NxWikiDocStore, n: i64, slug: *u8) -> i64 |
| 197 | func wm_measure(corpus_path: *u8, links_path: *u8, outs: *i64) -> i64 called by 2: mainmain calls 13: sys_mmapsys_read_filenx_wiki_doc_store_initwm_ingestnx_ims_resolve_rootwm_build_adj+7 |
| 417 | func 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 } |
| 418 | func wm_num(v: i64) -> i64 |
| 426 | func wm_pct(label: *u8, scaled: i64) -> i64 |
| 437 | func main() -> i64 |