Commit Graph
703 Commits
Author SHA1 Message Date
curo1305 bdd68b2edf feat(09-04): wire admin login redirect in LoginView.vue (D-08)
- After successful login, admin users redirect to /admin; regular users to /
- Honors ?redirect= query param for non-admin users as before
- authStore.user.role is synchronously populated before handleLoginResult fires
2026-06-12 16:08:25 +02:00
curo1305 5dbfb6c1d8 feat(09-04): rewire /admin nested route + guard + Tailwind safelist
- Replace flat /admin route with nested AdminLayout subtree (5 children)
- Fix beforeEach guard to use to.matched.some(r => r.meta.requiresAdmin)
- Add D-09 admin-on-user-route redirect and D-10a non-admin-on-admin redirect
- Add Tailwind safelist covering sky+amber color families (formatters + AuditLogTab)
2026-06-12 16:07:56 +02:00
curo1305andClaude Sonnet 4.6 b19ab8bcd1 docs(phase-09): update tracking after wave 2 — plan 09-03 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 16:03:58 +02:00
curo1305 71329798d5 chore: merge executor worktree (worktree-agent-ae0df1181a91ce55b) 2026-06-12 16:03:19 +02:00
curo1305 ec4bd691d1 docs(09-03): complete tab-to-view extraction plan — 4 views created
- AdminUsersView, AdminQuotasView, AdminAiView, AdminAuditView all extracted
- One import path rewrite (SearchableModelSelect depth correction)
- Build clean: 143 modules, 0 errors
2026-06-12 16:02:43 +02:00
curo1305 164003b19b feat(09-03): extract AdminAiView + AdminAuditView from tab components
- Created frontend/src/views/admin/AdminAiView.vue (extracted from AdminAiConfigTab.vue)
  - Import path for SearchableModelSelect rewritten to ../../components/ui/SearchableModelSelect.vue
  - System AI Providers (Global) section preserved above per-user table (Phase 7 constraint)
- Created frontend/src/views/admin/AdminAuditView.vue (verbatim from AuditLogTab.vue per D-13)
  - actionTypeClass() helper preserved verbatim with all bg-amber-50, bg-purple-50 dynamic classes
  - Filter bar, paginated table, CSV download, daily-export list all preserved as-is
- Both files have no defineProps, no top-level padding, identical line counts to sources
- Build succeeds: 143 modules transformed, no errors
2026-06-12 16:01:29 +02:00
curo1305 d690a445b9 feat(09-03): extract AdminUsersView + AdminQuotasView from tab components
- Created frontend/src/views/admin/AdminUsersView.vue (verbatim extraction of AdminUsersTab.vue)
- Created frontend/src/views/admin/AdminQuotasView.vue (verbatim extraction of AdminQuotasTab.vue)
- Both files have no defineProps, no top-level padding, identical import paths (../../api/client.js, ../../utils/formatters.js)
- Line counts match source exactly (480 and 182 lines respectively)
- Build succeeds with no Vite errors referencing new view files
2026-06-12 15:58:51 +02:00
curo1305andClaude Sonnet 4.6 1b1cc5d566 docs(phase-09): update tracking after wave 1 — plans 09-01 + 09-02 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 15:54:05 +02:00
curo1305 42cf3bfa06 chore: merge executor worktree (worktree-agent-a0c8d4832f87a5517) 2026-06-12 15:52:52 +02:00
curo1305 151f474854 docs(09-01): complete ADMIN-11 plan — admin overview endpoint summary
- SUMMARY.md documents 2 tasks completed, 8 tests passing, security invariants verified
- Self-check: all files present, commits verified
2026-06-12 15:51:45 +02:00
curo1305 41d81c089f feat(09-01): implement GET /api/admin/overview endpoint — ADMIN-11
- New backend/api/admin/overview.py: aggregate stats (user_count,
  total_storage_bytes, doc_status) + last 10 audit entries in one payload
- Sub-router carries NO prefix (parent __init__.py carries /api/admin)
- Reuses _build_filtered_query_with_handles + _audit_to_dict_with_handles
  from api.audit — no new serializer or query logic
