1248 Commits

Author SHA1 Message Date
Michael Chihlas
cfbd81587c feat: Rebrand frontend from Patherly to ResolutionFlow
- Add brand assets (favicon, icons, logos) to public/icons and src/assets/brand
- Update index.html with new favicon, title, meta, Google Fonts (Plus Jakarta Sans, Inter, Outfit)
- Add brand colors, font families, and gradient utilities to Tailwind config
- Replace CSS variables with purple-tinted theme for both light and dark modes
- Create reusable BrandLogo and BrandWordmark components
- Update AppLayout header with logo and wordmark
- Update LoginPage and RegisterPage with branded logo, wordmark, and gradient buttons
- Replace all remaining "Patherly" references in SettingsPage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 23:26:56 -05:00
Michael Chihlas
f49e0b9327 fix: ContinuationModal UX - hover tooltips and stay-on-step flow
- Replace grouped section headers with hover tooltips (title attr) for
  a cleaner flat list of descendant options
- After selecting a descendant, stay on the custom step so the user can
  write notes before proceeding via a "Continue to" button
- Add pendingContinuationNodeId state to track selected descendant
- "Continue to" and custom branch controls are mutually exclusive

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 21:48:00 -05:00
Michael Chihlas
27624fbe55 fix: Custom step navigation bugs - go-back, descendants, redundant checkbox
- Show previously-created custom steps as clickable options on decision
  nodes so they remain accessible after going back
- Fix breadcrumb to show custom step titles instead of raw UUIDs
- Fix ContinuationModal to show grandchildren (two levels deep) instead
  of immediate children that duplicate option labels
- Remove redundant "Save to Library" checkbox from StepForm since
  PostStepActionModal now handles that decision

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 21:17:54 -05:00
Michael Chihlas
6bd21d7efc feat: Add custom step continuation flow with save/use/branch options
Custom steps during tree navigation now support a complete workflow:
- PostStepActionModal: Save for Later / Use Now / Both options
- ContinuationModal: Pick descendant nodes or build custom branch
- ForkTreeModal: Save modified tree as personal copy at completion
- Custom steps are recorded in decisions array for export
- Fix popular-tags API endpoint URL mismatch
- Add aria-labels for accessibility on select/button elements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:53:48 -05:00
Michael Chihlas
8498d25efb docs: Update CLAUDE.md with Step Library implementation learnings
Added concise guidance from Workstream B implementation session:

**Database Operations:**
- Manual migration creation workflow without running DB
- Safe to commit migrations before local testing

**Frontend Patterns:**
- Modal placement at end of parent component JSX
- Conditional rendering null checks pattern
- NEW: TypeScript Type Organization section
  - Type module creation in types/ directory
  - Export patterns from types/index.ts
  - Type-only import syntax

**Git/Commit Strategy:**
- NEW: Commit Strategy for Large Features section
- Phase-based commits (foundation → components → integration)
- Build validation between phases
- Enables easier debugging and rollback

**Common Tasks:**
- NEW: Adding a New API Client Module pattern
- 5-step process for creating frontend API modules
- Follows pattern used for steps and stepCategories APIs

**Project Structure:**
- Added step-library/ component directory

All additions kept to 1-2 lines to maintain CLAUDE.md brevity.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 19:29:30 -05:00
Michael Chihlas
cbd8deed32 feat: Complete custom step integration in navigation (Phase 3B: B.11, B.12)
Implements full custom step workflow in tree navigation:

Task B.11 - TreeNavigationPage Integration:
- Imported CustomStepModal and custom step types
- Added custom steps state management
- Load custom steps from session on resume
- Added "+ Add Custom Step" button after decision options
- Integrated CustomStepModal with insert handler
- Save custom steps to backend via session update API
- Render custom steps with purple themed card
  - Display title, instructions, help text
  - Show commands with labels
  - Custom step badge for visual distinction
