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
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
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
structs
| none |
consts
| 128 | const GATE_PREFIX: *u8 = "/tmp/nx_regen_gate_store-" |
functions
| 26 | func gp(logfd: i64, s: *u8) -> i64 |
| 33 | func gn(logfd: i64, v: i64) -> i64 |
| 47 | func grow(logfd: i64, name: *u8, ok: i64) -> i64 |
| 54 | func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 57 | func add_page(st: *NxWikiDocStore, url: *u8, body: *u8) -> i64 |
| 62 | func mk_reg(reg: *RegRegistry, slugs: *i64, emits: *i64, files: *i64, roots: *i64, n: i64) -> i64 |
| 88 | func mk_plan(plan: *RegPlan, reg: *RegRegistry) -> i64 |
| 114 | func plan_row(plan: *RegPlan, slug: *u8) -> i64 |
| 130 | func main() -> i64 |