feat: add purpose-bound delegated review authority (ENG-CORE-DELEGATION-001B) - #127
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Identity
ENG-CORE-DELEGATION-001B-FIX1ENG-CORE-DELEGATION-001B143acc870244fa8c6d8d9a06066599e7a77fd533143acc870244fa8c6d8d9a06066599e7a77fd533b1d89c9ed5c2e19746cc2e2e54c8049cd6946fe25d0368a91c27c2229d18397524d742091b3123ffChange summary
This pull request adds a separate, opaque, single-use delegated-review credential domain. It supports only
review.queueandreview.transition. The fix commits harden five fail-closed boundaries found during review.not_foundresponse. Its event keeps only known issuer, grant, credential, owner, and digest evidence.engdr_attempts before FastAPI body validation. Malformed or noncanonical requests revoke the token and return the generic delegated401response.purpose_mismatch. Multiple distinct review credentials return the generic delegated401response without selecting a credential.Existing
engd_read delegation remains compatible. The change does not broaden ordinary API-key, service-client, review, read, or provisioner authority. Public review responses do not expose internal delegation attribution.Files changed by FIX1 and the follow-up
docs/ops/service-delegation.mdengram/api/app.pyengram/api/service_boundary.pyengram/auth.pyengram/delegation_auth.pyengram/models.pymigrations/030_service_review_delegation.sqlmigrations/downgrades/030_service_review_delegation.sqltests/test_service_review_delegation.pytests/test_service_review_delegation_postgres.pyMigration and downgrade evidence
Local evidence
make check: Ruff passed; strict mypy passed; 2,579 tests passed and 527 were skipped.make compose-ci: root 3,072 passed and 34 skipped; SDK 55 passed; MCP 36 passed; hooks 186 passed.Remote CI
b1d89c9ed5c2e19746cc2e2e54c8049cd6946fe2.5d0368a91c27c2229d18397524d742091b3123ff.refs/pull/127/mergestill resolved to5d0368a91c27c2229d18397524d742091b3123ffafter both runs completed.Credential scan evidence
tracked_files=0 database_fields=0.Remaining limitations
This change does not implement Portal UI, browser credential delivery, CIAM, MFA, browser-session step-up, or Portal proxy behavior.
ENG-PORTAL-REVIEW-001Aremains deferred. Operators must explicitly enable review delegation and configure a review broker and review grant.Recommendation
GREEN_FOR_REVIEW. Keep this pull request draft, open, and unmerged for reviewer reassessment.