code wiki / _hdl_build / nx_source_grade.nx

nx_source_grade.nx

buildroot/runtime/_hdl_build/nx_source_grade.nx

8765 B214 linesdepth 2pulls 2 transitivereach 8 importersview sourcekind librarytopic source
docsdependenciesstructsconstsfunctions

about

nx_source_grade.nx -- the SOURCE-CRITICISM organ: qualitative + quantitative accuracy grading of the sources an analysis stands on. Operator: "clarity on what we see in real terms, measuring qualitatively and quantitatively the accuracy based on first-party sources, their biases, their actual research method." Built from CORROBORATED tradecraft research (knowledge/library/analyst-tradecraft-best-practices-2026-06-10.txt): - NATO/Admiralty 6x6 (C2): source RELIABILITY A..F and information CREDIBILITY 1..6 are rated INDEPENDENTLY, then composed. F and 6 are honest "cannot judge" states -- they are NEVER actionable and owe a fetch-task (like the Analyst's narrative nodes). - First-party DISTANCE + METHOD rung (C6): primary>secondary>tertiary; measured-record > systematic-aggregation > survey > expert-estimate > marketing-claim. - INDEPENDENCE RULE (C5, the sharpest upgrade): two sources in the SAME incentive class are ECHOES of one interest, not corroboration. A claim is corroborated only across >=2 DISTINCT bias classes; agreement between OPPOSED incentive classes is the strongest signal. - ICD 203 (C1,C3): CONFIDENCE (how sure: 1=LOW 2=MODERATE 3=HIGH, driven by source quality + independence) is a SEPARATE dimension from LIKELIHOOD (7 estimative bands); the two must never be combined in one sentence -- sg_separation_ok encodes the law for report emitters. Quantitative score = permil composition of the four axes; qualitative grade = the (letter, digit) Admiralty pair, kept alongside, never replaced by the number. LAWS: struct-free, integer-only (permil), no &&/||. license_tier: ORIGINAL

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_source_grade.nx nx_analyst_case_sources.nx nx_ledger_data.nx nx_source_grade_gate.nx

imports: nx_syscalls.nx

imported by: nx_analyst_case_sources.nxnx_ledger_data.nxnx_source_grade_gate.nx

structs

none

consts

24const SG_REL_A: i64 = 1
25const SG_REL_F: i64 = 6 // reliability cannot be judged
26const SG_CRED_CONFIRMED: i64 = 1
27const SG_CRED_UNJUDGED: i64 = 6 // truth cannot be judged
30const SG_PRIMARY: i64 = 1 // the entity's own record (filing, posted price, instrument data)
31const SG_SECONDARY: i64 = 2 // reporting on a primary
32const SG_TERTIARY: i64 = 3 // aggregator synthesis of secondaries
35const SG_M_MEASURED: i64 = 5 // measured/primary record (audited filing, census, posted price)
36const SG_M_SYSTEMATIC:i64 = 4 // systematic aggregation (e.g. 200+ P&Ls)
37const SG_M_SURVEY: i64 = 3 // survey / price-guide aggregation
38const SG_M_EXPERT: i64 = 2 // expert estimate / industry rule-of-thumb
39const SG_M_MARKETING: i64 = 1 // marketing claim / anecdote
42const SG_ECHO: i64 = 0 // <2 distinct bias classes: echoes of one interest
43const SG_CORROB: i64 = 1 // >=2 distinct classes
44const SG_OPPOSED: i64 = 2 // >=2 distinct classes INCLUDING an opposed pair (strongest)
47const SG_CONF_LOW: i64 = 1
48const SG_CONF_MED: i64 = 2
49const SG_CONF_HIGH: i64 = 3

functions

52func sg_valid(rel: i64, cred: i64, party: i64, method: i64) -> i64
65func sg_actionable(rel: i64, cred: i64) -> i64
called by 1: main
72func sg_fetch_owed(rel: i64, cred: i64) -> i64
called by 1: main
79func sg_rel_permil(rel: i64) -> i64
called by 1: sg_score_permil
88func sg_cred_permil(cred: i64) -> i64
called by 1: sg_score_permil
97func sg_party_permil(party: i64) -> i64
called by 1: sg_score_permil
103func sg_method_permil(method: i64) -> i64
called by 1: sg_score_permil
113func sg_score_permil(rel: i64, cred: i64, party: i64, method: i64) -> i64
122func sg_independent(class_a: i64, class_b: i64) -> i64
called by 1: main
128func sg_distinct(vals: *i64, n: i64) -> i64
called by 2: cs_row_strengthmain
146func sg_strength(distinct_classes: i64, has_opposed: i64) -> i64
called by 2: cs_row_strengthmain
153func sg_has_opposed(vals: *i64, n: i64, oa: i64, ob: i64) -> i64
167func sg_confidence(worst_strength: i64, worst_score: i64) -> i64
called by 3: mainld_evalmain
175func sg_wep_band(permil: i64) -> i64
called by 1: main
185func sg_wep_name(band: i64) -> *u8
195func sg_conf_name(conf: i64) -> *u8
called by 2: mainmain
203func sg_separation_ok(same_sentence: i64) -> i64
called by 2: mainmain
209func sg_is_reproducible(rel: i64, cred: i64, party: i64, method: i64) -> i64
called by 2: mainmain calls 1: sg_score_permil