code wiki / (root) / nx_asset_signals_gate.nx

nx_asset_signals_gate.nx

buildroot/runtime/nx_asset_signals_gate.nx

22171 B412 linesdepth 11pulls 27 transitivereach 0 importersview sourcekind gate/prooftopic asset
docsdependenciesstructsconstsfunctions

about

nx_asset_signals_gate.nx -- KAT + TEETH for nx_asset_signals (R4 "what we need to do" pillar). Builds a FIXTURE catalog with KNOWN issues and proves the EXACT task signals are derived, that a fully-clean record yields ZERO signals (TEETH: no false positives), and that the derived signals can be EMITTED to a DEDICATED namespace and READ BACK (emission is verifiable end-to-end): record1 image, width+height present, has relations, is_current=1, HAS a phash, NO credential, tags EMPTY -> EXPECT exactly { MISSING_PROVENANCE, UNTAGGED } record2 image, width/height ABSENT, tagged, valid credential, has relations, is_current=1 -> EXPECT exactly { MISSING_METADATA } record3 image, full metadata, tagged, valid credential, has relations, is_current=1, phash = P record4 image, full metadata, tagged, valid credential, has relations, is_current=1, phash = P (record3 & record4 share an IDENTICAL perceptual fingerprint = a near-dup pair) -> EXPECT exactly { NEAR_DUP } for EACH of record3, record4 record5 image, full metadata, tagged, valid credential, has relations, is_current=1, UNIQUE phash -> EXPECT ZERO signals (the TEETH: a clean record triggers nothing) Assertions: (a) every EXPECTED (cid, code) signal is present in as_scan's output (b) NO UNEXPECTED signal exists (exact-set: total derived count == expected count) (c) record5 contributes ZERO signals (clean-record teeth, checked explicitly by cid) (d) as_emit writes them into the DEDICATED asset-signals namespace and as_list reads them ALL back, and as_get on one key returns its TAB record with the right signal_code+cid fields (verifiable) (e) ISOLATION: the production board store (knowledge/store/ws-) is NEVER touched (the gate uses a fresh /tmp catalog AND the dedicated namespace prefix is a different store by construction). Verdict appended to knowledge/status/asset_signals_gate.log (additive law #13). expect_exit: 0 license_tier: ORIGINAL

dependencies 10 imports · 0 importers

nx_syscalls.nx nx_canon_cid.nx nx_seg_store.nx nx_ed25519_signature.nx nx_asset_record.nx nx_asset_catalog.nx nx_asset_provenance.nx nx_asset_autotag.nx nx_asset_signals.nx nx_gate_verdict.nx nx_asset_signals_gate.nx

imports: nx_syscalls.nxnx_canon_cid.nxnx_seg_store.nxnx_ed25519_signature.nxnx_asset_record.nxnx_asset_catalog.nxnx_asset_provenance.nxnx_asset_autotag.nxnx_asset_signals.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main sys_openat_append g_puts sys_write sys_mmap mk_prefix sys_now_ms sys_mmap ↻ sys_clock_gettime_mono sys_mmap ↻ AS_PREFIX sset E mk_rec sys_mmap ↻ ar_fields sys_mmap ↻ ar_addf ar_present ar_encode canon_encode sys_mmap ↻ cc_cmp cc_w32 cc_len sys_munmap cat_ingest sys_mmap ↻ cat_ingest_cid ar_cid cid_of sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sha256_update sha256_final cid_from_digest sys_munmap ↻ ss_open

structs

none

consts

none

functions

41func g_puts(logfd: i64, s: *u8) -> i64
called by 2: g_putnmain calls 1: sys_write
48func g_putn(logfd: i64, v: i64) -> i64
called by 1: main calls 3: sys_mmapg_putssys_write
62func g_streq(a: *u8, b: *u8) -> i64
72func E() -> *u8 { return "\x00" as *u8 }
called by 1: main
73func sset(a: *i64, i: i64, s: *u8) -> i64 { a[i] = s as i64; return 0 }
called by 1: main
76func g_cat(dst: *u8, off: i64, src: *u8) -> i64
called by 1: main
84func mk_rec(core: *i64, prov: *i64, media: *i64, org: *i64, out: *u8) -> i64
called by 1: main calls 3: sys_mmapar_fieldsar_encode
92func mk_prefix(prefix: *u8, base: *u8, salt: i64) -> i64
called by 1: main calls 2: sys_now_mssys_mmap
108func sig_has(out_signals: *i64, cap: i64, count: i64, cid: *u8, code: *u8) -> i64
called by 1: main calls 3: g_streqas_sig_cidas_sig_code
119func sig_count_for(out_signals: *i64, cap: i64, count: i64, cid: *u8) -> i64
called by 1: main calls 2: g_streqas_sig_cid
131func fill_gray(buf: *u8, w: i64, h: i64, seed: i64) -> i64
called by 1: main
144func main() -> i64