rdev/internal/handlers
jordan a69eb7e587 feat(foundary): implement complete backend for conversational project design
Implements all 5 phases of Foundary Studio backend:

Phase 1: Chat Persistence (8 API endpoints)
- Conversations and messages with proper cascading deletes
- PostgreSQL schema with auto-update triggers
- Full CRUD operations with structured logging

Phase 2: Blueprint Entity (5 API endpoints)
- JSONB spec storage with GIN indexes
- Flexible structured data for project specifications
- Version-controlled blueprint management

Phase 3: Architect Service (3 API endpoints)
- Conversational AI orchestration with Claude
- Multi-turn dialogue with context building
- Blueprint spec extraction from conversations

Phase 4: Work Queue Integration
- Verified existing endpoint compatibility

Phase 5: Structured Questions (6 API endpoints)
- Four question types: text, choice, multichoice, yesno
- Answer validation with proper constraints
- Conversation-linked Q&A flow

Architecture:
- Textbook hexagonal architecture (domain → port → adapter → service → handler)
- Zero external dependencies in domain layer
- Consistent error handling with proper wrapping
- Auth scopes on all routes (projects:read, projects:execute)
- Structured logging with operation context and duration tracking
- NULL-safe DTO converters throughout

Database:
- 3 new migrations (019, 020, 021)
- UUIDs for all primary keys
- Proper foreign key constraints with ON DELETE CASCADE
- Optimized indexes including partial index for unanswered questions
- Auto-update triggers for timestamps

OpenAPI Documentation:
- Complete API documentation under 'Foundary' tag
- 22 new endpoints documented with examples
- Request/response schemas for all operations

Logging Improvements:
- Added operation field to all service logs
- Added duration_ms tracking for performance monitoring
- Log response_length instead of full response content
- Consistent use of logging field constants
- Execute-then-log pattern for delete operations

