code wiki / (root) / nx_wflow_execution_gate_t346.nx

nx_wflow_execution_gate_t346.nx source

↩ module page · 32 lines · 2300 B

1import "nx_wflow_execution_engine_candidate_t346.nx" 2func main()->i64{ 3 let stamp:*WfOwnedText=wf_text_decimal(sys_now_realtime_us()) 4 let ledger:*u8=sys_mmap(256);let input:*u8=sys_mmap(256) 5 var at:i64=wf_cat(ledger,0,"knowledge/gates/wfx-execution-");at=wf_cat(ledger,at,stamp.data);wf_cat(ledger,at,".log") 6 at=wf_cat(input,0,"knowledge/gates/wfx-input-");at=wf_cat(input,at,stamp.data);wf_cat(input,at,".dat") 7 let cx:*i64=sys_mmap(40) as *i64;cx[2]=ledger as i64;cx[3]="../tool_allowlist.conf" as *u8 as i64 8 var passed:i64=0 9 let no:i64=wf_exec_organ_observed(cx,"nx_wfx_nonexistent","SECRET-SENTINEL-MUST-NOT-LOG","recovery-case",1,1) 10 if no!=0{return 1};passed=passed+1 11 let bad:i64=wf_exec_organ_observed(cx,"nx_filehash",input,"recovery-case",2,1) 12 if bad!=0{return 2};passed=passed+1 13 let n:*i64=sys_mmap(8) as *i64 14 let source:*u8=wf_readall("knowledge/gates/nxmesh-neutral-converter-review-t346.json",n) 15 if (source as i64)==0||n[0]<=0{return 3} 16 if wf_writeall(input,source,n[0])!=0{return 4} 17 let good:i64=wf_exec_organ_observed(cx,"nx_filehash",input,"recovery-case",2,2) 18 if good!=1{return 5};passed=passed+1 19 let journal:*u8=wf_readall(ledger,n);if (journal as i64)==0{return 6} 20 if wf_has_rng(journal,0,n[0],"SECRET-SENTINEL-MUST-NOT-LOG")==1{return 7};passed=passed+1 21 if wf_lines_with2(journal,n[0],"phase=refused","dispatched=0")!=1{return 8};passed=passed+1 22 if wf_lines_with2(journal,n[0],"phase=complete","step=2")!=2{return 9};passed=passed+1 23 if wf_lines_with2(journal,n[0],"att=2","exit=0")!=2{return 10};passed=passed+1 24 let previous:i64=n[0] 25 if wfx_record(cx,"bad rid","nx_filehash","-",2,1,WFX_REFUSED,0,0,0,"invalid-token")!=WF_EVIDENCE_ERROR{return 11} 26 let unchanged:*u8=wf_readall(ledger,n);if n[0]!=previous{return 12};passed=passed+1 27 cx[2]="knowledge/gates/wfx-directory-not-created/ledger.log" as *u8 as i64 28 if wf_exec_organ_observed(cx,"nx_filehash",input,"evidence-refusal",1,1)!=WF_EVIDENCE_ERROR{return 13};passed=passed+1 29 p("WFEXEC-GATE passed=");pn(passed);p("/9 ledger=");p(ledger);p(" input=");p(input);p("\n") 30 p("Coverage: explicit real missing-input failure -> controlled fixture creation -> exact same read-only connector/argument success; no automated repair dispatch, deployment, mutation retry or postcondition certification.\n") 31 return 0 32}