75ac96a2d1
Funcion + helpers + tests + .md indexados.
- cpp/functions/viz/agent_runs_timeline.{h,cpp,md}
- cpp/functions/viz/agent_runs_timeline_helpers.{h,cpp}
- cpp/tests/test_agent_runs_timeline.cpp (17 cases, 53 assertions, PASS)
- cpp/tests/CMakeLists.txt: add_fn_test test_agent_runs_timeline
fn index: 1283 functions (+1).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3.6 KiB
3.6 KiB
id, title, status, type, domain, scope, priority, depends, blocks, related, created, updated, tags, flow
| id | title | status | type | domain | scope | priority | depends | blocks | related | created | updated | tags | flow | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0118 | Funcion cpp agent_runs_timeline: panel SSE de runs cross-app | pendiente | feature |
|
registry | alta |
|
|
2026-05-18 | 2026-05-18 |
|
0008 |
0118 — Funcion agent_runs_timeline_cpp_viz
Problema
Panel de timeline de runs es identico en kanban_cpp (0112) y skill_tree v2 (0116). Sin funcion compartida = duplicacion.
Decision
Funcion C++ en cpp/functions/viz/agent_runs_timeline.{cpp,h,md}. API:
namespace fn_viz {
struct AgentRun {
std::string id;
std::string app; // "kanban_cpp" | "skill_tree" | ...
std::string issue_id;
std::string card_id;
std::string branch;
std::string status; // "pending" | "running" | "done" | "validated" | "merged" | "aborted" | "failed"
int64_t started_at;
int64_t finished_at;
int dod_total;
int dod_done;
int dod_validated;
};
struct TimelineFilter {
std::vector<std::string> apps; // vacio = todos
std::vector<std::string> statuses; // vacio = todos
int64_t since_ts; // 0 = sin filtro
};
struct TimelineState {
std::string sse_url; // ej "http://localhost:8486/api/runs/sse"
std::vector<AgentRun> runs;
TimelineFilter filter;
std::function<void(const std::string&)> on_select; // callback(run_id)
};
void render_agent_runs_timeline(TimelineState& state);
void poll_sse_runs(TimelineState& state); // llamar 1x/frame, no bloquea
}
Renderiza tabla con data_table_cpp_viz:
- Cols: status (icon), app (chip color), issue/card, branch, dod_done/total, dod_validated/total, duration, started_at.
- Sort por started_at desc por defecto.
- Click row ->
on_select(run_id). - Filtros arriba: combo apps multi-select + combo statuses + date picker
since. - SSE en background thread: append runs nuevos, update statuses en vivo.
Criterios de aceptacion
cpp/functions/viz/agent_runs_timeline.{cpp,h,md}registrado.params_schemayoutputcompletos.- Tag
agentsaplicado. .mdcumple contrato self-doc (## Ejemplo,## Cuando usarla,## Gotchas).- SSE client en background thread con reconnect +
Last-Event-IDresume. - Demo en
cpp/apps/primitives_gallery/demos_viz.cppcon TimelineState mock (5 runs varied status). kanban_cpp::panel_agent_runsusa la funcion.skill_treepanel_timelineusa la funcion.fn doctor capabilitiesmuestra grupoagentscon esta funcion.uses_functionsdeclara:http_request_cpp_core,data_table_cpp_viz,icons_tabler_cpp_core,tokens_cpp_core.
Gotchas
- SSE reconnect: si
agent_runner_apicae, reintenta cada 5s con backoff. Estadodisconnectedvisible. - Thread-safety: SSE thread escribe
state.runs; UI thread lee. Mutex o cola SPSC. - Memory: si runs > 1000 historicos, paginar (LRU 200 visibles). Antiguos se descargan on-demand via
GET /api/runs?since=.... - App
chip color: mapear app_name -> accent del trio (kanban_cpp#a855f7, skill_tree color actual). Cache. - Click row durante streaming SSE: no resetear seleccion al refrescar lista; preservar por
run_id.
Out of scope
- Editor inline de DoD desde timeline (eso es panel DoD 0117).
- Export CSV/JSON.
- Notificaciones desktop al cambiar status.