- Registered overview_router on admin parent router in __init__.py
- All 8 ADMIN-11 tests pass; existing admin and audit suites stay green
2026-06-12 15:50:38 +02:00
curo1305 4e37cb0fab docs(09-02): complete admin route shell plan — layout, sidebar, overview view
- AdminLayout.vue: flex sidebar shell with router-view in padded content area
- AdminSidebar.vue: 5 nav links (D-07 order), indigo Admin badge (D-05), no Back-to-app (D-06)
- AdminOverviewView.vue: single-fetch 4-card stats + recent audit table
- getAdminOverview() API function added to api/admin.js
2026-06-12 15:49:07 +02:00
curo1305 1e14e15cbf feat(09-02): create AdminOverviewView.vue
- Single-fetch view calling getAdminOverview() on mount with loading/error states
- Four stat cards grid (Users, Storage, Processing, Ready) per ADMIN-11 and D-01
- Recent audit table with 5 columns (When/Event/Actor/Target/IP) matching AuditLogTab.vue structure
- Uses formatSize/formatDate from shared utils/formatters.js (no duplication)
- No top-level padding (AdminLayout owns p-8 max-w-5xl mx-auto)
- No Pinia store — single-fetch component consistent with admin tab pattern
2026-06-12 15:48:19 +02:00
curo1305 4eb489feb8 feat(09-02): create AdminLayout.vue and AdminSidebar.vue
- AdminLayout: flex h-screen shell with AdminSidebar + main content area (p-8 max-w-5xl mx-auto router-view)
- AdminSidebar: 5 nav links in D-07 order (Overview/Users/Quotas/AI Config/Audit Log) with SVG icons
- Admin badge subtitle ("Admin" in indigo-500 per D-05) replaces "Document Manager"
- No Back-to-app link (D-06 applied)
- User identity footer + sign-out reused verbatim from AppSidebar.vue pattern
- Scoped nav-link/nav-link-active CSS identical to AppSidebar.vue
2026-06-12 15:47:35 +02:00
curo1305 4caeed2d22 test(09-01): add failing xfail tests for ADMIN-11 overview endpoint
- 8 xfail tests covering auth guards, aggregate stats, and sensitive field scan
- Tests will become real assertions once overview.py is implemented in Task 2
2026-06-12 15:47:18 +02:00
curo1305 fd12ee2a22 feat(09-02): add getAdminOverview() to api/admin.js
- Export async function calling request('/api/admin/overview')
- Follows existing GET helper pattern (no extra wrapping)
- Auto-re-exported via client.js barrel (Phase 8 CODE-04 invariant preserved)
2026-06-12 15:46:00 +02:00
curo1305andClaude Sonnet 4.6 2fd7591eac docs(09): fix plan checker warnings — ORDER BY desc, closed tag, resolved marker
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 15:40:31 +02:00
curo1305andClaude Sonnet 4.6 ba30ada87a docs(09): create phase 9 plan — Admin Panel Rearchitecture
5 plans across 4 waves covering ADMIN-08..12, CODE-06, CODE-09:

- 09-01 (W1): backend GET /api/admin/overview + 8 ADMIN-11 tests
- 09-02 (W1): AdminLayout + AdminSidebar + AdminOverviewView + getAdminOverview API
- 09-03 (W2): extract 4 admin tab components to standalone views
- 09-04 (W3): nested /admin route + to.matched.some guard + D-08/D-09/D-10 redirects + Tailwind safelist (sky+amber) + login redirect + delete AdminView/tabs
- 09-05 (W4): CODE-09 comment purge for Phase 9 + retroactive Phase 8 backend sub-packages + human UAT checkpoint

