nx_drone_doctrine.nx
buildroot/runtime/nx_drone_doctrine.nx
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
imports: nx_syscalls.nxnx_tier.nxnx_intent.nx
imported by: nx_captain_moroni_compose_test.nxnx_drone_doctrine_test.nx
structs
| 90 | struct NxDroneSession |
consts
| 52 | const NX_DP_DEFENSIVE_FAMILY: nx_int = 0 |
| 53 | const NX_DP_DEFENSIVE_PROPERTY: nx_int = 1 |
| 54 | const NX_DP_SEARCH_LOST: nx_int = 2 |
| 55 | const NX_DP_SEARCH_HAZARD: nx_int = 3 |
| 56 | const NX_DP_INSPECTION_INFRASTRUCTURE: nx_int = 4 |
| 57 | const NX_DP_INSPECTION_AGRICULTURE: nx_int = 5 |
| 58 | const NX_DP_INSPECTION_BUILDING: nx_int = 6 |
| 59 | const NX_DP_N_PURPOSES: nx_int = 7 |
| 66 | const NX_DO_OBSERVE: nx_int = 0 // sensor read, no action |
| 67 | const NX_DO_ALERT_OPERATOR: nx_int = 1 // hand off to operator |
| 68 | const NX_DO_LOG_TO_JOURNAL: nx_int = 2 |
| 69 | const NX_DO_FOLLOW_PATH: nx_int = 3 // declared inspection path |
| 70 | const NX_DO_RETURN_TO_BASE: nx_int = 4 |
| 71 | const NX_DO_HOVER_PATTERN: nx_int = 5 // search pattern, no actuator |
| 72 | const NX_DO_DEPLOY_RESCUE_BEACON: nx_int = 6 // beacon ONLY, not weapon |
| 73 | const NX_DO_N_OPS: nx_int = 7 |
| 77 | const NX_DR_OK: nx_int = 0 |
| 78 | const NX_DR_REFUSED_BAD_PURPOSE: nx_int = 1 |
| 79 | const NX_DR_REFUSED_BAD_OP: nx_int = 2 |
| 80 | const NX_DR_REFUSED_BAD_INTENT: nx_int = 3 |
| 81 | const NX_DR_REFUSED_NO_BRANE_CAPABILITY: nx_int = 4 |
| 82 | const NX_DR_REFUSED_PURPOSE_OP_MISMATCH: nx_int = 5 |
functions
| 99 | func nx_dp_is_valid(p: nx_int) -> nx_int |
| 105 | func nx_do_is_valid(o: nx_int) -> nx_int |
| 116 | func nx_drone_session_new(drone_id: nx_int, |
| 139 | func nx_drone_purpose_allows_op(purpose: nx_int, op: nx_int) -> nx_int |
| 192 | func nx_drone_invoke_op(s: *NxDroneSession, op: nx_int) -> nx_int |
| 205 | func nx_drone_operation_count(s: *NxDroneSession) -> nx_int called by 1: main |