M0 + M1 done

This commit is contained in:
marcos.lohmann_at_orcl
2026-09-11 15:04:34 -03:00
parent 5ebec725ec
commit 439f60598e
51 changed files with 2991 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
"""PDP decision contract (EP-03-T04).
Every response from the PDP is one of these three outcomes, never a bare
boolean -- `policy_version` and `reason_code` are mandatory so the Gateway's
audit trail (EP-08-T02) and end-to-end correlation (EP-08-T03, RF-17) always
have something to point at, and so a REQUIRE_APPROVAL is never collapsed
into ALLOW/DENY by a caller that only checks truthiness.
"""
from __future__ import annotations
from enum import StrEnum
from pydantic import BaseModel
class PDPOutcome(StrEnum):
ALLOW = "ALLOW"
DENY = "DENY"
REQUIRE_APPROVAL = "REQUIRE_APPROVAL"
class PDPDecision(BaseModel):
outcome: PDPOutcome
policy_version: str
reason_code: str
"""Machine-readable reason, e.g. NOT_IN_ENTITLEMENT, TRANSACTION_POLICY_DENIED,
APPROVAL_THRESHOLD_EXCEEDED, ALLOWED, PDP_UNAVAILABLE (README.md §27)."""