code wiki / (root) / nx_lora_screen.nx

nx_lora_screen.nx source

↩ module page · 24 lines · 1441 B

1// nx_lora_screen.nx -- G16: contamination/integrity screen on an acquired LoRA or checkpoint file, BEFORE it may 2// enter elara_loras.txt or the served model path (/compare/gen watch G16, symbol lc_screen). 3// THIN MAIN over nx_lora_screen_lib.nx -- all judgement lives in the lib so nx_lora_screen_gate proves it 4// in-process against crafted fixtures (no stale-artifact gap between gate and organ). 5// usage: nx_lora_screen <path> 6// exit: 0 CLEAN | 1 FLAGGED (each flag named with its values) | 2 usage | 3 UNPROVEN (unreadable/unjudgeable 7// format -- abstain, never acquit) | 4 REFUSED-pickle (CWE-502: pickled checkpoints execute code on load) 8// SCOPE: this is the STATIC half of the screen (bytes on disk). The RENDER half -- one fixed-seed screening 9// image per candidate, adjudicated before adoption (the elf-ears tell that found amateur_photography_zimage_v1) 10// -- rides the gen worker and is declared in gen.plan G16; this organ is its admission precondition. 11// license_tier: ORIGINAL 12import "nx_syscalls.nx" 13import "nx_lora_screen_lib.nx" 14 15func main(argc: i64, argv: *i64) -> i64 { 16 if argc<2 { 17 var n: i64=0 18 let u: *u8 = "usage: nx_lora_screen <path-to-.safetensors>\n screens declared tensor extents against the file's bytes; refuses pickled formats outright (CWE-502)\n" as *u8 19 while u[n]!=(0 as u8){n=n+1} 20 sys_write(1,u,n) 21 return 2 22 } 23 return lc_screen(argv[1] as *u8) 24}