nx_lorebook_gate.nx
buildroot/runtime/nx_lorebook_gate.nx
about
nx_lorebook_gate.nx -- the REFEREE for companionchat CC3 (em_lorebook in nx_lorebook.nx): a keyed entry is injected only when
the turn touches one of its triggers; the match is ASCII case-insensitive; an entry fires once per turn; a turn touching
nothing writes zero bytes; a malformed row is counted and never fires; and an over-budget turn REFUSES LOUDLY with the
numbers, injecting no partial entry. GPU-free, in-process, fixture confs under /tmp/<gate>/ written at run time.
license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_lorebook.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
| 10 | const LG_DIR: *u8 = "/tmp/nx_lorebook_gate" as *u8 |
| 11 | const LG_CONF: *u8 = "/tmp/nx_lorebook_gate/lore.conf" as *u8 |
| 12 | const LG_CONF_TIGHT: *u8 = "/tmp/nx_lorebook_gate/lore_tight.conf" as *u8 |
| 13 | const LG_CONF_NOBUDGET: *u8 = "/tmp/nx_lorebook_gate/lore_nobudget.conf" as *u8 |
| 14 | const LG_CONF_ABSENT: *u8 = "/tmp/nx_lorebook_gate/does_not_exist.conf" as *u8 |
| 15 | const LG_MODE_DIR: i64 = 511 |
| 16 | const LG_MODE_FILE: i64 = 420 |
| 17 | const LG_OUT_CAP: i64 = 8192 |
| 18 | const LG_STATS_CAP: i64 = 64 |
| 19 | const LG_ROWS: *u8 = "# fixture lorebook\n@budget 600\nbeach|beach, shore|The cove west of the house has black sand and a tide pool she loves.\ncafe|cafe,coffee|Marisol's cafe on the corner does the cardamom latte she orders.\nbroken|only two fields\n" as *u8 |
| 20 | const LG_ROWS_TIGHT: *u8 = "@budget 40\nbeach|beach|The cove west of the house has black sand and a tide pool she loves.\n" as *u8 |
| 21 | const LG_ROWS_NOBUDGET: *u8 = "beach|beach|The cove west of the house has black sand and a tide pool she loves.\n" as *u8 |
| 22 | const LG_BEACH_TELL: *u8 = "black sand" as *u8 |
| 23 | const LG_CAFE_TELL: *u8 = "cardamom" as *u8 |
| 24 | const LG_REFUSED_TELL: *u8 = "[WORLD refused" as *u8 |
| 25 | const LG_HEAD_TELL: *u8 = "[WORLD --" as *u8 |
| 26 | const LG_TIGHT_BUDGET_TEXT: *u8 = " budget of 40 " as *u8 |
functions
| 28 | func lg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 29 | func lg_find(buf: *u8, n: i64, needle: *u8) -> i64 |
| 43 | func lg_write(path: *u8, body: *u8) -> i64 |
| 51 | func lg_run(conf: *u8, turn: *u8, out: *u8, stats: *i64) -> i64 |
| 55 | func main() -> i64 |