Commit Graph

66 Commits

Author SHA1 Message Date
Jason Woltje
0edc24438d Merge PR #113: Kanban Board Implementation 2026-01-29 20:52:19 -06:00
Jason Woltje
bcb2913549 fix: address code review feedback - add explicit TypeScript return types
- Add explicit JSX.Element return types to all Kanban components
- Add explicit void return type to handleDragStart
- Add explicit Promise<void> return type to handleDragEnd (async)
- Import React for JSX namespace access
- Complies with typescript.md: explicit return types REQUIRED

Components updated:
- KanbanBoard.tsx
- KanbanColumn.tsx
- TaskCard.tsx

Per code review checklist (code-review.md section 4a):
✓ NO any types
✓ Explicit return types on all exported functions
✓ Explicit parameter types
✓ Interfaces for props
✓ Proper event handler types
2026-01-29 20:50:52 -06:00
Jason Woltje
148aa004e3 docs: add CONTRIBUTING.md 2026-01-29 20:36:16 -06:00
Jason Woltje
4fcc2b1efb feat(#17): implement kanban board view 2026-01-29 20:36:14 -06:00
Jason Woltje
52aa1c4d06 Merge fix/controller-guards with conflict resolution 2026-01-29 20:30:57 -06:00
Jason Woltje
460bcd366c Merge remote-tracking branch 'origin/fix/rls-dto-errors' into develop 2026-01-29 20:30:20 -06:00
Jason Woltje
48abdbba8b fix(api): add WorkspaceGuard to controllers and fix route ordering 2026-01-29 20:15:33 -06:00
Jason Woltje
26a0df835f fix(api): fix RLS context, DTO validation, and error handling
- Wrap SET LOCAL in transactions for proper connection pooling
- Make workspaceId optional in query DTOs (derived from guards)
- Replace Error throws with UnauthorizedException in activity controller
- Update workspace guard to remove RLS context setting
- Document that services should use withUserContext/withUserTransaction
2026-01-29 20:14:27 -06:00
Jason Woltje
715481fbbb fix(database): add composite unique constraints for workspace isolation 2026-01-29 20:06:45 -06:00
9977d9bcf4 Merge pull request 'feat(#22): Implement brain query API endpoint' (#108) from feature/22-brain-api into develop
Reviewed-on: #108
2026-01-30 01:45:59 +00:00
Jason Woltje
540344d108 Merge develop to resolve conflicts 2026-01-29 19:45:29 -06:00
181fb6ce2a Merge pull request 'feat(#82): Implement personality module' (#107) from feature/82-personality into develop
Reviewed-on: #107
2026-01-30 01:43:56 +00:00
15e13129c7 Merge branch 'develop' into feature/82-personality 2026-01-30 01:43:40 +00:00
567a799c53 Merge pull request 'feat(#16): Implement WebSocket real-time updates' (#106) from feature/16-websocket into develop
Reviewed-on: #106
2026-01-30 01:43:32 +00:00
5a470a127f Merge branch 'develop' into feature/16-websocket 2026-01-30 01:43:06 +00:00
ac110beb4d Merge pull request 'feat(knowledge): Add link resolution service' (#105) from feature/know-link-resolution into develop
Reviewed-on: #105
2026-01-30 01:42:55 +00:00
cb0a16effa Merge branch 'develop' into feature/know-link-resolution 2026-01-30 01:42:44 +00:00
a75265e535 Merge pull request 'feat(#21): Implement Ollama integration' (#104) from feature/21-ollama into develop
Reviewed-on: #104
2026-01-30 01:42:36 +00:00
1e1a2b4960 Merge branch 'develop' into feature/21-ollama 2026-01-30 01:42:23 +00:00
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
1bd21b33d7 feat(#22): implement brain query API
- Create brain module with service, controller, and DTOs
- POST /api/brain/query - Structured queries for tasks, events, projects
- GET /api/brain/context - Get current workspace context for agents
- GET /api/brain/search - Search across all entities
- Support filters: status, priority, date ranges, assignee, etc.
- 41 tests covering service (27) and controller (14)
- Integrated with AuthGuard, WorkspaceGuard, PermissionGuard
2026-01-29 19:40:30 -06:00
Jason Woltje
8383a98070 feat(#82): add prompt formatter service to personality module
- Add PromptFormatterService for formatting system prompts based on personality
- Support context variable interpolation (userName, workspaceName, etc.)
- Add formality level modifiers (VERY_CASUAL to VERY_FORMAL)
- Add template validation for custom variables
- Add preview endpoint for formatted prompts
- Fix UpdatePersonalityDto to avoid @nestjs/mapped-types dependency
- Update PersonalitiesController with new endpoints
- Add comprehensive tests (33 passing tests)

Closes #82
2026-01-29 19:38:18 -06:00
Jason Woltje
10ed2cdb4f feat(#16): implement websocket real-time updates
- Add WebSocket gateway with workspace-scoped rooms
- Define event types: task.created, task.updated, task.deleted
- Define event types: event.created, event.updated, event.deleted
- Define event types: project.created, project.updated, project.deleted
- Add shared WebSocket types for type safety
- WebSocketModule already integrated in AppModule
2026-01-29 19:37:53 -06:00
Jason Woltje
24768bd664 feat(knowledge): add link resolution service
- Add resolveLinksFromContent() to parse wiki links from content and resolve them
- Add getBacklinks() to find all entries that link to a target entry
- Import parseWikiLinks from utils for content parsing
- Export new types: ResolvedLink, Backlink
- Add comprehensive tests for new functionality (27 tests total)
2026-01-29 19:34:57 -06: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
f706b3b982 feat(#21): implement ollama integration
- Add Ollama client library (ollama npm package)
- Create LlmService for chat completion and embeddings
- Support streaming responses via Server-Sent Events
- Add configuration via env vars (OLLAMA_HOST, OLLAMA_TIMEOUT)
- Create endpoints: GET /llm/health, GET /llm/models, POST /llm/chat, POST /llm/embed
- Replace old OllamaModule with new LlmModule
- Add comprehensive tests with >85% coverage

Closes #21
2026-01-29 19:28:31 -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