# Decision Rules

# R-SUB: Submission Rules

## Submission Rules

These rules govern what constitutes a valid data submission. All three must pass before a submission enters the pending-validation queue.

<div id="bkmrk-r-sub-01-shacl-valid" style="border:2px solid #1a7f64;border-radius:10px;padding:18px;margin:18px 0;background:#eaf5ef"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-SUB-01` **SHACL Validation Required**</div>Every submission must pass the `cth:FieldDataQuality` SHACL shape before entering the validation queue. Submissions that fail are rejected at ingestion with a machine-readable error payload.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** OPA policy `submit.rego` calls the SHACL validator endpoint synchronously. Rejection codes returned as JSON-LD ValidationReport. </div></div><div id="bkmrk-r-sub-02-fpic-mandat" style="border:2px solid #6b3a9e;border-radius:10px;padding:18px;margin:18px 0;background:#f3eef9"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-SUB-02` **FPIC Mandatory for Indigenous Territory**</div>Any parcel whose GPS centroid intersects an officially recognised indigenous territory or Afro-Colombian collective territory requires a valid `cth:FPICCredential` signed by the Community Sovereign before submission is accepted.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** Postgis `ST_Within()` check against `territorial_boundaries` table at ingestion. Row-level security blocks write if FPIC credential not present in JWT claims. </div></div><div id="bkmrk-r-sub-03-methodology" style="border:2px solid #b35c00;border-radius:10px;padding:18px;margin:18px 0;background:#fdf3e7"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-SUB-03` **Methodology Declaration Required**</div>Submitter must declare which measurement methodology was used (e.g. KoboToolbox GPS v2.3, Planet NDVI mosaic 2025-Q4, manual tape survey). Methodology ID must resolve to a registered entry in `cth_methodology_registry`.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** Foreign key constraint on `submissions.methodology_id`. Validator accreditation scope is checked against methodology type. </div></div><div id="bkmrk-%E2%84%B9%EF%B8%8F-these-three-rules" style="background:#e8f4f8;border:1px solid #17a2b8;border-radius:8px;
padding:14px 18px;margin:16px 0">ℹ️ These three rules compose: a submission must pass ALL of R-SUB-01, R-SUB-02, and R-SUB-03 simultaneously. Partial compliance is not accepted.</div>

# R-VAL: Validation Rules

## Validation Rules

Validation is the act of a credentialed third party signing that data meets a specific standard. These rules prevent conflicts of interest and ensure regulatory-grade assurance.

<div id="bkmrk-r-val-01-accredited-" style="border:2px solid #1a6b8a;border-radius:10px;padding:18px;margin:18px 0;background:#e8f4f8"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-VAL-01` **Accredited Validators Only**</div>Only principals holding a valid `cth:ValidatorCredential` may sign validation results. Validator credentials list the specific methodologies and standards the holder is accredited to validate.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** OPA `validate.rego` checks credential claims. Unsigned or self-signed validation results are rejected at ingestion. </div></div><div id="bkmrk-r-val-02-no-self-cer" style="border:2px solid #c0392b;border-radius:10px;padding:18px;margin:18px 0;background:#fdecea"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-VAL-02` **No Self-Certification**</div>A Data Submitter may not validate their own submission. The validator DID must differ from the submitter DID. This applies transitively — a validator who is a beneficial owner of the submitting entity is also disqualified.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** Ledger constraint: `submission.submitter_did ≠ validation.validator_did`. Beneficial ownership conflicts flagged via off-chain KYC check at validator onboarding. </div></div><div id="bkmrk-r-val-03-cbam-and-ar" style="border:2px solid #b35c00;border-radius:10px;padding:18px;margin:18px 0;background:#fdf3e7"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-VAL-03` **CBAM and Article 6 Require Validation**</div>EUDR DDS can be self-declared by the operator (EU Regulation 2023/1115 Article 4). However, CBAM declarations (Article 7) and Article 6.4 carbon credits require third-party validation before a Digital Conformity Credential (DCC) can be issued.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** Compliance export endpoint checks `validation_status` field. CBAM and Art.6 exports blocked if no signed DCC present. </div></div>

# R-CON: Consent & Benefit Rules

## Consent &amp; Benefit Rules

