code wiki / _hdl_build / nx_self_sufficiency.nx

nx_self_sufficiency.nx source

↩ module page · 50 lines · 2693 B

1// nx_self_sufficiency.nx -- the team models its OWN full-loop self-sufficiency (operator: "what is our 2// map to a self-sufficient full loop, given a target and building with a runner?"). The loop, given a 3// TARGET, is 7 stages: 4// S1 TARGET -- a target/objective arrives (operator, or the Researcher's L0 desire) TEAM 5// S2 SPEC -- Researcher decomposes it to L8 (nx_researcher_spec) TEAM 6// S3 SPACE -- a SEARCH SPACE + verifier exists for it... or a NEW MODULE must be authored TEAM | LLM-GAP 7// S4 AUTHOR -- Builder authors the solution BY SEARCH (bsy_author / bs4_synth / pi_iterate) TEAM 8// S5 VERIFY -- Engineer GATES it with a RUNNER (eng_build_gate / the _run_*.sh harness) TEAM 9// S6 JUDGE -- Referee/Examiner grade OBJECTIVELY (no self-grading) TEAM 10// S7 BANK -- register in the self-model; Teacher tracks acquisition M0->M3 TEAM 11// The loop is FULLY CLOSED (target->bank with NO Claude) when the search space already exists. It is 12// OPEN at exactly ONE stage -- S3, when a brand-NEW module/search-space must be authored: that is the 13// novel-module LLM-gap, the last thing Claude still writes by hand. The MAP to full self-sufficiency = 14// close S3 (the custom Nishi LLM, or the local backup, authors new modules). license_tier: ORIGINAL 15 16import "nx_syscalls.nx" 17 18const SS_TARGET: i64 = 1 19const SS_SPEC: i64 = 2 20const SS_SPACE: i64 = 3 21const SS_AUTHOR: i64 = 4 22const SS_VERIFY: i64 = 5 23const SS_JUDGE: i64 = 6 24const SS_BANK: i64 = 7 25const SS_N: i64 = 7 26 27const SS_TEAM: i64 = 1 28const SS_LLM: i64 = 2 29 30// stage owner -- only S3 is an LLM-gap, and ONLY when the search space does not yet exist. 31func ss_stage_owner(stage: i64, space_exists: i64) -> i64 { 32 if stage == SS_SPACE { if space_exists == 0 { return SS_LLM } } 33 return SS_TEAM 34} 35 36// the loop is fully closed (target -> bank, no Claude) iff the search space already exists. 37func ss_loop_closed(space_exists: i64) -> i64 { return space_exists } 38 39// how many of the 7 stages the team owns for this target. 40func ss_team_stages(space_exists: i64) -> i64 { 41 var c: i64 = 0; var s: i64 = 1 42 while s <= SS_N { if ss_stage_owner(s, space_exists) == SS_TEAM { c = c + 1 } s = s + 1 } 43 return c 44} 45 46// the one OPEN stage when a new module is needed (-1 if the loop is closed). 47func ss_open_stage(space_exists: i64) -> i64 { if space_exists == 0 { return SS_SPACE } return 0 - 1 } 48 49// is the open stage the novel-module rung? (the only thing that needs the LLM in the loop) 50func ss_open_is_novel_module(space_exists: i64) -> i64 { if ss_open_stage(space_exists) == SS_SPACE { return 1 } return 0 }