Files: 32 changed, 2800+ lines added
- 7 domain models
- 3 database migrations
- 3 port interfaces
- 3 postgres adapters
- 4 services (conversation, blueprint, question, architect)
- 4 handlers with DTOs
- OpenAPI documentation
- Integration in main.go

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-09 00:50:46 -07:00
..
agents_test.go feat: Add CI pipeline proxy, DNS alias management, and worker executor system 2026-01-27 21:05:28 -07:00
agents.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
architect_dto.go feat(foundary): implement complete backend for conversational project design 2026-02-09 00:50:46 -07:00
architect.go feat(foundary): implement complete backend for conversational project design 2026-02-09 00:50:46 -07:00
audit_test.go feat: Implement hexagonal architecture with services, webhooks, queue, and telemetry 2026-01-25 19:57:46 -07:00
audit.go feat: Implement hexagonal architecture with services, webhooks, queue, and telemetry 2026-01-25 19:57:46 -07:00
blueprint_dto.go feat(foundary): implement complete backend for conversational project design 2026-02-09 00:50:46 -07:00
blueprints.go feat(foundary): implement complete backend for conversational project design 2026-02-09 00:50:46 -07:00
builds_test.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
builds_ws.go chore: prepare for composable monorepo template implementation 2026-01-31 11:39:28 -07:00
builds.go feat: add work task error classification and user-facing error codes 2026-02-03 00:07:34 -07:00
claude_config_test.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
claude_config.go fix: go.work race condition with batch components and idempotent provisioning 2026-02-05 12:31:40 -07:00
components_operations_test.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
components_test.go fix: go.work race condition with batch components and idempotent provisioning 2026-02-05 12:31:40 -07:00
components.go fix: go.work race condition with batch components and idempotent provisioning 2026-02-05 12:31:40 -07:00
conversation_dto.go feat(foundary): implement complete backend for conversational project design 2026-02-09 00:50:46 -07:00
conversations.go feat(foundary): implement complete backend for conversational project design 2026-02-09 00:50:46 -07:00
create_and_build.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
credentials_test.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
credentials.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
diagnostics_test.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
diagnostics.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
domain_service_adapter.go feat: Add multi-domain support with auto-generated slugs for landing page cookbook 2026-01-28 12:55:59 -07:00
health_test.go feat: Implement hexagonal architecture with services, webhooks, queue, and telemetry 2026-01-25 19:57:46 -07:00
health.go feat(saga): implement enterprise-grade resilience architecture 2026-02-08 01:58:02 -07:00
helpers_test.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
infrastructure_deploy.go feat: implement composable monorepo template system with component architecture 2026-01-31 19:11:42 -07:00
infrastructure_domain_test.go feat: Add CI pipeline proxy, DNS alias management, and worker executor system 2026-01-27 21:05:28 -07:00
infrastructure_domains_test.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
infrastructure_domains.go feat: implement composable monorepo template system with component architecture 2026-01-31 19:11:42 -07:00
infrastructure_mocks_test.go feat: add path-based ingress management for component lifecycle 2026-02-04 01:31:50 -07:00
infrastructure_pipelines_test.go feat(saga): implement enterprise-grade resilience architecture 2026-02-08 01:58:02 -07:00
infrastructure_pipelines.go feat(saga): implement enterprise-grade resilience architecture 2026-02-08 01:58:02 -07:00
infrastructure_test.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
infrastructure.go feat(saga): implement enterprise-grade resilience architecture 2026-02-08 01:58:02 -07:00
keys_test.go feat: Add CI pipeline proxy, DNS alias management, and worker executor system 2026-01-27 21:05:28 -07:00
keys.go feat: implement composable monorepo template system with component architecture 2026-01-31 19:11:42 -07:00
mock_operation_test.go feat: complete template upgrade - chassis framework, UI library, auth, app-nextjs, OpenAPI, and cookbook 2026-02-02 00:46:51 -07:00
operations.go feat: add operations audit system and template improvements 2026-02-01 19:08:57 -07:00
project_management_test.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
project_management.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
projects_bench_test.go feat: Implement hexagonal architecture with services, webhooks, queue, and telemetry 2026-01-25 19:57:46 -07:00
projects_commands_test.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
projects_commands.go fix: go.work race condition with batch components and idempotent provisioning 2026-02-05 12:31:40 -07:00
projects_stream_test.go feat: Add CI pipeline proxy, DNS alias management, and worker executor system 2026-01-27 21:05:28 -07:00
projects_stream.go feat: Add multi-provider code agent interface with Claude Code and OpenCode adapters 2026-01-27 09:25:51 -07:00
projects_test.go feat: add diagnostics endpoint and external health monitoring 2026-02-03 19:10:56 -07:00
projects.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
question_dto.go feat(foundary): implement complete backend for conversational project design 2026-02-09 00:50:46 -07:00
questions.go feat(foundary): implement complete backend for conversational project design 2026-02-09 00:50:46 -07:00
queue_test.go feat: Implement hexagonal architecture with services, webhooks, queue, and telemetry 2026-01-25 19:57:46 -07:00
queue.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
saga.go feat(saga): implement enterprise-grade resilience architecture 2026-02-08 01:58:02 -07:00
sdlc_artifacts.go feat: add artifact pass/fail/needs-fix lifecycle for SDLC execution phases 2026-02-02 22:14:53 -07:00
sdlc_branches_test.go feat: add SDLC branch management, merge, archive, and orchestrator APIs 2026-02-02 12:30:03 -07:00
sdlc_branches.go feat: add SDLC branch management, merge, archive, and orchestrator APIs 2026-02-02 12:30:03 -07:00
sdlc_callback.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
sdlc_features.go feat: add SDLC orchestration - library, CLI, and API integration 2026-02-02 09:57:05 -07:00
sdlc_generate.go fix(sdlc): route conflict with SDLCGenerateHandler shadowing SDLC routes 2026-02-08 11:27:41 -07:00
sdlc_merge_test.go feat: add SDLC branch management, merge, archive, and orchestrator APIs 2026-02-02 12:30:03 -07:00
sdlc_merge.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
sdlc_orchestrator_test.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
sdlc_orchestrator.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
sdlc_queries.go feat: add SDLC orchestration - library, CLI, and API integration 2026-02-02 09:57:05 -07:00
sdlc_tasks.go feat: add SDLC orchestration - library, CLI, and API integration 2026-02-02 09:57:05 -07:00
sdlc_test.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
sdlc.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
timeouts.go feat: implement composable monorepo template system with component architecture 2026-01-31 19:11:42 -07:00
verify_test.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
verify.go feat: implement Visual Verification API layer (Week 2) 2026-02-03 19:29:40 -07:00
webhooks_test.go feat: Implement hexagonal architecture with services, webhooks, queue, and telemetry 2026-01-25 19:57:46 -07:00
webhooks.go feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements 2026-02-02 13:55:50 -07:00
woodpecker_webhook_test.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
woodpecker_webhook.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
work_dto.go fix: wire workService to WorkersHandler and add /work/tasks endpoint 2026-02-06 10:35:39 -07:00
work_lifecycle_test.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
work_test.go fix: wire workService to WorkersHandler and add /work/tasks endpoint 2026-02-06 10:35:39 -07:00
work.go fix: wire workService to WorkersHandler and add /work/tasks endpoint 2026-02-06 10:35:39 -07:00
workers_test.go feat: add structured logging infrastructure and SDLC extensions 2026-02-04 22:56:04 -07:00
workers.go feat: enterprise worker pool with HTTP sidecar pattern 2026-02-05 16:21:11 -07:00