Commit Graph

12 Commits

Author SHA1 Message Date
egutierrez 625569485f feat(doctor): add fn doctor CLI + 14 functions for system management
Adds `fn doctor` read-only diagnostic command with subcommands artefacts,
services, sync, uses-functions, unused, and --json flag for agents.
Each subcommand wraps a registry function in functions/infra/.

New functions:
- artefact_doctor, services_status, pc_locations_drift,
  audit_uses_functions, find_unused_functions (Go diagnostics)
- backup_sqlite_db, rotate_backups, wait_for_http, wait_for_port,
  port_kill, tail_journal, pre_commit_hook_install (bash utilities)
- notify_telegram (Go HTTP)
- backup_all pipeline (tag launcher)

Plus prior session leftovers (scan_secrets_in_dirty, append_diary_entry,
git utilities, http_session_cookie_middleware, compile/full-git pipelines).

Fixes pc_locations_drift filepath.Join bug with absolute dir_path.
Documents fn doctor in CLAUDE.md, .claude/rules/fn_doctor.md (rule 23),
docs/architecture.md, CHANGELOG.md (2026-05-07), and diary entry.

First fn doctor uses-functions run found drift in 7/12 apps (deuda
para sincronizar app.md con imports reales).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 01:42:10 +02:00
egutierrez 80e1076d99 feat(registry): index cpp/apps/* + e2e test infrastructure
registry/indexer.go ahora escanea <lang>/apps/*/app.md ademas de apps/ y
projects/*/apps/. cpp/apps/chart_demo y cpp/apps/shaders_lab pasan a estar
en registry.db con sus manifests.

Infraestructura de tests e2e (opt-in con -DFN_BUILD_TESTS=ON):
- vendor de Dear ImGui Test Engine (personal/open-source license).
- chart_demo_tests target con tests/chart_demo_tests.cpp.
- /e2e-cpp slash command para crear y ejecutar tests e2e.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 11:51:38 +02:00
egutierrez 07341aa89f feat: jwt_generate, jwt_validate, password_hash, password_verify
Fase 2 del issue 0010 — auth core:
- jwt_generate/validate: HS256 manual con crypto/hmac + crypto/sha256
- password_hash/verify: wrappers de golang.org/x/crypto/bcrypt (cost 12 default)
- JWT rechaza alg != HS256 para mitigar ataque 'alg=none'
- hmac.Equal para comparacion constant-time de firmas
2026-04-18 17:39:00 +02:00
egutierrez 4bc6d1bced feat: tipos auth (JWTClaims, Session, OAuthConfig, OAuthTokens, Permission, Role)
Fase 1 del issue 0010 — tipos base del sistema de auth en dominio infra.
Define las estructuras que usaran jwt_*, session_*, oauth2_* y rbac_*.

Añade dep golang.org/x/crypto/bcrypt para el hashing de passwords.
2026-04-18 17:37:19 +02:00
egutierrez 3b2cd26a06 merge: issue/0011-websocket-sse — WebSocket + SSE (8 fns, 4 tipos)
# Conflicts:
#	registry.db
2026-04-18 17:33:32 +02:00
egutierrez 1675d2bb84 feat: file_validate_type y file_unique_name puras (issue 0014 fase 2) 2026-04-18 17:12:05 +02:00
egutierrez 0255207514 feat: tipos WSHub, WSClient, WSMessage, SSEEvent (issue 0011 fase 1) 2026-04-18 17:10:28 +02:00
egutierrez 29c8046d4e chore: actualizar deps Go, sources.yaml y funciones infra modificadas
Nuevas dependencias para ClickHouse, DuckDB, Postgres drivers.
Actualizar sources.yaml con funciones extraídas.
Ajustes menores en write_jupyter_launcher, write_mcp_jupyter_config y docker_run_container.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:55:55 +02:00
egutierrez 9abaefeb00 fix: stubs shell y tui usan tipos nativos en firmas en vez de Result/Option de core
Result[T] y Option[T] de core no son accesibles desde otros paquetes sin import.
Cambiado a (T, error) y (T, bool) siguiendo la regla de tipos nativos en firmas.
Añadidas dependencias bubbletea/bubbles/lipgloss al go.mod raíz para que tui compile.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:23:06 +01:00
egutierrez 94a1a81297 feat: parser de frontmatter YAML para .md de funciones y tipos
Implementa ParseFunctionMD y ParseTypeMD que extraen frontmatter YAML
de archivos .md y construyen los structs del registry. Soporta los tres
kinds (function, pipeline, component) con sus campos especificos.
Extrae automaticamente el ejemplo del body si existe seccion ## Ejemplo.

Dependencia: gopkg.in/yaml.v3

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 02:07:06 +01:00
egutierrez 11d1dea6e0 feat: schema SQLite con FTS5 y triggers de sync
Crea la base de datos del registry con:
- Tabla functions con todos los campos del schema v1.0 incluyendo component
- Tabla types con campos algebraicos
- Tablas virtuales FTS5 para busqueda full-text sobre nombre, descripcion, tags, signature y domain
- Triggers AFTER INSERT/UPDATE/DELETE para mantener FTS sincronizado
- Open con WAL mode y foreign keys habilitadas
- Drop y Purge para regeneracion del indice

Dependencia: github.com/mattn/go-sqlite3 (requiere CGO_ENABLED=1 -tags fts5)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 02:04:16 +01:00
egutierrez 2a55cd99dc chore: inicializar modulo Go y gitignore
Inicializa go mod con nombre fn-registry.
Configura .gitignore para ignorar registry.db (indice regenerable),
binario fn, artefactos de compilacion y archivos de IDE/OS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 01:59:11 +01:00