code wiki / _hdl_build / nx_nightly_maintenance.nx
nx_nightly_maintenance.nx source
↩ module page · 51 lines · 2715 B
1// nx_nightly_maintenance.nx -- the team's NIGHTLY CLOSE, like a store shutting down for the night
2// (operator): when work winds down, every organ runs its closing task so the ecosystem opens clean
3// the next day. The Conductor orchestrates; each organ does ONE closing job and reports issues that
4// go on the MORNING LIST (nothing is hidden, nothing is auto-deleted -- additive only):
5// LIBRARIAN -- CITATION AUDIT: every artifact/finding must carry citations; count the uncited.
6// ENGINEER -- INVENTORY: count capabilities, confirm every one has a verifying GATE; count gaps.
7// GENEALOGIST -- SPRAWL SCAN: exact + near duplicate pairs across the registry.
8// CARETAKER -- PRUNE PLAN: pending safe soft-retires (the gardener's to-do, never auto-applied).
9// CRITIC -- BLIND-SPOT SWEEP: beliefs leaned on without a red-team.
10// SCORECARD -- REGRESSION CHECK: any teammate weaker than yesterday.
11// The store CLOSES CLEAN only when every check is zero; otherwise it leaves a morning list. RACI: the
12// Conductor runs the close, each organ owns its check, the Scribe logs it. license_tier: ORIGINAL
13
14import "nx_genealogist.nx"
15import "nx_caretaker.nx"
16import "nx_syscalls.nx"
17
18const NM_CLEAN: i64 = 0
19const NM_ISSUES: i64 = 1
20
21// LIBRARIAN: every artifact must be cited (rule: research is reproducible only if sourced). # uncited.
22func nm_citation_audit(n: i64, cited: *i64) -> i64 {
23 var u: i64 = 0; var i: i64 = 0
24 while i < n { if cited[i] == 0 { u = u + 1 } i = i + 1 }
25 return u
26}
27
28// ENGINEER inventory: # capabilities missing a verifying gate (every cap must be provable by execution).
29func nm_inventory_missing_gates(n: i64, has_gate: *i64) -> i64 {
30 var m: i64 = 0; var i: i64 = 0
31 while i < n { if has_gate[i] == 0 { m = m + 1 } i = i + 1 }
32 return m
33}
34
35// ENGINEER inventory: count proven capabilities (the night's headcount of what is real).
36func nm_inventory_proven(n: i64, proven: *i64) -> i64 {
37 var p: i64 = 0; var i: i64 = 0
38 while i < n { if proven[i] == 1 { p = p + 1 } i = i + 1 }
39 return p
40}
41
42// the MORNING LIST size = total issues across all organs' checks.
43func nm_morning_list(uncited: i64, missing_gates: i64, sprawl: i64, pending_prunes: i64, blindspots: i64, regressions: i64) -> i64 {
44 return uncited + missing_gates + sprawl + pending_prunes + blindspots + regressions
45}
46
47// the store-closed verdict: CLEAN only if nothing is on the morning list.
48func nm_nightly_close(uncited: i64, missing_gates: i64, sprawl: i64, pending_prunes: i64, blindspots: i64, regressions: i64) -> i64 {
49 if nm_morning_list(uncited, missing_gates, sprawl, pending_prunes, blindspots, regressions) > 0 { return NM_ISSUES }
50 return NM_CLEAN
51}