feat(infra): modelo de datos del meta-orquestador de flota (flow 0012)

Fase 1, piezas 1+2:
- ClaudeFleet + list_claude_fleet ganan DodContract/DodStatus/Role,
  leidos de goals/<sessionId>.json (.dod_contract/.dod_status/.role).
  Aditivo: fleetview sigue compilando.
- classify_fleet_termination (pura): clasifica el estado de terminacion
  de un agente (RECLAMA/MAL_LANZADO/DICE_TERMINADO/ESTANCADO/TRABAJANDO)
  con precedencia fija, para que un watcher sin LLM decida. 34 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
agent
2026-06-20 19:51:11 +02:00
parent b569561115
commit 28a53ee357
7 changed files with 315 additions and 40 deletions
+18 -12
View File
@@ -6,18 +6,21 @@ version: "1.0.0"
algebraic: product
definition: |
type ClaudeFleet struct {
PID int `json:"pid"`
KittyPID int `json:"kitty_pid"`
SessionID string `json:"session_id"`
Rename string `json:"rename"`
Target string `json:"target"`
Goal string `json:"goal"`
Phase string `json:"phase"`
Status string `json:"status"`
Cwd string `json:"cwd"`
TmuxWindow string `json:"tmux_window"`
Alive bool `json:"alive"`
UpdatedAt int64 `json:"updated_at"`
PID int `json:"pid"`
KittyPID int `json:"kitty_pid"`
SessionID string `json:"session_id"`
Rename string `json:"rename"`
Target string `json:"target"`
Goal string `json:"goal"`
Phase string `json:"phase"`
DodContract string `json:"dod_contract"`
DodStatus string `json:"dod_status"`
Role string `json:"role"`
Status string `json:"status"`
Cwd string `json:"cwd"`
TmuxWindow string `json:"tmux_window"`
Alive bool `json:"alive"`
UpdatedAt int64 `json:"updated_at"`
}
description: "Registro de una sesion de Claude Code en la maquina local. Cruza el estado del proceso (/proc) con la metadata que Claude Code persiste en ~/.claude (sessions/<PID>.json + goals/<sessionId>.json). Pieza de datos de la app TUI fleetview, producida por list_claude_fleet_go_infra."
tags: [claude-fleet, infra, claude, session, process]
@@ -36,6 +39,9 @@ file_path: "functions/infra/claude_fleet.go"
| `Target` | string | derivado | sessionId[:8] + "@" + basename(cwd). |
| `Goal` | string | goals/<sessionId>.json .goal | "" si no hay sidecar. |
| `Phase` | string | goals .phase | "" si no hay sidecar. |
| `DodContract` | string | goals .dod_contract | Criterio de aceptacion FIJO escrito al lanzar el agente; "" si ausente o vacio. |
| `DodStatus` | string | goals .dod_status | Estado del DoD: `pending`\|`met`\|`failed`; "" si ausente o vacio. |
| `Role` | string | goals .role | Rol en la flota: `orchestrator`\|`executor`; "" si ausente (los consumidores asumen executor). El orquestador se pinea arriba en la TUI. |
| `Status` | string | sessions .status | idle\|busy\|waiting. |
| `Cwd` | string | sessions .cwd | Working directory. |
| `TmuxWindow` | string | (reservado) | "" por ahora; se rellena en fase posterior. |