code wiki / _hdl_build / nx_source_grade.nx
nx_source_grade.nx
buildroot/runtime/_hdl_build/nx_source_grade.nx
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
imports: nx_syscalls.nx
imported by: nx_analyst_case_sources.nxnx_ledger_data.nxnx_source_grade_gate.nx
structs
| none |
consts
| 24 | const SG_REL_A: i64 = 1 |
| 25 | const SG_REL_F: i64 = 6 // reliability cannot be judged |
| 26 | const SG_CRED_CONFIRMED: i64 = 1 |
| 27 | const SG_CRED_UNJUDGED: i64 = 6 // truth cannot be judged |
| 30 | const SG_PRIMARY: i64 = 1 // the entity's own record (filing, posted price, instrument data) |
| 31 | const SG_SECONDARY: i64 = 2 // reporting on a primary |
| 32 | const SG_TERTIARY: i64 = 3 // aggregator synthesis of secondaries |
| 35 | const SG_M_MEASURED: i64 = 5 // measured/primary record (audited filing, census, posted price) |
| 36 | const SG_M_SYSTEMATIC:i64 = 4 // systematic aggregation (e.g. 200+ P&Ls) |
| 37 | const SG_M_SURVEY: i64 = 3 // survey / price-guide aggregation |
| 38 | const SG_M_EXPERT: i64 = 2 // expert estimate / industry rule-of-thumb |
| 39 | const SG_M_MARKETING: i64 = 1 // marketing claim / anecdote |
| 42 | const SG_ECHO: i64 = 0 // <2 distinct bias classes: echoes of one interest |
| 43 | const SG_CORROB: i64 = 1 // >=2 distinct classes |
| 44 | const SG_OPPOSED: i64 = 2 // >=2 distinct classes INCLUDING an opposed pair (strongest) |
| 47 | const SG_CONF_LOW: i64 = 1 |
| 48 | const SG_CONF_MED: i64 = 2 |
| 49 | const SG_CONF_HIGH: i64 = 3 |
functions
| 52 | func sg_valid(rel: i64, cred: i64, party: i64, method: i64) -> i64 |
| 65 | func sg_actionable(rel: i64, cred: i64) -> i64 called by 1: main |
| 72 | func sg_fetch_owed(rel: i64, cred: i64) -> i64 called by 1: main |
| 79 | func sg_rel_permil(rel: i64) -> i64 called by 1: sg_score_permil |
| 88 | func sg_cred_permil(cred: i64) -> i64 called by 1: sg_score_permil |
| 97 | func sg_party_permil(party: i64) -> i64 called by 1: sg_score_permil |
| 103 | func sg_method_permil(method: i64) -> i64 called by 1: sg_score_permil |
| 113 | func sg_score_permil(rel: i64, cred: i64, party: i64, method: i64) -> i64 |
| 122 | func sg_independent(class_a: i64, class_b: i64) -> i64 called by 1: main |
| 128 | func sg_distinct(vals: *i64, n: i64) -> i64 |
| 146 | func sg_strength(distinct_classes: i64, has_opposed: i64) -> i64 |
| 153 | func sg_has_opposed(vals: *i64, n: i64, oa: i64, ob: i64) -> i64 |
| 167 | func sg_confidence(worst_strength: i64, worst_score: i64) -> i64 |
| 175 | func sg_wep_band(permil: i64) -> i64 called by 1: main |
| 185 | func sg_wep_name(band: i64) -> *u8 |
| 195 | func sg_conf_name(conf: i64) -> *u8 |
| 203 | func sg_separation_ok(same_sentence: i64) -> i64 |
| 209 | func sg_is_reproducible(rel: i64, cred: i64, party: i64, method: i64) -> i64 |