Commit Graph

42 Commits

Author SHA1 Message Date
f1f4b0792c Merge pull request 'feat(#15): Implement Gantt chart component' (#103) from feature/15-gantt-chart into develop
Reviewed-on: #103
2026-01-30 01:42:14 +00:00
d771fd269c Merge branch 'develop' into feature/15-gantt-chart 2026-01-30 01:41:23 +00:00
Jason Woltje
16697bfb79 fix: address code review feedback
- Replace type assertions with type guards in types.ts (isDateString, isStringArray)
- Add useCallback for event handlers (handleTaskClick, handleKeyDown)
- Replace styled-jsx with CSS modules (gantt.module.css)
- Update tests to use CSS module class name patterns
2026-01-29 19:32:23 -06:00
Jason Woltje
aa6d466321 feat(#15): implement gantt chart component
- Add milestone support with diamond markers
- Implement dependency line rendering with SVG arrows
- Add isMilestone property to GanttTask type
- Create dependency calculation and visualization
- Add comprehensive tests for milestones and dependencies
- Add index module tests for exports
- Coverage: GanttChart 98.37%, types 91.66%, index 100%
2026-01-29 19:08:47 -06:00
Jason Woltje
1cb54b56b0 Merge feature/82-personality-module (#82) into develop
Implements Personality Module:
- Personality model and Prisma migration
- CRUD API with controller and service
- Comprehensive test suite
- Integration with workspace
2026-01-29 17:59:28 -06:00
Jason Woltje
5dd46c85af feat(#82): implement Personality Module
- Add Personality model to Prisma schema with FormalityLevel enum
- Create migration and seed with 6 default personalities
- Implement CRUD API with TDD approach (97.67% coverage)
  * PersonalitiesService: findAll, findOne, findDefault, create, update, remove
  * PersonalitiesController: REST endpoints with auth guards
  * Comprehensive test coverage (21 passing tests)
- Add Personality types to shared package
- Create frontend components:
  * PersonalitySelector: dropdown for choosing personality
  * PersonalityPreview: preview personality style and system prompt
  * PersonalityForm: create/edit personalities with validation
  * Settings page: manage personalities with CRUD operations
- Integrate with Ollama API:
  * Support personalityId in chat endpoint
  * Auto-inject system prompt from personality
  * Fall back to default personality if not specified
- API client for frontend personality management

All tests passing with 97.67% backend coverage (exceeds 85% requirement)
2026-01-29 17:58:09 -06:00
Jason Woltje
0b330464ba feat(#17): implement Kanban board view
- Drag-and-drop with @dnd-kit
- Four status columns (Not Started, In Progress, Paused, Completed)
- Task cards with priority badges and due dates
- PDA-friendly design (calm colors, gentle language)
- 70 tests (87% coverage)
- Demo page at /demo/kanban
2026-01-29 17:55:33 -06:00
Jason Woltje
5ce3bb0e28 Merge feature/41-widget-hud-system (#41) into develop
Implements Widget/HUD system:
- BaseWidget, WidgetRegistry, WidgetGrid
- TasksWidget, CalendarWidget, QuickCaptureWidget
- Layout persistence with useLayouts hooks
- Comprehensive test suite
2026-01-29 17:54:50 -06:00
Jason Woltje
14a1e218a5 feat(#41): implement Widget/HUD system
- BaseWidget wrapper with loading/error states
- WidgetRegistry for central widget management
- WidgetGrid with react-grid-layout integration
- TasksWidget, CalendarWidget, QuickCaptureWidget
- useLayouts hooks for layout persistence
- Comprehensive test suite (TDD approach)
2026-01-29 17:54:46 -06:00
Jason Woltje
c2bbc2abee Merge feature/know-008-link-resolution (#60) into develop
Implements link resolution service for Knowledge Module:
- Three-tier resolution (exact title, slug, fuzzy)
- Workspace-scoped (RLS compliant)
- Batch processing with deduplication
- 19 tests, 100% coverage
2026-01-29 17:51:26 -06:00
Jason Woltje
3b113f87fd feat(#60): implement link resolution service
- Create LinkResolutionService with workspace-scoped link resolution
- Resolve links by: exact title match, slug match, fuzzy title match
- Handle ambiguous matches (return null if multiple matches)
- Support batch link resolution with deduplication
- Comprehensive test suite with 19 tests, all passing
- 100% coverage of public methods
- Integrate service with KnowledgeModule

Closes #60 (KNOW-008)
2026-01-29 17:50:57 -06:00
Jason Woltje
566bf1e7c5 Merge feature/15-gantt-chart (#15) into develop
Implements Gantt chart component:
- Task visualization with timeline bars
- PDA-friendly language (Target passed, not OVERDUE)
- 33 tests, 96% coverage
- Accessible with ARIA labels
- Demo page at /demo/gantt
2026-01-29 17:46:17 -06:00
Jason Woltje
9a95d8fb43 Merge feature/know-007-wiki-link-parser (#59) into develop
Implements wiki-link parser for Knowledge Module:
- Parses [[links]] syntax from markdown
- Supports Page Name, display text, and slug formats
- 43 tests with 100% coverage
2026-01-29 17:44:30 -06:00
Jason Woltje
9ff7718f9c feat(#15): implement Gantt chart component
- Create GanttChart component with timeline visualization
- Add task bars with status-based color coding
- Implement PDA-friendly language (Target passed vs OVERDUE)
- Support task click interactions
- Comprehensive test coverage (96.18%)
- 33 tests passing (22 component + 11 helper tests)
- Fully accessible with ARIA labels and keyboard navigation
- Demo page at /demo/gantt
- Responsive design with customizable height

Technical details:
- Uses Next.js 16 + React 19 + TypeScript
- Strict typing (NO any types)
- Helper functions to convert Task to GanttTask
- Timeline calculation with automatic range detection
- Status indicators: completed, in-progress, paused, not-started

Refs #15
2026-01-29 17:44:13 -06:00
Jason Woltje
1e5fcd19a4 feat(#59): implement wiki-link parser
- Created wiki-link-parser.ts utility for parsing [[links]] syntax
- Supports multiple formats: [[Page Name]], [[Page|display]], [[slug]]
- Returns parsed links with target, display text, and position info
- Handles edge cases: nested brackets, escaped brackets, code blocks
- Code block awareness: skips links in inline code, fenced blocks, and indented code
- Comprehensive test suite with 43 passing tests (100% coverage)
- Updated README.md with parser documentation

Implements KNOW-007 (Issue #59) - Wiki-style linking foundation
2026-01-29 17:42:49 -06:00
Jason Woltje
95833fb4ea docs: add unified ROADMAP.md with all milestones and parallel execution strategy
Includes:
- All milestones M2-M7 with status
- Dependency graph
- Parallel execution strategy
- Issue references for Federation (#83-94) and Orchestration (#95-102)
- Versioning policy (0.0.x -> 0.1.0 MVP -> 1.0.0)
v0.0.2
2026-01-29 17:31:24 -06:00
Jason Woltje
82a09373e0 docs: add Federation Architecture design document
Captures:
- Peer-to-peer federation model (master/spoke)
- Agent Federation Protocol (CONNECT, QUERY, COMMAND, EVENT, DISCONNECT)
- Authentik integration for enterprise SSO and RBAC
- Data sovereignty principles (query, don't replicate)
- RBAC model with workspace/team hierarchy
- Implementation phases targeting 0.1.0 MVP
- Versioning policy (0.0.x dev, 0.1.0 MVP, 1.0.0 stable)
2026-01-29 17:25:57 -06:00
Jason Woltje
a5b984c7fd fix(knowledge): resolve TypeScript errors in tags service
- Fix updateData typing for partial updates
- Add slug field to CreateTagDto
- Build now passes

Note: tasks.controller.spec.ts needs test config update for WorkspaceGuard
2026-01-29 17:09:27 -06:00
Jason Woltje
25947cee52 feat(web): add knowledge entry editor page (KNOW-006) 2026-01-29 17:05:48 -06:00
Jason Woltje
5291fece26 feat(web): add workspace management UI (M2 #12)
- Create workspace listing page at /settings/workspaces
  - List all user workspaces with role badges
  - Create new workspace functionality
  - Display member count per workspace

- Create workspace detail page at /settings/workspaces/[id]
  - Workspace settings (name, ID, created date)
  - Member management with role editing
  - Invite member functionality
  - Delete workspace (owner only)

- Add workspace components:
  - WorkspaceCard: Display workspace info with role badge
  - WorkspaceSettings: Edit workspace settings and delete
  - MemberList: Display and manage workspace members
  - InviteMember: Send invitations with role selection

- Add WorkspaceMemberWithUser type to shared package
- Follow existing app patterns for styling and structure
- Use mock data (ready for API integration)
2026-01-29 16:59:26 -06:00
Jason Woltje
287a0e2556 feat(knowledge): add markdown rendering (KNOW-004)
- Install marked, marked-highlight, marked-gfm-heading-id, sanitize-html
- Create markdown utility with GFM support (tables, task lists, strikethrough)
- Add code syntax highlighting with highlight.js
- Implement XSS sanitization for security
- Update knowledge service to use markdown renderer
- Add comprehensive test suite (34 tests, all passing)
- Generate IDs for headers for deep linking
- Cache rendered HTML in database for performance
2026-01-29 16:57:57 -06:00
Jason Woltje
4881d0698f docs: add KNOW-002 completion summary 2026-01-29 16:17:18 -06:00
Jason Woltje
81d426453a fix(knowledge): fix type safety issues in entry CRUD API (KNOW-002)
- Remove @nestjs/swagger decorators (package not installed)
- Fix controller to use @Request() req for accessing workspaceId
- Fix service to properly handle nullable Prisma fields (summary)
- Fix update method to conditionally build update object
- Add missing tag DTOs to satisfy dependencies

Resolves compilation errors and ensures type safety.
2026-01-29 16:16:49 -06:00
Jason Woltje
4729f964f1 docs: add M2 database layer completion report 2026-01-29 16:14:20 -06:00
Jason Woltje
f07f04404d feat(knowledge): add tag management API (KNOW-003)
- Add Tag DTOs (CreateTagDto, UpdateTagDto) with validation
- Implement TagsService with CRUD operations
- Add TagsController with authenticated endpoints
- Support automatic slug generation from tag names
- Add workspace isolation for tags
- Include entry count in tag responses
- Add findOrCreateTags method for entry creation/update
- Implement comprehensive test coverage (29 tests passing)

Endpoints:
- GET /api/knowledge/tags - List workspace tags
- POST /api/knowledge/tags - Create tag
- GET /api/knowledge/tags/:slug - Get tag by slug
- PUT /api/knowledge/tags/:slug - Update tag
- DELETE /api/knowledge/tags/:slug - Delete tag
- GET /api/knowledge/tags/:slug/entries - List entries with tag

Related: KNOW-003
2026-01-29 16:13:40 -06:00
Jason Woltje
244e50c806 feat(multi-tenant): add Team model and RLS policies
Implements #9, #10
- Team model with workspace membership
- TeamMember model with role-based access (OWNER, ADMIN, MEMBER)
- Row-Level Security policies for tenant isolation on 19 tables
- Helper functions: current_user_id(), is_workspace_member(), is_workspace_admin()
- Developer utilities in src/lib/db-context.ts for easy RLS integration
- Comprehensive documentation in docs/design/multi-tenant-rls.md

Database migrations:
- 20260129220941_add_team_model: Adds Team and TeamMember tables
- 20260129221004_add_rls_policies: Enables RLS and creates policies

Security features:
- Complete database-level tenant isolation
- Automatic query filtering based on workspace membership
- Defense-in-depth security with application and database layers
- Performance-optimized with indexes on workspace_id
2026-01-29 16:13:09 -06:00
Jason Woltje
1edea83e38 feat(knowledge): add database schema for Knowledge Module
Implements KNOW-001
- KnowledgeEntry, Version, Link, Tag, Embedding models
- Full indexes and constraints
- Seed data for testing
2026-01-29 16:07:58 -06:00
Jason Woltje
9b7e1f926f docs(adr): add ADR-001 API-first agent-agnostic design
Key decision: Mosaic Stack exposes APIs first, agent skills are thin wrappers.
Platform works standalone, agent layer is swappable.
2026-01-29 16:05:09 -06:00
Jason Woltje
91399f597f docs(design): add Knowledge Module design and implementation plan
- Full design document with architecture, data model, API specs
- 28 implementation issues across 5 phases (~127h total)
- Wiki-link syntax, semantic search, graph visualization
- Integration points for agent access

Ref: memory/2025-01-29-agent-orchestration.md
2026-01-29 15:38:50 -06:00
Jason Woltje
f47dd8bc92 feat: add domains, ideas, layouts, widgets API modules
- Add DomainsModule with full CRUD, search, and activity logging
- Add IdeasModule with quick capture endpoint
- Add LayoutsModule for user dashboard layouts
- Add WidgetsModule for widget definitions (read-only)
- Update ActivityService with domain/idea logging methods
- Register all new modules in AppModule
2026-01-29 13:47:03 -06:00
Jason Woltje
973502f26e feat(#37-41): Add domains, ideas, relationships, agents, widgets schema
Schema additions for issues #37-41:

New models:
- Domain (#37): Life domains (work, marriage, homelab, etc.)
- Idea (#38): Brain dumps with pgvector embeddings
- Relationship (#39): Generic entity linking (blocks, depends_on)
- Agent (#40): ClawdBot agent tracking with metrics
- AgentSession (#40): Conversation session tracking
- WidgetDefinition (#41): HUD widget registry
- UserLayout (#41): Per-user dashboard configuration

Updated models:
- Task, Event, Project: Added domainId foreign key
- User, Workspace: Added new relations

New enums:
- IdeaStatus: CAPTURED, PROCESSING, ACTIONABLE, ARCHIVED, DISCARDED
- RelationshipType: BLOCKS, BLOCKED_BY, DEPENDS_ON, etc.
- AgentStatus: IDLE, WORKING, WAITING, ERROR, TERMINATED
- EntityType: Added IDEA, DOMAIN

Migration: 20260129182803_add_domains_ideas_agents_widgets
2026-01-29 12:29:21 -06:00
Jason Woltje
a220c2dc0a fix(#5,#36): Fix critical security issues and add comprehensive tests
SECURITY FIXES:
- Replace generic Error with UnauthorizedException in all controllers
- Fix workspace isolation bypass in findAll methods (CRITICAL)
- Controllers now always use req.user.workspaceId, never allow query override

CODE FIXES:
- Fix redundant priority logic in tasks.service.ts
- Use TaskPriority.MEDIUM as default instead of undefined

TEST ADDITIONS:
- Add multi-tenant isolation tests for all services (tasks, events, projects)
- Add database constraint violation handling tests (P2002, P2003, P2025)
- Add missing controller error tests for events and projects controllers
- All new tests verify authentication and workspace isolation

RESULTS:
- All 247 tests passing
- Test coverage: 94.35% (exceeds 85% requirement)
- Critical security vulnerabilities fixed

Fixes #5
Refs #36

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 18:55:07 -06:00
Jason Woltje
132fe6ba98 feat(#5): Implement CRUD APIs for tasks, events, and projects
Implements comprehensive CRUD APIs following TDD principles with 92.44%
test coverage (exceeds 85% requirement).

Features:
- Tasks API: Full CRUD with filtering, pagination, and subtask support
- Events API: Full CRUD with recurrence support and date filtering
- Projects API: Full CRUD with task/event association
- Authentication guards on all endpoints
- Workspace-scoped queries for multi-tenant isolation
- Activity logging for all operations (CREATED, UPDATED, DELETED, etc.)
- DTOs with class-validator validation
- Comprehensive test suite (221 tests, 44 for new APIs)

Implementation:
- Services: Business logic with Prisma ORM integration
- Controllers: RESTful endpoints with AuthGuard
- Modules: Properly registered in AppModule
- Documentation: Complete API reference in docs/4-api/4-crud-endpoints/

Test Coverage:
- Tasks: 96.1%
- Events: 89.83%
- Projects: 84.21%
- Overall: 92.44%

TDD Workflow:
1. RED: Wrote failing tests first
2. GREEN: Implemented minimal code to pass tests
3. REFACTOR: Improved code quality while maintaining coverage

Refs #5

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 18:43:12 -06:00
Jason Woltje
05fc1c60f4 docs: Add comprehensive TDD requirements to CLAUDE.md
- Add detailed TDD workflow (Red-Green-Refactor)
- Specify test-first approach as non-negotiable
- Include testing requirements (85% coverage minimum)
- Add test types and running instructions
- List TDD anti-patterns to avoid
- Provide example TDD session workflow

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 17:51:55 -06:00
Jason Woltje
dd5b3117a7 docs: Restructure documentation with Bookstack-compatible hierarchy
- Organized docs into numbered shelf/book/chapter/page structure
- Created comprehensive README.md with project overview
- Added Getting Started book (quick start, installation, configuration)
- Added Development book (workflow, testing, type sharing)
- Added Architecture book (design principles, PDA-friendly patterns)
- Added API Reference book (conventions, authentication)
- Moved TYPE-SHARING.md to proper location
- Updated all cross-references in main README
- Created docs/README.md as master index
- Removed old QA automation reports
- Removed deprecated SETUP.md (content split into new structure)

Documentation structure follows Bookstack best practices:
- Numbered books: 1-getting-started, 2-development, 3-architecture, 4-api
- Numbered chapters and pages for ordering
- Clear hierarchy and navigation
- Cross-referenced throughout

Complete documentation available at: docs/README.md

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 17:46:33 -06:00
Jason Woltje
6a038d093b feat(#4): Implement Authentik OIDC authentication with BetterAuth
- Integrated BetterAuth library for modern authentication
- Added Session, Account, and Verification database tables
- Created complete auth module with service, controller, guards, and decorators
- Implemented shared authentication types in @mosaic/shared package
- Added comprehensive test coverage (26 tests passing)
- Documented type sharing strategy for monorepo
- Updated environment configuration with OIDC and JWT settings

Key architectural decisions:
- BetterAuth over Passport.js for better TypeScript support
- Separation of User (DB entity) vs AuthUser (client-safe subset)
- Shared types package to prevent FE/BE drift
- Factory pattern for auth config to use shared Prisma instance

Ready for frontend integration (Issue #6).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Fixes #4
2026-01-28 17:26:34 -06:00
Jason Woltje
139a16648d chore: Remove unnecessary QA automation reports 2026-01-28 16:26:20 -06:00
Jason Woltje
dd747a1d87 feat(#3): Add comprehensive tests and improve Prisma seed script
- Create comprehensive test suite for PrismaService (10 tests)
- Fix AppController tests with proper PrismaService mocking
- Wrap seed operations in transaction for atomicity
- Replace N+1 pattern with batch operations (createMany)
- Add concurrency warning to seed script
- All tests passing (14/14)
- Build successful
- Test coverage >85%

Fixes #3

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 16:24:25 -06:00
Jason Woltje
99afde4f99 feat(#2): Implement PostgreSQL 17 + pgvector database schema
Establishes multi-tenant database layer with vector similarity search for AI-powered memory features. Includes Docker infrastructure, Prisma ORM integration, NestJS services, and shared types across the monorepo.

Key changes:
- Docker: PostgreSQL 17 + pgvector v0.7.4, Valkey cache
- Schema: 8 models (User, Workspace, Task, Event, Project, ActivityLog, MemoryEmbedding) with RLS preparation
- NestJS: PrismaModule, DatabaseModule, EmbeddingsService
- Shared: Type-safe enums, constants, and database types

Fixes #2

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 16:06:34 -06:00
Jason Woltje
355cf2124b fix(#1): Address code review findings
- Convert ApiResponse to discriminated union for type-safe error handling
- Add HealthStatus type with HealthState literal union
- Make BaseEntity fields readonly for immutability
- Add GlobalExceptionFilter with structured logging
- Add port validation with clear error messages in main.ts
- Improve parseDate to log warnings for invalid dates
- Add comprehensive Button tests (variants, onClick, disabled)
- Add slugify edge case tests (empty, special chars, numbers)
- Create ESLint configs for all packages
- Remove compiled JS files from src directories
- Convert .prettierrc.js to .prettierrc.json

Refs #1

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 15:07:04 -06:00
Jason Woltje
f277afde36 chore(#1): Add .pnpm-approve-builds to .gitignore
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 13:32:08 -06:00
Jason Woltje
92e20b1686 feat(#1): Set up monorepo scaffold with pnpm workspaces + TurboRepo
Implements the foundational project structure including:
- pnpm workspaces configuration
- TurboRepo for build orchestration
- NestJS 11.1.12 API (apps/api)
- Next.js 16.1.6 web app (apps/web)
- Shared packages (config, shared, ui)
- TypeScript strict mode configuration
- ESLint + Prettier setup
- Vitest for unit testing (19 passing tests)

Fixes #1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 13:31:33 -06:00