nx_source_tier.nx
buildroot/runtime/nx_source_tier.nx
about
nx_source_tier.nx -- the research-established ranking rule, bits-up.
module: nishi-core.search.bench.source_tier
depends: fx.nx (Q16.16 tier scores), nx_str.nx (substring matching)
capability: CORE_COMPUTE
wired_status: FULLY_WIRED
Operationalizes the operator's principle: FIRST-HAND source material (the
actual film / official photo / canonical record / direct interview) ranks
ABOVE derivative commentary (reaction videos, "top 10" listicles, SEO
aggregators, tier-lists). This is the anti-Google ranking thesis from
docs/00-VISION + the five-tier taxonomy from docs/04-DEDUP.
Two-stage, data-driven (Rule #11 -- the tables ARE the policy):
1. domain -> base tier (primary/editorial/platform/archive/community)
2. title/url "derivative" signals DEMOTE a result to commentary even on
a high-tier domain (a YouTube reaction video is platform AND
derivative; the same channel's official trailer is not).
A result is_primary (first-hand) iff base tier == PRIMARY and no derivative
signal fired. That boolean feeds nx_bench_primary_precision_at_k; the gain
(tier score, zeroed when derivative) feeds nx_bench_dcg/ndcg.
Tier scores from docs/04-DEDUP: primary 1.0, editorial 0.9, platform 0.7,
archive 0.6, community 0.5, unknown 0.3 (Q16.16).
dependencies 2 imports · 6 importers
imported by: nx_bench_harness.nxnx_diora_live_serp.nxnx_facet_classify.nxnx_rank_fused.nxnx_research_web.nxnx_source_tier_test.nx
structs
| 37 | struct NxTierVerdict |
consts
| 30 | const NX_TIER_PRIMARY: i64 = 1 |
| 31 | const NX_TIER_EDITORIAL: i64 = 2 |
| 32 | const NX_TIER_PLATFORM: i64 = 3 |
| 33 | const NX_TIER_ARCHIVE: i64 = 4 |
| 34 | const NX_TIER_COMMUNITY: i64 = 5 |
| 35 | const NX_TIER_UNKNOWN: i64 = 6 |
| 44 | const NX_TIER_VERDICT_BYTES: i64 = 32 |
functions
| 47 | func nx_tier_score(tier: i64) -> i64 |
| 57 | func nx_tier_lc(c: i64) -> i64 |
| 66 | func nx_tier_ci_contains(hay: *u8, needle: *u8) -> i64 |
| 90 | func nx_tier_host_has(url: *u8, domain: *u8) -> i64 |
| 97 | func nx_tier_of_url(url: *u8) -> i64 |
| 166 | func nx_tier_is_derivative(url: *u8, title: *u8) -> i64 |
| 196 | func nx_tier_classify(url: *u8, title: *u8, out: *NxTierVerdict) -> i64 |
| 216 | func nx_tier_gain(v: *NxTierVerdict) -> i64 |