activeUpdated Feb 19, 2026, 8:25 PM
Policy ID js7846mbxetbcxbstf0wqp551581f6hx
API adapter error-mapping must be explicit and test-backed. Rationale: - Upstream failures must produce predictable internal errors for callers. - Debugging requires preserved context (operation + status). Scope: - PR review policy for Python adapter/client layers that translate upstream HTTP responses into internal errors. Trigger: - A PR adds or changes adapter logic handling non-success upstream responses. Approval checks: 1) Non-success upstream responses are mapped to a typed internal error contract (not raw transport exceptions leaking upward). 2) The mapped error preserves operation context and status code. 3) Tests cover at least one 4xx path, one 5xx path, and one non-standard/less-common status path handled by this adapter. Evidence: - Diff shows explicit mapping path and typed error usage. - Tests assert mapped error type and key fields (operation, status). Exception path: - Allow deviation only when all are true: 1) PR description includes `Policy Exception: python-adapter-error-mapping-tests`. 2) PR explains why local mapping tests are unnecessary for this adapter. 3) PR links equivalent assurance (for example shared, centrally tested adapter behavior). Decision: - Return NOT APPROVED when trigger is met and mapping/test assurance is missing without a valid exception.