Skip to content

release: v0.3.0 — Fase B, capa REST completa - #111

Merged
g-garciac2022 merged 13 commits into
mainfrom
dev
Aug 15, 2026
Merged

release: v0.3.0 — Fase B, capa REST completa#111
g-garciac2022 merged 13 commits into
mainfrom
dev

Conversation

@g-garciac2022

Copy link
Copy Markdown
Collaborator

v0.3.0 — Fase B: la capa REST completa

Release de dev a main. Recoge todo lo construido desde v0.2.0, que cerró la
Fase A: 80 ficheros, 8.593 líneas.

Qué entra

PR Qué
#83 · #84 Plan de trabajo, prototipo de UI y spike del bucle del agente
#85 Contrato REST y orquestación de POST /analyze
#88 App FastAPI con /analyze, CORS y OpenAPI
#94 Adopción de ruff como linter y formateador
#95 Transporte MCP configurable (stdio | streamable-http)
#96 Reescritura de R5: el catálogo no es un lanzador
#98 Registro automático de integraciones
#99 GET /tools por handshake MCP
#101 POST /tools/{name}/execute y contrato de retorno estructurado
#104 Historial persistente y GET /history con paginación
#105 Filtros y retención del historial
#110 Estructura del repositorio y validación E2E

Requisitos que cierra

R4 (API REST), R5 (catálogo y transparencia) y R9 (persistencia e
historial). Con ellos queda cerrado el hito H2.

…83)

* docs: plan de trabajo con hitos hasta la entrega (feb 2027)

* docs: prototipo de UI (5 pantallas) y requisito del agente conversacional (R13)

* docs: prototipo de UI (5 pantallas), decisiones de diseño y cambios de requisitos (#73)
* feat(api): add REST API contract and models for clickbait analysis

feat(nlp): update model cards with dimensions for signal classification

test(nlp): enhance model cards tests to validate dimensions and signal registration

* feat(api): implement orchestration for POST /analyze endpoint

* feat(api): enhance headline validation to prevent empty strings in AnalyzeRequest

* feat(ci): update branch filter to include dev for pull requests and pushes

* feat(tests): add comprehensive tests for /analyze orchestration with mock dependencies
* feat(requirements): add fastapi and uvicorn to requirements

* docs: registrar H1 y aclarar la organización del trabajo

Sección de H1 en Fase B: contrato de POST /analyze — los tres principios del
esquema, por qué el veredicto va por dimensiones y no por mayoría, el tono como
señal que se muestra pero no vota, y el desajuste del campo signal que destapó
el diseño. Incluye los límites: analyze() no es alcanzable por HTTP y los tests
usan dobles.

Convenciones: el README decía 'minor = épica' mientras la tabla de hitos
asignaba v0.3 a H2, llevando dos ejes de agrupación a la vez. En Fase B el hito
sustituye a la épica —ya trae dominio y fecha— y las épicas quedan como
histórico de Fase A. La tabla de ramas documentaba 'feature/' cuando la práctica
es 'feat/<nº issue>-<slug>

* feat(api): app FastAPI con /analyze y /health

App REST como segundo entry point, independiente del servidor MCP: se arranca
con `uvicorn backend.api.app:app`. Ambos son fachadas sobre el mismo núcleo, no
una encima de la otra.

- POST /analyze delega en la orquestación ya existente. Devuelve 200 aunque
  alguna señal falle; cada una lleva su propio status.
- GET /health reutiliza el mismo sondeo que la tool MCP: check_health sale de
  register() para que las dos fachadas no puedan divergir.
- CORS con orígenes por setting. allow_credentials en False: autoriza cookies y
  autenticación HTTP, que aquí no existen, y no es lo que necesitan los tokens
  Bearer.
- configure_logging en el lifespan, no al importar, para que los tests no
  hereden la configuración global de structlog.

12 tests de la capa HTTP: validación, delegación, CORS y OpenAPI. No repiten la
orquestación, que ya cubre test_analyze.py.

Validado en vivo: análisis real por HTTP en 0,4-0,7 s en caliente. Discrimina —
"Federal Reserve Holds Interest Rates Steady" sale factual con las cuatro
señales de acuerdo; "17 Things Nobody Tells You About Moving Abroad" sale
ambiguo porque el zero-shot lo lee como factual y léxico y lineal lo marcan.

* feat(docs): update requirements and README with deployment architecture and API behavior
* chore: add Ruff configuration file for linter and formatter and fixed bugs found by it.

* chore: add unused numpy import for testing Ruff checks

* chore: remove unused numpy import for Ruff checks
* feat(config): make MCP server transport configurable with default to stdio

* feat(tests): automate HTTP server verification for MCP transport
* feat(integrations): implement automatic discovery and registration of integrations

* ruff check
* feat(metadata): add tool metadata handling for categories and origins

* feat(api): implement GET /tools endpoint for dynamic tool catalog retrieval
* feat(core): relaunch exceptions in log_tool_invocation to ensure proper error handling

* feat(mcp): contrato de retorno estructurado en las tools

* refactor(api): refactor MCP session handling into a dedicated module

* fix(api): correct import and type hint for async session handling

* feat(api): add execute tool endpoint with argument validation and error handling

* docs: registrar #100 en el README

* feat(spike): add Spike #82 for revalidating selection with real descriptions
…#104)

* feat(history): implement persistent history storage for analysis and tool executions

* feat(tests): implement history tests.

* feat(history): refine SQL query to specify columns in history retrieval

feat(bench): add benchmarks for database connection and write performance

feat(bench): measure impact of connection management on SQLite performance
* feat(api): implement history retention policies and indexing for performance

* feat(api): add filtering options for history retrieval and include retention policy in response

* Refine TFG requirements, enhance Ruff configuration, and add performance benchmarks

- Updated requirements in `docs/requisitos.md` to clarify filtering criteria for execution history in the Backend API.
- Enhanced `ruff.toml` to include detection of blocking calls within async functions and added comments on limitations.
- Introduced new benchmarking scripts in `spikes/bench_poda_convergencia.py` and `spikes/bench_poda_coste_e_indice.py` to evaluate pruning strategies and their costs.
- Created `spikes/bench_poda_limite_fijo_y_count.py` to address design flaws in previous benchmarks and assess the impact of fixed limits on pruning performance.
- Added `spikes/check_fechas_lexicograficas.py` to verify the correctness of date comparisons in SQLite, ensuring lexicographic order aligns with chronological order.
@g-garciac2022
g-garciac2022 merged commit 4c2d8db into main Aug 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant