code wiki / _hdl_build / nx_team_solve.nx
nx_team_solve.nx
buildroot/runtime/_hdl_build/nx_team_solve.nx
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
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
structs
| none |
consts
| 24 | const TS_MAGIC_131072: i64 = 131072 |
| 25 | const TS_MAGIC_262144: i64 = 262144 |
| 27 | const TS_MAXV: i64 = 32 |
functions
| 29 | func 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 } |
| 30 | func 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 } |
| 31 | func ts_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 32 | func ts_unlink(path: *u8) -> i64 { return __syscall(263, AT_FDCWD, path, 0, 0, 0, 0) } |
| 34 | func ts_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 48 | func ts_score_of(path: *u8) -> i64 |
| 58 | func ts_write_buf(path: *u8, buf: *u8, n: i64) -> i64 |
| 67 | func 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 |
| 69 | func ts_at(buf: *u8, ls: i64, le: i64, pat: *u8, pl: i64) -> i64 |
| 79 | func ts_vocab(toks: *i64) -> i64 |
| 110 | func ts_variant(tbuf: *u8, tn: i64, transform: *u8, outpath: *u8) -> i64 |
| 138 | func ts_run(variantpath: *u8) -> i64 |
| 164 | func ts_search(taskpath: *u8, solved: *u8) -> i64 |
| 189 | func ts_solve(taskpath: *u8) -> i64 |
| 200 | func main(argc: i64, argv: *i64) -> i64 |