Commit Graph

36 Commits

Author SHA1 Message Date
egutierrez 0ac5a6c78b merge: issue/0019-structured-logging — slog-based structured logging (7 fns, 3 tipos)
# Conflicts:
#	registry.db
2026-04-18 17:33:18 +02:00
egutierrez 1860cf2bc6 feat: tipos Logger, LogLevel y LogEntry para structured logging (infra)
Tipos base para las funciones de structured logging sobre log/slog:
- LogLevel: suma enum Debug/Info/Warn/Error
- Logger: wrapper producto con nivel, output, formato y fields contextuales
- LogEntry: modelo canonico JSON para tests y pipelines de logs

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 17:14:19 +02:00
egutierrez 036c0a8d63 feat(infra): rate limiter token-bucket in-memory + tipos y core funcs
Implementa fase 1 del issue 0016:
- Tipos RateLimiter, RateLimitConfig y RateLimitResult en types/infra/
- rate_limiter_new: constructor con validacion rate/burst > 0
- rate_limiter_check: evalua token bucket por key, calcula Allowed/Remaining/ResetAt/RetryAfter
- rate_limit_headers (pure): construye headers IETF X-RateLimit-* y Retry-After
- rate_limiter_cleanup: goroutine GC de entries inactivas con stop idempotente

Sin dependencias externas (no Redis). sync.Mutex + map. Algoritmo token bucket
estandar con recarga lineal proporcional al tiempo transcurrido.
2026-04-18 17:11:22 +02:00
egutierrez 3304084121 merge: issue/0023-testing-utils — Go testing utilities
# Conflicts:
#	registry.db
2026-04-13 02:06:03 +02:00
egutierrez 32be754b60 merge: issue/0018-config-env — Config & env management
# Conflicts:
#	registry.db
2026-04-13 02:05:47 +02:00
egutierrez 9da8a698b9 merge: issue/0015-db-migrations — SQL migration system
# Conflicts:
#	registry.db
2026-04-13 02:05:31 +02:00
egutierrez f433d0097b merge: issue/0013-background-jobs — SQLite job queue
# Conflicts:
#	registry.db
2026-04-13 02:05:20 +02:00
egutierrez 7404a9a977 merge: issue/0012-email-smtp — Email SMTP functions 2026-04-13 02:05:03 +02:00
egutierrez c3b007a4e7 feat(infra): tipos ConfigError y ConfigValidation + funciones puras Go (validate, merge, dump)
- ConfigError y ConfigValidation como tipos producto con sus .md en types/infra/
- config_validate: validacion con tags required/format/min/max/oneof via reflection
- config_merge: merge no-mutante de map[string]string con precedencia de override
- config_dump: serializacion de structs a map con mascara *** para campos secret
- 17 tests unitarios, todos PASS

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 02:01:43 +02:00
egutierrez ec36278c7b feat: tipos Migration/MigrationStatus y funciones puras migration_parse + migration_validate
Fase 1 del issue 0015. Tipos Go en functions/infra/migration.go con metadata en
types/infra/. Funciones puras: MigrationParse (parsea filename NNN_name.sql +
bloques -- +up/-- +down) y MigrationValidate (verifica secuencia, huecos,
duplicados, bloques vacios). 16 tests, todos pasan.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 02:01:34 +02:00
egutierrez ef3ae2aae9 feat: tipos y funciones email SMTP en Go (infra)
Tipos: EmailAttachment, EmailMessage, SMTPConfig.
Puras: email_build_html, email_build_text, email_with_attachment, email_template_render.
Impuras: smtp_connect (TLS/STARTTLS/plain), smtp_send (MIME multipart con adjuntos).
Solo stdlib: net/smtp, crypto/tls, text/template, mime/multipart.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 02:01:13 +02:00
egutierrez b5a867ca5a feat: cola de jobs asincrona basada en SQLite (issue 0013)
Implementa el subsistema completo de background jobs para apps Go en el
dominio infra. 9 funciones + 3 tipos + 17 tests, todos pasando.

- Tipos: Job (product), JobQueue (product), JobStatus (sum) con
  JobHandler, EnqueueOption y WorkerOption usando functional options pattern
