code wiki / _hdl_build / nx_data_source_ladder.nx
nx_data_source_ladder.nx
buildroot/runtime/_hdl_build/nx_data_source_ladder.nx
about
nx_data_source_ladder.nx -- MANHEIM-BUILD (ingestion): reads the vehicle-data source registry and emits
the INGESTION ORDER cheapest-first (operator: "ingest first public, then private, then expensive as the
last mile"). Sovereign (nx_cc->nxasm, no gcc), deterministic. Author-by-organ: the team COMPUTES the
order from the registry DATA -- adding a source = a registry row, zero rebuild.
reads knowledge/registry/vehicle_data_sources.tsv (cost_tier<TAB>source<TAB>...; # comments skipped)
emits sources ordered by cost_tier ascending (0=public -> 1=private -> 2=paid) and the FREE-BACKBONE
coverage = tier0 / total (how far public-first gets us before we pay).
GATE (self-validating): the emitted order is COST-MONOTONE non-decreasing (the cheapest-first guarantee),
tier0>0 (public-first is actually viable), the tier counts sum to the parsed total; and a NEG-CONTROL
hand-built out-of-order sequence MUST be flagged not-monotone (proves the monotone check has teeth, not
vacuous). A broken rule -> verdict=RED. Evidence -> knowledge/status/data_source_ladder.log.
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 16 | const DSL_MAGIC_65536: i64 = 65536 |
| 17 | const DSL_MAGIC_65535: i64 = 65535 |
| 19 | const DSL_SRC: *u8 = "knowledge/registry/vehicle_data_sources.tsv" |
| 20 | const DSL_LOG: *u8 = "knowledge/status/data_source_ladder.log" |
| 21 | const DSL_MAXR: i64 = 256 |
functions
| 23 | func dsl_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 24 | func dsl_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 } |
| 25 | func dsl_wr(fd: i64, buf: *u8, a: i64, b: i64) -> i64 { var i: i64 = a; while i < b { sys_write(fd, (((buf as i64)+i) as *u8), 1); i = i + 1 } return 0 } |
| 27 | func dsl_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 36 | func dsl_eol(buf: *u8, n: i64, i: i64) -> i64 { var j: i64 = i; while j < n { if buf[j] == (10 as u8) { return j } j = j + 1 } return n } called by 1: main |
| 39 | func dsl_monotone(tiers: *i64, n: i64) -> i64 called by 1: main |
| 45 | func main() -> i64 |