code wiki / _hdl_build / nx_pm_status.nx
nx_pm_status.nx source
↩ module page · 45 lines · 2152 B
1// nx_pm_status.nx -- the PROJECT MANAGER's STATUS REPORT (operator: I want status updates like a real
2// team, and to SEE the breadth from layer 8 up, not snippets). The PM summarizes the team's own
3// inventory (the self-model register): how many capabilities at each LAYER (L8 machine-code up to L0
4// output), how many PROVEN, the grade distribution (S/A/B from the Examiner), and the next build. The
5// team reports its OWN status -- no more black box. Owned by the PM, composing the self-model
6// (inventory) + Examiner (grades) + the layered backlog (next build). license_tier: ORIGINAL.
7
8import "nx_syscalls.nx"
9
10// total capabilities across the layers.
11func pm_total(layer_counts: *i64, nlayers: i64) -> i64 {
12 var t: i64 = 0; var i: i64 = 0
13 while i < nlayers { t = t + layer_counts[i]; i = i + 1 }
14 return t
15}
16
17// proven percent (per-1000) of the inventory.
18func pm_proven_permil(proven: i64, total: i64) -> i64 {
19 if total <= 0 { return 0 }
20 return (proven * 1000) / total
21}
22
23// BREADTH check: is every layer populated (a full bits-up stack, no empty layer)? 1 = full-stack.
24func pm_full_stack(layer_counts: *i64, nlayers: i64) -> i64 {
25 var i: i64 = 0
26 while i < nlayers { if layer_counts[i] == 0 { return 0 } i = i + 1 }
27 return 1
28}
29
30// the layer with the FEWEST capabilities = where the stack is thinnest (a status flag for attention).
31func pm_thinnest_layer(layer_counts: *i64, nlayers: i64) -> i64 {
32 var idx: i64 = 0; var lo: i64 = layer_counts[0]; var i: i64 = 1
33 while i < nlayers { if layer_counts[i] < lo { lo = layer_counts[i]; idx = i } i = i + 1 }
34 return idx
35}
36
37// the headline health of the project: PROVEN ratio high + full stack + at least one S-class. returns
38// a 0-1000 project-health score the PM reports.
39func pm_health(proven: i64, total: i64, full_stack: i64, sclass: i64) -> i64 {
40 var h: i64 = pm_proven_permil(proven, total) / 2 // up to 500 from proven ratio
41 if full_stack == 1 { h = h + 300 } // full bits-up stack
42 if sclass >= 1 { h = h + 200 } // at least one genuine exceed
43 if h > 1000 { h = 1000 }
44 return h
45}