- job_queue_create: CREATE TABLE + indices + WAL mode
- job_enqueue: INSERT con UUID (github.com/google/uuid), WithPriority/WithScheduledAt/WithMaxAttempts
- job_dequeue: SELECT+UPDATE atomico en transaccion exclusiva, filtro por jobTypes
- job_complete / job_fail: transiciones de estado; fail → dead cuando attempts >= max_attempts
- job_status_summary: pura, formatea conteo de jobs por estado
- job_worker: poll loop bloqueante, context-cancelable, graceful shutdown
- job_worker_pool: N workers con golang.org/x/sync/errgroup
- job_cleanup: DELETE jobs terminales mas viejos que olderThan

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 02:00:44 +02:00
egutierrez a38ac74b86 feat: tipos TestServer y TestDB para utilidades de testing en Go core
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 02:00:11 +02:00
egutierrez 5dbd71307f feat: tipos HTTP — Middleware, Route, HTTPError
Tres tipos Go en el paquete infra para construir servidores HTTP:
- Middleware: funcion que envuelve http.Handler (patron decorator)
- Route: struct con Method, Path y Handler para registrar rutas
- HTTPError: struct con Status, Code y Message para respuestas JSON de error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 01:57:34 +02:00
egutierrez f21664e052 feat: funciones Go de deploy — systemd, VPS setup, deploy remoto
Nuevas funciones infra para deploy sin Docker: generación de units
systemd (pura), instalación/restart/status de servicios remotos via
SSH, setup inicial de VPS (crear dirs, usuario, permisos), y pipelines
de deploy completo (setup_vps_app, deploy_app_remote). Incluye tipo
DeployConfig con la configuración de deploy por app.
2026-04-12 17:29:52 +02:00
egutierrez ab7317b0c0 feat: add Go SSH config management functions and type
7 funciones Go del dominio infra para gestion programatica de ~/.ssh/config:
ssh_config_parse (parser de bloques Host/Match), ssh_config_read (lectura del
archivo), ssh_config_find (busqueda por host), ssh_config_add_entry y
ssh_config_remove_entry (CRUD), ssh_config_render (serializacion a texto),
ssh_config_write (escritura atomica). Incluye tipo SshConfigEntry (product type)
y tests unitarios del parser.
2026-04-12 13:54:43 +02:00
egutierrez 741fdcee24 feat: add process manager and execution store types (0007b, 0007c)
Process spawn/wait/kill functions for subprocess management with output
capture, timeout, and process group cleanup. DagRun and DagStepResult
types for SQLite execution persistence.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 13:05:13 +02:00
egutierrez 3136eb862f feat: add DAG core functions — parse, validate, topo sort, resolve env, cron match (0007a, 0007d)
Pure functions for parsing dagu-compatible YAML, validating DAG structure,
topological sorting with parallel levels (Kahn's algorithm), and env variable
resolution. Also adds cron_match for schedule matching.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 13:05:05 +02:00
egutierrez 817ec9fc36 refactor: reorganize OSINT types — genéricos a core, específicos en cybersecurity
Mueve tipos genéricos (Person, Organization, Location, Email, Phone, Document,
Domain, Event, SocialMedia) de cybersecurity a core. Mantiene en cybersecurity
solo los específicos de seguridad (CryptoWallet, IPAddress, Malware, Vulnerability).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 23:47:01 +02:00
egutierrez 53200cbc0d feat: funciones Go — core (cron, join_by_key, validate_struct), datascience (pivot, diff_entities), infra (http, cache, cron_ticker)
Nuevas funciones Go con tests en tres dominios:
- core: parse_cron_expr, next_cron_time, join_by_key, validate_struct_fields + tipo CronSchedule
- datascience: pivot (tabla dinámica), diff_entities (comparación de entidades)
- infra: http_get_json, http_post_json, http_download_file, cache_to_sqlite, cron_ticker

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:11:12 +02:00
egutierrez 6ba6507618 feat: tipos OSINT para dominio cybersecurity
13 tipos product (person, email, domain, IP, phone, social_media, organization, location, vulnerability, malware, crypto_wallet, document, event) para modelar entidades de inteligencia de fuentes abiertas.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 03:23:43 +02:00
egutierrez 560cbf280e feat: funciones SSH para infra — conn, check, exec, download, upload, tunnel
Conjunto completo de funciones SSH para operaciones remotas: conexión,
verificación de host, ejecución de comandos, transferencia de archivos
(upload/download) y gestión de túneles. Incluye tipo SSHConn y tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 22:03:41 +02:00
egutierrez 47235e702c feat: abstracción DB multi-engine — CRUD genérico y openers para SQLite, Postgres, ClickHouse, DuckDB
Funciones Go con interfaz unificada para operaciones DB: open, close, create_table, exec, query, insert_row, insert_batch.
Openers específicos por engine. Tipo DBConfig para configuración común.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:55:17 +02:00
egutierrez 2f119478af feat: funciones NordVPN bash y Go — CLI, contenedor Docker y parser de estado
Funciones bash para instalar, conectar, desconectar, estado, IP, ciudades, países y protocolo.
Funciones Go para gestionar contenedor NordVPN (run/start/stop) y parsear estado.
Incluye tipo NordVPNStatus y tests para el parser.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:55:08 +02:00
egutierrez 8581d3959a refactor: mover .go de tipos Go a functions/{domain}/ para compilación unificada
Los archivos .go de tipos ahora viven junto a las funciones en functions/{domain}/
(mismo paquete Go), resolviendo errores de compilación por tipos no encontrados
(Option, Pair, Result, etc.). Los .md de metadata permanecen en types/{domain}/
con file_path actualizado a functions/. Se elimina types.go duplicado de infra.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:23:00 +01:00
egutierrez 9e6bea681f feat: funciones Go para API Metabase y tipo MetabaseClient
Añade funciones Go stub para la API de Metabase en dominio infra:
auth, CRUD de cards, dashboards y users, execute_query y execute_card.
Incluye tipo MetabaseClient y helper HTTP compartido.
Todas las funciones son impuras con stubs not-implemented.
2026-03-28 20:32:24 +01:00
egutierrez 263791c229 feat: 5 tipos Docker — container, image, volume, network, compose_project
Tipos producto para modelar recursos Docker en el registry.
Usados como type_ref en las entities de fn_operations.
2026-03-28 04:38:08 +01:00
egutierrez 0402e0fdbe feat: 10 funciones infra Docker y 2 tipos — operaciones de contenedores e imagenes
Funciones Docker: list/start/stop/remove containers, list/pull/remove images,
inspect, logs, run. Tipos: ContainerInfo e ImageInfo. Pre-existentes en el
dominio infra, ahora registrados.
2026-03-28 03:58:43 +01:00
egutierrez 2f95dcc076 feat: tipo CmdResult y 6 funciones shell — ejecucion de comandos del sistema
Tipo cmd_result (product: Stdout, Stderr, ExitCode). Funciones: Run,
RunWithTimeout, RunShell, RunShellTimeout, RunPipe (impuras) y Which (pura).
Stubs que documentan devfactory/shell para el registry.
2026-03-28 03:58:25 +01:00
egutierrez fdcde03382 feat: 11 tipos TUI — componentes Bubble Tea del dominio tui
Tipos producto para ListItem, ListModel, FilteredListModel, SpinnerModel,
SpinnerWithTimeoutModel, ProgressModel, MultiProgressModel, Theme, Styles,
BaseModel y ConfirmModel. Stubs que documentan las definiciones de
devfactory/tui para el registry.
2026-03-28 03:58:08 +01:00
egutierrez 0f9a72dfc9 feat: tipos cybersecurity CIDRBlock, ThreatResult, PortResult
Tres tipos de dominio seguridad:
- CIDRBlock: rango de red parseado (product)
- ThreatResult: Clean/Suspicious/Malicious (sum)
- PortResult: Open/Closed/Filtered (sum)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 02:23:16 +01:00
egutierrez b33038e3c8 feat: tipo datascience OutlierResult (sum)
Tipo suma para clasificar datos como Normal u Outlier con z-score.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 02:23:12 +01:00
egutierrez 6242613886 feat: tipos finance OHLCV, Tick, BollingerResult, DrawdownResult
Tipos de dominio financiero:
- OHLCV: vela de mercado (product)
- Tick: evento de trade individual (product)
- BollingerResult: bandas superior/media/inferior (product)
- DrawdownResult: max drawdown con indices pico-valle (product)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 02:23:08 +01:00
egutierrez 9fb1e30e18 feat: tipos core Option[T], Pair[A,B] y Error base
Tres tipos nuevos en core:
- Option[T]: tipo suma Some/None para valores opcionales
- Pair[A,B]: tipo producto genérico para agrupar dos valores
- Error: tipo de error base referenciado como error_type por impuras

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 02:23:03 +01:00
egutierrez 8b99c470d8 feat: tipo suma Result[T] con Ok y Err
Primer tipo del registry: Result generico inspirado en Rust.
Tipo suma con dos variantes: Ok(T) y Err(error).
Metodos: IsOk, IsErr, Unwrap, UnwrapErr, UnwrapOr.
Incluye implementacion, documentacion .md y 4 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 02:10:40 +01:00
egutierrez 727c706ebf chore: estructura de directorios del registry
Crea el arbol de directorios segun la arquitectura definida:
- functions/ con subdirectorios core, finance, io, pipelines, components
- types/ con subdirectorios core, finance
- cmd/fn/ para el CLI
Cada directorio incluye .gitkeep para preservar la estructura.

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