code wiki / (root) / nx_grab_ext_emit_gate.nx

nx_grab_ext_emit_gate.nx

buildroot/runtime/nx_grab_ext_emit_gate.nx

13607 B266 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_grab_ext_emit_gate.nx -- REFEREE for nx_grab_ext_emit (/compare/mediaingest R10 ge_emit). IN-PROCESS AND NETWORK-FREE. It imports the emitter and calls its pure functions against a PLANTED conf image held in memory, so nothing is written to disk, no browser is involved, and the production knowledge/grab_ext.conf is never read or touched by this gate. THE LOAD-BEARING TOOTH IS THE MV2/MV3 STRUCTURAL SPLIT. The whole reason both twins are emitted from one conf is that they must differ in STRUCTURE and never in POLICY: MV2: background.scripts, browser_action, and <all_urls> INSIDE permissions MV3: background.service_worker, action, and <all_urls> moved OUT to host_permissions A wrong split is the defect that ships a Chrome extension the store rejects, or a Firefox one whose host access silently does nothing. Testing that both manifests merely "contain the name" would pass on a broken split, so the teeth below check the permissions array CONTENTS on each side, in both directions -- present where it belongs and ABSENT where it does not. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_grab_ext_emit.nx nx_gate_verdict.nx nx_grab_ext_emit_gate.nx

imports: nx_syscalls.nxnx_grab_ext_emit.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

structs

none

consts

20const T_CAP: i64 = 262144
21const T_SMALL: i64 = 4096
25const T_CONF: *u8 = "# comment|not_a_row\nname|Test Grab\nversion|9.9\ndescription|planted\ngecko_id|t@nishi.local\nedge|https://edge.invalid\ncapture_path|/api/vault/capture\nmagnet_path|/t/m\nvideo_path|/t/v\nsession_header|X-Nishi-Session\nsession_key|nsess\nmedia_ext|m3u8\nmedia_ext|mp4\nmedia_ext|webm\nperm|webRequest\nperm|storage\nhost_perm|<all_urls>\n# trailing comment\n"
28const T_CONF_HTTP: *u8 = "name|X\nversion|1\ndescription|d\ngecko_id|g\nedge|http://edge.invalid\ncapture_path|/c\nsession_header|H\nsession_key|k\nmedia_ext|mp4\nperm|storage\nhost_perm|<all_urls>\n"
34const T_CONF_NOPERM: *u8 = "name|Y\nversion|1\ndescription|d\ngecko_id|g\nedge|https://e.invalid\ncapture_path|/c\nsession_header|H\nsession_key|k\nmedia_ext|mp4\nhost_perm|<all_urls>\n"

functions

36func t_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
38func t_find(buf: *u8, n: i64, lit: *u8, from: i64) -> i64
52func t_has(buf: *u8, n: i64, lit: *u8) -> i64 { if t_find(buf, n, lit, 0) >= 0 { return 1 } return 0 }
56func t_array_of(buf: *u8, n: i64, key: *u8, off_out: *i64) -> i64
86func main() -> i64