code wiki / (root) / nx_drone_doctrine.nx

nx_drone_doctrine.nx

buildroot/runtime/nx_drone_doctrine.nx

8197 B207 linesdepth 3pulls 3 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_drone_doctrine.nx -- sealed defensive-only purposes (Phase M3). Per [[feedback-captain-moroni-doctrine]] Phase M3: "Sealed type with ONLY defensive variants. NO Lethal / Targeting / Strike variants — substrate refuses to instantiate them. The substrate REFUSES to compile drone code outside the sealed defensive set. An attacker cannot use NishiLang to BUILD a killer drone — the type system rejects the program." THE STRUCTURAL REFUSAL OF LETHAL AUTONOMY. The cardinal's hardest and most important primitive. By making the offensive variants UNREPRESENTABLE at the type level, an attacker forking NishiLang to build a killer drone has to extend the type system itself -- which announces the offensive intent and is detectable by every downstream user of the fork. Defensive purposes shipped V1 (the ONLY admissible drone uses): - DEFENSIVE_FAMILY -- perimeter alert around family - DEFENSIVE_PROPERTY -- perimeter alert around land/buildings - SEARCH_LOST -- find missing persons - SEARCH_HAZARD -- identify environmental hazards - INSPECTION_INFRASTRUCTURE -- power lines / agriculture / building - INSPECTION_AGRICULTURE -- crop health, irrigation, herd - INSPECTION_BUILDING_INTEGRITY -- roof, structural EXPLICITLY ABSENT (and refused at the type system): Lethal, Targeting, Strike, Surveillance-of-non-consenting-person, Attack, CrowdControl, Reconnaissance-of-private-property-without-consent. Per Captain Moroni: every drone instantiation requires a NxDronePurpose that is one of the sealed defensive values; runtime further requires Defensive intent + twin-key authorization if purpose involves real-world flight (vs simulator). Composes: nx_intent -- caller must declare Defensive nx_brane -- CAP_DRONE_ACTUATE must be granted + scope-narrowed per purpose nx_evict_journal -- every instantiation logged with purpose + ops

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_tier.nx nx_intent.nx nx_drone_doctrine.nx nx_captain_moroni_compose_test.nx nx_drone_doctrine_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_intent.nx

imported by: nx_captain_moroni_compose_test.nxnx_drone_doctrine_test.nx

structs

90struct NxDroneSession

consts

52const NX_DP_DEFENSIVE_FAMILY: nx_int = 0
53const NX_DP_DEFENSIVE_PROPERTY: nx_int = 1
54const NX_DP_SEARCH_LOST: nx_int = 2
55const NX_DP_SEARCH_HAZARD: nx_int = 3
56const NX_DP_INSPECTION_INFRASTRUCTURE: nx_int = 4
57const NX_DP_INSPECTION_AGRICULTURE: nx_int = 5
58const NX_DP_INSPECTION_BUILDING: nx_int = 6
59const NX_DP_N_PURPOSES: nx_int = 7
66const NX_DO_OBSERVE: nx_int = 0 // sensor read, no action
67const NX_DO_ALERT_OPERATOR: nx_int = 1 // hand off to operator
68const NX_DO_LOG_TO_JOURNAL: nx_int = 2
69const NX_DO_FOLLOW_PATH: nx_int = 3 // declared inspection path
70const NX_DO_RETURN_TO_BASE: nx_int = 4
71const NX_DO_HOVER_PATTERN: nx_int = 5 // search pattern, no actuator
72const NX_DO_DEPLOY_RESCUE_BEACON: nx_int = 6 // beacon ONLY, not weapon
73const NX_DO_N_OPS: nx_int = 7
77const NX_DR_OK: nx_int = 0
78const NX_DR_REFUSED_BAD_PURPOSE: nx_int = 1
79const NX_DR_REFUSED_BAD_OP: nx_int = 2
80const NX_DR_REFUSED_BAD_INTENT: nx_int = 3
81const NX_DR_REFUSED_NO_BRANE_CAPABILITY: nx_int = 4
82const NX_DR_REFUSED_PURPOSE_OP_MISMATCH: nx_int = 5

functions

99func nx_dp_is_valid(p: nx_int) -> nx_int
105func nx_do_is_valid(o: nx_int) -> nx_int
116func nx_drone_session_new(drone_id: nx_int,
called by 2: mainmain calls 2: nx_dp_is_validsys_mmap
139func nx_drone_purpose_allows_op(purpose: nx_int, op: nx_int) -> nx_int
192func nx_drone_invoke_op(s: *NxDroneSession, op: nx_int) -> nx_int
205func nx_drone_operation_count(s: *NxDroneSession) -> nx_int
called by 1: main