code wiki / (root) / nx_gen_mind_gate.nx

nx_gen_mind_gate.nx

buildroot/runtime/nx_gen_mind_gate.nx

6244 B101 linesdepth 6pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen_mind_gate.nx -- the REFEREE for companionchat CC0 (go_mind_context in nx_companion_mind.nx). DONE-RULE (pre-declared in companionchat.plan): the composed chat prompt provably contains em_recall hits, cm_ctx relationship lines and es_context typed state whenever those stores hold data for the session, proven against the REAL promoted organs (forked from the serving root); a neg-control with empty stores must compose NO fabricated memory or present lines. FIXTURE LAW: scratch lives under /tmp/<gate>/ (never a production plane) and the session key is unique PER RUN, so the gate is idempotent -- a memory planted by run N can never make run N+1's empty-session tooth vacuous. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_companion_mind.nx nx_gen_mind_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_companion_mind.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_mkdir sys_chdir sys_mmap ↻ gv_check gv_puts ↻ sys_mmap ↻ mg_session sys_now_us sys_mmap ↻ sys_clock_gettime_mono sys_mmap ↻ mg_write_session_file sys_openat_wr sys_write ↻ mg_len sys_close mind_session sys_mmap ↻ sys_read_file sys_openat_rd

structs

none

consts

13const MG_DIR: *u8 = "/tmp/nx_gen_mind_gate" as *u8
14const MG_MODE_DIR: i64 = 511
15const MG_MODE_FILE: i64 = 420
16const MG_CAP: i64 = 16384
17const MG_TOKEN: *u8 = "qux9zebra" as *u8
18const MG_PLANT: *u8 = "my cat is named qux9zebra and she is grey" as *u8
19const MG_ASK: *u8 = "what is my cat qux9zebra called again" as *u8
20const MG_HELLO: *u8 = "hello there" as *u8

functions

22func mg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
25func mg_session(out: *u8) -> i64
called by 1: main calls 2: sys_now_ussys_mmap
40func mg_write_session_file(session: *u8) -> i64
48func main() -> i64