41 Commits

Author SHA1 Message Date
egutierrez 8aa1146b45 feat(launcher): launch_linux.sh arranca en modo completo (HTTP+WS+Work)
Antes forzaba --api "" (binding SQLite directo), lo que desactivaba el
WebSocket del Monitor tab. Ademas no exportaba FN_REGISTRY_ROOT, por lo que la
tab Work no encontraba el binario dev_console y caia a un placeholder.

Ahora pasa --api http://127.0.0.1:8484 con registry.db como segundo argumento
de fallback (el binario cae a SQLite directo si el servicio no responde) y
exporta FN_REGISTRY_ROOT. El resultado es la app completa con un solo comando,
con degradacion elegante cuando sqlite_api no esta arriba.
2026-06-03 19:13:03 +02:00
egutierrez ca67f343df docs: documentar dependencias de runtime (sqlite_api, call_monitor, dev_console)
La tab Work (issue 0102) y su backend dev_console no estaban documentados.
Se anade una seccion que mapea las tres apps de las que depende el dashboard
en tiempo de ejecucion, su tipo de acoplamiento y el comportamiento degradado
cuando cada una falta.
2026-06-03 17:37:36 +02:00
egutierrez 371266c52b Merge quick/linux-launcher: launcher Linux + binding directo 2026-06-02 23:00:23 +02:00
egutierrez 0ac03fe5b0 feat(linux): launcher de escritorio con binding SQLite directo
Anade launch_linux.sh y appicon.png para correr el dashboard en Linux nativo:
- Stagea el ejecutable + assets a ~/fn_apps/registry_dashboard/ y lanza desde
  alli, de modo que local_files/ (imgui.ini, app_settings.ini, layouts.db, logs)
  queda contenido en esa carpeta en lugar del arbol de build o el escritorio.
- Fuerza --api "" para leer registry.db directo y prescindir de sqlite_api
  (el puente HTTP solo hacia falta cuando el binario corria en Windows con los
  datos en WSL).
- appicon.png: rasterizado del appicon.ico para el icono del .desktop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 23:00:23 +02:00
egutierrez ff67e4e069 chore: auto-commit (4 archivos)
- app.md
- appicon.ico
- views.cpp
- work_tab.cpp

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 00:31:34 +02:00
egutierrez ca436aa6cc feat(dev): issues 0100-0104 — dev_console binary + work_tab + DoD user-facing + frontmatter migration de 146 issues + taxonomia canonica
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 02:44:05 +02:00
egutierrez 092d03ba53 docs(flows): DoD obligatorio con user-facing surface + abrir issues 0100-0103 (taxonomia, frontmatter migration, dev_console, work dashboard)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 00:07:04 +02:00
egutierrez 04cfa2aba0 chore: auto-commit (4 archivos)
- data.h
- data_http.cpp
- views.cpp
- appicon.ico

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 16:33:25 +02:00
egutierrez 9cbf2f7492 merge Monitor renderers migration (issue 0081-J) 2026-05-15 16:43:54 +02:00
egutierrez 3f8c12db89 migrate Monitor Recent Executions + Failed Functions to data_table::render with Badge/Duration renderers (issue 0081-J)
- Replace ##monitor_recent BeginTable (6 cols) with data_table::render:
  - Duration renderer on duration_ms col (warn=500ms, error=2000ms)
  - Badge renderer on Status col: ok=#22c55e, error=#ef4444, running=#3b82f6, timeout=#f59e0b
  - success bool encoded as "ok"/"error" string for badge matching
- Replace ##monitor_failed_fns BeginTable (5 cols) with data_table::render:
  - Badge renderer on Error Class col: sqlite/network/timeout/not_found/auth/parse/io/permission/unknown
  - empty error_class normalized to "unknown" for badge match
- Add g_dt_monitor_recent + g_dt_monitor_failed persistent State members
- Remove all inline coloring helpers for these two tables (covered by renderers)
- fn doctor cpp-apps: registry_dashboard BeginTable inline count 7 -> 5
  (5 remaining are layout splitters: kpi_grid/chart_grid/monitor_kpi/proj_layout/explorer_layout)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 16:43:51 +02:00
