Commit Graph
66 Commits
Author SHA1 Message Date
Renn F 0a5988a18f Added serious RAG capabilties 2025-12-30 02:35:58 +01:00
Renn F 5315e9c72d feat: workflow enforcement, RAG upgrade, and permission fixes
Task Management:
  - Add cancellation safeguards: require valid reason category (duplicate,
    obsolete, blocked_permanently, reassigned, scope_change, stakeholder_request)
  - Protect active work from arbitrary cancellation - must pause/block first
  - Auto-notify PM when task is blocked with ACTION REQUIRED message
  - PM task scan now shows blocked tasks needing their attention

  Permissions:
  - Add VIEW_STATS to Developer, QA, Documenter, Head Marketing KB permissions
  - Aligns code with docs/workflows/PERMISSIONS.md specification

  RAG/Embeddings:
  - Upgrade embedding model from all-MiniLM-L6-v2 to nomic-embed-text-v1.5
  - 768 dimensions with 8K token context (vs 512 tokens)
  - Add per-index chunk sizes: docs=1536, journals=1024, others=512
  - Switch to fixed chunking (semantic chunking loads separate MiniLM model)
  - Add einops dependency required by nomic model
2025-12-29 00:30:18 +01:00
Renn F fc55068f2b feat: add Kubernetes manifests and A2A protocol support
Phase 2 - A2A Protocol:
- Add A2A models (AgentCard, Task, Message)
- Add A2A service layer
- Add A2A routes with SSE streaming
- Add agent discovery endpoints

Phase 3 - Kubernetes:
- Add deploy/ directory with Kustomize structure
- PostgreSQL StatefulSet with pgvector
- Redis Deployment with persistence
- API and Orchestrator Deployments
- RBAC for orchestrator to manage Jobs
- ArgoCD Application manifest
- Development and production overlays
- K8s Jobs API support in orchestrator
2025-12-28 19:52:01 +01:00
Renn F b4d4fb089f Revert "feat: add Kubernetes manifests and A2A protocol support"
This reverts commit b943eb7ac1.
2025-12-28 06:03:54 +01:00
Renn FandClaude Opus 4.5 b943eb7ac1 feat: add Kubernetes manifests and A2A protocol support
Phase 2 - A2A Protocol:
- Add A2A models (AgentCard, Task, Message)
- Add A2A service layer
- Add A2A routes with SSE streaming
- Add agent discovery endpoints