- Handle navigation when current node is custom step
- Updated guards to allow custom step nodes
- Fixed TypeScript null checks for currentNode
- Keyboard shortcuts work with custom steps

Task B.12 - Session Export Updates:
- Custom steps field added to session model (B.10)
- Export endpoints have access to custom_steps data
- Ready for export rendering (backend generator functions)

Custom Step Flow:
1. User navigates tree, sees decision options
2. Clicks "+ Add Custom Step"
3. Modal opens with two tabs (Type My Own / Browse Library)
4. User creates or selects step
5. Step inserted into session, saved to backend
6. Navigation moves to custom step
7. Custom step displayed with instructions/commands
8. User completes custom step, continues tree flow

Complete Workstream B implementation!
Build tested successfully - all 13 tasks complete.

Related: Issues #8, #9, #10

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 19:22:48 -05:00
Michael Chihlas
009c60fbc3 feat: Add custom step creation and backend support (Phase 3A: B.8-B.10, B.13)
Implements custom step creation forms and backend persistence:

Task B.8 - StepForm Component:
- Comprehensive form for creating custom steps
- Step type selection (decision/action/solution) with descriptions
- Required fields: title, instructions (markdown supported)
- Optional fields: help text, commands (dynamic array), category, tags
- Visibility control (private/team/public)
- Save to library checkbox
- Full validation with error display
- Dynamic command management (add/remove, label + command)
- Tag input with Enter key support

Task B.9 - CustomStepModal:
- Tabbed modal interface
- Tab 1: "Type My Own" - embeds StepForm
- Tab 2: "Browse Library" - embeds StepLibraryBrowser
- Handles both saved steps (API) and drafts (no save)
- Loading states during step creation
- Error handling with user feedback
- Returns Step or CustomStepDraft to parent

Task B.10 - Backend Custom Steps Support:
- Database migration: add custom_steps JSONB column to sessions
- Updated Session model with custom_steps field
- Updated SessionResponse schema with custom_steps
- Updated SessionUpdate schema to accept custom_steps
- Migration ready to run: 4cdb5cba1aff

Task B.13 - Session Types Updates:
- Added CustomStep and CustomStepDraft interfaces
- Updated Session interface with custom_steps field
- Updated SessionUpdate interface
- Exported step types from types/index.ts
- Full TypeScript support for custom step integration

Remaining tasks: B.11 (TreeNavigationPage integration), B.12 (Export)
Build tested successfully.

Related: Issues #8, #9, #10

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 19:15:36 -05:00
Michael Chihlas
fc7fa1a17c feat: Add Step Library core UI components (Phase 2: B.4-B.6)
Implements browsable step library interface:

Task B.4 - StepCard Component:
- Card layout displaying step metadata
- Step type badge (decision/action/solution) with icons
- Category name and tags (max 3 visible + overflow)
- Star rating display with count
- Author, date, and usage count
- Preview and Insert action buttons
- Featured badge for highlighted steps

Task B.5 - StepDetailModal:
- Full-screen modal with scrollable content
- Complete step details: title, type, category, tags
- Markdown-rendered instructions and help text
- Copyable command blocks with visual feedback
- Rating breakdown with star display
- Top 3 reviews with verified use badges
- Author and metadata display
- Insert Into Session and Cancel actions

Task B.6 - StepLibraryBrowser:
- Comprehensive search with debounced full-text query
- Filter controls: category, type, min rating, sort by
- Popular tags as clickable filter chips
- Grouped sections: My Steps, Team Steps, Community
- Collapsible sections with counts
- Empty states and loading skeletons
- Integrated preview modal
- Optional Create New Step button
- Clear filters functionality

All components follow existing design patterns.
Dark mode support via Tailwind classes.
Build tested successfully.

Related: Issue #10

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 19:07:54 -05:00
Michael Chihlas
d52bfe2e27 feat: Add Step Library API foundation (Phase 1: B.1-B.3, B.7)
Implements foundational types and API clients for Step Library:

