Phase 0.1: update planning docs to current state

- codebase-vs-requirements.md: rewritten to reflect actual IST-stand (PostgreSQL, React, 12 plugins, unified contacts)
- security-review-phase2.md: added resolution summary for M-01/M-02/M-03/M-05/m-03/m-08
- architecture.md: added section 11 'Implementation Status' with what's built and what's missing
- MASTER-PLAN.md: comprehensive 754-line plan with 8 phases + Phase 3.5 (~590h total)
- PROGRESS.md: progress tracking file for agent work
This commit is contained in:
Agent Zero
2026-07-23 00:35:40 +02:00
parent c2143eea19
commit 3f2307ab54
5 changed files with 1025 additions and 527 deletions
+23
View File
@@ -11,6 +11,29 @@
## VERDICT: APPROVED_WITH_CONCERNS
> **Update 2026-07-23:** Several risks have been resolved in the codebase since this review.
> See "Resolution Status" markers below each risk.
### Resolution Summary (2026-07-23)
| Risk | Severity | Status | How resolved |
|------|----------|--------|-------------|
| M-01 (Brute-Force) | Major | ✅ RESOLVED | `rate_limit.py` implemented with Redis INCR+EXPIRE. Login, password-reset, general API rate limiting. |
| M-02 (RLS) | Major | ✅ RESOLVED | Migration 0015 implements PostgreSQL RLS policies on all tenant-scoped tables. ORM filter + RLS as defense-in-depth. |
| M-03 (Worker Tenant) | Major | ✅ RESOLVED | `worker.py` (71 lines) with tenant context propagation. ARQ jobs carry tenant_id. |
| M-04 (Secret Rotation) | Major | ⬜ OPEN | No rotation policy documented. Planned in Phase 0.1. |
| M-05 (CORS) | Major | ✅ RESOLVED | Explicit origin list in config.py, no wildcards. |
| M-06 (Plugin Security) | Major | ⬜ PARTIAL | Plugin migration runner validates tenant_id. Plugin install validation planned in Phase 3.10b. |
| M-07 (Dependency Risk) | Major | ⬜ OPEN | PyMuPDF (AGPL) → pypdf replacement planned in Phase 0.20. |
| m-01 (Secret Key) | Minor | ⬜ OPEN | Purpose documentation planned in Phase 0.1. |
| m-02 (2FA) | Minor | ⬜ OPEN | Post-MVP, acceptable for v1. |
| m-03 (Tenant Switch) | Minor | ✅ RESOLVED | Tenant switch validates user_tenants membership. |
| m-04 (CSRF Token) | Minor | ⬜ OPEN | SameSite+Origin is sufficient. Token unused. Planned cleanup in Phase 0.18. |
| m-05 (SQL Injection) | Minor | ⬜ PARTIAL | SQLAlchemy ORM used everywhere. Unified search has f-string table names (controlled). Guideline planned in Phase 3.8. |
| m-06 (Mail Encryption) | Minor | ⬜ OPEN | Hardcoded salt `b"leocrm-mail-salt"` — fix planned in Phase 0.19. |
| m-07 (Backup) | Minor | ⬜ OPEN | Backup system planned in Phase 5.15. |
| m-08 (Log Injection) | Minor | ✅ RESOLVED | structlog with JSON formatting. |
The architecture is well-structured with strong fundamentals (session-based auth, CSRF protection, CSP headers, RBAC with field-level permissions, audit trail). However, **7 major risks** and **8 minor risks** must be addressed before or during implementation. No critical blocking issues found, but 3 major risks (RLS gap, rate limiting, CORS) should be resolved before Phase 3 start.
| Severity | Count |