Phase 3 - Kubernetes:
- Add deploy/ directory with Kustomize structure
- PostgreSQL StatefulSet with pgvector
- Redis Deployment with persistence
- API and Orchestrator Deployments
- RBAC for orchestrator to manage Jobs
- ArgoCD Application manifest
- Development and production overlays
- K8s Jobs API support in orchestrator

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 05:48:51 +01:00
Renn F f9398e4caa RAG Implementation 2025-12-28 03:04:41 +01:00
Renn F ecc049684d Fixes Applied
1. Transaction Rollback Bug

  File: roboco/services/optimal_brain/indexes/base.py
  - Changed: On transaction error, now closes and reconnects instead of just rollback
  - Before: conn.rollback() (didn't fully reset connection state)
  - After: conn.close() + store._init_schema() (forces fresh connection)

  2. Docs Directory Path

  Files:
  - roboco/services/optimal.py - Added /app/docs as first path to check
  - docker/orchestrator.Dockerfile - Added COPY docs /app/docs

  3. Shared SentenceTransformer

  Files:
  - Created roboco/services/optimal_brain/shared_embedder.py - Singleton holder
  - Modified roboco/services/optimal_brain/indexes/base.py - Uses shared embedder
  - Modified roboco/services/optimal.py - Closes shared embedder on shutdown
2025-12-27 22:05:07 +01:00
Renn F 1116e597d0 RAG expansion + Optimal API 2025-12-27 21:53:38 +01:00
Renn F 3f48a93504 Fixing QA, Documenter and PM issues with tasks. 2025-12-27 02:15:07 +01:00
Renn F d2034e538f It works pretty nicely with the ultimate test 2025-12-27 00:34:11 +01:00
Renn F 8c3bf9e22c Huge refactoring but stuff is working again; minus some issues here and there. 2025-12-26 18:01:53 +01:00
Renn F c813dcfae4 Bringing back some old friends 2025-12-25 23:06:41 +01:00
Renn F 1f6c099d8a Deleted Files (7,506 lines removed)
| File                          | Lines  | Purpose                                   |
  |-------------------------------|--------|-------------------------------------------|
  | HOMELAB_TEAM_V0.md            | 3,443  | Original blueprint doc (now in CLAUDE.md) |
  | WORKFLOWS.md                  | 260    | Workflow docs                             |
  | roboco/agents/*.py            | ~5,800 | Entire Python agent framework (14 files)  |
  | roboco/models/organization.py | 157    | Unused org types                          |

  New Files (53 lines added)

  | File                        | Lines | Purpose                                                    |
  |-----------------------------|-------|------------------------------------------------------------|
  | roboco/runtime/streaming.py | 53    | Migrated set_reasoning_stream_callback from deleted agents |

  Modified Files

  Config & Settings:
  - .gitignore - Added .OLD/ directory

  Blueprints (13 files):
  - Fixed roboco_task_plan() signatures: (task_id, plan) → (task_id, approach, steps, risks?, open_questions?)
  - PM blueprints: Fixed channel access (read/write for dev-all, qa-all, doc-all)

  Core Code:
  | File                           | Changes                                   |
  |--------------------------------|-------------------------------------------|
  | roboco/agents_config.py        | Team naming uxui → ux_ui, docstring fixes |
  | roboco/api/routes/tasks.py     | Hardcoded roles → AgentRole enum          |
  | roboco/services/permissions.py | Cell PM → Main PM notification fix        |
  | roboco/services/task.py        | Removed unused imports                    |
  | roboco/bootstrap.py            | Updated import path after agents deletion |
  | roboco/runtime/__init__.py     | Added streaming exports                   |
  | roboco/runtime/orchestrator.py | Various improvements (+229/-10)           |
  | roboco/mcp/task_server.py      | Docstring team fix                        |
  | roboco/mcp/tasks/handlers/*.py | Handler improvements                      |
  | roboco/enforcement/*.py        | Lifecycle enforcement updates             |
  | roboco/db/tables.py            | Table changes (+76 lines)                 |
  | roboco/models/base.py          | Minor enum tweaks                         |
  | roboco/seeds/initial_data.py   | Docstring team fix                        |

  Key Architecture Change:
  Removed the unused Python agent framework (roboco/agents/) - the system uses Docker-based Claude Code spawning via roboco/runtime/orchestrator.py instead.
2025-12-25 21:01:12 +01:00
Renn F 7f13e10bf4 Documenter is ignored but it works pretty well 2025-12-25 07:40:39 +01:00
Renn F 15f5be3f8b Changes Made
roboco/agents/base.py - Added proper workflow methods:
  - _qa_pass(task_id, qa_notes) - Calls /pass-qa endpoint
  - _qa_fail(task_id, qa_notes, issues) - Calls /fail-qa endpoint
  - _docs_complete(task_id, doc_notes?) - Calls /docs-complete endpoint
  - Marked old _mark_needs_revision, _mark_awaiting_documentation, _mark_awaiting_pm_review as DEPRECATED

  roboco/agents/qa.py - Fixed verdict phase:
  - Now uses _qa_pass() instead of _mark_awaiting_documentation()
  - Now uses _qa_fail() instead of _mark_needs_revision()
  - Properly passes QA notes and issue lists

  roboco/agents/documenter.py - Fixed submit phase:
  - Now uses _docs_complete() instead of _mark_awaiting_pm_review()
  - Properly passes documentation summary as notes
2025-12-24 23:34:42 +01:00
Renn F dd1b3394a7 Addressing submit_pm_review, get_or_create_channel_by_slug, and other discrepancies/painpoints of the agents 2025-12-24 23:05:26 +01:00
Renn F 67eac35c68 Moved on to DHI (Docker Hardened Images) 2025-12-24 22:19:43 +01:00
Renn F 4055cdead4 Fixed escalation bug 2025-12-24 22:19:19 +01:00
Renn F b39461ac85 retry mechanism for piragi RAG 2025-12-24 21:23:14 +01:00
Renn F ac621ee4e2 Aligning on tasks and messaging, journals and more: MCP, Blueprints, Implementations, tools, API, etc 2025-12-24 21:19:42 +01:00
Renn F afde0d5441 Fixed issues reported by agents 2025-12-24 04:23:16 +01:00
Renn F 06720b1978 Killed "active" session dependency:
1. roboco/mcp/schemas/__init__.py:
    - SendMessageInput.task_id → required
    - AskQuestionInput.task_id → required
    - ReportBlockerInput.task_id → required
  2. roboco/mcp/message_server.py:
    - Removed _get_active_session() entirely (dead code)
    - Simplified _handle_message_send() - no fallback, just uses task's linked session
    - Updated tool signatures for roboco_ask_question and roboco_report_blocker
  3. roboco/api/routes/tasks.py (earlier fix):
    - Added subtask validation before parent completion

  New behavior:
  - All messages MUST have task_id
  - Task's linked session is the only source of truth
  - No session? → Clear error: "Cell PM must create one"
  - No more "active" status guessing
2025-12-23 22:58:07 +01:00
Renn F 204b959733 1. Blueprint updates - Added NO_GROUPS escalation docs to all 12 agent blueprints
2. Multi-image Docker architecture - Created role-specific Dockerfiles:
  - agent-base.Dockerfile (shared foundation)
  - agent-pm.Dockerfile, agent-dev-be.Dockerfile, agent-dev-fe.Dockerfile
  - agent-qa-be.Dockerfile, agent-qa-fe.Dockerfile, agent-doc.Dockerfile, agent-ux.Dockerfile
3. Orchestrator updates - roboco/runtime/orchestrator.py:
  - Added AGENT_IMAGES mapping and get_agent_image() function
  - Updated _ensure_agent_image() to build base + specialized images
  - Updated _spawn_container() to use role-specific image
  - Made _generate_mcp_config() role-aware (though kept notify for all since they need to receive)
2025-12-23 21:23:50 +01:00
Renn F 31c776b84a - roboco/api/schemas/sessions.py - Added SessionTaskInfo model and task_links field to SessionResponse
- roboco/api/routes/sessions.py - Updated list_sessions to load task links with task titles
2025-12-23 07:16:17 +01:00
Renn F 829c0309f5 Changes Made:
/roboco/roboco/mcp/message_server.py:
- Renamed _get_or_create_session → _get_active_session
- Removed auto-creation of sessions - now returns error instead
- Added helpful error guidance when no session exists:

"NO_ACTIVE_SESSION"
"No active session in this channel. Sessions are created by PMs for tasks."

Guidance:
1. Include task_id in your message call if working on a task (routes to task's session)
2. If no task session exists, ask your PM to create one using roboco_session_create_for_tasks
3. All work communication should happen within task sessions

What This Enforces

1. Only PMs can create sessions using roboco_session_create_for_tasks (already enforced by can_create_tasks())
2. Agents MUST provide task_id when sending messages to route to the task's session
3. If no session exists → agents get clear guidance instead of auto-creating chaos
4. No more "Session 750c51e7" with 0-1 messages - sessions will be intentionally created and managed
2025-12-23 05:22:37 +01:00
Renn F 1753f5c9e6 Improved workflow. Ready for git, figma, etc; AND BIGGER TESTS 2025-12-23 04:39:46 +01:00
Renn F b7611c24fc feat(sessions): Session-Task linking with scoped context management
Major feature: Sessions are now linked to tasks with smart routing and context loading, ensuring agents have proper discussion context.

## Session-Task Relationship (Many-to-Many)
  - Added SessionTaskTable junction table linking sessions to tasks
  - Sessions can link to multiple tasks, tasks can have multiple sessions
  - is_primary flag marks the main discussion session for a task
  - relationship_type: discussion, planning, review, retrospective
  - Subtasks auto-inherit parent task's session

## BACKLOG Status + Activation Flow
  - Tasks now created with BACKLOG status (not PENDING)
  - PMs must create session BEFORE activating task
  - roboco_task_activate() transitions BACKLOG → PENDING
  - Prevents race condition where dev starts before session exists
  - Flow: CREATE (backlog) → SESSION → ACTIVATE (pending) → spawn

## Session Scopes
  - SessionScope enum: initiative, cell, task
  - initiative: Cross-cell coordination (Main PM, #dev-all)
  - cell: Cell-specific work (Cell PM default)
  - task: Individual task execution (dev level)
  - Enables future smart context loading by scope

## Message Routing to Task Sessions
  - When task_id provided in roboco_message_send(), routes to task's primary session instead of channel's active session
  - New API endpoint: GET /sessions/for-task/{task_id}
  - TaskResponse now includes linked sessions array

## Dev Session Access
  - New tool: roboco_session_history_for_task(task_id)
  - Devs can now see their task's discussion history
  - Messages tagged with task_id for filtering

## Communication Guidelines
  - Added "When to Post / When NOT to Post" to all 9 agent blueprints
  - Devs/QA/Doc should use task tools for status, journal for reasoning
  - Sessions reserved for coordination that needs response
  - Reduces noise: no "Starting work" or "Made progress" chat messages

Files changed:
  - DB: SessionTaskTable, SessionScope column
  - Services: messaging.py (linking), task.py (activation)
  - MCP: 5 new session tools, message routing update
  - API: session-task endpoints, TaskResponse sessions
  - Blueprints: All 13 updated with session/activation workflow
2025-12-22 18:04:31 +01:00
Renn F 4e06bdb842 BIG REFACTORING: Making everything scalable, maintanable, modularized, code quality, separation of concerns, etc. 2025-12-22 04:30:50 +01:00
Renn F dfa8077484 Agents (backend cell at least) are able to receive a full task, break it down into smaller tasks, work on them, qa verify them, document them, pm verify them; and that's it. Completed task. 2025-12-21 20:11:29 +01:00
Renn F 5d71f2fe9d 1. roboco/mcp/utils.py - Created shared utilities:
- ApiClient class with connection pooling and automatic header injection
    - ApiResponse wrapper with .ok, .is_status(), .json() methods
    - get_agent_headers(), format_error_response(), resolve_agent_uuid()
2. roboco/mcp/schemas/__init__.py - Added new input schemas:
    - TaskBlockInput (groups blocker parameters)
    - TaskPauseInput (groups pause parameters)
3. Refactored all 4 MCP servers:
    - journal_server.py - Uses shared ApiClient
    - notify_server.py - Uses shared ApiClient
    - message_server.py - Uses shared ApiClient
    - task_server.py - Uses shared ApiClient, reduced argument count with dataclasses
2025-12-21 03:20:13 +01:00
Renn F b04993d8b8 Improved workflow and task lifecycle 2025-12-21 03:09:12 +01:00
Renn F 3122d2759e Remove tasks directory 2025-12-21 00:20:32 +01:00
Renn F 42b4ed6187 Enhanced blueprints, workflow and minor fixes 2025-12-20 23:39:07 +01:00
Renn F eb9109a855 Static agents IDs 2025-12-19 17:13:54 +01:00
Renn F a3058e9e02 fix(mcp): resolve agent authentication and journal routing issues
- Add X-Agent-Team header to all MCP servers (journal, task, message, notify)
The permission system uses (role, team) tuple for channel access lookup.
Without team, lookup returned empty list causing "Channel not found" errors.

- Standardize header case to X-Agent-ID (uppercase) matching frontend

- Reorder journal routes: /me/* endpoints now defined before /{agent_id}/*
FastAPI was matching /me/entries as /{agent_id}/entries with agent_id="me"
causing "Agent not found: me" errors

- Fix journal search returning empty results:
- optimal.py: Pass chunk.metadata to SearchResult instead of empty dict
- journal.py: Read entry_id from result.metadata instead of parsing contentfix(mcp): resolve agent authentication and journal routing issues

- Add X-Agent-Team header to all MCP servers (journal, task, message, notify)
The permission system uses (role, team) tuple for channel access lookup.
Without team, lookup returned empty list causing "Channel not found" errors.

- Standardize header case to X-Agent-ID (uppercase) matching frontend

- Reorder journal routes: /me/* endpoints now defined before /{agent_id}/*
FastAPI was matching /me/entries as /{agent_id}/entries with agent_id="me"
causing "Agent not found: me" errors

- Fix journal search returning empty results:
- optimal.py: Pass chunk.metadata to SearchResult instead of empty dict
- journal.py: Read entry_id from result.metadata instead of parsing content
2025-12-18 19:07:50 +01:00
Renn F eed29cdf4a Fixes + Cleanup 2025-12-18 03:29:08 +01:00
Renn F 9f008e5362 Fixed MCP connection and other MCP issues + API fixes 2025-12-18 00:32:54 +01:00
Renn F 405944f36a Fixed agent-orchestrator init and token bburn mitigation plan 2025-12-16 22:04:24 +01:00
Renn F 20366f20be Fixed journal resolution of UUIDs to slugs 2025-12-16 19:28:38 +01:00
Renn F 0e0eda8809 Summary: Backend-Frontend Alignment Complete
I've completed the foundational alignment work between the backend (roboco) and frontend (roboco-panel) to prepare for implementing the PLAN.md. Here's what was done:

Backend Changes (roboco)

1. Enhanced TaskResponse Schema (roboco/api/schemas/tasks.py)
- Added nested response models: ProgressUpdateResponse, CheckpointResponse, CommitRefResponse, SubTaskResponse, TaskPlanResponse
- TaskResponse now includes:
- plan: TaskPlanResponse | None
- checkpoints: list[CheckpointResponse]
- progress_updates: list[ProgressUpdateResponse]
- commits: list[CommitRefResponse]
- auditor_notes: str | None
- Added TaskSummaryResponse for lightweight list views

2. Updated Route Converter (roboco/api/routes/tasks.py)
- Added conversion functions: _convert_plan(), _convert_checkpoints(), _convert_progress_updates(), _convert_commits()
- Updated _to_response() to populate all new fields

Frontend Changes (roboco-panel)

1. Updated Types (src/types/index.ts)
- Added task supporting types: ProgressUpdate, Checkpoint, CommitRef, SubTask, TaskPlan
- Updated Task interface with all new fields
- Changed priority from Priority enum to number (0-3)
- Added Journal types: Journal, JournalEntry, JournalEntryCreate, JournalStats, GrowthMetrics
- Added Auditor types: AuditorFlag, AuditorReport, AuditorDashboard, TeamHealth, CEOOverview

2. Created Journals API Client (src/lib/api/journals.ts)
- Complete CRUD for journals and entries
- Convenience endpoints: addTaskReflection, addDecisionLog, addLearning, addStruggle, addNote
- Analytics: getMyStats, getMyGrowthMetrics
- Search: searchEntries

3. Enhanced Dashboard API Client (src/lib/api/dashboard.ts)
- Added Auditor endpoints: getAuditorDashboard, getAuditorFlags, createAuditorFlag, resolveAuditorFlag, getAuditorReports, createAuditorReport, sendAuditorReport
- Added CEO detail endpoints: getCeoTeamDetails, getCeoBlockerDetails, getCeoVelocity
- Added additional Kanban endpoints: getKanbanDocumenter, getKanbanCellPm, getKanbanBoard, getKanbanStats

4. Created Journals Hooks (src/hooks/use-journals.ts)
- Query hooks: useMyJournal, useJournalByAgent, useMyJournalEntries, useJournalEntry, useMyJournalStats, useMyGrowthMetrics, useSearchJournalEntries
- Mutation hooks: useCreateJournalEntry, useDeleteJournalEntry, useAddTaskReflection, useAddDecisionLog, useAddLearning, useAddStruggle, useAddNote

5. Enhanced Dashboard Hooks (src/hooks/use-dashboard.ts)
- Added CEO hooks: useCeoTeamDetails, useCeoBlockerDetails, useCeoVelocity, useRecentActivity, useAgentStatus
- Added Kanban hooks: useKanbanDocumenter, useKanbanCellPm, useKanbanBoard, useKanbanStats
- Added Auditor hooks: useAuditorDashboard, useAuditorFlags, useAuditorReports, useCreateAuditorFlag, useResolveAuditorFlag, useCreateAuditorReport, useSendAuditorReport

6. Fixed Existing Components
- Updated kanban/page.tsx to use numeric priorities with proper labels (P0-P3)
- Updated create-task-dialog.tsx to use numeric priority selection

What's Ready for PLAN.md Implementation

The foundation is now in place for implementing the PLAN.md phases:

| Component             | Status | Notes                              |
|-----------------------|--------|------------------------------------|
| Task Detail Page      | Ready  | Backend now returns full task data |
| Agent Journal Page    | Ready  | API client and hooks complete      |
| Auditor Dashboard     | Ready  | API client and hooks complete      |
| Role-Specific Kanban  | Ready  | All endpoints available            |
| CEO Overview Enhanced | Ready  | Team details, velocity, blockers   |
2025-12-16 01:35:06 +01:00
Renn F 856d2ea9f8 Fixing permissions for chats 2025-12-15 23:51:19 +01:00
Renn F fe2f7f7595 Fix communications for frontend 2025-12-15 20:59:31 +01:00
Renn F a8df78fa3e Fixing CORS 2025-12-15 20:04:50 +01:00
Renn F 65f52a2dcc Fixed some minor issues with tags and CORS 2025-12-15 16:52:12 +01:00
Renn F 9fb0b9c9e2 Fixed OptimalAPI init 2025-12-15 03:10:08 +01:00
Renn F d16d678cdc Small fixes 2025-12-15 02:35:20 +01:00
Renn F f67a96403b Fixed MCP servers communication + other minor updates 2025-12-15 02:13:20 +01:00
Renn F 54c0a41055 Improved Orchestrator is now Smarter and cost-efficient/effective. MCPs still unreachable 2025-12-15 00:26:28 +01:00
Renn F bc9cd7575d V0 finally out 2025-12-14 22:05:34 +01:00
Renn F 348795c50b Finished reorganization 2025-12-14 03:40:48 +01:00