feat(auth): register project read catalogue foundation - #208
Conversation
…to codex/ws-auth-001-11a-project-read-catalogue
📝 WalkthroughWalkthroughAdds two project-read permissions and related planned actions, assigns the permissions to selected admin roles, introduces Alembic audit-evidence parity with guarded downgrade behavior, and updates tests, schema fingerprints, workstream metadata, and authorization documentation. ChangesProject-read authorization
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant AdminAuthorization
participant PermissionCatalogue
participant AuditEvidenceMigration
participant PostgreSQLAuditEvents
AdminAuthorization->>PermissionCatalogue: resolve project-read permissions
PermissionCatalogue->>AuditEvidenceMigration: provide action and permission mappings
AuditEvidenceMigration->>PostgreSQLAuditEvents: update audit evidence constraints
PostgreSQLAuditEvents-->>AuditEvidenceMigration: check existing evidence rows during downgrade
AuditEvidenceMigration-->>AdminAuthorization: preserve or remove project-read parity
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/operations_authorization_service.md`:
- Around line 676-680: The active-action breakdown in the catalogue summary must
enumerate all 22 active actions, including the five omitted AUTH-10 actions:
three AUTH-10B reads and two AUTH-10C mutations. Update the breakdown near the
referenced summary while preserving the existing counts and ensuring it matches
the catalogue and docs/spec_authorization_service.md.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 68be6981-b1cf-47ed-9ef3-b35de3f4bd86
📒 Files selected for processing (13)
.agent-loop/initiatives/WS-AUTH-001-workstream-authorization-service/chunks/WS-AUTH-001-11A-project-read-catalogue-foundation.mdbackend/alembic/versions/0035_project_read_action_evidence.pybackend/app/modules/authorization/admin_schemas.pybackend/app/modules/authorization/admin_service.pybackend/app/modules/authorization/catalogue.pybackend/app/modules/authorization/policy.pybackend/tests/conftest.pybackend/tests/test_alembic.pybackend/tests/test_auth.pybackend/tests/test_authorization.pydocs/operations_authorization_service.mddocs/operations_roles_permissions.mddocs/spec_authorization_service.md
Chunk
WS-AUTH-001-11A— Project Read Catalogue And Projection FoundationGoal
Register eleven project-read authorization actions as planned, add the two required read permissions and exact administrative role mappings, and establish migration/audit parity without activating any API route.
Human-approved intent
The user approved resuming this bounded AUTH-owned chunk after pulling and reconciling current
main.What changed
project.setup_diagnostic.readandproject.effective_policy.read.0035_project_read_evidencewith guarded downgrade behavior.Why it changed
Later project-read surfaces need stable AUTH-owned action, permission, ownership, and audit contracts before product routes can safely activate them.
Design chosen
Use the existing immutable authorization catalogue, role-policy matrix, administrative definition projection, and audit evidence constraints. All eleven actions remain planned so the authorization kernel denies them until their owning chunks activate the corresponding product surfaces.
Alternatives rejected
project.readfor diagnostics/policy: loses least-privilege separation.Scope control
No project module, actor router, route registration, token-role mapping, compatibility alias, fallback path, CI workflow, or coverage threshold changed.
Product behavior
No new endpoint is available. The eleven actions cannot produce allowed authorization evidence while planned.
Acceptance criteria proof
Tests/checks run
git diff --check: passed.Backend / test.Test delta
Four substantive tests added; no tests removed, skipped, or weakened. Existing public totals, migration-head expectations, and schema fingerprint were updated to the new canonical catalogue.
CI integrity
No workflow, runner, dependency, lint, typecheck, or coverage configuration changed. Hosted CI must preserve the 78% repository floor and 90% authorization subsystem floor.
Reviewer results
PASS: senior engineering, QA/test, security/auth, product/ops, architecture, CI integrity, docs, reuse/dedup, and test delta. QA's obsolete gate-command finding and docs' obsolete merge-intent finding were fixed and rechecked.
External review
Agent Gates, hosted Backend coverage, and CodeRabbit pass on final head
5bdea944; unresolved review threads: zero.Remaining risks
Migration 0035 rewrites frozen audit vocabulary constraints; focused PostgreSQL proof and hosted full coverage both pass on the final head.
Follow-up work
11B/11C chunks may activate only their owned product surfaces. This PR does not begin them.
Human review focus
Human merge ownership
Summary by CodeRabbit
New Features
Documentation
Bug Fixes