Add WHOOSH search service with BACKBEAT integration

Complete implementation:
- Go-based search service with PostgreSQL and Redis backend
- BACKBEAT SDK integration for beat-aware search operations
- Docker containerization with multi-stage builds
- Comprehensive API endpoints for project analysis and search
- Database migrations and schema management
- GITEA integration for repository management
- Team composition analysis and recommendations

Key features:
- Beat-synchronized search operations with timing coordination
- Phase-based operation tracking (started → querying → ranking → completed)
- Docker Swarm deployment configuration
- Health checks and monitoring
- Secure configuration with environment variables

Architecture:
- Microservice design with clean API boundaries
- Background processing for long-running analysis
- Modular internal structure with proper separation of concerns
- Integration with CHORUS ecosystem via BACKBEAT timing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Code
2025-09-06 11:16:39 +10:00
parent 595b05335d
commit 33676bae6d
29 changed files with 4262 additions and 185 deletions

View File

@@ -0,0 +1,76 @@
-- Initial schema for WHOOSH MVP
-- Minimal subset focused on single-agent execution mode
-- Teams table - core team management
CREATE TABLE teams (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL,
description TEXT,
status VARCHAR(50) NOT NULL DEFAULT 'forming',
task_id UUID,
gitea_issue_url TEXT,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
completed_at TIMESTAMP WITH TIME ZONE
);
-- Team roles enumeration
CREATE TABLE team_roles (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL UNIQUE,
description TEXT,
capabilities JSONB,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Team assignments - who's on what team
CREATE TABLE team_assignments (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
team_id UUID NOT NULL REFERENCES teams(id) ON DELETE CASCADE,
agent_id UUID NOT NULL,
role_id INTEGER NOT NULL REFERENCES team_roles(id),
status VARCHAR(50) NOT NULL DEFAULT 'active',
assigned_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
completed_at TIMESTAMP WITH TIME ZONE,
UNIQUE(team_id, agent_id)
);
-- Minimal agents registry
CREATE TABLE agents (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL,
endpoint_url TEXT NOT NULL,
capabilities JSONB NOT NULL DEFAULT '{}',
status VARCHAR(50) NOT NULL DEFAULT 'available',
last_seen TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
performance_metrics JSONB DEFAULT '{}',
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Minimal SLURP submissions tracking
CREATE TABLE slurp_submissions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
team_id UUID REFERENCES teams(id) ON DELETE CASCADE,
ucxl_address TEXT NOT NULL UNIQUE,
artifact_type VARCHAR(100) NOT NULL,
metadata JSONB DEFAULT '{}',
submitted_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
status VARCHAR(50) NOT NULL DEFAULT 'submitted'
);
-- Insert default team roles for MVP
INSERT INTO team_roles (name, description, capabilities) VALUES
('executor', 'Single-agent task executor', '{"code_generation": true, "task_execution": true, "git_operations": true}'),
('coordinator', 'Team coordination and oversight', '{"team_management": true, "task_planning": true, "quality_assurance": true}'),
('reviewer', 'Code and output review', '{"code_review": true, "quality_assurance": true, "documentation": true}');
-- Indexes for performance
CREATE INDEX idx_teams_status ON teams(status);
CREATE INDEX idx_teams_created_at ON teams(created_at);
CREATE INDEX idx_team_assignments_team_id ON team_assignments(team_id);
CREATE INDEX idx_team_assignments_agent_id ON team_assignments(agent_id);
CREATE INDEX idx_agents_status ON agents(status);
CREATE INDEX idx_agents_last_seen ON agents(last_seen);
CREATE INDEX idx_slurp_submissions_team_id ON slurp_submissions(team_id);
CREATE INDEX idx_slurp_submissions_ucxl_address ON slurp_submissions(ucxl_address);