code wiki / (root) / nx_search_emerge.nx

nx_search_emerge.nx

buildroot/runtime/nx_search_emerge.nx

6035 B93 linesdepth 22pulls 148 transitivereach 1 importersview sourcekind tooltopic search
docsdependenciesstructsconstsfunctions

about

nx_search_emerge.nx -- EMERGENCE DETECTION: turn the federated frontier feed into a "where is this field moving" signal. Fetches arXiv (sorted newest-first) over sovereign TLS (reuses nx_search_extern's fetch), extracts the <published> year-months, and computes the RECENCY-VELOCITY (share of sampled hits from the newest month) + TOTAL VOLUME (opensearch:totalResults). High velocity = activity concentrated NOW (emergent 'photonic/quantum'); low + huge volume = mature ('lightbulb'). HONEST: one snapshot = velocity; TRUE emergence = this signal DRIFTING UP over the daily runs (nx_cap_census check tracks that). license_tier: ORIGINAL

dependencies 4 imports · 1 importers

nx_search_extern.nx nx_syscalls.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_search_emerge.nx nx_frontier_watch.nx

imports: nx_search_extern.nxnx_syscalls.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nx

imported by: nx_frontier_watch.nx

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

main ep sys_write nx_trust_store_load_from_c sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_tag asn1_read_length asn1_read_length ↻ x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻ x509_read_alg_id

structs

none

consts

11const EM_MAGIC_4194304: i64 = 4194304
12const EM_MAGIC_1024: i64 = 1024
14const EM_HOT: i64 = 600 // >=600 permille of sampled hits from the newest month = hot production
15const EM_WARM: i64 = 250

functions

17func ep(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
18func en(v: i64) -> i64 { if v==0 { sys_write(1,"0" as *u8,1); return 0 } var m: i64=v; if m<0 { sys_write(1,"-" as *u8,1); m=0-m } let t: *u8=sys_mmap(28); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } while k>0 { k=k-1; sys_write(1,(((t as i64)+k) as *u8),1) } return 0 }
20func em_digit(c: i64) -> i64 { if c>=48 { if c<=57 { return 1 } } return 0 }
called by 1: em_int_after
22func em_ym7(buf: *u8, pos: i64, out: *u8) -> i64 { var i: i64=0; while i<7 { out[i]=buf[pos+i]; i=i+1 } out[7]=0 as u8; return 0 }
called by 1: em_collect_yms
24func em_ymcmp(a: *u8, b: *u8) -> i64 { var i: i64=0; while i<7 { let ca: i64=a[i] as i64; let cb: i64=b[i] as i64; if ca<cb { return 0-1 } if ca>cb { return 1 } i=i+1 } return 0 }
called by 2: em_maxymem_count_eq
26func em_collect_yms(buf: *u8, n: i64, openm: *u8, flat: *u8, maxd: i64) -> i64
calls 1: em_ym7
39func em_maxym(flat: *u8, nd: i64, out: *u8) -> i64
calls 1: em_ymcmp
45func em_count_eq(flat: *u8, nd: i64, ref: *u8) -> i64 { var c: i64=0; var k: i64=0; while k<nd { let p: *u8=((flat as i64)+k*8) as *u8; if em_ymcmp(p,ref)==0 { c=c+1 } k=k+1 } return c }
calls 1: em_ymcmp
46func em_find_after(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: em_int_after
54func em_int_after(buf: *u8, n: i64, key: *u8) -> i64
64func em_label(share: i64) -> *u8
70func main(argc: i64, argv: *i64) -> i64