egutierrez 55a9c07e46 merge data_table migration (issue 0081-J)
Migrates registry_dashboard tables to data_table::render() via fn_table_viz.
2026-05-15 14:39:55 +02:00
egutierrez 3d7c5bc0a1 migrate function/type/app tables to data_table_cpp_viz (issue 0081-J)
- Replace table_view() calls in draw_recent_functions, draw_apps_list,
  draw_analysis_list, draw_types_list, and vaults panel with
  data_table::render() via fn_table_viz static lib.
- Migrate Monitor sub-tabs Top Functions, Violations, Copied Code to
  data_table::render() with persistent State per panel.
- Keep Recent Executions and Failed Functions as custom ImGui tables
  (per-cell coloring + tooltips not supported by data_table).
- Layout-splitter tables (kpi_grid, chart_grid, monitor_kpi,
  proj_layout, explorer_layout) intentionally not migrated.
- CMakeLists: target_link_libraries(registry_dashboard PRIVATE fn_table_viz).
- app.md uses_functions += data_table_cpp_viz + full fn_table_viz stack.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 14:39:51 +02:00
egutierrez 00ee6a93e3 chore: auto-commit (4 archivos)
- data.h
- data_http.cpp
- main.cpp
- views.cpp

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 02:06:46 +02:00
egutierrez 5c53cfcb68 merge: issue/0086-monitor-tab — Monitor tab + WS live stream
UI:
- Tab Monitor first/default in TabBar
- 5 KPIs (Calls/Errors/Violations/Copies/Versions)
- Recent Executions table with timestamps
- Date filter (1h/24h/7d/30d/All)
- Live LED + last-event indicator

Backend:
- Hand-rolled RFC6455 WS client (ws_client.{h,cpp})
- Connects to sqlite_api /api/events/call_monitor
- Snapshot + delta application to g_data.claude
- Reconnect with exponential backoff

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:35:38 +02:00
egutierrez f7109a8ca0 docs(monitor): bump to v0.4.0, update app.md with Monitor + WS section
- About info updated to reflect Monitor as primary tab and the WS feature set.
- app.md gains a dedicated "Fase — Monitor tab + WebSocket live stream" section
  documenting the architecture, KPIs, WS hub design, fallback semantics, and
  the scope decisions (no TLS, skip Accept verification, WS client not yet
  extracted to cpp/functions/).
- Roadmap items added: extract ws_client when a second consumer arrives,
  Sec-WebSocket-Accept verification, migrate to coder/websocket on the server.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:35:26 +02:00
egutierrez 9205567d5f feat(monitor): WS client live stream + apply snapshot/delta to UI
Hand-rolled minimal RFC6455 WebSocket client (~330 LOC) tailored to the
Monitor tab's needs. Single endpoint, text frames, masked client→server,
exponential reconnect backoff (0.5s → 8s cap), thread-safe in/out queues.
TLS is intentionally out of scope (localhost-only). Sec-WebSocket-Accept
verification is skipped — the server is controlled, 101 status is enough.

Files:
- ws_client.{h,cpp}: WsClient with start(host,port,path), drain(), send_text(),
  is_connected(), last_event_ts(). Worker thread does connect + handshake +
  read_loop + reconnect.
- CMakeLists.txt: pulls ws_client.cpp into the dashboard target. ws2_32 was
  already linked for http_client.cpp.
- main.cpp: parses host:port from --api URL, spawns a global WsClient, and
  drains its queue once per render frame via poll_ws(). apply_ws_message()
  routes JSON to g_data.claude:
    snapshot → replace KPIs + recent_executions
    delta    → append rows, increment total_calls / total_errors
  monitor_set_ws_state() forwards connection state + last_event_ts to the
  Monitor toolbar LED.

End-to-end smoke test passed against sqlite_api on localhost:8484:
- Snapshot received with KPIs + 100 recent rows.
- After INSERT INTO calls, delta arrives within ~250ms (server ticker).
- Errors (success=0) propagate correctly and bump the Errors KPI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:34:03 +02:00
egutierrez 87b7ef45ff feat(monitor): Monitor tab as primary landing + errors KPI + recent executions + date filter
Rebrand "Claude Usage" tab to "Monitor" and promote it to first/default tab in
the main TabBar. Monitor is the landing for the reactive loop (construir →
ejecutar → recopilar → analizar → mejorar).