Consent rules govern what happens after data is collected. They protect community sovereignty and ensure benefit flows back to data contributors.

<div id="bkmrk-r-con-01-revocation-" style="border:2px solid #6b3a9e;border-radius:10px;padding:18px;margin:18px 0;background:#f3eef9"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-CON-01` **Revocation Cascades Immediately**</div>When a Community Sovereign revokes FPIC for a territory, all downstream credentials (DCCs, EUDR DDS) that relied on data from that territory are immediately flagged `status: suspended`. Third parties holding those credentials are notified via webhook within 60 seconds.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** FPIC revocation event triggers `cascade_revoke()` Postgres function. Downstream credential IDs stored in `fpic_dependencies` table. Webhook queue processes within 60s SLA. </div></div><div id="bkmrk-r-con-02-purpose-lim" style="border:2px solid #1a7f64;border-radius:10px;padding:18px;margin:18px 0;background:#eaf5ef"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-CON-02` **Purpose Limitation Enforced at Runtime**</div>Data may only be used for the purposes declared in the FPIC credential and the submission metadata. An agent or API call requesting data for an undeclared purpose (e.g. using EUDR data for a carbon market without explicit consent) is rejected by OPA.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** OPA `purpose.rego` compares `request.purpose` claim against `fpic.permitted_purposes[]` array. Rejection logged as PROV-O `wasInvalidatedBy` event. </div></div><div id="bkmrk-r-con-03-benefit-sha" style="border:2px solid #b35c00;border-radius:10px;padding:18px;margin:18px 0;background:#fdf3e7"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-CON-03` **Benefit-Sharing Terms in Ledger**</div>Any commercial use of community data (carbon credits, premium certification fees, data licensing) requires a benefit-sharing agreement recorded in the governance ledger before data access is granted. Minimum 20% of net commercial value must flow to contributing community.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** Benefit-sharing contract hash stored in `benefit_agreements` table. OPA `commercial.rego` blocks commercial data access if no valid agreement present. </div></div><div id="bkmrk-%E2%9A%A0%EF%B8%8F-important%3A-r-con-" style="background:#fff3cd;border:1px solid #ffc107;border-radius:8px;
padding:14px 18px;margin:16px 0">⚠️ **Important:** R-CON-01 is the hardest rule in the framework. Revocation can cascade to invalidate export documents that third parties (coffee buyers, EU customs) are relying on. CTH Data Stewards must proactively manage community relationships to avoid surprise revocations.</div>

# R-AGT: Agent Rules

## Agent Rules

AI agents are first-class participants in this framework. These rules ensure agents are accountable, auditable, and structurally cannot exceed the permissions of the humans who delegate to them.

<div id="bkmrk-r-agt-01-all-agent-a" style="border:2px solid #0d6efd;border-radius:10px;padding:18px;margin:18px 0;background:#e7f0ff"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-AGT-01` **All Agent Actions Logged as PROV-O**</div>Every action taken by an AI agent — read, write, policy evaluation, credential check — must produce a W3C PROV-O provenance record. The record must name: (a) the agent DID, (b) the delegating human DID, (c) the action type, (d) the entity acted upon, (e) timestamp.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** PROV-O records written to `provenance_log` append-only table synchronously with the action. Failed PROV-O write aborts the action transaction. </div></div><div id="bkmrk-r-agt-02-policy-chec" style="border:2px solid #0d6efd;border-radius:10px;padding:18px;margin:18px 0;background:#e7f0ff"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-AGT-02` **Policy Check Mandatory Before Every Write**</div>An agent MUST call `POST /policy/evaluate` before any write operation (submission, validation signature, credential issuance, ledger entry). The policy evaluation result must be `allow: true` before the write proceeds. This is enforced at the API gateway level — agents cannot bypass it.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** API gateway middleware intercepts all write requests. `X-Policy-Token` header must contain a fresh (&lt; 30s) OPA evaluation token. Requests without valid token receive 403. </div></div><div id="bkmrk-r-agt-03-fpic-block-" style="border:2px solid #c0392b;border-radius:10px;padding:18px;margin:18px 0;background:#fdecea"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-AGT-03` **FPIC Block is Absolute**</div>When FPIC is not granted or has been revoked for a territory, no agent action may read or write data for that territory. This is not an OPA rule — it is enforced at Postgres row-level security, below the API layer. There is no override, no emergency bypass, no admin exception.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** Postgres RLS policy: `fpic_status = 'active'` required on every row. Even CTH Steward credentials do not bypass this. The only way to lift the block is for the Community Sovereign to re-grant FPIC. </div></div><div id="bkmrk-%E2%84%B9%EF%B8%8F-agent-design-prin" style="background:#e8f4f8;border:1px solid #17a2b8;border-radius:8px;
padding:14px 18px;margin:16px 0">ℹ️ Agent design principle: an agent inherits the delegating human's permissions — never more. If the human cannot do something, neither can the agent acting on their behalf. Credential delegation is explicit and recorded in the JWT claims.</div>

