code wiki / (root) / nx_agreebound.nx

nx_agreebound.nx

buildroot/runtime/nx_agreebound.nx

7871 B148 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_agreebound.nx -- WRITING arc, rung W-AGB-1: THE PANEL-RELIABILITY BOUND. Closes gap-queue rows #1 and #2 of nx_writebench in ONE rung, because they are two facets of a single missing thing -- a mechanical answer to "is this verdict reliable enough to ACT on?": #1 multi-detector-disagreement-bound -- ruler: detectors disagree 3.9x on violence, 3.1x on insult, 1.45x on sexual, ON THE SAME CORPUS. A one-detector rule is therefore a coin flip, and any single detector's rate is an INTERVAL, never a point. #2 judge-reliability-alpha-floor -- ruler Table 1: LLM-vs-human Krippendorff alpha collapses to 0.24 (violence) / 0.43 (insult) ON MODEL OUTPUT, well under the 0.6 substantial floor. ★★THE LAW THIS MECHANIZES: a panel that cannot agree cannot license enforcement. The estate has been bitten repeatedly by a single confident judge (the editjudge that blessed its own mask, DEC026; the compliance metric that ROSE while the picture got worse). This organ refuses to let ONE score authorize an action -- structurally, at ndet<2, no matter how good that score looks. ★WHAT IT IS NOT: this is a RELIABILITY meter, not a content filter, and it never scores content itself. It takes ratings other organs produced and answers how much they can be trusted. It has no opinion about what a consenting adult asks for -- consistent with [[nx_dialogue]], the only lines are legal ones, enforced upstream by rg_decision's age/consent/locale gate. A low-reliability panel downgrades to REPORT-ONLY; it never escalates into a refusal it could not justify. ★THRESHOLDS ARE PARAMETERS (rule 11): every floor/cap is an argument, with the ruler-derived defaults below named and cited. A caller tightening a bound edits DATA, never this organ. Krippendorff nominal alpha, EXACT INTEGER (no float anywhere), for an equal-raters-per-unit panel: D_pairs = sum over units of (n_u^2 - sum_c n_uc^2) (ordered disagreeing pairs) E_pairs = n^2 - sum_c n_c^2 (expected, from the marginals) alpha = 1 - [D_pairs/(m-1)] * [(n-1)/E_pairs] => alpha_permil = 1000 - (1000 * D_pairs * (n-1)) / ((m-1) * E_pairs) Signed: alpha BELOW zero means worse than chance, and is reported as such, never clamped to 0. Pure integer, NO syscalls, caller owns every buffer -- same contract as nx_dialogue/nx_register. license_tier: ORIGINAL module: nishi-core.write.agreebound depends: (none -- pure) capability: WRITE_PANEL_RELIABILITY

dependencies 0 imports · 1 importers

nx_agreebound.nx nx_agreebound_gate.nx

imports: none

imported by: nx_agreebound_gate.nx

structs

none

consts

39const AB_UNDEFINED: i64 = 0 - 1000000 // alpha undefined (m<2, or ZERO variation => De=0)
40const AB_RATIO_UNBOUNDED: i64 = 0 - 1 // a detector fired and another never did => ratio is infinite
43const AB_ENFORCE: i64 = 0 // panel is reliable enough to act on
44const AB_REPORT_ONLY: i64 = 1 // measure and publish, but DO NOT auto-enforce
45const AB_REFUSE_SINGLE: i64 = 2 // structurally a coin flip: fewer than two independent detectors
51const AB_ALPHA_FLOOR_DEFAULT: i64 = 600
52const AB_RATIO_CAP_DEFAULT: i64 = 2000
53const AB_PERMIL: i64 = 1000

functions

59func ab_span_lo(rates: *i64, n: i64) -> i64
called by 2: ab_ratio_permilmain
68func ab_span_hi(rates: *i64, n: i64) -> i64
called by 2: ab_ratio_permilmain
79func ab_ratio_permil(rates: *i64, n: i64) -> i64
called by 1: main calls 2: ab_span_loab_span_hi
91func ab_unit_disagree(counts: *i64, ncat: i64) -> i64
called by 1: ab_alpha_permil
106func ab_alpha_permil(ratings: *i64, nunits: i64, nraters: i64, ncat: i64, marg: *i64, cnt: *i64) -> i64
called by 1: main calls 1: ab_unit_disagree
141func ab_enforce(ndet: i64, alpha_permil: i64, ratio_permil: i64, alpha_floor: i64, ratio_cap: i64) -> i64
called by 1: main