UI additions:
- Local toolbar inside Monitor with date preset combo (1h / 24h / 7d / 30d /
  All), manual Refresh button, and live LED + last-event-ts indicator.
- 5 KPI cards (was 4): added "Errors" derived from COUNT(*) FROM calls WHERE
  success = 0 filtered by the active window.
- New sub-tab "Recent Executions" (first sub-tab) with columns: When,
  Function, Tool, ms, OK (check/X colored), Error class. Backed by calls
  table, sorted by ts DESC, limit 100, filtered by window.
- Violations sub-tab gains "When" column with formatted ts.

Data layer:
- data.h: RecentExecutionRow + window_secs + ws_connected/last_event_ts /
  last_seen_call_id watermark on ClaudeUsageData.
- data_http.{h,cpp}: load_claude_usage_http now takes window_secs and embeds
  ts_filter() in calls/errors/violations queries. total_errors populated.
  recent_executions populated up to 100 rows. New standalone
  load_recent_executions_http() for future WS-driven partial refetch.
- main.cpp: reload_data preserves window_secs across reloads; new
  reload_monitor() does a Monitor-only refetch when the user changes the
  window or clicks Refresh, without re-querying the full registry.

Wiring:
- views.h: draw_monitor + monitor_consume_reload_request() +
  monitor_set_ws_state() exported. draw_claude_usage removed.
- views.cpp: render() consumes monitor_consume_reload_request each frame
  and dispatches reload_monitor().

This is the UI half of issue 0086. The server-side WebSocket endpoint in
sqlite_api and the C++ WS client are next; the LED is wired to
monitor_set_ws_state but stays gray until those land.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:26:29 +02:00
egutierrez 33d50aacdd feat(kotlin-compose): design system + 33 components + gallery_kt + e2e android emulator + scaffolder fixes
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 16:29:05 +02:00
egutierrez ddf8e76ad6 feat(dashboard): functions explorer + top-level tabs + pie chart fit
- Pie charts (Purity, Kind) ahora reciben plot_h explicito para que respeten
  el panel contenedor y no desborden cuando la ventana se reduce.
- Nueva pestana "Explorer": split layout con lista filtrable a la izquierda
  (search por nombre/descripcion + combos lang/domain) y panel de detalle
  a la derecha con tabs Code (read-only multiline), Documentation (selectable
  text), Tests (con dropdown si la funcion tiene varios tests, muestra lang +
  file_path + codigo) y Metadata (id, version, file_path, returns,
  uses_functions, uses_types, params_schema, example, notes).
- Reorganizacion de navegacion: TabBar movido arriba, justo debajo de la
  toolbar. Tabs: Dashboard | Explorer | Projects | Apps | Analysis | Types.
  Cada tab ocupa toda la zona de contenido. Dashboard incluye KPIs + charts
  + tabla de Recent Functions.
- Cache del Explorer (lista de funciones) invalidado en trigger_reload.
- Nuevas funciones HTTP: load_function_detail_http, load_all_functions_http,
  load_unit_tests_http (todas usan /api/databases/registry/query con escape
  defensivo de comilla simple en IDs).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 23:13:02 +02:00
egutierrez 641723bdf1 docs(app.md): document additional uses_functions deps
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 11:46:06 +02:00
egutierrez ec60a80844 chore: ignorar registry.db (no debe vivir aqui)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 18:14:07 +02:00
egutierrez 00a19d8632 feat(dashboard): v0.3.0 — Status panel, dashboard_panel/grid, AppConfig pattern
- main.cpp: bump 0.2.0 → 0.3.0; añadir Status section en Settings via
  settings_window_add_section (fuente API/SQLite, URL, DB path, Reload).
- views.cpp: chart_panel manual + BeginChild custom → dashboard_panel/grid
  del registry. KPI cards con sparkline a la derecha, altura responsive.
