Files
roboco/.tasks/active/TASK-001-build-infrastructure/phase-1-core-services.md
T
2025-12-10 17:37:24 +01:00

3.5 KiB

TASK-001: Phase 1 - Core Services

Status

  • State: completed
  • Priority: P0
  • Cell: board

Dates

  • Created: 2025-12-09
  • Completed: 2025-12-09

Overview

Implement Phase 1 of the RoboCo system per HOMELAB_TEAM_V0.md blueprint:

  • Database schema
  • Messaging API
  • Agent framework
  • Infrastructure setup

Acceptance Criteria

  • Database schema designed and implemented
  • Messaging API (REST) functional
  • Agent base class created
  • Simple orchestrator built
  • PostgreSQL configured
  • Redis configured

What Was Built

1. Project Configuration

  • pyproject.toml - Dependencies, ruff, mypy, pytest config
  • docker-compose.yml - PostgreSQL, Redis, Qdrant
  • .env.example - Environment template
  • alembic/ - Migration setup

2. Data Models (roboco/models/)

File Models
base.py All enums (TaskStatus, AgentRole, Team, etc.)
task.py Task, TaskPlan, Checkpoint, CommitRef
agent.py Agent, ModelConfig, AgentPermissions
session.py Session, SessionConfig
message.py ExtractedMessage, RawStream
group.py Group
channel.py Channel
notification.py Notification
journal.py Journal, JournalEntry
handoff.py DocumenterHandoff

3. Database Layer (roboco/db/)

  • base.py - Async SQLAlchemy engine, session factory
  • tables.py - All ORM table definitions (10 tables)

4. Configuration (roboco/config.py)

  • Environment-based settings via pydantic-settings
  • Database, Redis, Qdrant, LLM provider configs

5. Messaging API (roboco/api/)

Route Endpoints
health.py /health, /ready
channels.py CRUD for channels, member management
sessions.py Session lifecycle
messages.py Send, edit, delete messages
notifications.py Send, list, acknowledge

6. WebSocket (roboco/api/websocket.py)

  • /ws/channels/{id} - Channel stream
  • /ws/agents/{id} - Agent output stream
  • /ws/sessions/{id} - Session stream
  • ConnectionManager for broadcasting

7. Agent Framework (roboco/agents/)

  • base.py - Agent base class with lifecycle, LLM stubs
  • orchestrator.py - Spawn/stop agents, health monitoring

File Structure

roboco/
├── __init__.py
├── config.py
├── models/
│   ├── __init__.py
│   ├── base.py, task.py, agent.py, session.py
│   ├── message.py, group.py, channel.py
│   ├── notification.py, journal.py, handoff.py
│   └── README.md
├── db/
│   ├── __init__.py
│   ├── base.py
│   └── tables.py
├── api/
│   ├── __init__.py
│   ├── app.py
│   ├── deps.py
│   ├── websocket.py
│   └── routes/
│       ├── __init__.py
│       ├── health.py
│       ├── channels.py
│       ├── sessions.py
│       ├── messages.py
│       └── notifications.py
└── agents/
    ├── __init__.py
    ├── base.py
    └── orchestrator.py

Next Steps (Phase 2: Communication)

Per HOMELAB_TEAM_V0.md section 13.4:

  • Transcription service (extract messages from LLM streams)
  • Message extraction pipeline
  • Permission system

Quick Context Restore

Phase 1 core services complete. Database schema, Messaging API, and Agent framework are functional. WebSocket streaming is in place. Ready for Phase 2 which adds transcription/extraction pipelines to process agent LLM output into structured messages.