# Epic: Hive.CEO -- Embedded Self-Aware Agent System

## META
- epic-id: HIVE-CEO
- priority: P1
- phase: Cross-cutting (scaffolded, activates post-Phase 1 ship)
- created: 2026-02-14
- status: IN_PROGRESS (scaffolding complete, runtime activation pending)

> **NOTE**: This epic covers the Hive.CEO embedded agent system (self-awareness, self-improvement, self-healing). It is DIFFERENT from epic-hive-mode.md which covers Hive Mode (Phase 3 GPU pooling feature).

## DESCRIPTION
Embed a 5-agent system (CEO, Analyst, Watcher, Builder, Advisor) inside LLMHosts.com that monitors application health, proposes improvements, heals failures, and adapts as the application evolves. Admin panel at `/admin/hive/` provides dashboard, kanban, chat, approval queue, activity log, and configuration.

## BACKLOG ITEMS

### DONE (Scaffolding)

| ID | Title | Status | Priority |
|----|-------|--------|----------|
| HCEO-001 | Scaffold .hive/ directory (identity, soul, config, capabilities, constraints, evolution-log, memory, metrics) | DONE | P0 |
| HCEO-002 | Create hive/ Python package with 5 agent implementations (base, CEO, analyst, watcher, builder, advisor) | DONE | P0 |
| HCEO-003 | Implement admin panel API routes (FastAPI, 20 endpoints + WebSocket) | DONE | P0 |
| HCEO-004 | Implement model provider abstraction (Ollama, OpenAI, OpenRouter, Anthropic) | DONE | P0 |

### READY (Activates After Phase 1 Ship)

| ID | Title | Status | Priority |
|----|-------|--------|----------|
| HCEO-005 | Wire hive admin routes into LLMHosts FastAPI app (mount at /admin/hive/) | READY | P1 |
| HCEO-006 | Implement full codebase Analyst re-index with git diff incremental updates | READY | P1 |
| HCEO-007 | Implement Watcher health check loop with HTTP endpoint monitoring | READY | P1 |
| HCEO-008 | Implement Builder sandbox validation (Docker container test execution) | READY | P1 |

### BACKLOG (Phase 2+)

| ID | Title | Status | Priority |
|----|-------|--------|----------|
| HCEO-009 | Build React admin panel frontend (dashboard, kanban, chat, approvals, activity, config) | BACKLOG | P1 |
| HCEO-010 | Implement LLM-powered Advisor analysis (connect to model providers for improvement proposals) | BACKLOG | P1 |
| HCEO-011 | Implement LLM-powered admin chat (CEO agent with full codebase context) | BACKLOG | P2 |
| HCEO-012 | Implement skill crystallization (auto-generate .hive/skills/ from recurring patterns) | BACKLOG | P2 |

## ACCEPTANCE CRITERIA
- [ ] All 5 Hive agents activate after `llmhosts serve` starts
- [ ] Admin panel accessible at `/admin/hive/` with authentication
- [ ] Health monitoring produces meaningful scores for a running LLMHosts instance
- [ ] At least one improvement cycle completes end-to-end (observe → propose → approve → build → verify)
- [ ] Evolution detection fires when significant code changes are made
- [ ] All agent actions logged and visible in activity log
- [ ] Progressive enhancement verified: LLMHosts works identically if hive/ package is removed

## DEPENDENCIES
- Phase 1 proxy must be functional for Watcher health monitoring
- GitHub access (God-Mode provisioned) for Builder PR creation
- At least one model provider (Ollama local or cloud API key) for LLM-powered features