- views.h: signature de draw_kpi_row pasa RegistryData (para sparkline).
- CMakeLists.txt: añadir process_state_machine.cpp (dependencia de
  process_runner tras issue 0045).
2026-04-29 00:58:17 +02:00
egutierrez a728e2b0a1 docs(app.md): notas Settings submenu + Git column (sesion 2026-04-28)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 22:41:47 +02:00
egutierrez a466fff71a feat: Settings submenu (Settings.../About...), git column, projects tab
- main.cpp: registrar info About via fn_ui::about_window_set_info
- views.cpp: nueva columna "Git" en la tabla Apps (remote/local/-)
- data.h/cpp + data_http.cpp: AppRow gana repo_url + dir_path
- views.cpp: actions bar (Reindex / + Add / Reload / inbox) y modal Add
- views.cpp: tab Projects con tree + detalle anidado
- data_http.cpp: load_projects_http, load_project_detail_http, http_post_*
- http_client.cpp: SO_RCVTIMEO en Windows como DWORD ms (timeout 5 ms bug)
- CMakeLists: limpieza de srcs duplicados con fn_framework
- app.md: notas operativas y estado actual

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 22:06:31 +02:00
egutierrez 57d8f0198a fix(cmake): guard NOT TARGET sqlite3_vendored para evitar duplicado
Cuando registry_dashboard se compila como subdirectorio de cpp/ (en lugar
de standalone), el parent ya define sqlite3_vendored. Sin el guard, cmake
falla con "another target with the same name already exists".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 18:42:12 +02:00
egutierrez d6bdab89e8 feat(views): chart panels con tamano fijo, altura de row constante, gitignore imgui.ini
- Nuevo chart_panel_begin/end local (reemplaza dashboard_panel con
  AutoResizeY): BeginChild con altura explicita pasada por parametro,
  NoScrollbar | NoScrollWithMouse. Rompe el feedback loop plot <-> panel
  que causaba deslizamiento lateral y scrollbar fugaz.
- Altura de charts fija 260px (antes GetContentRegionAvail().y * 0.35).
  Sin esto, redimensionar la ventana propaga cambios de altura a todos
  los plots y se ve vibracion.
- KPIs reorganizados en ImGui::BeginTable 4 cols x 2 rows. Las celdas
  de tabla propagan ancho constrained, necesario para que el BeginChild
  interno del kpi_card (card v1.2 compacta 78px) ocupe exactamente la
  celda.
- imgui.ini al .gitignore: estado local de la ventana, no versionable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 21:31:26 +02:00
egutierrez 646b9463c0 feat(kpis): 4-col table + card container para cada KPI
Reemplaza dashboard_grid (BeginGroup) por ImGui::BeginTable de 4 columnas.
Las celdas de tabla si propagan ancho constrained al BeginChild interno de
kpi_card, cosa que BeginGroup no hace. Layout 2x4 en vez de 1x8 (mas legible
a anchos tipicos).

Reduce duplicacion iterando un array de {label,value,fmt}.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 20:52:24 +02:00
egutierrez 570103d83e feat(ui): migrar a tokens + primitivos del design system
Dashboard ahora usa:
- fn_tokens::apply_dark_theme() al primer frame (colors + spacing
  + radius + rounding consistentes con @fn_library / Mantine).
- page_header_begin/end para el header (en vez de Text + Separator
  + Button manual). Subtítulo con conteos de entidades.
- empty_state en las 4 tablas cuando están vacías — mensaje amable
  con acción sugerida en lugar de tabla vacía silenciosa.