# R-CHG: Change Governance Rules

## Change Governance Rules

These rules govern how the framework itself evolves. Stability is a feature — downstream systems (EU customs, carbon registries, AI agents) depend on predictable interfaces.

<div id="bkmrk-r-chg-01-%E2%85%94-supermajo" style="border:2px solid #1a7f64;border-radius:10px;padding:18px;margin:18px 0;background:#eaf5ef"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-CHG-01` **⅔ Supermajority for Major Changes**</div>Changes to core framework elements — governance model, role definitions, FPIC requirements, compliance mappings, standards layer — require a ⅔ supermajority of the Governance Board. Minor changes (clarifications, bug fixes, new regulatory appendices) require simple majority.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** Change classification defined in the Framework Versioning Policy (Appendix A). Voting recorded in governance ledger with member DIDs. Results publicly verifiable. </div></div><div id="bkmrk-r-chg-02-community-p" style="border:2px solid #6b3a9e;border-radius:10px;padding:18px;margin:18px 0;background:#f3eef9"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-CHG-02` **Community Panel Structural Veto**</div>The Community Sovereignty Panel holds a structural veto on any change that affects FPIC rules, community data rights, or benefit-sharing requirements. This veto cannot be overridden by any vote of any other body, including a unanimous Governance Board.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** Veto encoded as a constitutional constraint in the framework charter, not as an OPA rule. Legal enforceability governed by Colombian Law 70/1993 and ILO Convention 169. </div></div><div id="bkmrk-r-chg-03-emergency-p" style="border:2px solid #b35c00;border-radius:10px;padding:18px;margin:18px 0;background:#fdf3e7"><div style="display:flex;align-items:center;gap:10px;margin-bottom:10px"> `R-CHG-03` **Emergency Patch Protocol**</div>Critical security or compliance fixes may be deployed by CTH Data Stewards within 48 hours without a board vote. The patch must be (a) narrowly scoped to the security/compliance issue, (b) announced to all board members immediately, (c) ratified or reversed by formal board vote within 30 days.

<div style="background:#fff;border-radius:6px;padding:10px 14px;font-size:0.88em;color:#555"> **Implementation:** Emergency patch log in governance ledger. Automatic 30-day ratification deadline enforced by scheduled task. Unratified patches auto-revert. </div></div><table id="bkmrk-version-typeexamplea" style="width:100%;border-collapse:collapse;margin:16px 0"><thead><tr><th style="background:#1a7f64;color:#fff;padding:10px 14px;text-align:left">Version Type</th><th style="background:#1a7f64;color:#fff;padding:10px 14px;text-align:left">Example</th><th style="background:#1a7f64;color:#fff;padding:10px 14px;text-align:left">Approval Required</th><th style="background:#1a7f64;color:#fff;padding:10px 14px;text-align:left">Notice Period</th></tr></thead><tbody><tr style="background:#f9fbfa"><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">Major (X.0.0)</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">New role type, FPIC rule change</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">⅔ supermajority + Community Panel</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">90 days</td></tr><tr style="background:#fff"><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">Minor (x.Y.0)</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">New regulatory mapping, additional standard</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">Simple majority</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">30 days</td></tr><tr style="background:#f9fbfa"><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">Patch (x.y.Z)</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">Clarification, typo, bug fix</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">Steward + 1 board member</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">7 days</td></tr><tr style="background:#fff"><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">Emergency</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">Security/compliance critical</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">Steward (ratify within 30d)</td><td style="padding:9px 14px;border-bottom:1px solid #e8ede9">Immediate</td></tr></tbody></table>