feat(0121b): audit_e2e_coverage_go_infra + fn doctor e2e-coverage subcmd

- Crea functions/infra/audit_e2e_coverage.go: AuditE2ECoverage(roots) escanea
  app.md recursivamente, detecta e2e_checks: en frontmatter, retorna
  E2ECoverageReport{total, with_checks, missing, coverage_pct}.
- Crea functions/infra/e2e_coverage_report.go: tipo E2ECoverageReport con
  JSON tags (total, with_checks, missing, coverage_pct).
- Crea types/infra/e2e_coverage_report.md: metadata del tipo para registry.
- Crea functions/infra/audit_e2e_coverage.md: documentacion self-contained
  con Ejemplo, Cuando usarla, Gotchas.
- Crea functions/infra/audit_e2e_coverage_test.go: 3 tests (empty, all-covered,
  partial) — todos pasan.
- Edita cmd/fn/doctor.go: agrega case "e2e-coverage" -> doctorE2ECoverage().
  Output text (tabla tabwriter + lista de apps missing) y --json (E2ECoverageReport).

Acceptance verificado:
  fn doctor e2e-coverage --json -> {total, with_checks, missing, coverage_pct} OK
  fn doctor e2e-coverage        -> tabla text OK
  go test ./functions/infra/... -> 3/3 PASS
  fn show audit_e2e_coverage_go_infra -> indexada OK

task_run: task_d285372493cce2e6 iter 1

Co-authored-by: fn-orquestador <noreply@fn-registry>
This commit is contained in:
2026-05-19 01:45:54 +02:00
parent 32bb2cbd25
commit 7b0b697b18
6 changed files with 368 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
---
name: e2e_coverage_report
lang: go
domain: infra
version: "1.0.0"
algebraic: product
definition: |
type E2ECoverageReport struct {
Total int `json:"total"`
WithChecks int `json:"with_checks"`
Missing []string `json:"missing"`
CoveragePct float64 `json:"coverage_pct"`
}
description: "Reporte de cobertura de e2e_checks sobre apps escaneadas. Total es el numero de app.md encontrados, WithChecks los que declaran e2e_checks:, Missing los paths relativos sin cobertura, y CoveragePct el porcentaje 0-100 con 2 decimales."
tags: [e2e, coverage, audit, doctor, report, infra]
uses_types: []
file_path: "functions/infra/e2e_coverage_report.go"
---
## Campos
- `total`: numero de archivos `app.md` encontrados en los directorios escaneados.
- `with_checks`: cuantos de esos `app.md` declaran el bloque `e2e_checks:` en su frontmatter YAML.
- `missing`: lista de paths relativos a los `app.md` que no tienen `e2e_checks:`.
- `coverage_pct`: `(with_checks / total) * 100`, redondeado a 2 decimales. `0.0` cuando `total == 0`.
## Notas
Retornado por `audit_e2e_coverage_go_infra`. Consumido por `fn doctor e2e-coverage`
y por el bucle reactivo para generar proposals `e2e_check_add` en apps sin cobertura.