All locked decisions D-01..D-16 mapped to tasks; safelist corrected to include sky (OneDrive) and amber (audit badges) per RESEARCH.md Pattern 7.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 15:34:31 +02:00
curo1305andClaude Sonnet 4.6 373e009ed8 docs(09): research phase — admin panel rearchitecture
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 13:35:34 +02:00
curo1305 e5bed6e219 docs(state): record phase 9 context session 2026-06-12 13:23:29 +02:00
curo1305 6721e60166 docs(09): capture phase context 2026-06-12 13:23:25 +02:00
curo1305andClaude Sonnet 4.6 a42f0ed623 test(08): UAT complete — 7/7 passed, phase 8 marked complete
All 7 UAT tests passed (cold start, auth, documents, admin, cloud storage,
session revocation, Vite 6 build). Security gate: 0 threats open. Phase 8
transition complete — ROADMAP.md updated, PROJECT.md evolved with Phase 8
decisions, stale handoff deleted. Next: Phase 9 (Admin Panel Rearchitecture).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 11:28:56 +02:00
curo1305andClaude Sonnet 4.6 ee3d2d2d3d docs(phase-08): mark VALIDATION.md complete — Nyquist-compliant 9/9
Audit confirmed all phase-8 requirements are COVERED:
- CR-01/02/03: session revocation tests promoted from stubs → 3 passing
- CODE-01/02/03: route regression — 58 passed, 4 xfailed
- CODE-04: frontend smoke — 136/136 passed
- CODE-08: single CloudConnectionOut definition confirmed
- PERF-01: npm packages verified

Full suite: 405 passed, 6 skipped, 7 xfailed (1 pre-existing env gap: no local python-docx)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 11:24:49 +02:00
curo1305andClaude Sonnet 4.6 cd4f372e46 docs(phase-08): add security threat verification — all 45 threats closed
Register sourced from 8 PLAN.md threat_model blocks (register_authored_at_plan_time: true).
36 mitigate threats verified CLOSED by gsd-security-auditor. 9 accepted risks documented.
threats_open: 0 — phase advancement unblocked.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 11:18:16 +02:00
curo1305andClaude Sonnet 4.6 ace8899211 test(08): complete UAT — 7/7 passed, all regression verified
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 11:07:24 +02:00
curo1305andClaude Sonnet 4.6 6bda133c81 chore(08-08): PERF-01 packages + Vite 6 upgrade + pin requirements.txt
- Upgraded vite 5.4.21 → 6.4.3 (fixes CVE-2026-39363, CVE-2026-39364)
- Upgraded @vitejs/plugin-vue 5.2.4 → 6.0.7 (Vite 6 peer dep)
- Installed @vueuse/core@14.3.0, @vueuse/integrations@14.3.0,
  sortablejs@1.15.7, @tailwindcss/forms@0.5.11,
  rollup-plugin-visualizer@7.0.1, @types/sortablejs@1.15.9
- Wired @tailwindcss/forms plugin in tailwind.config.js (VISUAL-02 ready)
- Pinned backend/requirements.txt to exact == versions per D-17 (32 packages)
- Frontend: 136/136 tests pass on Vite 6; 0 npm audit vulnerabilities
- Backend: 408 passed, 4 skipped, 7 xfailed (baseline 405+1)
- Phase 8 complete (8/8 plans)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 10:54:34 +02:00
curo1305andClaude Sonnet 4.6 8828871ecd wip: phase-08 paused at plan 08/08 — wave 2 complete, 08-08 pending npm verification
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 10:34:41 +02:00
curo1305andClaude Sonnet 4.6 9a3ce6ef39 docs(08-04/05/06): add plan summaries — wave 2 backend decomposition complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 10:29:40 +02:00
curo1305andClaude Sonnet 4.6 81337bd9e3 feat(08-05): decompose documents API monolith into documents/ package — CODE-02 CODE-08
- upload.py: request_upload_url, upload_document, confirm_upload (3 routes)
- crud.py: list_documents, get_document, patch_document, delete_document, classify_document (5 routes)
- content.py: stream_document_content + _parse_range (1 route)
- shared.py: _CLOUD_PROVIDERS, UploadUrlRequest, DocumentPatch (single definitions)
- __init__.py: router aggregator prefix=/api/documents, 9 routes total
- documents.py monolith deleted; all URL paths unchanged
- list_documents registered on parent router to avoid FastAPI empty-path/prefix check
- get_storage_backend_for_document re-exported for test monkeypatching compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 10:27:48 +02:00
curo1305andClaude Sonnet 4.6 f01fb0e6d5 feat(08-04): delete admin.py monolith after URL regression — CODE-01 CODE-08
Task 3: 54 admin+cloud+ai-config tests pass with package; admin.py and
admin_OLD_REMOVE_IN_TASK_3.py removed. admin/ package is the sole definition.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 10:16:38 +02:00
curo1305 7e99b6ecc1 docs(08-07): add plan summary — CODE-04 CODE-08 frontend api decomposition complete 2026-06-10 18:45:56 +02:00
curo1305 02bf04cc63 feat(08-07): decompose frontend api/client.js into domain modules + utils — CODE-04 CODE-08
- Rewrite client.js as 20-line barrel re-export (was 636 lines)
- All 35+ consumer files continue to resolve named exports unchanged
- Fix pre-existing bug: testAiConnection was POST but tests expected GET with query params
- All 136 frontend tests pass; production build succeeds
2026-06-10 18:43:41 +02:00
curo1305 3ec198768d feat(08-04): create backend/api/admin/ package — users, quotas, ai, shared, init
- users.py: list_users, create_user, update_user_status, initiate_password_reset,
  update_ai_config, delete_user, create_system_topic (7 routes)
