code wiki / (root) / nx_field_beat_gate.nx

nx_field_beat_gate.nx

buildroot/runtime/nx_field_beat_gate.nx

9834 B156 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic field
docsdependenciesstructsconstsfunctions

about

nx_field_beat_gate.nx -- THE GATE FOR THE FIELD BEAT'S DECISIONS (nx_field_beat_lib, /compare/fieldwatch FW4). Drives the decision core IN-PROCESS on fixtures assembled at RUNTIME under /tmp/nx_field_beat_gate/ (no fork of the discover organ, no production stamp, no journal row). What it must catch: a list reader that counts comment or blank lines as domains or keeps a CR inside a name; a receipt reader that takes a seed line's candidates= for the run's, or reads an absent field as zero; a classifier that calls a clean exit with no receipt OK; a stamp path that lets a trial run write the production heartbeat; a stamp whose partition does not sum; a verdict that reads GREEN over zero runs. The fork of nx_field_discover is deliberately not exercised here (that would share the production artifact with a beat); the first production stamp with domains= and sum= is the wire's witness. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_field_beat_lib.nx nx_field_beat_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_field_beat_lib.nx

imported by: nobody (leaf or entry point)

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

main 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 ↻ gv_head gv_puts sys_write ↻ sys_mkdir g_fix g_slen sys_mmap ↻ sys_mmap ↻ fb_list_domains fb_domain_at g_slen ↻ gv_check_eq gv_check gv_puts ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap fb_streq fb_domain_at ↻ gv_check ↻ fb_receipt_ok

structs

none

consts

15const G_DIR: *u8 = "/tmp/nx_field_beat_gate"
16const G_STAMP: *u8 = "/tmp/nx_field_beat_gate/fixture.stamp"
17const G_STAMP_RED: *u8 = "/tmp/nx_field_beat_gate/fixture_red.stamp"
18const G_MODEDIR: i64 = 493
19const G_CAP: i64 = 65536
20const G_PATH: i64 = 1024
22const G_LIST: *u8 = "@ comment line\nmodding~\n fieldwatch \n\nsearch\n@ tail\n"
23const G_COMMENTS: *u8 = "@ a\n@ b\n\n"
24const G_RECEIPT: *u8 = "[nx_field_discover] CWD anchored\nFIELD-SEED key=nexus kind=named url=https://a/ candidates=5\nFIELD-OK dom=modding seeds=43 scanned=40 fetched=2 reused=38 failed=3 sum=43 named=31 candidates=736 mentions=1200 capped=0 bytes=9999 out=/x\n"
25const G_NO_OK: *u8 = "FIELD-SEED key=nexus kind=named url=https://a/ candidates=5\nFIELD-REFUSE no seeds file\n"
26const G_CH_AT: i64 = 64
27const G_CH_TILDE: i64 = 126
28const G_CH_HASH: i64 = 35
29const G_CH_CR: i64 = 13
30const G_TS: i64 = 1788648000
31const G_LISTPATH: *u8 = "/tmp/nx_field_beat_gate/list.txt"
32const G_OVER: i64 = 3 // rows past FB_MAX_DOMAINS in the capped fixture

functions

34func g_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main calls 2: g_slensys_mmap
35func g_fix(src: *u8) -> *u8
49func g_read(path: *u8, lenout: *i64) -> *u8
57func main(argc: i64, argv: *i64) -> i64