From 02f308bb9bed55ec12797b2706bc329fe2dfc7a7 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Thu, 19 Mar 2026 13:47:03 +0000 Subject: [PATCH] docs: update CURRENT-STATE.md to reflect Phases 1-4 progress Co-Authored-By: Claude Opus 4.6 (1M context) --- CURRENT-STATE.md | 162 ++++++++++++++++++++++++++++++----------------- 1 file changed, 103 insertions(+), 59 deletions(-) diff --git a/CURRENT-STATE.md b/CURRENT-STATE.md index 2008e8a1..a1d981d4 100644 --- a/CURRENT-STATE.md +++ b/CURRENT-STATE.md @@ -2,19 +2,19 @@ > **Purpose:** Quick-reference file showing exactly where the project stands. > **For Claude Code:** Read this first to understand what's done and what's next. -> **Last Updated:** February 14, 2026 +> **Last Updated:** March 19, 2026 --- -## Active Phase: Phase 2.5 - Step Library Foundation (In Progress) +## Active Phase: Phase 4 - Enterprise & Growth Features (In Progress) --- ## What's Complete -### Backend (100%) -- FastAPI project structure with 25+ API endpoints -- PostgreSQL database with Docker, 30+ Alembic migrations +### Core Platform +- FastAPI project structure with 35+ API endpoints +- PostgreSQL database with Docker, 75+ Alembic migrations - User authentication (JWT, register, login, refresh, logout, invite codes) - Refresh token rotation with JTI-based revocation - Trees CRUD with full-text search (FTS index) @@ -27,32 +27,64 @@ - Audit log table with JSONB details - Soft delete for trees with cascade cleanup -### Frontend (Phase 2 Complete) -- React 19 + Vite + TypeScript + Tailwind setup -- Authentication UI (login, register) +### Frontend Core +- React 19 + Vite + TypeScript + Tailwind CSS v4 (`@tailwindcss/vite`) +- **Slate & Ice Design System** — Dark glassmorphism, ice-cyan gradient accents, glass-card system +- **Brand fonts:** Bricolage Grotesque (headings), IBM Plex Sans (body), JetBrains Mono (labels) +- Authentication UI (login, register, email verification) - Tree library/browsing page with grid/list/table views - Tree navigation interface (session player) - Session management with history and detail pages -- Export functionality (download) - **Tree Editor** — Form-based with visual preview, Zustand + immer + zundo (undo/redo) - **Markdown rendering** in session player and node editor -- **Monochrome Design System** — Dark-only, glass-morphism cards, Inter font, theme toggle removed - **Tree Organization** — Categories, tags (autocomplete), user folders (3-level hierarchy), filters -- **RBAC & Permissions** — `usePermissions` hook, ProtectedRoute with role guards, permission-based UI hiding +- **RBAC & Permissions** — `usePermissions` hook, ProtectedRoute with role guards - **Session Scratchpad** — Floating overlay (Ctrl+/), auto-save, markdown preview - **Admin Panel** — 8 pages (dashboard, users, invite codes, audit logs, plan limits, feature flags, settings, categories) -- **Session Quick Wins** (Issues #51-#55): - - Session timer (`useSessionTimer` hook, MM:SS / HH:MM:SS) - - Keyboard hints (Tab focuses notes) - - Repeat Last Session (prefills metadata from localStorage) - - Session auto-recovery (resume incomplete sessions) - - Copy step to clipboard - - Delete tree button in all view modes -- **Session Outcomes** — Outcome modal on session completion, step timing tracking -- **Settings page** at `/settings` — Default export format preference -- **Session Sharing** — ShareSessionModal, SharedSessionPage (`/shared/sessions/:token`), MySharesPage (`/my-shares`), share link copy/manage from navigation page -- **Procedural Editor UX** — Section headers as first-class step type, "More Options" collapsible for advanced fields, URL intake field type, improved tag input (comma/semicolon/Tab delimiters) -- **Type-aware Routing** — Centralized `getTreeNavigatePath` helper, procedural sessions route to `/flows/:id/navigate`, resume support in procedural navigator, safety redirect in troubleshooting navigator +- **Session Quick Wins** — Timer, keyboard hints, repeat last, auto-recovery, copy step, delete tree +- **Session Outcomes** — Outcome modal on completion, step timing tracking +- **Session Sharing** — Share links, public/account views, MySharesPage +- **Procedural Editor UX** — Section headers, collapsible advanced fields, URL intake, tag input +- **Type-aware Routing** — Centralized `getTreeNavigatePath`/`getTreeEditorPath` helpers +- **Account Management** — Profile settings, delete/leave/transfer, chat retention +- **PostHog Analytics** — Event tracking, user identification, autocapture + +### FlowPilot AI System (Phases 1-3 Complete) + +**Phase 1 — AI Session Engine:** +- FlowPilotEngine with multi-step guided troubleshooting +- AI copilot panel + standalone assistant chat with RAG +- Confidence-tiered model routing via `settings.get_model_for_action()` +- Intake form with ticket/client fields, session pause/resume +- AI-generated ticket summaries, outcome tracking + +**Phase 2 — PSA Integration & Escalation:** +- ConnectWise PSA integration (ticket linking, note posting, member mapping) +- PSA documentation auto-push with retry scheduler +- Session pause/resume, mid-session ticket linking +- Escalation handoff workflow with LLM-enhanced briefing package +- Escalation pickup flow for senior engineers +- PSA settings UI on IntegrationsPage +- In-session script generator + +**Phase 3 — Knowledge Flywheel:** +- AI session analysis → automatic flow proposal generation +- FlowProposal model with review queue (approve, edit & publish, dismiss, reject) +- Knowledge gap detection (weak options, high escalation domains) +- FlowPilot analytics dashboard (metrics, confidence tiers, PSA stats, gaps) +- APScheduler batch analysis job with `max_instances=1` +- Auto-reinforcement for sessions matching existing flows + +### Phase 4 Slice 2 — Notification System (Just Completed) +- NotificationConfig, NotificationLog, Notification models + migration +- Multi-channel delivery: in-app, email (Resend), Slack webhooks, Teams webhooks +- Notification service with event routing and fire-and-forget delivery +- APScheduler retry job with exponential backoff (30s, 2m, 10m, max 3 retries) +- 9 API endpoints (config CRUD + in-app notification management) +- Wired into escalation, proposal approval, and knowledge flywheel events +- Frontend: NotificationsPanel (bell icon + dropdown), NotificationSettings UI +- Notifications tab on IntegrationsPage +- Pydantic validation for event keys, cross-tenant protection ### Security Hardening (Phases A-D Complete) - Registration role hardcoded to `engineer` @@ -63,22 +95,27 @@ - Centralized permissions in `permissions.py` - `is_active` field on User model, enforced in auth - Admin user management endpoints (6 endpoints) -- Refresh token rotation with JTI-based revocation - Password complexity validation (uppercase, lowercase, digit, min 10 chars) - Soft delete cascade cleanup (folder/tag junctions) - SQL wildcard escaping in tag search +- PSA credentials encrypted at rest (Fernet) -### Backend Schema Features (Not Yet in Frontend) -- **Tree Forking** (migration 022) — `parent_tree_id`, `root_tree_id`, `fork_depth`, `fork_reason` -- **Tree Sharing** (migration 024) — tree share links -- **Enhanced Invite Codes** (migration 030) — email, assigned_plan, trial_duration_days +### Maintenance Flows +- Batch session launch, saved target lists +- APScheduler scheduling with croniter + pytz + +### Survey System +- Public survey page, admin invite tracking +- Response viewer with CSV export +- Email-to-self, thank-you page +- Admin read/unread/archive/delete management ### Documentation -- CLAUDE.md (project context for Claude Code) -- CLAUDE.md includes consolidated lessons learned (formerly LESSONS-LEARNED.md) -- Design system guide, component examples +- CLAUDE.md (comprehensive project context) +- UI-DESIGN-SYSTEM.md, REBRAND-IMPLEMENTATION-GUIDE.md +- ConnectWise API reference docs in `docs/connectwise/` - Feature specifications through Phase 4 -- Rebrand implementation guide +- Phase implementation plans in `docs/plans/` --- @@ -86,49 +123,55 @@ | Task | Status | Notes | |------|--------|-------| -| Editor-Embedded Flow Assist | In Progress | AI panel in tree + procedural editors, ghost node suggestions, action-type routing | -| Step Library Frontend | In Progress | Backend complete, frontend UI pending | -| Procedural Flows Lifecycle | In Progress | Resume support done, full run chooser/reuse pending | -| Tree Forking UI | Planning | Backend schema complete (migration 022) | +| Phase 4 Slice 1 — Public Templates Gallery | Not Started | SEO/lead-gen surface for flow templates | +| Phase 4 Slice 3 — Session Export | Not Started | PDF (weasyprint), markdown, clipboard copy | +| Phase 4 Slice 4 — Mobile/Responsive | Not Started | Tablet/phone polish for field technicians | +| Phase 4 Slice 5 — Enterprise Readiness | Not Started | Custom branding, PSA stubs, SSO groundwork | --- ## What's Next (Priority Order) -### Immediate (Phase 2.5 Completion) -1. Step Library Frontend UI (browse, search, rate/review) -2. Procedural Flows run lifecycle (RunChooserModal, intake reuse/prefill) -3. Tree Forking UI and workflow +### Immediate (Phase 4 Remaining Slices) +1. Public Templates Gallery (SEO, lead generation) +2. Session Export (PDF, markdown, copy-to-clipboard) +3. Mobile/Responsive polish +4. Enterprise readiness (branding, rate limiting, SSO prep) -### Soon (Phase 3) -- File attachments for sessions -- Offline capability -- Client context system -- Advanced analytics dashboard - -### Later (Phase 4) -- PSA integrations (ConnectWise, Kaseya) +### Soon (Phase 5) +- Additional PSA integrations (Autotask/Kaseya) - PowerShell automation framework -- Enterprise features (SSO, white-label) +- Advanced analytics and reporting + +### Later +- Enterprise SSO (SAML/OIDC) +- White-label deployment +- Marketplace for community flow templates --- ## Environment Quick Reference ### Start Development -```powershell -docker start patherly_postgres -cd backend && .\venv\Scripts\activate && uvicorn app.main:app --reload -cd frontend && npm run dev +```bash +# Start PostgreSQL (Docker Compose) +docker compose up -d + +# Backend (from backend/) +source venv/bin/activate +uvicorn app.main:app --reload + +# Frontend (from frontend/) +npm run dev ``` ### URLs -- Frontend: http://localhost:5173 -- Backend API: http://localhost:8000 -- API Docs: http://localhost:8000/api/docs +- Frontend: http://192.168.0.9:5173 +- Backend API: http://192.168.0.9:8000 +- API Docs: http://192.168.0.9:8000/api/docs ### Run Tests -```powershell +```bash cd backend && pytest --override-ini="addopts=" ``` @@ -138,5 +181,6 @@ cd backend && pytest --override-ini="addopts=" | Issue | Workaround | Status | |-------|------------|--------| -| pytest-asyncio version conflict | Use 0.24.0 | Documented | -| No local psql on Windows | Use `docker exec` | Documented | +| `analysis_status` has no CheckConstraint | Valid values documented in code comments | Low priority | +| Review queue/analytics pages have no frontend role gate | Backend 403 protects data; UX could show message | Low priority | +| Review queue capped at 50 with no pagination UI | Filters can narrow results | Low priority |