Commit Graph

27 Commits

Author SHA1 Message Date
curo1305 a5f202b069 Fix Phase 3 UAT blockers: MinIO presigned URL hostname, CORS, admin flush→commit, auth refresh race
Bugs fixed:
- minio_backend.py: generate_presigned_put_url and presigned_get_url used internal
  _client (minio:9000) instead of _public_client (localhost:9000). Browser received
  ERR_NAME_NOT_RESOLVED. Fixed by using _public_client with region='us-east-1' to
  skip region-discovery HTTP request from inside the container.

- docker-compose.yml: MINIO_API_CORS_ALLOW_ORIGIN was set from CORS_ORIGINS which
  uses pydantic JSON list format '["http://localhost:5173"]'. MinIO expected a plain
  string and never matched the origin. Fixed to use FRONTEND_URL instead.

- admin.py: All write handlers (create_user, update_user_status, update_user_quota,
  update_ai_config) used session.flush() without session.commit(). Changes appeared
  to succeed (response reflected in-memory state) but rolled back on session close.
  Fixed by replacing flush() with commit() in all four write handlers.

- auth.js: Concurrent refresh() calls from QuotaBar and App.vue on page reload caused
  a token rotation race — first call rotated the cookie, second arrived with stale
  cookie and cleared accessToken. Fixed by deduplicating with a shared in-flight
  promise (_refreshInFlight).

Phase 3 UAT: 9/10 pass. UAT-3 (QuotaBar visual) pending browser confirmation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 11:30:41 +02:00
curo1305 b5dde2aad9 wip: Phase 3 UAT in progress — 2/10 tests pass, upload XHR bug open
Fixes applied this session:
- frontend/src/api/client.js: noRefreshPaths exclusion prevents auth 401s
  from triggering session-expired error on login/register/refresh
- frontend/src/router/index.js: async beforeEach with silent refresh()
  restores session from httpOnly cookie on page reload

UAT state: 2 pass (cold-start, admin block), 1 open (XHR upload network error),
7 pending. MinIO PUT fails in browser — needs console output to diagnose.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 21:26:50 +02:00
curo1305 a5994d9ff4 chore: commit pending phase-3 work and add TEST_ACCOUNTS.md
Includes planning artifacts (03-CONTEXT, 03-DISCUSSION-LOG, 03-02-SUMMARY),
integration test script, MinIO/auth/docker fixes, and local dev account reference.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 11:30:56 +02:00
curo1305 254e756cb8 docs(03-05): complete frontend presigned upload + quota bar plan
- 03-05-SUMMARY.md: plan summary covering 3-step XHR upload, QuotaBar.vue, UploadProgress error block, STORE-03/04/05 completed
- STATE.md: advance to plan 5 checkpoint pending; add 5 key decisions from plan 03-05
2026-05-23 22:02:03 +02:00
curo1305 6bd57629ce docs(03-04): complete flat-file settings retirement and per-user AI classification plan
- 03-04-SUMMARY.md: Plan complete — classifier signature, env var defaults, security
  mitigations T-03-17/18/19/21 all resolved; DOC-03, DOC-05 requirements completed
- STATE.md: Advance to Plan 4/5 complete, add 5 key decisions from this plan
- ROADMAP.md: Mark 03-04-PLAN.md complete (Wave 4)
- REQUIREMENTS.md: Mark DOC-03 and DOC-05 as complete
2026-05-23 20:39:33 +02:00
curo1305 aadc69fea0 docs(03-03): complete per-user document and topic isolation plan
- 03-03-SUMMARY.md: documents all endpoint auth guards, ownership assertions, namespace isolation pattern, and SQLite compat deviations
- STATE.md: advance to Plan 3/5 complete, add 6 key decisions (get_regular_user, 404-not-403, CASE WHEN, or_/is_(None), AI user namespace)
- ROADMAP.md: mark 03-03-PLAN.md complete
- REQUIREMENTS.md: mark SEC-04 and DOC-04 complete
2026-05-23 20:22:12 +02:00
curo1305 4e9b586ec4 docs(03-01): complete Wave 0 scaffolding plan — migration 0003 + xfail stubs
- Create 03-01-SUMMARY.md with all 19 new test IDs, task commits, and decisions
- Update STATE.md: phase 3 in progress, plan 1/5 complete, 3 new key decisions
- Update ROADMAP.md: mark 03-01-PLAN.md as complete (2026-05-23)
2026-05-23 13:48:07 +02:00
curo1305 fdc32d431d docs(03): create Phase 3 execution plan — document migration & multi-user isolation
5 plans across 5 sequential waves covering: Alembic migration 0003 (null-user
cleanup, NOT NULL constraint, quota reconciliation), presigned MinIO PUT upload
flow with atomic quota enforcement, auth guards on all document/topic endpoints,
flat-file settings retirement + per-user AI classification, and frontend quota bar
with 3-step XHR upload progress.

