code wiki / _hdl_build / nx_chartlay_adoption_gate.nx

nx_chartlay_adoption_gate.nx

buildroot/runtime/_hdl_build/nx_chartlay_adoption_gate.nx

27220 B505 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_chartlay_adoption_gate.nx -- datavis DV9 (2026-09-15): THE FLEET RATCHET for the one chart-layout ruler. Names every SVG-emitting function in the compare generators (the sources are DATA in cl_adoption.conf) and refuses a chart that scales, places or colours by hand. An emitter is an ADOPTER when it, or its prefix family (the helpers sharing its name up to the first underscore -- the estate's one-figure-one-prefix convention), calls a ruler verb (the verbs are DATA too); HAND when none does; HAND-COLOUR when the family paints an SVG fill or stroke with a literal rgb() instead of a token. A decorative icon (aria-hidden on the tag) is counted, never judged; an SVG named only in a comment is nothing. Named allow rows exempt one function WITH a reason and can only shrink: an allow row whose function is no longer an offender is STALE and reads RED until deleted, so the ratchet tightens by construction. Planted fixtures prove every class both ways before the live census runs, and the census prints one line per emitter -- a count without a worklist is not actionable. The imprecision lived with: attribute literals are matched in their single-quoted spelling only (the family's emitters use no other), and nx_lineconf_lib is not composed because it is a first-key reader while this file is a ROW LIST with repeated keys. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_chartlay_adoption_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

structs

none

consts

16const CA_CONF: *u8 = "knowledge/compare/cl_adoption.conf"
17const CA_CONF_BR: *u8 = "buildroot/knowledge/compare/cl_adoption.conf"
18const CA_BR_PFX: *u8 = "buildroot/"
19const CA_DIR: *u8 = "/tmp/nx_chartlay_adoption_gate/"
20const CA_FX_CONF: *u8 = "/tmp/nx_chartlay_adoption_gate/fixture.conf"
21const CA_FX_CONF_ALLOW: *u8 = "/tmp/nx_chartlay_adoption_gate/fixture_allow.conf"
22const CA_FX_CONF_STALE: *u8 = "/tmp/nx_chartlay_adoption_gate/fixture_stale.conf"
23const CA_FX_A: *u8 = "/tmp/nx_chartlay_adoption_gate/adopter.nx"
24const CA_FX_H: *u8 = "/tmp/nx_chartlay_adoption_gate/hand.nx"
25const CA_FX_C: *u8 = "/tmp/nx_chartlay_adoption_gate/colour.nx"
26const CA_FX_I: *u8 = "/tmp/nx_chartlay_adoption_gate/icon.nx"
27const CA_DIR_MODE: i64 = 493
28const CA_FILE_MODE: i64 = 420
29const CA_MAX_FUNCS: i64 = 4096
30const CA_MAX_ROWS: i64 = 256
31const CA_NAME_W: i64 = 96
32const CA_PATH_W: i64 = 256
33const CA_REASON_W: i64 = 320
34const CA_MAX_EMIT: i64 = 512
35const CA_TAG_SPAN: i64 = 400
36const CA_NUM_W: i64 = 24
37const CA_I64: i64 = 8
38const CA_CH_NL: i64 = 10
39const CA_CH_QUOTE: i64 = 34
40const CA_CH_SLASH: i64 = 47
41const CA_CH_BSLASH: i64 = 92
42const CA_CH_PIPE: i64 = 124
43const CA_CH_USCORE: i64 = 95
44const CA_CH_LPAREN: i64 = 40
45const CA_CH_GT: i64 = 62
46const CA_CH_D0: i64 = 48
47const CA_CH_MINUS: i64 = 45
49const CA_NONE: i64 = -1
50const CA_ADOPTER: i64 = 1
51const CA_HAND: i64 = 2
52const CA_HAND_COLOUR: i64 = 3
54const CA_S_SOURCES: i64 = 0
55const CA_S_UNREADABLE: i64 = 1
56const CA_S_FUNCS: i64 = 2
57const CA_S_EMITTERS: i64 = 3
58const CA_S_ADOPTERS: i64 = 4
59const CA_S_HAND: i64 = 5
60const CA_S_HAND_COLOUR: i64 = 6
61const CA_S_ICONS: i64 = 7
62const CA_S_ALLOWED: i64 = 8
63const CA_S_STALE_ALLOW: i64 = 9
64const CA_S_OFFENDERS: i64 = 10
65const CA_S_RULERS: i64 = 11
66const CA_S_EMIT_TRUNC: i64 = 12
67const CA_S_W: i64 = 13

functions

69func ca_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
70func ca_put(fd: i64, s: *u8) -> i64 { sys_write(fd, s, ca_len(s)); return 0 }
71func ca_putn(fd: i64, v: i64) -> i64
called by 1: cl_adoption_gate calls 2: sys_mmapsys_write
83func ca_q(fd: i64) -> i64 { let b: *u8 = sys_mmap(2); b[0] = CA_CH_QUOTE as u8; sys_write(fd, b, 1); return 0 }
called by 1: ca_fx_adopter calls 2: sys_mmapsys_write
85func ca_find(buf: *u8, n: i64, needle: *u8) -> i64
97func ca_starts(buf: *u8, n: i64, needle: *u8) -> i64
called by 2: ca_rowcl_adoption_gate calls 1: ca_len
104func ca_eq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] == b[i] { if a[i] == (0 as u8) { return 1 } i = i + 1 } return 0 }
106func ca_copy(dst: *u8, cap: i64, s: *u8, n: i64) -> i64
114func ca_cat(dst: *u8, cap: i64, a: *u8, b: *u8) -> i64
called by 1: ca_read_source calls 1: ca_len
126func ca_write(path: *u8, s: *u8) -> i64 { sys_unlinkat(path); let fd: i64 = sys_openat_wr(path, CA_FILE_MODE); if fd < 0 { return -1 } sys_write(fd, s, ca_len(s)); sys_close(fd); return 0 }
127func ca_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
131func ca_strip(src: *u8, n: i64, dst: *u8) -> i64
called by 1: cl_adoption_gate
155func ca_row(buf: *u8, n: i64, key: *u8, k: i64) -> i64
called by 1: cl_adoption_gate calls 2: ca_lenca_starts
175func ca_field(buf: *u8, n: i64, ls: i64, idx: i64, out: *u8, cap: i64) -> i64
called by 1: cl_adoption_gate calls 1: ca_copy
193func ca_read_source(path: *u8, out_n: *i64, scratch: *u8) -> *u8
201func ca_tag_is_icon(buf: *u8, n: i64, p: i64) -> i64
called by 1: cl_adoption_gate calls 1: ca_find
210func ca_verdict_of(em_names: *u8, em_verd: *i64, em_n: i64, name: *u8) -> i64
calls 1: ca_eq
215func ca_verdict_word(v: i64) -> *u8
called by 1: cl_adoption_gate
224func cl_adoption_gate(conf: *u8, st: *i64, em_names: *u8, em_verd: *i64) -> i64
394func ca_fx_adopter() -> i64
405func ca_fx_hand() -> i64
416func ca_fx_colour() -> i64
426func ca_fx_icon() -> i64
436func ca_fx_conf(path: *u8, allow_row: *u8) -> i64
446func main() -> i64