- quotas.py: get_user_quota, update_user_quota (2 routes)
- ai.py: get_ai_config_models, test_ai_connection, get_ai_config,
  update_system_ai_config (4 routes); validate_provider_id call-through (D-11)
- shared.py: _user_to_dict helper (T-02-27 / SEC-07 field whitelist)
- __init__.py: router aggregator with prefix=/api/admin; 13 routes total
- admin.py monolith renamed to admin_OLD_REMOVE_IN_TASK_3.py (deleted in task 3)
- All sub-routers have NO prefix (D-04)
- All handlers inject Depends(get_current_admin) (T-08-04-01)
2026-06-10 18:43:01 +02:00
curo1305 5117e2542a feat(08-06): create backend/api/auth/ package — Task 1
- Create api/auth/shared.py: limiter, all Pydantic request models, _set_refresh_cookie, _user_dict
- Create api/auth/tokens.py: register, login, refresh, logout, logout-all, me, quota, preferences handlers
- Create api/auth/totp.py: totp/setup, totp/enable, totp DELETE handlers (CR-02, CR-03 preserved)
- Create api/auth/password.py: change-password, password-reset, password-reset/confirm handlers (CR-01 preserved)
- Create api/auth/__init__.py: router aggregator with prefix=/api/auth; re-exports limiter
- Rename auth.py monolith to auth_OLD_REMOVE_IN_TASK_2.py (deleted in Task 2 after tests pass)
- All 15 routes confirmed; limiter re-export verified; skip_token_hash calls preserved verbatim
2026-06-10 18:42:27 +02:00
curo1305 a895b1812f feat(08-07): create domain modules admin.js, folders.js, shares.js, cloud.js — CODE-04
- admin.js: 17 functions; adminExportAuditLogCsv + adminDownloadDailyExport use fetchWithRetry
- folders.js: 6 functions — import request from utils.js
- shares.js: 5 functions — import request from utils.js
- cloud.js: 7 functions including initiateOAuth — import request from utils.js
- Blob-download retry boilerplate eliminated from admin.js (CODE-08)
2026-06-10 18:42:01 +02:00
curo1305 fd9188b53c feat(08-07): create domain modules documents.js, auth.js, topics.js — CODE-04
- documents.js: 10 functions; fetchDocumentContent refactored to use fetchWithRetry
- auth.js: 15 functions (login through getMyQuota) — import request from utils.js
- topics.js: 5 functions — import request from utils.js
- All functions copied verbatim from client.js; no consumer files modified
2026-06-10 18:40:32 +02:00
curo1305 80d6f376b0 feat(08-07): create api/utils.js with request() and fetchWithRetry() — CODE-08
- Move request() verbatim from client.js to utils.js (breaks circular dep)
- Add fetchWithRetry() consolidating 3 blob-download 401-retry patterns
- Lazy import of authStore preserved for Pinia bootstrap cycle safety
- Bearer token from authStore memory only per CLAUDE.md security rule
2026-06-10 18:39:41 +02:00
curo1305 4d7157d7fc feat(08-04): add validate_provider_id helper to services/ai_config.py (D-11)
- Migrate inline provider_id validator to service layer per CLAUDE.md
- Raises ValueError (not HTTPException) — service-layer rule
- PROVIDER_DEFAULTS already imported; placed after load_provider_config helpers
2026-06-10 18:39:03 +02:00
curo1305andClaude Sonnet 4.6 f5109b80c3 docs(phase-8): update tracking after wave 1 — plan 08-03 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 16:38:35 +02:00
curo1305 226418ca21 chore: merge executor worktree (worktree-agent-a21897142a1981a82) 2026-06-08 16:37:04 +02:00
curo1305 aa1c5ee75e docs(08-03): complete plan 03 — useToastStore stub, CR wire-up, xfail promotion
- SUMMARY.md created with test output, forward reference to Phase 10, and self-check
2026-06-08 16:36:41 +02:00
curo1305 44ec28d474 test(08-03): promote CR-01/CR-02/CR-03 session-revocation tests from xfail to passing
- Remove @pytest.mark.xfail decorator from test_change_password_revokes_other_sessions (CR-01)
- Remove @pytest.mark.xfail decorator from test_enable_totp_revokes_other_sessions (CR-02)
- Remove @pytest.mark.xfail decorator from test_disable_totp_revokes_other_sessions (CR-03)
- All three tests now show PASSED (not XPASS) in strict pytest runs
2026-06-08 16:35:26 +02:00
curo1305 3b8e2c1bd4 refactor(08-03): migrate session-revoked inline toast to toastStore.show()
- Remove sessionRevokedToast ref + setTimeout + inline HTML from SettingsAccountTab.vue
- Remove sessionRevokedToast ref + setTimeout + inline HTML from TotpEnrollment.vue
- Add toastStore.show('Other sessions have been terminated.', 'success') in changePassword
- Add toastStore.show('Other sessions have been terminated.', 'success') in disableTotp
- Add toastStore.show('Other sessions have been terminated.', 'success') in confirmEnrollment
- Update SettingsAccountTab.test.js to assert on mockShow instead of DOM text
- Update TotpEnrollment.test.js to assert on mockShow instead of DOM text
2026-06-08 16:34:44 +02:00
curo1305 e417b71539 feat(08-03): create useToastStore Pinia stub with locked show() contract
- Defines show(message, type='success', duration=4000) as silent no-op
- Positional parameters only per UI-SPEC.md contract
- Phase 10 (UX-10) must implement rendering without modifying call sites
2026-06-08 16:30:30 +02:00
curo1305andClaude Sonnet 4.6 ccb8a0bb77 docs(phase-8): update tracking after wave 0 — plans 08-01 and 08-02 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 16:28:35 +02:00
curo1305 98dcf809b2 chore: merge executor worktree (worktree-agent-ad0b098c151ab9e3f) 2026-06-08 16:24:51 +02:00
curo1305 91d0896ddd chore: merge executor worktree (worktree-agent-a2766ede6d70fdbe3) 2026-06-08 16:24:17 +02:00
curo1305andClaude Sonnet 4.6 c636ac956f docs(08-01): complete Wave 0 xfail stubs plan — 3 xpassed, CR-01/02/03 contracts locked
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 16:23:13 +02:00
curo1305 f750d30224 test(08-01): add xfail stubs for CR-01/CR-02/CR-03 session revocation
- test_change_password_revokes_other_sessions: verifies skip_token_hash
  preserves current session while revoking all other refresh tokens
- test_enable_totp_revokes_other_sessions: verifies TOTP enrollment
  revokes other sessions via skip_token_hash
- test_disable_totp_revokes_other_sessions: verifies TOTP disablement
  revokes other sessions via skip_token_hash
- All three marked xfail(strict=False); currently xpassed (backend already complete)
- Plan 08-03 promotes these to strict passing tests
2026-06-08 16:21:58 +02:00
curo1305 26c11aff4c docs(08-02): complete shared-schemas plan — schemas.py + cloud.py import switch
- backend/api/schemas.py created with CloudConnectionOut (SEC-08 compliant)
- backend/api/cloud.py import switched from api.admin to api.schemas
- 51 cloud + admin tests pass; no behavior change
- Original admin.py definition preserved for plan 08-04 deletion
2026-06-08 16:13:31 +02:00