nx_research_refute.nx source
↩ module page · 30 lines · 1702 B
1// nx_research_refute.nx -- S2 of the Tesla ladder: ADVERSARIAL REFUTATION. Over a set of numeric claim-specs
2// (a pattern the value follows, a claimed value in tenths, a tolerance) and fetched evidence text, it verdicts
3// each claim (CONFIRMED / DISCREDITED / UNVERIFIABLE) and ADMITS ONLY CONFIRMED claims -- a claim survives only
4// if the evidence AFFIRMS it; a wrong claim is DISCREDITED, an unfindable one is UNVERIFIABLE (never fabricated).
5// This is the integrity layer FARS lacked (its own audit: 7.4% fabricated results, 5.7% hallucinated citations).
6// Composes S1 (nx_research_synth_qwen produces the per-claim units to check) + nx_claim_verify_core (the verdict).
7// The evidence FETCH stays in the caller (gate Tier-2 over sovereign TLS) so this organ is pure/deterministic/$0.
8// license_tier: ORIGINAL
9import "nx_syscalls.nx"
10import "nx_claim_verify_core.nx"
11
12// refute nspec claims against evidence buf[0,n). specs are parallel arrays: pats[k]=(*u8 as i64), claims[k], tols[k].
13// out[0]=confirmed out[1]=discredited out[2]=unverifiable out[3]=admitted(=confirmed only). returns admitted.
14func rr_refute(buf: *u8, n: i64, pats: *i64, claims: *i64, tols: *i64, nspec: i64, out: *i64) -> i64 {
15 var cf: i64 = 0
16 var ds: i64 = 0
17 var uv: i64 = 0
18 var k: i64 = 0
19 while k < nspec {
20 let pat: *u8 = pats[k] as *u8
21 let code: i64 = cvc_verify_text(buf, n, pat, claims[k], tols[k])
22 if code == 0 { cf = cf + 1 } else { if code == 3 { ds = ds + 1 } else { uv = uv + 1 } }
23 k = k + 1
24 }
25 out[0] = cf
26 out[1] = ds
27 out[2] = uv
28 out[3] = cf // adversarial admission: ONLY confirmed claims survive
29 return cf
30}