code wiki / _hdl_build / nx_hub_spoke.nx
nx_hub_spoke.nx source
↩ module page · 50 lines · 2912 B
1// nx_hub_spoke.nx -- the central permanent HUB (main Nishi) grows by absorbing what its CLONES learn, then
2// spawns stronger clones (operator: "iterate and grow the central permanent west team the hub... spoked
3// projects like elder ai receive and feedback... automated improving scaffolding loops where like naruto
4// learns from his clones and gets more capable then sends out more powerful clones our team does the
5// same"). The Naruto invariant: a clone is spawned with the hub's CURRENT power; what it learns returns to
6// the hub and -- ONLY if it passes the governance gate -- raises the hub's power; the next clone is spawned
7// stronger. Additive-only, so no regression/drift. license_tier: ORIGINAL Integration is gated by
8// nx_ingest_governed; refined by /deep-research wfb7jkc6h (running).
9
10import "nx_syscalls.nx"
11
12// a clone is exactly as capable as the hub at spawn time (it inherits the hub's grown capability set).
13func hs_clone_power(hub_caps: i64) -> i64 { return hub_caps }
14
15// the hub INTEGRATES a clone's learning -- but only through the governance gate (Engineer+Council+docs).
16// rejected learnings do NOT shrink the hub (additive-only); accepted ones grow it.
17func hs_integrate(hub_caps: i64, learned: i64, governed_admit: i64) -> i64 {
18 if governed_admit != 1 { return hub_caps } // held/rejected -> hub unchanged (no regression)
19 if learned < 0 { return hub_caps }
20 return hub_caps + learned
21}
22
23// monotonic-growth invariant: the hub never regresses, only grows or holds.
24func hs_no_regression(hub_before: i64, hub_after: i64) -> i64 { if hub_after >= hub_before { return 1 } return 0 }
25
26// the next clone is STRONGER than the previous one iff the hub integrated something between them.
27func hs_next_stronger(prev_clone_power: i64, hub_after: i64) -> i64 { if hub_after > prev_clone_power { return 1 } return 0 }
28
29// HUB-AND-SPOKE: a spoke project (e.g. Elder AI) RECEIVES the hub's current capability set...
30func hs_spoke_receive(hub_caps: i64) -> i64 { return hub_caps }
31// ...and FEEDS BACK a learning, which only counts if it passes the same governance gate.
32func hs_spoke_feedback(learning: i64, governed_admit: i64) -> i64 {
33 if governed_admit != 1 { return 0 }
34 if learning < 0 { return 0 }
35 return learning
36}
37
38// run K generations of the Naruto loop: each gen spawns a clone (records its power), the clone learns
39// `gain` (gated by `admit`), the hub integrates. writes each clone's power into out_powers; returns the
40// final hub power. monotonic by construction.
41func hs_run_generations(hub0: i64, gains: *i64, admits: *i64, k: i64, out_powers: *i64) -> i64 {
42 var hub: i64 = hub0
43 var g: i64 = 0
44 while g < k {
45 out_powers[g] = hs_clone_power(hub) // spawn a clone at the current power
46 hub = hs_integrate(hub, gains[g], admits[g]) // absorb its (governed) learning
47 g = g + 1
48 }
49 return hub
50}