code wiki / _hdl_build / nx_wiki_structure_regen_gate.nx

nx_wiki_structure_regen_gate.nx

buildroot/runtime/_hdl_build/nx_wiki_structure_regen_gate.nx

18099 B316 linesdepth 11pulls 16 transitivereach 0 importersview sourcekind gate/prooftopic wiki
docsdependenciesstructsconstsfunctions

about

nx_wiki_structure_regen_gate.nx -- TEETH for IMS A4b (the re-publish-on-pulse engine). HERMETIC + apply_flag=0 throughout: the gate exercises the regen DECISION CORE (reg_decide + reg_guard_and_apply) directly against in-memory NxWikiDocStore fixtures + a synthetic RegRegistry, with do_push_flag/apply_flag = 0 EVERYWHERE -- it never touches web_assets, the NAS, the vault, or SSH. Each clean assertion is paired with a PLANTED-fault assertion that forces a specific verdict at a known page: T1 CLEAN registry (every non-root page cross-linked, no dead links) -> EVERY emitter page CLEAN + would_publish=YES, 0 orphans, and the manual-only page is RC_MANUAL_ONLY (counted, not published). T2 PLANTED ORPHAN via a DROPPED LINK: page "hub" used to link "leaf" (baseline) but its re-emitted body DROPS that link, leaving "leaf" with 0 inbound -> regen marks the OFFENDING page ("hub") RC_REFUSE_ORPHAN + would_publish=NO. (proves it REFUSES to create an orphan, and attributes it to the change that caused it.) [TEETH] T3 PLANTED GUARD-FAIL: a page whose would-be body has NO freshness stamp -> pg_decide returns PG_REJECT_NO_FRESHNESS -> that page is skipped (would_publish=NO) with the EXACT reason. [TEETH] T4 PUSH SAFETY: across the WHOLE run, apply_flag=0 -> NO page has pushed==1 (push_invoked never set). [TEETH] GREEN iff T1..T4 with EXACT verdicts/identities. exit 0 GREEN / 1 RED. Logs to knowledge/status/wiki_structure_regen_gate.log. Sovereign: nx_wiki_structure_regen (which composes A1 monitor + A2 guard + A4a versioned-publish + index_builder) + nx_syscalls. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_wiki_structure_regen.nx nx_syscalls.nx nx_wiki_structure_regen_gate.n

imports: nx_wiki_structure_regen.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 gp sys_write sys_mmap nx_wiki_doc_store_init sys_mmap ↻ add_page nx_wiki_doc_store_add sys_mmap ↻ nx_wib_pool_alloc slen mk_reg sys_mmap ↻ reg_eq mk_plan sys_mmap ↻ slen ↻ reg_decide nx_wiki_doc_store_count sys_mmap ↻ 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 reg_len nx_ims_orphans nx_wiki_doc_store_count ↻ sys_mmap ↻ nx_ims_inbound_counts nx_wiki_doc_store_count ↻ sys_mmap ↻ nx_wiki_doc_store_lookup ↻ nx_ims_collect_targets sys_mmap ↻ nx_wiki_forward_links

structs

none

consts

128const GATE_PREFIX: *u8 = "/tmp/nx_regen_gate_store-"

functions

26func gp(logfd: i64, s: *u8) -> i64
called by 3: gngrowmain calls 1: sys_write
33func gn(logfd: i64, v: i64) -> i64
called by 1: main calls 3: gpsys_mmapsys_write
47func grow(logfd: i64, name: *u8, ok: i64) -> i64
called by 1: main calls 1: gp
54func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: add_pagemain
57func add_page(st: *NxWikiDocStore, url: *u8, body: *u8) -> i64
called by 1: main calls 2: nx_wiki_doc_store_addslen
62func mk_reg(reg: *RegRegistry, slugs: *i64, emits: *i64, files: *i64, roots: *i64, n: i64) -> i64
called by 1: main calls 2: sys_mmapreg_eq
88func mk_plan(plan: *RegPlan, reg: *RegRegistry) -> i64
called by 1: main calls 1: sys_mmap
114func plan_row(plan: *RegPlan, slug: *u8) -> i64
called by 1: main calls 1: reg_eq
130func main() -> i64