code wiki / (root) / nx_intent.nx

nx_intent.nx

buildroot/runtime/nx_intent.nx

7025 B171 linesdepth 2pulls 2 transitivereach 16 importersview sourcekind librarytopic intent
docsdependenciesstructsconstsfunctions

about

nx_intent.nx -- per-function intent declaration (Captain Moroni Phase M1). Per [[feedback-captain-moroni-doctrine]] Phase M1: "nx_intent<I> sealed type with values Defensive | Diagnostic | Educational | Creative. EVERY function declares intent; substrate refuses unintented operations." THE STRUCTURAL REFUSAL FOUNDATION. Substrate-level enforcement (not policy-level) of the Captain Moroni doctrine. A function declared with intent=Defensive cannot be invoked to compose an offensive operation; intent=Educational cannot exfiltrate; intent=Creative cannot command physical actuators. Distinct from nx_intent_survival.nx (image-render-verification primitive); the suffixed name there avoids any collision with this foundational primitive. Composes: nx_cell -- every cell declares its meta-intent nx_brane -- capability checks compose with intent checks nx_drone_doctrine -- intent must be Defensive for drone code nx_battery_safety -- intent restricts BMS commands nx_pollinate -- federation refuses non-Defensive payloads V1 ships: - 4 sealed values per cardinal - intent-pair compatibility table (caller's declared intent must be CONSISTENT with callee's declared intent) - structural-refusal predicate for offensive-pattern operations

dependencies 2 imports · 16 importers

nx_syscalls.nx nx_tier.nx nx_intent.nx nx_ai_audit.nx nx_ai_audit_test.nx nx_batt_recondition.nx nx_batt_recondition_test.nx nx_battery_safety.nx nx_battery_safety_test.nx nx_captain_moroni_compose_test.nx nx_drone_doctrine.nx nx_drone_doctrine_test.nx nx_intent_test.nx

diagram shows first 10 each side; +0 more imports, +6 more importers in the complete lists below.

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_ai_audit.nxnx_ai_audit_test.nxnx_batt_recondition.nxnx_batt_recondition_test.nxnx_battery_safety.nxnx_battery_safety_test.nxnx_captain_moroni_compose_test.nxnx_drone_doctrine.nxnx_drone_doctrine_test.nxnx_intent_test.nxnx_scam_detector.nxnx_scam_detector_test.nxnx_substrate_closure_compose_test.nxnx_tier3_ecology_compose_test.nxnx_transponder_quiescence.nxnx_transponder_quiescence_test.nx

structs

none

consts

36const NX_INTENT_DEFENSIVE: nx_int = 0
37const NX_INTENT_DIAGNOSTIC: nx_int = 1
38const NX_INTENT_EDUCATIONAL: nx_int = 2
39const NX_INTENT_CREATIVE: nx_int = 3
40const NX_INTENT_N_KINDS: nx_int = 4
44const NX_IN_OK: nx_int = 0
45const NX_IN_ERR_BAD_INTENT: nx_int = 1
46const NX_IN_REFUSED_INCONSISTENT: nx_int = 2 // caller / callee intents disagree
47const NX_IN_REFUSED_OFFENSIVE: nx_int = 3 // structural-refusal fire
48const NX_IN_REFUSED_UNDECLARED: nx_int = 4 // missing intent at boundary
114const NX_OPK_READ_OWN_STATE: nx_int = 0
115const NX_OPK_WRITE_OWN_STATE: nx_int = 1
116const NX_OPK_NETWORK_RECV: nx_int = 2
117const NX_OPK_NETWORK_SEND: nx_int = 3
118const NX_OPK_ACTUATE_DRONE: nx_int = 4 // offensive-pattern unless Defensive
119const NX_OPK_COMMAND_BATTERY: nx_int = 5 // offensive-pattern unless Defensive
120const NX_OPK_ACTIVATE_TRANSPONDER: nx_int = 6 // offensive-pattern unless Defensive
121const NX_OPK_KERNEL_PRIVILEGED: nx_int = 7 // offensive-pattern unless Defensive
122const NX_OPK_PEER_BROADCAST: nx_int = 8
123const NX_OPK_N_KINDS: nx_int = 9

functions

52func nx_intent_is_valid(i: nx_int) -> nx_int
76func nx_intent_compatible(caller: nx_int, callee: nx_int) -> nx_int
101func nx_intent_check_invocation(caller: nx_int, callee: nx_int) -> nx_int
125func nx_opk_is_valid(o: nx_int) -> nx_int
137func nx_opk_is_offensive_pattern(o: nx_int) -> nx_int
151func nx_intent_check_operation(intent: nx_int, op: nx_int) -> nx_int
165func nx_intent_string_short(i: nx_int) -> nx_int
called by 1: main