code wiki / _hdl_build / nx_critic.nx
nx_critic.nx source
↩ module page · 98 lines · 5569 B
1// nx_critic.nx -- the NISHI CRITIC: adversarial + scientific evaluation so a finding is never
2// "accepted as a commandment from God" but held to reproduction, caveats, and counter-theory.
3// The Critic's job (operator): triangulate feedback, demand scientific evaluation, and decide
4// whether a claim is a current working-LAW or just a THEORY that should be FLAGGED as provisional
5// and potentially superseded by a better future option -- exactly how QM superseded/expanded GR in
6// regimes GR could not reach. The PSNR-as-image-quality belief is the live example: we leaned on
7// it WITHOUT a red-team, and the rate-distortion-PERCEPTION tradeoff (Blau-Michaeli 2019) is the
8// counter-theory that demotes it. The Critic exists so that never silently happens again.
9//
10// Stance (Popper falsifiability + Kuhn paradigm shift + Lakatos): NOTHING is final. Every verdict
11// is PROVISIONAL; a LAW keeps a successor slot open; a belief leaned on without a refutation hunt
12// is a BLIND SPOT, flagged. RACI: the CRITIC evaluates/flags; the RESEARCHER hunts counter-evidence;
13// the BUILDER fixes what is demoted. license_tier: ORIGINAL Refs: Popper, Kuhn, Lakatos.
14
15import "nx_syscalls.nx"
16
17const CRIT_REFUTED: i64 = 0 // a surviving counter-theory wins -> demote + replace
18const CRIT_THEORY: i64 = 1 // provisional: reproduced but caveated / not adequately red-teamed
19const CRIT_LAW: i64 = 2 // current best working-law: reproduced + red-teamed + no surviving counter (STILL provisional)
20
21// the scientific verdict. reproductions = INDEPENDENT confirmations; counters = surviving counter-
22// theories backed by evidence; redteamed = was an adversarial refutation hunt actually run (1/0).
23func crit_status(reproductions: i64, counters: i64, redteamed: i64) -> i64 {
24 if counters >= 1 { return CRIT_REFUTED } // a surviving counter -> never a law
25 if reproductions >= 2 { if redteamed == 1 { return CRIT_LAW } }
26 return CRIT_THEORY
27}
28
29// the HUMILITY axiom: nothing the Critic blesses is gospel. Every verdict is provisional.
30func crit_is_provisional(status: i64) -> i64 { return 1 }
31
32// a belief leaned on WITHOUT a refutation hunt is a BLIND SPOT (the PSNR mistake) -- must be flagged
33// for a red-team before it is trusted, no matter how widely it is reproduced.
34func crit_is_blindspot(reproductions: i64, redteamed: i64) -> i64 {
35 if reproductions >= 1 { if redteamed == 0 { return 1 } }
36 return 0
37}
38
39// even a LAW keeps a SUCCESSOR SLOT open -- it is "current best in its regime", not final (GR->QM).
40func crit_keeps_successor_slot(status: i64) -> i64 { return 1 }
41
42// confidence to ACT on a belief now (permil): reproductions help, surviving counters and an absent
43// red-team hurt. Lets the team weight a provisional belief without treating it as certain.
44func crit_act_confidence(reproductions: i64, counters: i64, redteamed: i64) -> i64 {
45 var c: i64 = reproductions * 200
46 if c > 800 { c = 800 }
47 if redteamed == 1 { c = c + 200 } else { c = c - 200 }
48 c = c - counters * 500
49 if c < 0 { c = 0 }
50 if c > 1000 { c = 1000 }
51 return c
52}
53
54// ---- M2 upgrade (the growth loop's pick): GRADED counter-theory strength (a weak counter must not
55// nuke a belief like a strong one -- Lakatos: programmes degenerate gradually), a SETTLEDNESS
56// spectrum, and a PROACTIVE refutation-hunt trigger (the Critic stops waiting and queues blind
57// spots for the Researcher to attack). ----
58
59const CRIT_CONTESTED: i64 = 3 // belief and a MODERATE counter coexist -> resolve, don't auto-refute
60
61// grade a counter-theory's STRENGTH from its evidence: 0 none, 1 weak/anecdotal, 2 moderate,
62// 3 strong (reproduced AND independently sourced).
63func crit_counter_strength(counter_reproductions: i64, counter_sources: i64) -> i64 {
64 if counter_reproductions >= 2 { if counter_sources >= 2 { return 3 } }
65 if counter_reproductions >= 1 { if counter_sources >= 2 { return 2 } }
66 if counter_reproductions >= 1 { return 1 }
67 return 0
68}
69
70// graded verdict (supersedes the binary crit_status): a STRONG counter refutes; a MODERATE counter
71// makes it CONTESTED (coexist, must resolve); WEAK -> still a flagged THEORY; none + reproduced +
72// red-teamed -> LAW (still provisional).
73func crit_status2(reproductions: i64, counter_strength: i64, redteamed: i64) -> i64 {
74 if counter_strength >= 3 { return CRIT_REFUTED }
75 if counter_strength == 2 { return CRIT_CONTESTED }
76 if reproductions >= 2 { if redteamed == 1 { if counter_strength == 0 { return CRIT_LAW } } }
77 return CRIT_THEORY
78}
79
80// SETTLEDNESS 0-1000: how settled is a belief on a spectrum (not 3 buckets). reproductions + red-team
81// raise it; a stronger counter lowers it.
82func crit_settledness(reproductions: i64, counter_strength: i64, redteamed: i64) -> i64 {
83 var s: i64 = reproductions * 200; if s > 600 { s = 600 }
84 if redteamed == 1 { s = s + 400 }
85 s = s - counter_strength * 300
86 if s < 0 { s = 0 }
87 if s > 1000 { s = 1000 }
88 return s
89}
90
91// PROACTIVE refutation-hunt: the Critic sweeps the belief set and QUEUES the blind spots (reproduced
92// but never red-teamed) for the Researcher to hunt counter-evidence -- it triggers the attack instead
93// of waiting for one to arrive. writes the blind-spot indices to out[], returns the count.
94func crit_refutation_hunt_queue(n: i64, reproductions: *i64, redteamed: *i64, out: *i64) -> i64 {
95 var c: i64 = 0; var i: i64 = 0
96 while i < n { if crit_is_blindspot(reproductions[i], redteamed[i]) == 1 { out[c] = i; c = c + 1 } i = i + 1 }
97 return c
98}