Plan incremental AUTH module boundary recovery - #304
Conversation
📝 WalkthroughWalkthroughThis planning-only change defines AUTH module-boundary recovery. It adds the public API contract, consumer matrix, import-debt ledger, staged recovery plan, foundation chunk contract, status record, risk register, and implementation decisions. ChangesAUTH boundary recovery
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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: 3
🤖 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
@.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/chunks/WS-AUTH-003-01-boundary-foundation.md:
- Around line 41-47: Update the validator requirements in criterion 3 to
explicitly reject dynamic import APIs such as __import__ and
importlib.import_module, including aliased forms, alongside wildcard imports. If
supported dynamic forms are retained, define a closed allowlist and reject
unknown forms; add architecture tests covering these bypass cases and ensure the
validator fails closed.
In
@.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/IMPORT_LEDGER.md:
- Line 68: Update the Line 68 ledger entry referencing
backend/app/workers/project_setup.py to use the repository’s current
human-worker vocabulary so check_stale_authorization_docs.py no longer reports
HUMAN_WORKER_VOCABULARY. Only modify the checker if this path is intentionally
canonical, and rerun the stale-documentation gate to verify it passes.
- Around line 3-11: Update the inbound debt sections in IMPORT_LEDGER.md to
record each exact source-to-private-AUTH-module import edge, rather than only
source filenames. Alternatively, add a machine-readable count or hash that the
validator compares, ensuring existing entries cannot conceal newly added private
AUTH imports and neither violation count increases.
🪄 Autofix
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: c4c04fea-d883-404a-8138-d961ea30ba12
📒 Files selected for processing (10)
.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/CHUNK_MAP.md.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/CONSUMER_API_MATRIX.md.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/DECISIONS.md.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/DISCOVERY.md.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/IMPORT_LEDGER.md.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/INTENT.md.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/PLAN.md.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/RISKS.md.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/STATUS.md.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/chunks/WS-AUTH-003-01-boundary-foundation.md
Workstream PR Trust Bundle
Chunk
WS-AUTH-003-PLAN- Incremental AUTH module-boundary recovery planningGoal
Make
app.modules.authorization.apithe sole public AUTH boundary and eliminate private cross-module imports capability by capability.Intent And Planning Context
.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/INTENT.md.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/PLAN.md.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/chunks/WS-AUTH-003-01-boundary-foundation.mdWhat Changed
Why It Changed
The modular-monolith rule already exists, but implementation accumulated direct imports in both directions. A single large rewrite is too difficult to verify; deferring enforcement allows more debt.
Design Chosen
Merge a minimal API/import/test-structure-gate foundation, then require each feature chunk to expose and migrate only the capability it touches while shrinking the exact ledger.
Alternatives Rejected
Scope Control
Only
.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/**changed. No files are outside scope.Product Behavior
Evidence
All passed.
Acceptance Criteria Proof
Test Delta
No tests were added, modified, removed, skipped, or weakened. This is planning only; the foundation contract requires architecture tests for both validators. Line limits are guardrails; semantic review enforces one primary behavior and assertion parity.
Internal Reviewer Results
Reviewed the original plan and the test-structure amendment through exact head
747291d9. All valid findings were addressed.External Review
747291d9.CI And Gate Integrity
Remaining Risks
The foundation freezes rather than removes current import and structural-test debt. Static size gates cannot prove cohesion, so required semantic reviews remain part of every capability repair. Every touched capability must shrink the ledger; final closure requires zero violations.
Follow-Up Work
Human Review Focus
Inspect whether the bidirectional ledger is exact, the foundation is behavior-neutral, and the test policy enforces one primary observable behavior without cosmetic splitting or weakened security proof.
Human Merge Ownership