code wiki / (root) / nx_flow_state.nx

nx_flow_state.nx

buildroot/runtime/nx_flow_state.nx

11434 B284 linesdepth 4pulls 5 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_flow_state.nx -- F1 first stone of NISHI_FLOW_DOCTRINE_ROADMAP.md. Aggregate flow-state classifier. Composes the substrate's existing measurement layers (nx_perf_pathology, nx_etg outcomes, conductor placement signals, cross-arch parity verdicts, reclamation accounting) into a single sealed-enum verdict on whether the system is currently at its empirical near-edge -- the substrate's flow state. Csikszentmihalyi's nine conditions for flow, translated to substrate-testable signals: 1. Clear goals -> reference band present 2. Immediate feedback -> ETG attestation emitted 3. Challenge-skill balance -> tournament selected variant matching empirical ceiling 4. Action-awareness merger -> conductor placement decided 5. Loss of self-conscious -> substrate overhead < noise floor 6. Distorted time -> N/A substrate tier (human-flow F7) 7. Autotelic -> reclamation > 0 OR all confirmed 8. Concentration on task -> no second-class resources idle 9. Sense of control -> attestation chain complete All eight measurable conditions met simultaneously -> NX_FLOW_STATE_FLOW. Cardinal violations (paywall honored, second-class resources, single-arch overfit, latency spike) -> NX_FLOW_STATE_TILT. Insufficient signals -> NX_FLOW_STATE_BROKEN. Composes: [[NISHI_FLOW_DOCTRINE_ROADMAP]] F1 (this is the first stone) nx_perf_pathology.nx (classifier feeds flow signals) nx_etg.nx (attestation per probe) [[feedback-hardware-agnostic-is-robustness]] (cross-arch parity is one of the nine conditions) [[feedback-jim-clark-racing-line-substrate]] (the racing line IS the substrate's flow state) [[feedback-conductor-heterogeneous-compute-no-second-class-resources]] (P10 is TILT-inducing) [[feedback-reclamation-doctrine-captain-moroni]] (P11 is TILT-inducing) [[feedback-physical-truth-over-published-docs-silicon-empirical-

dependencies 3 imports · 1 importers

nx_syscalls.nx nx_perf_pathology.nx nx_etg.nx nx_flow_state.nx nx_flow_state_test.nx

imports: nx_syscalls.nxnx_perf_pathology.nxnx_etg.nx

imported by: nx_flow_state_test.nx

structs

94struct NxFlowState

consts

65const NX_FLOW_STATE_NONE: i64 = 0
66const NX_FLOW_STATE_FLOW: i64 = 1 // all 8 measurable conditions met
67const NX_FLOW_STATE_NEAR_FLOW: i64 = 2 // 6-7 conditions met
68const NX_FLOW_STATE_SLIPPING: i64 = 3 // 4-5 conditions met
69const NX_FLOW_STATE_TILT: i64 = 4 // cardinal violation present
70const NX_FLOW_STATE_BROKEN: i64 = 5 // insufficient signals
71const NX_FLOW_STATE_N: i64 = 6

functions

73func nx_flow_state_is_valid(s: i64) -> i64
called by 1: main
79func nx_flow_state_name(s: i64) -> *u8
135func nx_flow_state_init(s: *NxFlowState, silicon_serial_hash: i64)
called by 1: main
166func _flow_count_unsignaled(s: *NxFlowState) -> i64
called by 1: nx_flow_classify
180func _flow_count_met(s: *NxFlowState) -> i64
called by 1: nx_flow_classify
194func _flow_has_cardinal_violation(s: *NxFlowState) -> i64
called by 1: nx_flow_classify
202func nx_flow_classify(s: *NxFlowState) -> i64
255func nx_flow_attest(
called by 1: main calls 1: nx_etg_entry_init