Verification passed across all 12 dimensions. All 8 phase requirements covered
(STORE-03/04/05/06, SEC-04, DOC-03/04/05).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 13:36:28 +02:00
curo1305 1ba578c7f6 docs(03): UI design contract for Phase 3 document migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 10:21:05 +02:00
curo1305 5905642a31 docs(03): UI design contract for document migration and quota UI
Phase 3 UI-SPEC covering two-step presigned upload progress bar,
quota usage bar (amber 80% / red 95%), and 413 quota rejection
inline error block — all inheriting Phase 2 design system tokens.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 10:16:28 +02:00
curo1305 80eb280233 docs(02): phase 2 verification report
4/5 success criteria verified; 1 blocker gap identified: admin JWT
does not return 403 on document content endpoints because api/documents.py
has no auth enforcement (Phase 1 legacy state, deferred to Phase 3 per D-03).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 20:21:01 +02:00
curo1305 858be6260e docs(02-05): execution summary and state update
- 02-05-SUMMARY.md: admin panel frontend complete — AdminView, three tab components, AppSidebar update
- STATE.md: Phase 2 complete (5/5 plans), progress 40%, decisions added
- ROADMAP.md: Phase 2 marked complete, all 5 plans checked
- REQUIREMENTS.md: ADMIN-01 through ADMIN-05 and ADMIN-07 marked complete
2026-05-22 20:12:05 +02:00
curo1305 bcb63bf8aa docs(02-04): execution summary and state update
- 02-04-SUMMARY.md: admin API plan complete (18 tests, 7 endpoints, all security checks pass)
- STATE.md: advanced to plan 4/5, updated metrics and session continuity
2026-05-22 20:03:34 +02:00
curo1305 833f869a48 docs(02-03): execution summary and state update
- 02-03-SUMMARY.md: TOTP enrollment endpoints, password reset, account management UI
- STATE.md: advanced to Plan 3/5 complete, added key decisions
2026-05-22 19:57:09 +02:00
curo1305 3d487b82ef docs(02-02): execution summary — auth API endpoints + frontend auth wall complete
Requirements completed: AUTH-01, AUTH-02, AUTH-04, SEC-01, SEC-02, SEC-03, SEC-05

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 19:48:33 +02:00
curo1305 479b72ef9a docs(02-01): execution summary — auth service layer, deps, migration complete
- 02-01-SUMMARY.md: 3 tasks complete, 31 tests passing, all verification checks passed
- STATE.md: Phase 2 plan 1/5 complete, decisions added, open questions resolved
2026-05-22 19:27:29 +02:00
curo1305 16584ade00 docs(02): create phase 2 plan — Users & Authentication
5 plans across 5 waves covering AUTH-01..08, SEC-01..03/05..07,
ADMIN-01..05/07. Includes security hardening (Origin validation,
per-account rate limiting, TOTP replay prevention, refresh token
family revocation with security alert), TOTP + backup code login,
and admin panel frontend.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 19:13:44 +02:00
curo1305 333978d7cb docs(02): UI design contract for Phase 2 — Users & Authentication
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 15:12:02 +02:00
curo1305 9e28de8c15 docs(02): UI design contract for Users & Authentication phase
Specifies form field states, password strength indicator, TOTP enrollment
and backup codes patterns, loading states, error placement, admin table
row states, copywriting (anti-enumeration copy), and full component
inventory for Phase 2 frontend work.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 14:51:28 +02:00
curo1305 e0341348f0 docs(02): capture phase context 2026-05-22 14:33:20 +02:00
curo1305 16bb31eb6d docs(01-05): complete walking-skeleton plan — SUMMARY, STATE, ROADMAP
Phase 1 complete: all 5/5 plans executed, walking-skeleton e2e verified
live against Docker stack (postgres + minio + redis + backend + celery-worker).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 14:19:41 +02:00
curo1305 5d21c6f588 docs(01-04): complete StorageBackend + MinIO + async storage plan — SUMMARY, STATE, ROADMAP 2026-05-22 09:41:43 +02:00
curo1305 e822a8f4b1 docs(01-03): complete SQLAlchemy ORM + Alembic plan — SUMMARY, STATE, ROADMAP
- SUMMARY.md: all 11 tables documented, privilege grants, verification results, deviations
- STATE.md: plan counter advanced to 3/5, decisions added, session continuity updated
- ROADMAP.md: 01-03-PLAN.md marked complete, progress table updated to 3/5
2026-05-22 09:33:24 +02:00
curo1305 213afec6b3 docs(01-02): complete Wave 0 test scaffolds plan — SUMMARY, STATE, ROADMAP
- Create 01-02-SUMMARY.md: 19 total xfail tests across 5 files, 3 task
  commits documented, no deviations
- STATE.md: advance to plan 3/5, update progress to 40%, record decisions
  for async_client naming and xfail(strict=False) pattern
- ROADMAP.md: mark 01-02-PLAN.md complete, update progress table to 2/5
2026-05-22 09:10:27 +02:00
curo1305 f9b8a0d1ca docs(01-01): complete Compose + Config Foundation plan — SUMMARY, STATE, ROADMAP
- Create 01-01-SUMMARY.md with full execution record (3 tasks, 6 files)
- Update STATE.md: advance to plan 2 of 5, record key decisions, update session
- Update ROADMAP.md: mark 01-01 complete, update progress table (1/5 plans)
2026-05-22 09:01:16 +02:00
curo1305 6fed5ba531 docs(01): create phase 1 plan — 5 plans in 4 waves
Research, pattern mapping, and verification complete.
Walking Skeleton mode active (MVP Phase 1).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 08:49:36 +02:00
curo1305 126ac7cf63 docs(01): capture phase context 2026-05-21 21:31:06 +02:00