code wiki / (root) / nx_field_beat.nx

nx_field_beat.nx

buildroot/runtime/nx_field_beat.nx

9806 B162 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic field
docsdependenciesstructsconstsfunctions

about

nx_field_beat.nx -- THE OFF-PEAK FIELD BEAT (/compare/fieldwatch FW4, 2026-09-05): re-runs nx_field_discover for every domain on regen.list that carries a .seeds file, so the discovered field is LIVING -- re-read on a beat, never authored once. "Not during peak times" (operator, 2026-09-05) is MEASURED, not guessed: the clock row `fieldbeat` is listed in knowledge/status/clock_heavy.conf, so nx_clock_tickless defers it through clk_storm_defer while nx_ioadmit_lib reports zero spawn budget (the same D-state line /api/build refuses on); a wall-clock window would be a magic number that dispatches into a storm at 03:00 and idles a quiet afternoon. Stamp: knowledge/status/fieldbeat.stamp, truncate-written LAST (ts= domains= ran= ok= failed= skipped_no_seeds= sum= candidates_total= drifted_total= capped= verdict=GREEN|RED|EMPTY); a non-default list stamps <list>.stamp so a trial run can never forge the production heartbeat. Journal: knowledge/status/fieldbeat.jrnl, one row per domain per run (append). The decisions live in nx_field_beat_lib (gated in-process); the first production stamp is the wire's witness. fw_beat is the FW4 watch symbol: it IS the loop, not a name written to flip a cell. fw_refetch_drift is the FW5 watch symbol: the discover organ re-fetches every seed on every run and reports drifted= (a mirror whose bytes changed since the previous fetch); this beat sums it into drifted_total= -- a COUNT, never an alarm, because a dynamic page carrying a per-request nonce drifts every beat; the alarm is the .field diff FW9 raises when a rival appears or vanishes. Usage: nx_field_beat [list-path] default buildroot/knowledge/compare/regen.list Exits: 0 every domain with seeds ran OK | 1 at least one domain FAILED (stamp written, verdict=RED) | 2 usage | 3 refused: list unreadable or names no domain (NO stamp), or no domain carried seeds (stamp verdict=EMPTY) license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_field_beat_lib.nx nx_field_beat.nx

imports: nx_syscalls.nxnx_tool_run.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 fbp_err fb_puts sys_write fb_slen sys_chdir 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 ↻ fbp_out fb_puts ↻ sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close fb_list_domains fb_domain_at sys_clock_gettime_real sys_openat_append fw_beat sys_mmap ↻ fb_domain_at ↻ fb_cat fbp_exists

structs

none

consts

23const FB_ROOT: *u8 = "/volume1/homes/elderwesto/nishihost/"
24const FB_DISCOVER: *u8 = "/volume1/homes/elderwesto/nishihost/nx_field_discover.elf"
25const FB_LIST_DEFAULT: *u8 = "buildroot/knowledge/compare/regen.list"
26const FB_SEEDS_DIR: *u8 = "buildroot/knowledge/compare/"
27const FB_SEEDS_EXT: *u8 = ".seeds"
28const FB_JRNL: *u8 = "knowledge/status/fieldbeat.jrnl"
29const FB_PATH_CAP: i64 = 1024
30const FB_CAPCAP: i64 = 262144 // one discover receipt: FIELD-SEED lines for up to FD_MAX_SEEDS=62 seeds plus the FIELD-OK line, 256 KiB is 40x the measured 43-seed run
31const FB_ARGVN: i64 = 4
32const FB_DOMAIN_TIMEOUT_MS: i64 = 1800000 // one domain's discovery: at most FD_MAX_SEEDS=62 fetches through the sovereign fetcher, whose own per-fetch deadline bounds each; a domain past 30 minutes is counted FAILED and announced, never waited on forever
33const FB_T_OK: i64 = 0 // slots of the totals vector fw_beat fills
34const FB_T_FAILED: i64 = 1
35const FB_T_SKIPPED: i64 = 2
36const FB_T_CANDS: i64 = 3
37const FB_T_DRIFT: i64 = 4 // FW5: seed mirrors that changed since the previous fetch, summed over the domains that ran
38const FB_T_N: i64 = 5
39const FB_EXIT_RED: i64 = 1
40const FB_EXIT_USAGE: i64 = 2
41const FB_EXIT_REFUSE: i64 = 3
42const FB_OUTFD: i64 = 1
43const FB_ERRFD: i64 = 2

functions

45func fbp_out(s: *u8) -> i64 { fb_puts(FB_OUTFD, s); return 0 }
called by 2: fw_beatmain calls 1: fb_puts
46func fbp_err(s: *u8) -> i64 { fb_puts(FB_ERRFD, s); return 0 }
called by 1: main calls 1: fb_puts
47func fbp_exists(path: *u8) -> i64
called by 1: fw_beat calls 2: sys_mmapsys_read_file
56func fw_refetch_drift(cap: *u8, n: i64) -> i64 { return fb_receipt_int(cap, n, "drifted" as *u8) }
called by 1: fw_beat calls 1: fb_receipt_int
60func fw_beat(names: *u8, n: i64, ts: i64, jfd: i64, tot: *i64) -> i64
110func main(argc: i64, argv: *i64) -> i64