nx_imgattr_lib_gate.nx
buildroot/runtime/nx_imgattr_lib_gate.nx
about
nx_imgattr_lib_gate.nx -- the gate for nx_imgattr_lib. IN-PROCESS: it imports the lib and calls it
directly, so nx_gate_bite can mutate the subject and watch teeth die.
WHAT IT HAS TO PROVE:
- the WRITER can never emit an img whose attributes the data can escape from, however hostile the
caption is, and it REFUSES rather than emitting an img with no usable alt;
- the READER can say NO. A checker that passes everything passes every test, so every positive
tooth is paired with a control on markup that MUST fail;
- the reader sees something the incumbent ruler cannot. nx_page_verify's a11y check counts the
byte pattern - alt=- across the whole page; that rule is transcribed BY HAND below and asserted
to ACQUIT the exact markup our own site serves. So is a present/absent alt test. Only the
quote-break axis convicts it. That gap IS the defect, written as a test.
THE ORACLES ARE INDEPENDENT ON PURPOSE. A tooth that calls the same function on both sides cannot
fail, so nothing here asks ia_scan what the answer should have been: the expected values are
literals, and the two foreign grammars (nx_page_verify's alt counter and its src scan) are
transcribed here rather than imported.
license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_imgattr_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
| 23 | const IG_ARENA: i64 = 65536 |
| 24 | const IG_SMALL: i64 = 4096 |
| 28 | const IG_CAP_REAL: *u8 = "The card's own portrait -- the oracle we match against" as *u8 |
| 29 | const IG_SRC_REAL: *u8 = "/compare/koikatsu/native_kk396262.png" as *u8 |
| 30 | const IG_EXTRA: *u8 = "loading='lazy'" as *u8 |
| 31 | const IG_FILE_REAL: *u8 = "guides/kk_wubsy_mateditor_1.png" as *u8 |
| 32 | const IG_BLANK: *u8 = " " as *u8 |
| 34 | const IG_TRUNCATED_ALT: *u8 = "The card" as *u8 |
functions
| 37 | func ig_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 } called by 1: main |
| 38 | func ig_gt(a: i64, b: i64) -> i64 { if a > b { return 1 } return 0 } called by 1: main |
| 39 | func ig_and(a: i64, b: i64) -> i64 { if a == 1 { if b == 1 { return 1 } } return 0 } called by 1: main |
| 41 | func ig_cat(d: *u8, o: i64, s: *u8) -> i64 |
| 49 | func ig_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 59 | func ig_count(h: *u8, need: *u8) -> i64 |
| 78 | func ig_has(h: *u8, need: *u8) -> i64 { if ig_count(h, need) > 0 { return 1 } return 0 } |
| 84 | func ig_pv_a11y_alt(page: *u8) -> i64 { return ig_count(page, " alt=" as *u8) } |
| 85 | func ig_pv_a11y_img(page: *u8) -> i64 { return ig_count(page, "<img" as *u8) } |
| 90 | func ig_first_val(page: *u8, key: *u8, out: *u8, cap: i64) -> i64 |
| 126 | func ig_build_unescaped(d: *u8, src: *u8, capt: *u8) -> i64 |
| 141 | func ig_img_unreadable(markup: *u8) -> i64 |
| 151 | func main() -> i64 |