nx_frontier_scan.nx
buildroot/runtime/nx_frontier_scan.nx
about
nx_frontier_scan.nx -- THE AUTONOMOUS FRONTIER-NOTICER for a /compare domain.
Operator 2026-08-20: "we want to be able to notice things like the metahuman gap without needing claude
by having our own research on /compare sota and best of breed and workflowed and mcp and api etc".
WHAT THE METAHUMAN GAP ACTUALLY WAS (mined from the transcripts, not assumed -- writer session
55724797-9f7b-4f68-81aa-fd2de7997175, 2026-08-18 18:15:25Z): the operator said the characters looked
wrong, a seat ran FIVE WebSearch calls, and appended four citations to charsim.refs whose URLs IT NEVER
OPENED (three carry mirror '-' pin '-'; the fourth points at a page fetched three days earlier from a
DIFFERENT url). The gap therefore had TWO halves and only ONE of them needed the outside:
(A) the INTERNAL deficit signal -- rivals coded Best on skin/hair rows where our symbol is _ABSENT_.
Already mechanical, already in our own data, and NOBODY HAD EVER COMPUTED IT.
(B) the OUTSIDE BAR -- the 2026 numbers. That genuinely needed the live web.
This organ computes (A) from the domain's own files and pulls (B) through the sovereign fetcher.
IT EMITS PROPOSALS AND NEVER ADMITS ONE. It does not write <domain>.matrix, <domain>.refs, or any watch
cell. The measured law it obeys: no margin threshold makes auto-declaration safe (nx_memsugg, precision
808->890 permil at 24 percent coverage), and A COMPLETION SIGNAL THAT KEYS ON A NAME REWARDS WRITING THE
NAME. The list is the answer; a seat adjudicates it.
SEEDS ARE DATA, NEVER HAND-TYPED. They come from the domain's own board:
<domain>.axes field 4 is literally "frontier-kw;frontier-kw" -- the estate ALREADY declares per-row
frontier keywords and nothing had ever consumed them.
<domain>.matrix field 1 (the row label) -- always, so a domain without .axes still has seeds.
SOURCES ARE DATA TOO: knowledge/frontier_sources.conf. Both endpoints shipped with it were PROVEN
reachable through nx_research_fetch before a line of this was written (arXiv API 200/12267 B, HN Algolia
200/17063 B) -- necessary because nx_websearch is OUR OWN CRAWL INDEX (0 results for "metahuman"), so
it structurally cannot see the outside.
VERBS
seeds <domain> -- what this domain is about, from its own data. No network.
deficit <domain> -- the internal signal, ranked, WITH THE REASON PER ROW. No network.
scan <domain> [maxrows] [maxitems] -- fetch + diff + print proposals. Network. Writes nothing.
propose <domain> [maxrows] [maxitems] -- scan, then file the worklist + the frontierprop- plane rows.
RESOURCE ENVELOPE (a shipping criterion, not an afterthought): outbound requests are exactly
rows_scanned x sources, both bounded by conf and echoed in every run line; buffers are sized FROM THE
INPUT (sys_read_file, matrix+refs bytes, source count) so there is no ceiling to guess; the only writes
are one worklist file and at most rows x sources x 2 plane upserts, keyed by url hash so a re-scan
UPSERTS rather than grows.
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_deploy_lib.nxnx_comparetree_lib.nxnx_barfresh_lib.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
| 63 | const FS_PIPE: i64 = 124 |
| 64 | const FS_NL: i64 = 10 |
| 65 | const FS_HASH: i64 = 35 |
| 66 | const FS_AT: i64 = 64 |
| 67 | const FS_SEMI: i64 = 59 |
| 68 | const FS_SPACE: i64 = 32 |
| 69 | const FS_PLUS: i64 = 43 |
| 70 | const FS_ZERO: i64 = 48 |
| 71 | const FS_NINE: i64 = 57 |
| 72 | const FS_UPA: i64 = 65 |
| 73 | const FS_UPZ: i64 = 90 |
| 74 | const FS_LOA: i64 = 97 |
| 75 | const FS_LOZ: i64 = 122 |
| 76 | const FS_USCORE: i64 = 95 |
| 77 | const FS_SLASH: i64 = 47 |
| 78 | const FS_COLON: i64 = 58 |
| 79 | const FS_LBRACE: i64 = 123 |
| 84 | const FS_SECTION_MAX: i64 = 16 |
| 85 | const FS_PATHCAP: i64 = 1024 |
| 86 | const FS_URLCAP: i64 = 2048 |
| 87 | const FS_TXTCAP: i64 = 4096 |
| 88 | const FS_MAXP: i64 = 12 |
| 89 | const FS_MAXROWS: i64 = 64 |
| 90 | const FS_RIVALS: i64 = 4 |
| 91 | const FS_CODE_BEST: i64 = 2 |
| 92 | const FS_CODE_YES: i64 = 1 |
| 93 | const FS_HASH_BASE: i64 = 131 |
| 94 | const FS_HASH_MASK: i64 = 0xffffffff |
| 95 | const FS_HEXDIG: i64 = 8 |
| 96 | const FS_HEXSHIFT: i64 = 4 |
| 97 | const FS_HEXRADIX: i64 = 16 |
| 98 | const FS_PERMIL: i64 = 1000 |
| 99 | const FS_DIRMODE: i64 = 0x1ed |
| 100 | const FS_PLANE_ARGS: i64 = 10 |
| 104 | const FS_LINECAP: i64 = 4 * 2048 + 1024 |
| 107 | const FS_PROPS_PER_ROW: i64 = 2 |
| 507 | const FS_CODE_PART: i64 = 3 |
| 768 | const FS_DASH: i64 = 45 |
| 769 | const FS_CR: i64 = 13 |
| 770 | const FS_MONTH_TAG: *u8 = "month=" |
| 771 | const FS_MONTH_TAG_LEN: i64 = 6 |
| 772 | const FS_DATED_PIPES: i64 = 10 // src|kind|url|item|topen|tclose|uopen|uclose|join|dopen|dclose |
| 773 | const FS_ATT_C_BARS: i64 = 0 |
| 774 | const FS_ATT_C_APPENDED: i64 = 1 |
| 775 | const FS_ATT_C_ALREADY: i64 = 2 |
| 776 | const FS_ATT_C_UNATTESTABLE: i64 = 3 |
| 777 | const FS_ATT_C_FETCHES: i64 = 4 |
| 778 | const FS_ATT_C_NEWER: i64 = 5 |
| 779 | const FS_ATT_C_STALE: i64 = 6 |
| 780 | const FS_ATT_C_N: i64 = 8 |
| 781 | const FS_YMBUF: i64 = 16 |
| 782 | const FS_TODAYBUF: i64 = 32 |
functions
| 109 | func fs_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 110 | func fs_w(s: *u8) -> i64 { sys_write(1, s, fs_slen(s)); return 0 } called by 6: fs_emit_seedsfs_deficitfs_scan_sourcefs_w_ymfs_attest_domainmain calls 2: sys_writefs_slen |
| 111 | func fs_wn(base: *u8, off: i64, len: i64) -> i64 |
| 116 | func fs_n(v: i64) -> i64 { nxi_fd(1, v); return 0 } |
| 117 | func fs_cat(dst: *u8, pos: i64, s: *u8) -> i64 called by 7: fs_cmp_pathfs_emit_seedsfs_scan_sourcefs_attest_rowfs_build_urlfs_attest_domain+1 calls 1: fs_slen |
| 124 | func fs_catn(dst: *u8, pos: i64, src: *u8, a: i64, b: i64) -> i64 |
| 130 | func fs_eol(buf: *u8, n: i64, i: i64) -> i64 |
| 136 | func fs_find(buf: *u8, n: i64, from: i64, lit: *u8) -> i64 called by 8: fs_item_endfs_fetchfs_scan_sourcefs_item_fieldfs_newest_monthfs_attest_row+2 calls 1: fs_slen |
| 154 | func fs_item_end(buf: *u8, n: i64, it: i64, idlm: *u8) -> i64 |
| 160 | func fs_fold(c: i64) -> i64 |
| 166 | func fs_streq(a: *u8, ao: i64, ae: i64, lit: *u8) -> i64 |
| 173 | func fs_prefix(a: *u8, ao: i64, ae: i64, lit: *u8) -> i64 |
| 180 | func fs_is_row(buf: *u8, i: i64, le: i64) -> i64 |
| 188 | func fs_pipes(buf: *u8, i: i64, le: i64, pos: *i64) -> i64 |
| 199 | func fs_digit_at(buf: *u8, a: i64, b: i64) -> i64 |
| 208 | func fs_atoi(s: *u8) -> i64 called by 1: main |
| 226 | func fs_conf_get(cb: *u8, cn: i64, key: *u8) -> i64 |
| 262 | func fs_tok_in(hay: *u8, hn: i64, tok: *u8, tl: i64) -> i64 |
| 281 | func fs_cover_permil(title: *u8, a: i64, b: i64, corp: *u8, cn: i64, min_token: i64, tok: *u8) -> i64 |
| 315 | func fs_seed_q(dst: *u8, src: *u8, a: i64, b: i64, cap: i64, maxtok: i64, min_token: i64, join: *u8) -> i64 |
| 358 | func fs_urlhash(buf: *u8, a: i64, b: i64) -> i64 called by 1: main |
| 364 | func fs_hex(dst: *u8, pos: i64, v: i64) -> i64 called by 1: main |
| 381 | func fs_has_slash(s: *u8) -> i64 |
| 386 | func fs_basename(s: *u8) -> i64 called by 1: main |
| 392 | func fs_cmp_path(dst: *u8, dom: *u8, ext: *u8) -> i64 |
| 405 | func fs_emit_seeds(dom: *u8) -> i64 called by 1: main calls 14: sys_mmapfs_cmp_pathsys_read_filefs_has_slashct_readall_2dirct_first_authored+8 |
| 508 | func fs_code_rank(c: i64) -> i64 called by 1: fs_deficit |
| 519 | func fs_deficit(mb: *u8, mn: i64, lead_code: i64, rowa: *i64, rowb: *i64, score: *i64, verbose: i64) -> i64 |
| 590 | func fs_fetch(url: *u8, tmpout: *u8, savepath: *u8, olen: *i64) -> i64 called by 2: fs_scan_sourcefs_attest_domain calls 5: sys_mmapdep_run_capturesys_read_filefs_findfs_catn |
| 625 | func fs_scan_source(dom: *u8, kind: *u8, url: *u8, idlm: *u8, topen: *u8, tclose: *u8, |
| 785 | func fs_ym_at(rb: *u8, a: i64, b: i64) -> i64 |
| 792 | func fs_fixed_month(spec: *u8) -> i64 |
| 797 | func fs_w_ym(b: *u8, ix: i64) -> i64 { bf_ym_write(b, 0, ix); fs_w(b); return 0 } |
| 798 | func fs_catn_num(dst: *u8, pos: i64, v: i64) -> i64 |
| 810 | func fs_today(dst: *u8) -> i64 |
| 826 | func fs_item_mentions(rb: *u8, it: i64, ie: i64, subj: *u8, so: i64, sn: i64, min_token: i64, tok: *u8) -> i64 |
| 843 | func fs_item_field(rb: *u8, it: i64, ie: i64, open: *u8, close: *u8, off: *i64) -> i64 |
| 857 | func fs_newest_month(rb: *u8, rn: i64, idlm: *u8, dopen: *u8, dclose: *u8, fixed: i64, max_items: i64, |
| 900 | func fs_attest_row(plan: *u8, refkey: *u8, today: *u8, ym: i64, note: *u8) -> i64 called by 2: fs_attest_domainmain calls 8: sys_mmapsys_read_filefs_catfs_findbf_ym_writesys_openat_append+2 |
| 929 | func fs_ref_url(refs: *u8, refsn: i64, key: *u8, klen: i64, off: *i64) -> i64 |
| 950 | func fs_src_fields(sb: *u8, spos: *i64, sle: i64, kind: *u8, idlm: *u8, topen: *u8, tclos: *u8, uopen: *u8, uclos: *u8, join: *u8, dopen: *u8, dclos: *u8) -> i64 |
| 963 | func fs_build_url(url: *u8, sb: *u8, a: i64, b: i64, qbuf: *u8) -> i64 |
| 975 | func fs_attest_domain(dom: *u8, dbase: *u8, sb: *u8, sn: i64, today: *u8, max_items: i64, min_token: i64, seed_tokens: i64, tot: *i64) -> i64 |
| 1174 | func main(argc: i64, argv: *i64) -> i64 |