code wiki / _hdl_build / nx_team_solve.nx

nx_team_solve.nx

buildroot/runtime/_hdl_build/nx_team_solve.nx

10265 B227 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic team
docsdependenciesstructsconstsfunctions

about

nx_team_solve.nx -- the MULTI-MEMBER gap solver: how the whole Nishi TEAM (not just the LLM) grows capabilities. When the practice loop (flywheel) hits a GAP (a task scoring <1000), the team solves it by routing to the right MEMBER, cheapest/most-automatic first: TIER-1 MECHANISTIC-SEARCH (this organ, automatic, NO LLM): search the team's EXISTING capability vocabulary (the run_organ transforms, read DATA-DRIVEN from ale_exec.spec) for one that already solves the gap -- the team often HAS the capability and just needs to FIND it. Scores 1000 -> SOLVED, no LLM, no new build. TIER-2 EVOLUTIONARY (nx_evolve / GP -- a heavier search member): for gaps whose solution is a COMPOSITION/parameterization beyond a single existing transform -- routed (ROUTE=EVO). TIER-3 LLM (one team member, last resort): NOVEL capabilities needing reasoning/design -- routed (ROUTE=LLM); the gap_filer already files an ALE-GAP rung the LLM member (or a future organ) picks up. The LLM is NOT the default -- it is what the automatic members escalate to. So the team is self-sufficient for everything its existing + searchable capabilities cover, and only reaches for the LLM on the genuinely-novel frontier. Reuses the harness (DRY). args mode: nx_team_solve <task> -> try to solve; print TEAMSOLVE solved_by / route. no-arg: SELF-GATE -- a gap solvable by an EXISTING transform (wrong/blank instruction) is SOLVED by tier-1 search; a gap needing a NEW capability ESCALATEs -> TEAMSOLVE-GATE verdict=GREEN. Landmines: nested ifs (no &&/||), <=6 args/func, no empty-string literal. license_tier: ORIGINAL module: nishi-core.team.solve depends: nishi-core.sys.syscalls capability: MULTI_MEMBER_GAP_SOLVE

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_team_solve.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ts_solve sys_mmap ts_search sys_mkdir sys_mmap ↻ ts_read sys_openat_rd sys_read sys_close ts_vocab sys_mmap ↻ ts_read ↻ ts_at ts_variant sys_mmap ↻ ts_at ↻ ts_cat ts_write_buf ts_unlink sys_openat_wr sys_write sys_close ↻ ts_run ts_unlink ↻ sys_fork sys_openat_wr ↻ sys_dup3 sys_mmap ↻ sys_execve sys_exit sys_wait4 ts_score_of sys_mmap ↻ ts_read ↻ ts_p sys_write ↻ sys_exit ↻ ts_p ↻ sys_mmap ↻

structs

none

consts

24const TS_MAGIC_131072: i64 = 131072
25const TS_MAGIC_262144: i64 = 262144
27const TS_MAXV: i64 = 32

functions

29func ts_p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: ts_solvemain calls 1: sys_write
30func ts_fp(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main calls 1: sys_write
31func ts_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
34func ts_read(path: *u8, buf: *u8, cap: i64) -> i64
48func ts_score_of(path: *u8) -> i64
called by 1: ts_run calls 2: sys_mmapts_read
58func ts_write_buf(path: *u8, buf: *u8, n: i64) -> i64
67func ts_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64 = off; var i: i64 = 0; while s[i] != (0 as u8) { dst[o] = s[i]; o = o + 1; i = i + 1 } return o }
called by 1: ts_variant
69func ts_at(buf: *u8, ls: i64, le: i64, pat: *u8, pl: i64) -> i64
called by 2: ts_vocabts_variant
79func ts_vocab(toks: *i64) -> i64
called by 1: ts_search calls 3: sys_mmapts_readts_at
110func ts_variant(tbuf: *u8, tn: i64, transform: *u8, outpath: *u8) -> i64
138func ts_run(variantpath: *u8) -> i64
189func ts_solve(taskpath: *u8) -> i64
called by 1: main calls 3: sys_mmapts_searchts_p
200func main(argc: i64, argv: *i64) -> i64