code wiki / _hdl_build / nx_paper_panel.nx
nx_paper_panel.nx source
↩ module page · 76 lines · 4080 B
1// nx_paper_panel.nx -- ADMISSIBILITY of a manuscript grade (AS-2).
2//
3// ★WHY THIS IS A COMPOSITION AND NOT A NEW ORGAN. The obvious move after shipping a
4// manuscript grader (nx_paperbench) was to build "nx_paper_referee". A check-before-build
5// sweep found the ecosystem ALREADY HAS the referee machinery, in three organs:
6// nx_referee.nx ref_no_self_grade -- the scorer must not be a competitor
7// nx_referee_v2.nx rf2_judge_independent (R6 preference-leakage),
8// rf2_holdout_clean (R7 contamination)
9// nx_peer_review.nx pr_agreement / pr_resolve / pr_divergence_cause -- dual grade + tie-break
10// Building a fourth would have been duplication. This organ contributes the ONE thing that
11// did not exist: binding those gates to a MANUSCRIPT grade so that a score is inadmissible
12// unless its grader is independent of the paper's author.
13//
14// ★★AND IT INDICTS OUR OWN PUBLISHED WORK. RT-004 scored 1000 permille on nx_paperbench --
15// but that grader was written by the same author, in the same session, as the paper it
16// graded. rf2_judge_independent has said since it was written that such a judge is INVALID.
17// So the honest verdict on RT-004's headline is PP_INADMISSIBLE, and the published page must
18// say so. A number produced by a compromised grader is not a small error to be discounted;
19// it carries no information at all.
20//
21// Integer, deterministic. No hw writes (Rule 26). license_tier: ORIGINAL
22//
23// module: nishi-core.research.paper_panel
24// depends: nx_referee.nx, nx_referee_v2.nx, nx_peer_review.nx
25// genealogy_id: referee_v1_no_self_grade + referee_v2_r6_leakage + peer_review_dual_grade
26import "nx_referee.nx"
27import "nx_referee_v2.nx"
28import "nx_peer_review.nx"
29
30// verdict codes for a manuscript grade
31const PP_INADMISSIBLE: i64 = 0 // the grader was not independent -- the score carries no information
32const PP_PROVISIONAL: i64 = 1 // independent, but two graders diverge -- tie-break applied
33const PP_ADMITTED: i64 = 2 // independent, and the graders agree
34
35// Is the grader independent of the manuscript's author?
36// Composes v1 self-grade detection with v2 preference-leakage. Both must hold: distinct
37// identities are NOT sufficient when the grader shares a model, lineage, or family with
38// the author -- which is exactly the case when one session writes both.
39func pp_grader_independent(grader_id: i64, author_id: i64, same_model: i64, inheritance: i64, same_family: i64) -> i64 {
40 if ref_no_self_grade(grader_id, author_id, author_id) != 1 { return 0 }
41 if rf2_judge_independent(same_model, inheritance, same_family) != 1 { return 0 }
42 return 1
43}
44
45// A grade is admissible only if the grader is independent AND the manuscript was not
46// part of what the grader was tuned on (R7 contamination).
47func pp_admissible(independent: i64, holdout_clean: i64) -> i64 {
48 if independent != 1 { return 0 }
49 if holdout_clean != 1 { return 0 }
50 return 1
51}
52
53// THE PANEL VERDICT. out[0] receives the resolved grade.
54// ★A high score can never launder a compromised grader: when admissible==0 the verdict is
55// PP_INADMISSIBLE and out[0] is forced to 0, no matter what the graders reported.
56func pp_verdict(admissible: i64, grade_a: i64, grade_b: i64, tiebreak: i64, out: *i64) -> i64 {
57 if admissible != 1 {
58 out[0] = 0
59 return PP_INADMISSIBLE
60 }
61 out[0] = pr_resolve(grade_a, grade_b, tiebreak)
62 if pr_agreement(grade_a, grade_b) == PR_AGREE { return PP_ADMITTED }
63 return PP_PROVISIONAL
64}
65
66// When two graders diverge, name the missing input rather than averaging the disagreement
67// away: a divergence usually means the panel lacked a SOTA baseline or the evidence.
68func pp_divergence_cause(has_sota_baseline: i64, has_evidence: i64) -> i64 {
69 return pr_divergence_cause(has_sota_baseline, has_evidence)
70}
71
72// Convenience: the single question "was this manuscript self-graded?"
73func pp_self_graded(grader_id: i64, author_id: i64) -> i64 {
74 if ref_no_self_grade(grader_id, author_id, author_id) == 1 { return 0 }
75 return 1
76}