code wiki / _hdl_build / nx_llm_gap_registry.nx
nx_llm_gap_registry.nx source
↩ module page · 66 lines · 3480 B
1// nx_llm_gap_registry.nx -- where the team needs an LLM to INTERCEDE, marked so a future CUSTOM LLM
2// can be TESTED on those exact measures (operator: till we have our own LLM there is always a gap; the
3// team must recognize where an LLM like Claude intercedes BEYOND building capabilities, and mark it
4// down, so our custom LLM can be tested for S-class-exceed on the measures we needed). The COUNCIL
5// flags a task as an LLM-intercession point ONLY when it is NOT mechanizable AND the team has no
6// capability for it -- otherwise the team handles it (the mechanizable-invention doctrine: most rungs
7// need no LLM). Each gap tracks: kind, status (LLM-DEPENDENT or RESOLVED-by-a-team-capability), and
8// the S-class measure a candidate LLM must hit to close it. The OPEN gaps ARE the test suite for our
9// own LLM. RACI: Council flags, Registry records, Builder tries to resolve by building a capability,
10// the custom LLM is later tested against the residue. license_tier: ORIGINAL.
11
12import "nx_syscalls.nx"
13
14// gap KINDS -- the classes of LLM-level work the team cannot mechanize in sovereign NishiLang
15const LG_FETCH: i64 = 1 // retrieve external/web data
16const LG_EXTRACT: i64 = 2 // prose -> structured verified claims
17const LG_PROSE: i64 = 3 // natural-language authoring (paper/caption prose)
18const LG_NOVEL_REASON: i64 = 4 // open-ended reasoning / novel synthesis
19const LG_NOVEL_MODULE: i64 = 5 // authoring a brand-new NishiLang module/algorithm
20
21const LG_LLM_DEPENDENT: i64 = 0 // still needs the LLM
22const LG_RESOLVED: i64 = 1 // a team capability now covers it -> gap closed
23
24// the COUNCIL's flag: is this an LLM-intercession point? only if NOT mechanizable AND no team capability.
25func lg_council_flag(mechanizable: i64, has_team_capability: i64) -> i64 {
26 if mechanizable == 1 { return 0 }
27 if has_team_capability == 1 { return 0 }
28 return 1
29}
30
31// a gap's status (resolved iff the team built a capability for it).
32func lg_status(has_team_capability: i64) -> i64 { if has_team_capability == 1 { return LG_RESOLVED } return LG_LLM_DEPENDENT }
33
34// number of OPEN (LLM-dependent) gaps = the size of the test suite our custom LLM must clear.
35func lg_open_count(n: i64, status: *i64) -> i64 {
36 var c: i64 = 0; var i: i64 = 0
37 while i < n { if status[i] == LG_LLM_DEPENDENT { c = c + 1 } i = i + 1 }
38 return c
39}
40
41// the CUSTOM-LLM TEST on one gap: does the candidate's score meet the required S-class measure?
42func lg_custom_passes(candidate_score: i64, required_measure: i64) -> i64 {
43 if candidate_score >= required_measure { return 1 }
44 return 0
45}
46
47// is the custom LLM READY to replace Claude's intercession? -- it must clear EVERY open gap at the
48// required measure. returns 1 ready, else 0 (and the first failing gap is the work that remains).
49func lg_custom_ready(n: i64, status: *i64, candidate: *i64, required: *i64) -> i64 {
50 var i: i64 = 0
51 while i < n {
52 if status[i] == LG_LLM_DEPENDENT { if lg_custom_passes(candidate[i], required[i]) == 0 { return 0 } }
53 i = i + 1
54 }
55 return 1
56}
57
58// the first OPEN gap the custom LLM still FAILS (the next measure to chase); -1 if ready.
59func lg_first_unmet(n: i64, status: *i64, candidate: *i64, required: *i64) -> i64 {
60 var i: i64 = 0
61 while i < n {
62 if status[i] == LG_LLM_DEPENDENT { if lg_custom_passes(candidate[i], required[i]) == 0 { return i } }
63 i = i + 1
64 }
65 return 0 - 1
66}