Volver a la wiki

Feature: Bump de límite lint (700→2000) + auto-alert en wiki_lint_bulk

Resumen

Incremento del límite de SELECT en wiki_lint_bulk de 700 a 2000 páginas y adición de auto-alert visual cuando se alcanza el límite. Responde al footgun documentado en s90: el cron lint con limit:200 hardcoded escondía 111 orphans porque solo veía las 200 páginas más viejas en la tabla.

Integrado en commit s90 (28-05-2026) tras revisión de observabilidad y detectar falta de cobertura en corpus creciente.

Contexto: el footgun

Problema original (s90 retrospectivo):

Raíz: El límite es una heurística para evitar timeout en el SELECT pero no es transparente; el operador no sabía que existían páginas sin escanear.

Solución

A) Bump de límite

Parámetro limit en wiki_lint_bulk incrementado de 700 a 2000:

# .github/workflows/wiki-lint.yml (línea 69)
limit: 2000

Y en /opt/biblioteca-crons/wiki-lint.sh (sed in-place):

sed -i 's/"limit":700/"limit":2000/g' config.yml

Cobertura:

B) Auto-alert: flag limit_reached

Cuando allPages.length >= limit, se activa el flag y se añade una advertencia visible en el summary del log de lint:

const limitReached = allPages.length >= limit;
const limitAlert = limitReached
  ? ` ⚠ LIMIT_REACHED=${limit} (corpus puede haber crecido — subir limit en wiki-lint.yml + /opt/biblioteca-crons/wiki-lint.sh)`
  : '';

// Se incluye en summary + artifacts del log

Ejemplo de salida cuando se alcanza el límite:

{
  "scanned": 2000,
  "limit_reached": true,
  "limit_used": 2000,
  "stale": [...],
  "...": "..."
}

Con en el summary visible:

Lint bulk: 2000 pages · ... applied(...) ⚠ LIMIT_REACHED=2000 (corpus puede haber crecido — subir limit en wiki-lint.yml + /opt/biblioteca-crons/wiki-lint.sh)

Cambios

ArchivoCambioLíneas
.github/workflows/wiki-lint.ymlBump limit 700 → 200069
functions/api/mcp/handlers/wiki.ts::wikiLintBulk()Auto-alert flag + limitAlert string1484–1507
functions/api/mcp/index.tsLogging de limit_reached + limit_used en artifacts(indirecto)

Operación

El cron lint ejecuta cada noche (hora exacta TBD en infra); cuando limit_reached=true:

  1. ✅ El lint sigue ejecutándose normalmente (cubre las 2000 más viejas).
  2. 🔔 Se registra en bib_wiki_log (operation=‘lint’) con flag limit_reached: true.
  3. 👁️ Operador revisa los logs y ve la advertencia.
  4. ⬆️ Si es consistente por varias semanas, bump a 3000 (o arquitectura del SELECT).

Registros de cambios

VersiónCambioFecha
1.0Bump 700→2000 + auto-alert2026-05-28

Decisiones de diseño

Véase también

Subir