code wiki / _hdl_build / nx_skill_request.nx

nx_skill_request.nx

buildroot/runtime/_hdl_build/nx_skill_request.nx

8854 B215 linesdepth 6pulls 10 transitivereach 1 importersview sourcekind librarytopic skill
docsdependenciesstructsconstsfunctions

about

nx_skill_request.nx -- LIB: "my chef hasn't covered this -- ask them." Requests as a DEMAND INSTRUMENT. The estate already banked the rule this is built on: MEASURE demand, never predict desirability, and DUPLICATE COUNT IS POPULARITY -- it is free and already computed. So a request is not a wish list entry, it is a counted signal, and the count is what a chef is actually shown when deciding what to film next. THREE THINGS IT REFUSES TO DO, because each one would corrupt the signal it exists to produce: 1. IT WILL NOT COUNT THE SAME PERSON TWICE. Demand is DISTINCT requesters, not clicks. One enthusiast hitting the button ten times is one person who wants it; counting clicks would let a single loud user outrank a genuinely popular gap, which is precisely the failure mode that makes vote counts worthless. 2. IT WILL NOT REQUEST WHAT ALREADY EXISTS. If the chef has already covered that skill, the request is REFUSED and the existing video is handed back instead. Sending someone a request for work they have already done wastes their goodwill and teaches them to ignore the channel. 3. IT WILL NOT TREAT "WE NEVER INDEXED THEM" AS "THEY HAVEN'T DONE IT." A request against a chef we do not hold is accepted but TAGGED as un-indexed, so it routes to our own crawling backlog rather than to a chef who may already have the video sitting on their channel. Schema (prefix passed in, e.g. knowledge/store/skillreq-): req:ids -> TAB list of request keys req:<chef>:<skill> -> distinct-requester count <t> kind <t> chef-indexed(1|0) reqby:<chef>:<skill> -> TAB list of unit ids that asked (the dedup set AND the audit trail) license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 5 imports · 1 importers

nx_skill_video.nx nx_meal_plan.nx nx_food_science.nx nx_seg_store.nx nx_syscalls.nx nx_skill_request.nx nx_skill_market_gate.nx

imports: nx_skill_video.nxnx_meal_plan.nxnx_food_science.nxnx_seg_store.nxnx_syscalls.nx

imported by: nx_skill_market_gate.nx

structs

none

consts

32const SR_TAB: i64 = 9
33const SR_KEYCAP: i64 = 240
34const SR_VALCAP: i64 = 1024
35const SR_MAXU: i64 = 512
38const SR_F_COUNT: i64 = 0
39const SR_F_KIND: i64 = 1
40const SR_F_INDEXED: i64 = 2
43const SR_ALREADY_COVERED: i64 = 0 - 2 // refused: the chef has already made this
44const SR_DUPLICATE: i64 = 0 // this unit already asked; the count did NOT move
45const SR_COUNTED: i64 = 1 // a new distinct requester

functions

50func sr_keybuf() -> *u8 { if SR_KB == 0 { SR_KB = sys_mmap(SR_KEYCAP) as i64 } return SR_KB as *u8 }
51func sr_pq() -> *i64 { if SR_PQ == 0 { SR_PQ = sys_mmap(16) as i64 } return SR_PQ as *i64 }
52func sr_lq() -> *i64 { if SR_LQ == 0 { SR_LQ = sys_mmap(16) as i64 } return SR_LQ as *i64 }
53func sr_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
56func sr_pair(chef: *u8, sid: *u8, out: *u8) -> i64
called by 1: sr_request calls 1: as_append
63func sr_req_key(chef: *u8, sid: *u8, out: *u8) -> i64
called by 2: sr_fieldsr_request calls 1: as_append
71func sr_by_key(chef: *u8, sid: *u8, out: *u8) -> i64
80func sr_field(prefix: *u8, chef: *u8, sid: *u8, f: i64, out: *u8) -> i64
90func sr_count(prefix: *u8, chef: *u8, sid: *u8) -> i64
97func sr_has_asked(prefix: *u8, chef: *u8, sid: *u8, unit: *u8) -> i64
111func sr_requesters(prefix: *u8, chef: *u8, sid: *u8, outtoks: *i64) -> i64
124func sr_request(prefix: *u8, vidprefix: *u8, unit: *u8, chef: *u8, sid: *u8, kind: *u8, out_vid: *i64) -> i64
156func sr_is_unindexed(prefix: *u8, chef: *u8, sid: *u8) -> i64
called by 1: main calls 4: sys_mmapsr_fieldfd_atoisr_len
165func sr_rank(prefix: *u8, out_pairs: *i64, out_counts: *i64, max: i64) -> i64