code wiki / (root) / nx_source_tier.nx

nx_source_tier.nx

buildroot/runtime/nx_source_tier.nx

11550 B218 linesdepth 4pulls 5 transitivereach 14 importersview sourcekind librarytopic source
docsdependenciesstructsconstsfunctions

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

fx.nx nx_str.nx nx_source_tier.nx nx_bench_harness.nx nx_diora_live_serp.nx nx_facet_classify.nx nx_rank_fused.nx nx_research_web.nx nx_source_tier_test.nx

imports: fx.nxnx_str.nx

imported by: nx_bench_harness.nxnx_diora_live_serp.nxnx_facet_classify.nxnx_rank_fused.nxnx_research_web.nxnx_source_tier_test.nx

structs

37struct NxTierVerdict

consts

30const NX_TIER_PRIMARY: i64 = 1
31const NX_TIER_EDITORIAL: i64 = 2
32const NX_TIER_PLATFORM: i64 = 3
33const NX_TIER_ARCHIVE: i64 = 4
34const NX_TIER_COMMUNITY: i64 = 5
35const NX_TIER_UNKNOWN: i64 = 6
44const NX_TIER_VERDICT_BYTES: i64 = 32

functions

47func nx_tier_score(tier: i64) -> i64
called by 1: nx_tier_classify calls 1: fx_from_frac
57func nx_tier_lc(c: i64) -> i64
66func nx_tier_ci_contains(hay: *u8, needle: *u8) -> i64
90func nx_tier_host_has(url: *u8, domain: *u8) -> i64
97func nx_tier_of_url(url: *u8) -> i64
called by 1: nx_tier_classify calls 1: nx_tier_host_has
166func nx_tier_is_derivative(url: *u8, title: *u8) -> i64
196func nx_tier_classify(url: *u8, title: *u8, out: *NxTierVerdict) -> i64
216func nx_tier_gain(v: *NxTierVerdict) -> i64