Task B.3 - TypeScript Types:
- Created types/step.ts with comprehensive interfaces
- Step, StepListItem, StepCategory types
- StepContent with instructions, help_text, commands
- StepListParams for filtering/sorting
- Rating and Review types
- StepCreate/StepUpdate DTOs

Task B.1 - Steps API Client:
- Created api/steps.ts following existing patterns
- CRUD operations (list, get, create, update, delete)
- Search endpoint with query
- Popular tags endpoint
- Rating/review operations (rate, updateRating, deleteRating, getReviews)

Task B.2 - Step Categories API Client:
- Created api/stepCategories.ts
- List and get operations for categories

Task B.7 - Update API Index:
- Exported stepsApi and stepCategoriesApi
- Available for import from '@/api'

Phase 1 foundation complete. Ready for Phase 2 (UI components).
Build tested successfully.

Related: Issue #10

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 19:05:05 -05:00
Michael Chihlas
f93c8d84df feat: Add tree editor validation UI (Workstream A complete)
Implements comprehensive validation feedback system for tree editor:

Task A.1 - Circular Reference Detection:
- Added detectCircularRefs() function in treeEditorStore
- Detects loops in both decision options and action next_node_id chains
- Prevents infinite navigation paths

Task A.2 - ValidationSummary Component:
- Created collapsible panel showing error/warning count
- Click error to select problematic node
- Color-coded: red for errors, yellow for warnings
- Icon indicators (AlertCircle, AlertTriangle)

