code wiki / _hdl_build / nx_skill_video.nx

nx_skill_video.nx

buildroot/runtime/_hdl_build/nx_skill_video.nx

9428 B248 linesdepth 5pulls 9 transitivereach 4 importersview sourcekind librarytopic skill
docsdependenciesstructsconstsfunctions

about

nx_skill_video.nx -- LIB: WHO you learn a technique from is the learner's choice, not ours. For any skill the coach teaches, there may be several ways to watch it done: a PROFESSIONAL source, an AMATEUR one (often better -- a home cook's kitchen looks like yours), or a specific CHEF the learner already follows. This registry holds those sources per skill, keeps the chefs a person follows, and answers the question that actually gets asked: "has the cook I like already covered this?" THAT QUESTION IS A TRI-STATE, ON PURPOSE. sv_chef_covers returns -1 for a chef we have never heard of, 0 for a chef we know who has not covered this skill, and 1 for covered. Collapsing the first two into "no" would tell someone their favourite chef has not made the video when the truth is we never indexed them -- and that wrong answer is exactly what would send a pointless request to a chef who already has one. LINK ROT IS THE SAME PROBLEM AS THE RECIPE. A technique video is a citation like any other, so this reuses ms_is_archived from nx_meal_source rather than growing a second archive predicate: a source renders as preserved ONLY when its bytes actually come back out of the WARC. Schema (prefix passed in, e.g. knowledge/store/skillvid-): svid:ids -> TAB list of video ids svid:<vid> -> skill <t> title <t> creator <t> kind <t> url <t> licence <t> seconds <t> chef-id svid:skill:<sid> -> TAB list of video ids teaching that skill chef:ids -> TAB list of chef ids chef:<cid> -> display name <t> handle <t> home url follow:<unit> -> TAB list of chef ids this unit follows license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 5 imports · 3 importers

nx_meal_plan.nx nx_meal_source.nx nx_food_science.nx nx_seg_store.nx nx_syscalls.nx nx_skill_video.nx nx_meal_skills_page.nx nx_skill_request.nx nx_skills_emit.nx

imports: nx_meal_plan.nxnx_meal_source.nxnx_food_science.nxnx_seg_store.nxnx_syscalls.nx

imported by: nx_meal_skills_page.nxnx_skill_request.nxnx_skills_emit.nx

structs

none

consts

31const SV_TAB: i64 = 9
32const SV_KEYCAP: i64 = 200
33const SV_VALCAP: i64 = 2048
34const SV_MAXV: i64 = 256
37const SV_F_SKILL: i64 = 0
38const SV_F_TITLE: i64 = 1
39const SV_F_CREATOR: i64 = 2
40const SV_F_KIND: i64 = 3
41const SV_F_URL: i64 = 4
42const SV_F_LICENSE: i64 = 5
43const SV_F_SECONDS: i64 = 6
44const SV_F_CHEF: i64 = 7
47const SV_C_NAME: i64 = 0
48const SV_C_HANDLE: i64 = 1
49const SV_C_HOME: i64 = 2
52const SV_CHEF_UNKNOWN: i64 = 0 - 1
53const SV_CHEF_NO: i64 = 0
54const SV_CHEF_YES: i64 = 1

functions

59func sv_keybuf() -> *u8 { if SV_KB == 0 { SV_KB = sys_mmap(SV_KEYCAP) as i64 } return SV_KB as *u8 }
60func sv_pq() -> *i64 { if SV_PQ == 0 { SV_PQ = sys_mmap(16) as i64 } return SV_PQ as *i64 }
61func sv_lq() -> *i64 { if SV_LQ == 0 { SV_LQ = sys_mmap(16) as i64 } return SV_LQ as *i64 }
62func sv_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: sv_seconds
65func sv_empty() -> *u8
called by 1: main calls 1: sys_mmap
72func sv_field_at(prefix: *u8, key: *u8, f: i64, out: *u8) -> i64
81func sv_vid_key(vid: *u8, out: *u8) -> i64
called by 2: sv_add_videosv_field calls 1: as_append
87func sv_skill_key(sid: *u8, out: *u8) -> i64
called by 2: sv_add_videosv_by_skill calls 1: as_append
95func sv_add_video(prefix: *u8, vid: *u8, sid: *u8, title: *u8, creator: *u8, kind: *u8, url: *u8, license: *u8, seconds: i64, chef: *u8) -> i64
117func sv_field(prefix: *u8, vid: *u8, f: i64, out: *u8) -> i64
123func sv_seconds(prefix: *u8, vid: *u8) -> i64
130func sv_by_skill(prefix: *u8, sid: *u8, outtoks: *i64) -> i64
140func sv_by_skill_kind(prefix: *u8, sid: *u8, kind: *u8, outtoks: *i64) -> i64
158func sv_chef_key(cid: *u8, out: *u8) -> i64
called by 2: sv_add_chefsv_chef_field calls 1: as_append
164func sv_follow_key(unit: *u8, out: *u8) -> i64
called by 2: sv_followsv_follows calls 1: as_append
171func sv_add_chef(prefix: *u8, cid: *u8, name: *u8, handle: *u8, home: *u8) -> i64
185func sv_chef_field(prefix: *u8, cid: *u8, f: i64, out: *u8) -> i64
191func sv_chef_known(prefix: *u8, cid: *u8) -> i64
197func sv_follow(prefix: *u8, unit: *u8, cid: *u8) -> i64
203func sv_follows(prefix: *u8, unit: *u8, outtoks: *i64) -> i64
216func sv_chef_covers(prefix: *u8, cid: *u8, sid: *u8, out_vid: *i64) -> i64
237func sv_is_preserved(prefix: *u8, vid: *u8, warc: *u8, warclen: i64) -> i64
244func sv_preserved_bytes(prefix: *u8, vid: *u8, warc: *u8, warclen: i64) -> i64