nx_barfresh_gate.nx
buildroot/runtime/nx_barfresh_gate.nx
about
nx_barfresh_gate.nx -- GATE for the bar-age ruler (nx_barfresh_lib), driven IN-PROCESS on planted plan rows with the
current month HANDED IN, so every state is reached deterministically: a fresh bar, an older bar nobody looked for this
month (the hard fail), an older bar attested this month as the newest the listing has, an older bar a this-month scan
contradicts, an attestation from LAST month (does not count), an attestation for a DIFFERENT listing (does not count),
a plan with no bars (NO-BAR, not refused), malformed and future months, a year wrap, NUL-terminated lines as the ranker
hands them over, a mixed board whose partition must sum, a declaration made twice (a repeated bar id, a repeated
same-day scan) refused with its rule named while two scans on different days stay two attestations, the month-of-epoch derivation against the estate's own civil
date at a month boundary, and the two-tree plan read on /tmp trees. Every fixture asserts its own condition first.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_gatekit_lib.nxnx_barfresh_lib.nxnx_gate_verdict.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
| 15 | const G_ROOT: *u8 = "/tmp/nx_barfresh_gate" |
| 16 | const G_TREE_A: *u8 = "/tmp/nx_barfresh_gate/a/" |
| 17 | const G_TREE_B: *u8 = "/tmp/nx_barfresh_gate/b/" |
| 18 | const G_TREE_A_DIR: *u8 = "/tmp/nx_barfresh_gate/a" |
| 19 | const G_TREE_B_DIR: *u8 = "/tmp/nx_barfresh_gate/b" |
| 20 | const G_PLAN_B: *u8 = "/tmp/nx_barfresh_gate/b/probe.plan" |
| 21 | const G_DOM: *u8 = "probe" |
| 22 | const G_DOM_ABSENT: *u8 = "nowhere" |
| 23 | const G_I64: i64 = 8 |
| 24 | const G_MAX_BARS: i64 = 8 |
| 26 | const G_CUR_Y: i64 = 2026 |
| 27 | const G_CUR_M: i64 = 9 |
| 28 | const G_WRAP_Y: i64 = 2026 |
| 29 | const G_WRAP_M: i64 = 1 |
| 31 | const G_EPOCH_AUG31: i64 = 1788134400 |
| 32 | const G_EPOCH_SEP01: i64 = 1788220800 |
| 33 | const G_DAY_2026_09_06: i64 = 20702 |
| 34 | const G_Y_1970: i64 = 1970 |
| 36 | const G_FRESH: *u8 = "rung|X1|a rung|sym|d|Organ|1|-\nsotabar|B1|2026-09|aspect extraction|what september says|k1|note\n" |
| 37 | const G_UNATTESTED: *u8 = "rung|X1|a rung|sym|d|Organ|1|-\nsotabar|B1|2026-08|aspect extraction|what august says|k1|note\n" |
| 38 | const G_ATTESTED: *u8 = "rung|X1|a rung|sym|d|Organ|1|-\nsotabar|B1|2026-08|aspect extraction|what august says|k1|note\nbarscan|2026-09-06|k1|newest=2026-08|the listing was read, newest entry august\n" |
| 39 | const G_CONTRADICTED: *u8 = "sotabar|B1|2026-07|aspect extraction|what july says|k1|note\nbarscan|2026-09-06|k1|newest=2026-08|the listing has an august entry the bar ignores\n" |
| 40 | const G_OLD_SCAN: *u8 = "sotabar|B1|2026-08|aspect extraction|what august says|k1|note\nbarscan|2026-08-30|k1|newest=2026-08|a scan from last month\n" |
| 41 | const G_OTHER_REF: *u8 = "sotabar|B1|2026-08|aspect extraction|what august says|k1|note\nbarscan|2026-09-06|k2|newest=2026-08|a scan of a different listing\n" |
| 42 | const G_NOBAR: *u8 = "rung|X1|a rung|sym|d|Organ|1|-\nlog|1|X1|measure|no bars declared\n" |
| 43 | const G_MALFORMED: *u8 = "sotabar|B1|2026-13|subject|says|k1|thirteenth month\n" |
| 44 | const G_FUTURE: *u8 = "sotabar|B1|2026-10|subject|says|k1|a month that has not happened\n" |
| 45 | const G_WRAP: *u8 = "sotabar|B1|2025-12|subject|says|k1|note\nbarscan|2026-01-03|k1|newest=2025-12|december attested in january\n" |
| 46 | const G_MIXED: *u8 = "sotabar|B1|2026-09|subject|says|k1|fresh\nsotabar|B2|2026-08|subject|says|k2|nobody looked\n" |
| 47 | const G_MIXED_BARS: i64 = 2 |
| 50 | const G_DUPBAR: *u8 = "sotabar|B1|2026-09|subject|says|k1|declared once\nsotabar|B1|2026-09|subject|says again|k1|declared twice\n" |
| 51 | const G_DUPBAR_BARS: i64 = 2 |
| 52 | const G_DUPSCAN: *u8 = "sotabar|B1|2026-08|subject|says|k1|note\nbarscan|2026-09-06|k1|newest=2026-08|read once\nbarscan|2026-09-06|k1|newest=2026-08|the same read landed twice\n" |
| 53 | const G_DUPSCAN_SCANS: i64 = 2 |
| 54 | const G_TWO_SCANS: *u8 = "sotabar|B1|2026-08|subject|says|k1|note\nbarscan|2026-09-02|k1|newest=2026-08|read early in the month\nbarscan|2026-09-06|k1|newest=2026-08|read again on another day\n" |
| 55 | const G_RULE_BAR_DUP: *u8 = "BAR-DUPLICATE" |
| 56 | const G_RULE_SCAN_DUP: *u8 = "SCAN-DUPLICATE" |
| 57 | const G_RULE_NONE: *u8 = "NONE" |
functions
| 60 | func g_str_is(a: *u8, b: *u8) -> i64 |
| 68 | func g_copy(src: *u8) -> *u8 |
| 79 | func g_run(fx: *u8, cur: i64, c: *i64, st0: *i64, seen0: *i64) -> i64 |
| 91 | func main() -> i64 |