code wiki / (root) / nx_adopt_observation_gate_t313.nx

nx_adopt_observation_gate_t313.nx source

↩ module page · 27 lines · 1944 B

1import "nx_adoptgate.nx" 2import "nx_gate_verdict.nx" 3func main()->i64{ 4 let checks:*i64=gv_ctr() 5 let fixture:*u8="/volume1/homes/elderwesto/nishihost/buildroot/_build/nx_behavior_fixture_a_t297.sov.elf" 6 var arg:i64="exit0" as *u8 as i64 7 var q:NxBehaviorRequest 8 q.live=fixture;q.other=fixture;q.cwd=BP_HOST;q.args=&arg;q.arg_count=1;q.timeout_ms=1000;q.max_capture_bytes=0 9 var c:NxCdResult;var b:NxBehaviorResult;var r:NxAdoptObservation 10 let good:i64=ag_observe_result(&q,&c,&b,&r) 11 gv_check("native content and behavior compose without child gate or parsed stdout",good==0&&r.state==0&&c.state==0&&b.state==0&&r.behavior_ran==1&&b.matched==1,checks) 12 gv_check("matching observations never substitute for reviewed acceptance",r.requires_review==1&&b.coverage_verified==0,checks) 13 arg="exit1" as *u8 as i64 14 let nonzero:i64=ag_observe_result(&q,&c,&b,&r) 15 gv_check("legitimate matching nonzero remains observed requiring review",nonzero==0&&b.live_exit==1&&r.requires_review==1,checks) 16 arg="signal" as *u8 as i64 17 let sig:i64=ag_observe_result(&q,&c,&b,&r) 18 gv_check("actual signal cannot qualify adoption observation",sig==2&&r.state==2&&b.live_signal==9&&r.requires_review==1,checks) 19 arg="large" as *u8 as i64;q.max_capture_bytes=262144 20 let limited:i64=ag_observe_result(&q,&c,&b,&r) 21 gv_check("capture policy refusal cannot accept equal prefixes",limited==2&&b.state!=0&&r.state==2,checks) 22 q.max_capture_bytes=0;q.other="/volume1/homes/elderwesto/nishihost/missing-adoption-observation-t313.elf" 23 let missing:i64=ag_observe_result(&q,&c,&b,&r) 24 gv_check("missing candidate refuses before running live subject",missing==2&&c.state!=0&&r.behavior_ran==0&&b.live_reaped==0,checks) 25 gv_check("prior successful status is reset on missing artifact",r.state==2&&r.behavior_rc==-1&&r.requires_review==1,checks) 26 return gv_verdict("ADOPT-NATIVE-OBSERVATION",checks,"Candidate composition only; no promotion, no inferred workload coverage") 27}