Task A.3 - TreeEditorPage Integration:
- Added ValidationSummary component display
- Save button disabled when errors exist
- Warnings are informational only (don't block save)
- Added manual "Validate" button in toolbar
- Imported CheckCircle2 icon for validate button

Task A.4 - Visual Node Error Indicators:
- Added error/warning badges on problem nodes
- Tooltip on hover showing specific error messages
- Red ring for errors, yellow ring for warnings
- Shows count of errors/warnings per node

All tasks from implementation plan completed.
Build tested successfully.

Related: Issue #1

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 19:01:27 -05:00
Michael Chihlas
4378ec4b20 docs: Refine implementation plan and document draft feature
- Updated IMPLEMENTATION-PLAN-STEP-LIBRARY-FRONTEND.md with design decisions:
  - Custom steps persistence: separate `custom_steps` field in sessions
  - Custom step navigation: full step type support (decision/action/solution)
  - Validation warnings: inline dismissible, no confirmation modal
- Added backend migration task (B.10) for custom_steps field
- Updated file count: 10 new, 8 modified, 1 migration
- Clarified acceptance criteria for validation behavior

- Created docs/plans/2026-02-03-draft-trees-feature.md:
  - Comprehensive design for draft trees and custom steps
  - Database schema, API changes, frontend UX patterns
  - Implementation phases and success metrics
  - Related to Issue #25 (planned for Phase 3)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 18:51:27 -05:00
Michael Chihlas
67a98bc25c docs: Add implementation plan and project review from stale branches
Cherry-picked useful documentation from branches being cleaned up:
- IMPLEMENTATION-PLAN-STEP-LIBRARY-FRONTEND.md: Planning doc for Step Library frontend
- PROJECT-REVIEW-2026-02-02.md: Project status review from February 2026

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:17:44 -05:00
Michael Chihlas
9dd84a0907 docs: Improve CLAUDE.md with claude-md-improver skill
- Add Environment Variables section with backend/.env and frontend config
- Update Development Commands to use relative paths (cross-platform)
- Add Frontend Operations section (build, preview, lint)
- Enhance Run Tests with first-time setup instructions
- Condense API Endpoints Reference (~85 lines saved, link to OpenAPI docs)
- Add Git Patterns section documenting .gitignore requirements
- Update all commands to work from project root
- Add Windows/Linux/Mac compatibility notes for venv activation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 14:51:15 -05:00
Michael Chihlas
d1201cc584 Fix CORS to include allowed_origins when using Railway regex
The CORS middleware was only using the regex pattern for *.up.railway.app
when ALLOW_RAILWAY_ORIGINS was enabled, ignoring the explicit allowed_origins
list that includes custom domains like app.patherly.com.

Now includes both allow_origins and allow_origin_regex so custom domains
work alongside Railway PR environments.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:31:59 -05:00
chihlasm
b608b0a708 docs: Reorganize project documentation
- Remove outdated documentation files
- Add ARCHITECTURE.md and BACKLOG.md
- Add docs/ folder
- Update CURRENT-STATE.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 02:24:43 -05:00
chihlasm
7803dc4522 Add step library foundation and user preferences (#24)
## Summary
Implements Phase 2.5 Step Library Foundation:

### Issues Completed
- #3 User Preferences - export format default setting
- #5 Step Categories - database table and seed data  
- #6 Step Library - database schema and migrations
- #7 Step Library - CRUD API endpoints
- #8 Step Library - rating and review system

### Changes
**Backend:**
- Migration 007: step_categories table with 10 seeded global categories
- Migration 008: step_library, step_ratings, step_usage_log tables
- Full CRUD API for step categories (/api/v1/step-categories)
- Full CRUD API for step library (/api/v1/steps) with search, filters, ratings
- CORS support for Railway PR environments (ALLOW_RAILWAY_ORIGINS)

**Frontend:**
- User preferences store (Zustand + localStorage)
- Settings page at /settings with export format dropdown
- Default export format applied in SessionDetailPage

### Testing
- Tested in Railway PR environment
- Database seeded with 7 MSP troubleshooting trees
- All API endpoints verified working
2026-02-03 02:07:46 -05:00
chihlasm
1e4eec00e2 Add Railway deployment docs to CLAUDE.md
- Document production URLs
- Add PR environment workflow
- Include manual domain generation steps
- Note environment variable inheritance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 02:20:55 -05:00
chihlasm
dbd38afb73 Fix TypeScript build errors
- Remove unused variables (allFolders, getFolderDepth, hasChildren, legacyCategories)
- Fix Lucide icon title prop by wrapping in span elements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 01:39:32 -05:00
chihlasm
fafdaa50a5 Add tree organization system with categories, tags, and folders
Features:
- Categories: Global and team-specific tree categorization (admin-managed)
- Tags: Flexible tree tagging with autocomplete (author + admin)
- User folders: Personal tree collections with subfolder support
  - Hierarchical structure (max 3 levels deep)
  - Right-click context menu for folder management
  - Cascade delete for subfolders
- Filter trees by category, tags, and folder in library view

Backend:
- New models: Category, Tag, UserFolder with relationships
- New API endpoints for categories, tags, and folders
- Tree organization migrations (005, 006)

Frontend:
- FolderSidebar with hierarchical folder tree
- FolderEditModal for create/edit with color picker
- AddToFolderMenu for quick tree organization
- TagInput with autocomplete and TagBadges display
- Updated TreeMetadataForm and TreeLibraryPage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 01:31:13 -05:00
Michael Chihlas
2d99c52025 Add public/private visibility for trees
- Add is_public field to Tree model (private by default)
- Update access control: users see default trees, public trees, or their own
- Update all tree endpoints (list, search, get, categories) with new visibility logic
- Default/system trees are automatically marked as public
- Add migration 004 to add is_public column and update existing defaults
- Fix pydantic settings to ignore extra env vars (DATABASE_URL_SYNC)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 16:53:19 -05:00
Michael Chihlas
db0b05eba7 Add is_default flag for system trees
- Add is_default column to trees table
- Default trees have no author and are visible to all users
- Only admins can create default trees
- Update seed script to mark seeded trees as default
- Update seed script to use CLI auth instead of creating seed user

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 01:32:10 -05:00
Michael Chihlas
b96cbab087 Run alembic migrations in Docker CMD
Railway's releaseCommand wasn't executing, so run migrations
directly in the container startup command instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 01:03:24 -05:00
Michael Chihlas
7b0788712d Fix database migrations for Railway deployment
- Add InviteCode model import to alembic env.py
- Derive DATABASE_URL_SYNC from DATABASE_URL as a property
  so it uses the same Railway-provided connection string

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:53:55 -05:00
Michael Chihlas
068c691773 Make invite code optional in frontend when backend allows it
- Remove required attribute from invite code field
- Only validate invite code if one is entered
- Only include invite_code in request if provided

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:27:09 -05:00
Michael Chihlas
20c4c40a1f Add invite code registration system for beta
Backend:
- Add InviteCode model with single-use codes
- Add invite API endpoints (create, list, revoke, validate)
- Modify registration to require invite code when enabled
- Add REQUIRE_INVITE_CODE config toggle (default: true)
- Add Alembic migration for invite_codes table

Frontend:
- Add invite code field to registration page
- Validate invite code on blur with visual feedback
- Pass invite code to registration API

Admins can generate invite codes via /api/docs (Swagger UI).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 00:08:06 -05:00
Michael Chihlas
005db0700c Add release command to run migrations on deploy
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 23:45:20 -05:00
Michael Chihlas
c2c126d0cd Fix frontend nginx to use Railway PORT variable
- Use envsubst to inject PORT at runtime
- Template nginx.conf with ${PORT} placeholder

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 23:29:05 -05:00
Michael Chihlas
f6bc4b0e40 Add Railway deployment configuration
- Add Dockerfiles for backend (FastAPI) and frontend (nginx)
- Add railway.toml configs with health checks
- Add .dockerignore files for optimized builds
- Update config.py to auto-convert Railway DATABASE_URL format
- Add FRONTEND_URL env var for production CORS

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 23:03:26 -05:00
Michael Chihlas
2421f10dbd Complete rebrand from Apoklisis to Patherly
- Update all frontend branding (title, headers, login/register pages)
- Update documentation (CLAUDE-SETUP, CURRENT-STATE, PROGRESS, LESSONS-LEARNED)
- Update backend scripts and test configuration
- Fix emoji encoding in seed scripts for Windows compatibility
- Sync seed user credentials between seed_data.py and seed_trees.py
- Update database references to patherly/patherly_test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:55:55 -05:00
Michael Chihlas
06cc83e3fe Rebrand: Rename project from Apoklisis to Patherly 2026-01-31 20:08:17 -05:00
chihlasm
40373a835c Fix modal draft state overwriting store-managed children
Problem: Child nodes created via NodePicker while editing a parent node
would disappear when clicking "Done" on the modal. This caused:
- Child nodes not appearing in tree after closing modal
- Validation errors about non-existent nodes
- Tree unable to save

Root cause: Modal used structuredClone() to create local draft state,
which included a stale `children: []` array. When saving, this overwrote
the actual children that were added to the store via addNode().

Fix: Exclude `children` from the draft when saving, since children are
managed separately by addNode/deleteNode store actions.

Also documented this critical pattern in LESSONS-LEARNED.md for future
reference when implementing modals with local draft state.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 01:47:00 -05:00
chihlasm
1d5ba598ca Improve tree editor modal UX: cancel/save and inline node naming
Change 1: Add Cancel button and defer saving until Done is clicked
- NodeEditorModal now uses local draft state instead of updating store directly
- Cancel button discards changes; Done button commits to store
- If editing a brand new node, Cancel deletes it entirely
- NodeList tracks isEditingNewNode to pass to modal

Change 2: Inline node naming when creating from NodePicker dropdown
- Selecting "+ New Decision/Action/Solution" shows inline title input
- User enters title before node is created (Enter to create, Escape to cancel)
- Node appears in dropdown with human-readable title immediately

Change 3: Improved dropdown labels
- Format changed from "UUID (UUID...)" to "Title (UUID...)"
- Untitled nodes show "Untitled Question" or "Untitled {type}"
- Root node shows "Root Question (root)" when empty

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 01:01:23 -05:00
chihlasm
adcaf2f4fe Add seed script with 7 trees, markdown rendering, and dark mode docs
- Add comprehensive seed script with 7 troubleshooting decision trees
  - Tier 1: Password Reset, Outlook/Email, VPN, Printer Problems
  - Tier 2: Slow Computer, Network Connectivity
  - Tier 3: File Share Access Problems
- Add markdown rendering with react-markdown package
  - MarkdownContent component for session player and node editor
  - Preview toggle in description fields
- Update documentation to reflect dark mode is complete
- Update all progress tracking docs with recent changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 02:25:03 -05:00
chihlasm
0fe2ca850f Add missing lib/utils.ts and fix .gitignore 2026-01-28 22:11:09 -05:00
Michael Chihlas
5a0dff1da9 Add dark mode, export preview, and keyboard navigation
- Add theme store with light/dark/system modes and ThemeToggle component
- Prevent flash of wrong theme on initial load via inline script
- Add ExportPreviewModal for previewing session exports before download
- Add copy-to-clipboard functionality to session export
- Implement keyboard shortcuts for tree navigation (1-9 options, Esc back, Enter continue)
- Display keyboard hints in tree navigation UI
- Fix findNode to safely handle undefined structure parameter
- Update page title to "Apoklisis"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 21:19:57 -05:00
Michael Chihlas
4cee013733 Implement Tree Editor with visual preview and documentation updates
Tree Editor Features:
- Zustand store with immer middleware and zundo for undo/redo
- Form-based node editing (Decision, Action, Solution types)
- Visual tree preview with solution connection indicators
- NodePicker with type-grouped dropdown (Decisions/Actions/Solutions)
- SharedLinksMap for detecting nodes with multiple sources
- Modal component with scrollable body, fixed header/footer

New Components:
- TreeEditorLayout, TreeMetadataForm, NodeList, NodeEditorModal
- NodeFormDecision, NodeFormAction, NodeFormResolution
- DynamicArrayField, NodePicker
- TreePreviewPanel, TreePreviewNode

Documentation:
- Updated README.md status to Phase 2
- Added Tree Editor details to CURRENT-STATE.md
- Added modal/Zustand lessons to LESSONS-LEARNED.md
- Updated file structure in CLAUDE-SETUP.md
- Added Tree Editor progress to PROGRESS.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 03:00:00 -05:00
Michael Chihlas
088333174c Add User Preferences to MVP, add Phase 2.5 Personal Branching specs
- Fixed minor typescript errors that would show during compile
2026-01-27 23:49:12 -05:00
Michael Chihlas
cd10ecd42c Complete Phase 2: Frontend implementation with React + TypeScript
Frontend Features:
- React 18 + Vite + TypeScript + Tailwind CSS + Zustand
- JWT authentication with automatic token refresh
- Tree library with search and category filtering
- Full tree navigation (decision/action/solution nodes)
- Session management with notes and completion
- Session history with export (Markdown/Text/HTML)
- ErrorBoundary for graceful error handling

Backend Fixes:
- CORS: Added port 5174 to allowed origins
- Sessions: Fixed JSONB datetime serialization (mode='json')

Documentation:
- Updated PROGRESS.md with Phase 2 completion
- Updated 03-DEVELOPMENT-ROADMAP.md with checked items
- Added PHASE-2.5-PERSONAL-BRANCHING.md spec

Seed Data:
- Added backend/scripts/seed_data.py with Password Reset tree

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 22:42:22 -05:00
Michael Chihlas
7d96807fb1 Add production logging, datetime fixes, and session tests
DateTime Timezone Handling (Critical Bug Fix):
- Updated all models to use DateTime(timezone=True) for PostgreSQL
- Changed datetime defaults to lambda: datetime.now(timezone.utc)
- Fixed mixing of timezone-aware and timezone-naive datetime objects
- Resolved Internal Server Errors in session completion endpoint
- Affected models: User, Team, Tree, Session, Attachment

Production Logging System:
- Created logging_config.py with structured logging setup
- Added log rotation (10MB files, 10 backups) for production
- Implemented RequestLoggingMiddleware with correlation IDs
- Added ErrorLoggingMiddleware for comprehensive error tracking
- Integrated logging into main.py application startup
- Supports dev/prod modes with appropriate log levels

Integration Tests - Session Workflow:
- Created test_sessions.py with 12 comprehensive tests
- Session lifecycle: create, update, complete
- Session export in multiple formats (markdown, text, HTML)
- Error handling and authorization checks
- Added pytest.ini with coverage configuration
- Added requirements-dev.txt with pytest dependencies

Following 2026 FastAPI best practices for timezone handling and structured logging.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-27 20:39:09 -05:00
Michael Chihlas
aa54b6c192 Complete integration test suite with role-based auth fixes
Test Suite Completion (29 tests, all passing):
- Fixed test_auth.py: expect 201 status for registration endpoint
- Fixed test_trees.py: version only increments on tree_structure updates
- Fixed test_trees.py: delete endpoint requires admin role, returns 204
- Added admin user fixtures (test_admin, admin_auth_headers) in conftest.py

Role-Based User Registration Fix:
- Added role field to UserCreate schema (default="engineer")
- Updated registration endpoint to use user_data.role instead of hardcoding
- Enables proper admin/engineer/viewer role assignment during registration
- Maintains secure defaults while allowing test flexibility

Documentation Updates:
- Updated PROGRESS.md: corrected test count (29), added role fix notes
- Updated CLAUDE-SETUP.md: corrected test count, updated last modified date
- Updated backend file structure to include new logging and test files

Test Configuration:
- pytest 7.4.3 + pytest-asyncio 0.23.0 (stable async support)
- Comprehensive coverage: 7 auth + 10 trees + 12 sessions tests
- All endpoints verified with proper status codes and authorization

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-27 20:38:43 -05:00
Michael Chihlas
bf383c975b Update CLAUDE-SETUP.md with postgres MCP and current project state
- Added PostgreSQL MCP server documentation
- Updated project context with accurate tech stack
- Documented complete backend implementation
- Added development workflow and file structure
- Noted Fetch MCP unavailability with alternatives
2026-01-27 18:54:04 -05:00
Michael Chihlas
6a0f9cfc4a Standardize database naming and fix environment configuration
- Renamed database from 'decision_tree' to 'apoklisis' for consistency
- Updated docker-compose.yml: container renamed to 'apoklisis_postgres'
- Updated .env file with correct database URL
- Verified backend authentication flow working correctly
- Added postgres MCP server to Claude Code configuration
2026-01-27 18:28:10 -05:00
chihlasm
a3efe68282 Committing before moving to local disk 2026-01-26 00:35:37 -05:00
Michael Chihlas
a6fc86c95e Pin bcrypt version to 4.1.2 for passlib compatibility 2026-01-23 12:36:35 -05:00
Michael Chihlas
fa632da6bb Fix backend: add passlib/bcrypt, fix datetime timezone issues 2026-01-23 12:17:18 -05:00
Michael Chihlas
c823531a36 Merge branch 'main' of https://github.com/chihlasm/apoklisis 2026-01-22 14:49:53 -05:00
chihlasm
072f895231 Initial commit 2026-01-22 14:44:05 -05:00
Michael Chihlas
52e8190211 Initial commit: Backend API Phase 1a complete
- FastAPI backend with JWT auth
- PostgreSQL database schema
- Trees and Sessions CRUD APIs
- Export functionality (Markdown, Text, HTML)
- Docker setup for local development
- Alembic migrations
2026-01-22 14:38:53 -05:00