Nuevas deps de compilación (.cpp fuentes añadidas al CMakeLists):
tokens.cpp, badge.cpp, empty_state.cpp, page_header.cpp.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 14:52:08 +02:00
egutierrez fa7982727c build(win): ocultar consola al lanzar (WIN32_EXECUTABLE TRUE)
El .exe se enlazaba como console app (mingw default), lo que
abría una ventana de consola negra al lanzarlo desde el escritorio.
WIN32_EXECUTABLE TRUE hace que CMake pase -mwindows al linker
(SUBSYSTEM:WINDOWS), dejando solo la ventana ImGui.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 14:36:04 +02:00
egutierrez de76cd9ff9 fix: #include <cstdint> en http_client.cpp
uint16_t requiere <cstdint> explícitamente en mingw-w64 (más estricto que
g++ Linux). Sin esto el cross-compile a Windows falla con:
  error: 'uint16_t' does not name a type

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 13:56:12 +02:00
egutierrez 079bab81cc merge: quick/minimal-http-client — HTTP client minimalista, compilacion Windows OK 2026-04-13 01:45:33 +02:00
egutierrez 5b7001ebfb refactor: reemplazar cpp-httplib por HTTP client minimalista
cpp-httplib requiere std::mutex que no compila con MinGW win32
thread model. Se reemplaza por http_client.cpp: sockets crudos,
sin threading, sin SSL, funciona en ambos thread models.
Elimina vendor/httplib.h (10K lineas). nlohmann/json se mantiene.

main.cpp: doble clic sin argumentos intenta la API en localhost:8484
automaticamente. Si falla muestra pantalla de error con boton Retry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:45:30 +02:00
egutierrez ed07106cf1 merge: quick/http-api-integration — Dashboard consume sqlite_api via HTTP, fallback SQLite 2026-04-13 01:37:17 +02:00
egutierrez 3de6b05357 feat: main.cpp intenta HTTP API primero, fallback a SQLite
Nuevo flujo: por defecto conecta a sqlite_api en localhost:8484.
Si la API no responde, cae a SQLite directo. Flag --api para URL
custom. Launcher PowerShell actualizado con --api. app.md refleja
la nueva arquitectura dual HTTP/SQLite y dir_path del proyecto.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:37:09 +02:00
egutierrez 0ef3da3bf5 feat: data layer HTTP — consume sqlite_api en vez de SQLite directo
Nuevo data_http.cpp que obtiene todos los datos del registry via HTTP
POST a sqlite_api (/api/databases/registry/query). Mismas queries SQL
que el data layer SQLite pero ejecutadas remotamente. cpp-httplib como
cliente HTTP, nlohmann/json para parsear respuestas.

CMakeLists.txt actualizado: incluye data_http.cpp, vendor/ en includes,
linkea pthreads (Linux) y ws2_32 (Windows) para sockets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:37:03 +02:00
egutierrez 5c521fc6e3 chore: vendor cpp-httplib v0.18.3 y nlohmann/json v3.11.3
Librerias header-only para HTTP client y JSON parsing.
cpp-httplib usa sockets nativos (sin OpenSSL).
Necesarias para consumir sqlite_api desde el dashboard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:36:57 +02:00
egutierrez ea7e3c5a69 merge: quick/dashboard-improvements — Layout responsivo, KPIs extra, fix UNC paths Windows 2026-04-13 01:31:46 +02:00
egutierrez 615fd03e51 fix: printf format, paths WSL actualizados y repo_url en app.md
Corrige fprintf que usaba %s con std::string sin .c_str().
Actualiza path WSL en el launcher PowerShell a Ubuntu-22.04.
Añade repo_url en app.md apuntando al repo en Gitea.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:31:41 +02:00
egutierrez 80b0e827b6 feat: layout responsivo y KPIs adicionales en dashboard
Grid de charts pasa de 2 a 4 columnas con altura dinamica (35% del
espacio disponible). Se eliminan los paneles Activity y Extras,
moviendo Unit Tests y Proposals a la fila de KPIs (ahora 8 cards).
Se reduce spacing entre secciones para aprovechar mejor la pantalla.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:31:37 +02:00
egutierrez 423fb04b40 fix: soporte Windows UNC paths y busy timeout en SQLite
En Windows, si el path a registry.db es UNC (\\wsl.localhost\...),
SQLite no puede hacer locking correctamente. Se copia el DB a un
archivo temporal local antes de abrirlo. Se añade busy_timeout de
3 segundos para evitar SQLITE_BUSY en lecturas concurrentes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:31:33 +02:00
Egutierrez 303b6d476d Initial commit: registry_dashboard — Dashboard ImGui para fn_registry 2026-04-08 00:42:29 +02:00