nx_covenant.nx
buildroot/runtime/nx_covenant.nx
about
nx_covenant.nx -- multi-stakeholder + multi-generational consent.
Per META-CARDINAL feedback-regenerative-stewardship-doctrine-captain-moroni:
the legal-and-relational substrate where regenerative intentions become
regenerative actions without harm. Composes: landowner consent +
Indigenous Free Prior and Informed Consent (FPIC) per UN Declaration
on the Rights of Indigenous Peoples + Indigenous Data Sovereignty +
CARE Principles + watershed rights + regulatory compliance + neighbor
relationships + future-inheritor obligations.
V1 ships sealed enums of stakeholder classes + consent states +
covenant lifecycle + revocation handling. Per [[feedback-user-owns-
every-bit]]: every consent is operator-scope-bounded + time-bounded
+ revocable.
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_covenant_test.nx
structs
| 61 | struct NxConsentEntry |
| 75 | struct NxCovenant |
consts
| 24 | const NX_SH_LANDOWNER: nx_int = 0 |
| 25 | const NX_SH_INDIGENOUS_NATION: nx_int = 1 // requires FPIC |
| 26 | const NX_SH_DOWNSTREAM_WATER_USER: nx_int = 2 |
| 27 | const NX_SH_REGULATORY_BODY: nx_int = 3 |
| 28 | const NX_SH_NEIGHBOR: nx_int = 4 |
| 29 | const NX_SH_FUTURE_INHERITOR: nx_int = 5 // multi-generational |
| 30 | const NX_SH_OPERATOR: nx_int = 6 // the primary actor |
| 31 | const NX_SH_FAMILY_MEMBER: nx_int = 7 |
| 32 | const NX_SH_COMMUNITY_COUNCIL: nx_int = 8 |
| 33 | const NX_SH_TRUSTED_ADVISOR: nx_int = 9 // counsel / ecologist / etc. |
| 34 | const NX_SH_N_CLASSES: nx_int = 10 |
| 38 | const NX_CN_PENDING: nx_int = 0 |
| 39 | const NX_CN_GRANTED: nx_int = 1 |
| 40 | const NX_CN_GRANTED_CONDITIONAL: nx_int = 2 // with stipulations |
| 41 | const NX_CN_DECLINED: nx_int = 3 |
| 42 | const NX_CN_REVOKED: nx_int = 4 |
| 43 | const NX_CN_EXPIRED: nx_int = 5 |
| 44 | const NX_CN_NOT_APPLICABLE: nx_int = 6 // stakeholder doesn't apply here |
| 45 | const NX_CN_N_STATES: nx_int = 7 |
| 49 | const NX_CV_V_OK_ALL_GRANTED: nx_int = 0 |
| 50 | const NX_CV_V_PENDING_STAKEHOLDERS: nx_int = 1 |
| 51 | const NX_CV_V_BLOCKED_DECLINED: nx_int = 2 |
| 52 | const NX_CV_V_FPIC_REQUIRED_MISSING: nx_int = 3 // Indigenous consent missing |
| 53 | const NX_CV_V_REVOKED: nx_int = 4 |
| 54 | const NX_CV_V_EXPIRED: nx_int = 5 |
| 55 | const NX_CV_V_NULL: nx_int = 6 |
| 56 | const NX_CV_V_INVALID: nx_int = 7 |
| 57 | const NX_CV_V_N: nx_int = 8 |
| 71 | const NX_CN_ENT_BYTES: nx_int = 48 |
| 85 | const NX_CV_BYTES: nx_int = 48 |
functions
| 87 | func nx_sh_class_is_valid(c: nx_int) -> nx_int |
| 93 | func nx_cn_state_is_valid(s: nx_int) -> nx_int |
| 99 | func nx_cv_v_is_valid(v: nx_int) -> nx_int called by 1: main |
| 105 | func nx_cn_state_is_blocking(s: nx_int) -> nx_int called by 1: main |
| 112 | func nx_cn_state_is_satisfied(s: nx_int) -> nx_int |
| 119 | func nx_sh_class_requires_fpic(c: nx_int) -> nx_int called by 1: main |
| 124 | func nx_cv_new(covenant_id: nx_int, |
| 142 | func _cv_entry_at(c: *NxCovenant, idx: nx_int) -> *NxConsentEntry |
| 149 | func nx_cv_add_stakeholder(c: *NxCovenant, |
| 169 | func nx_cv_set_consent(c: *NxCovenant, |
| 199 | func nx_cv_classify(c: *NxCovenant, now_us: nx_size) -> nx_int |
| 241 | func nx_cv_count_by_class(c: *NxCovenant, class_id: nx_int) -> nx_int |