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)

structs

none

consts

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

functions

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