# Propuesta e2e_checks para apps/dag_engine # Generada por fn-recopilador en modo design-e2e (2026-05-19) # # INSTRUCCIONES: copiar el bloque e2e_checks al frontmatter de apps/dag_engine/app.md # tras revision humana. NO modificar app.md automaticamente. # # Stack detectado: # lang=go, framework=net/http + vite + react + mantine # CGO_ENABLED=1, build tags: fts5 # frontend/ con pnpm + vite (dist/ existente pero incompleto — pnpm build roto) # store/migrations/ con 2 migraciones SQL (001_init, 002_step_function_id) # tag 'service' → puerto 8090 (declarado en service.port) # operations.db NO presente (usa dag_engine.db propia, no el bucle reactivo) # subcmds disponibles: run, list, status, validate, server, help # NO hay archivos *_test.go (ni en raiz ni en store/) → check tests OMITIDO # # NOTAS IMPORTANTES: # - El binario productivo se llama "dag-engine" (con guion) segun README. # El app.md no declara entry_point como binario, solo "main.go". # Los checks usan "./dag_engine" (guion bajo) consistente con el cmd de build. # Si el nombre cambia, ajustar todos los cmd que lo referencian. # - pnpm build esta roto (Mantine API drift en StepTimeline.tsx + main.tsx). # El check build_frontend se marca severity: warning para no bloquear el gate. # - Las migraciones se aplican automaticamente en store.Open(), que es llamado # por cmdList. El check migrations_apply usa ese mecanismo (no hay --migrate-only). # - No se arranca el scheduler ni se ejecutan jobs reales. # - Port e2e: 8195 (8090 + 105 para no colisionar con prod). e2e_checks: # ----------------------------------------------------------------------- # check: build_frontend # Por que: el binario embebe frontend/dist via //go:embed all:frontend/dist. # Sin dist compilado, la UI sirve solo el index.html de placeholder. # Se marca warning porque el build esta roto actualmente (API drift # de Mantine en StepTimeline.tsx:49 y main.tsx:1 — ver fix notes # 2026-05-16 en app.md). Arreglar antes de promover a critical. # ----------------------------------------------------------------------- - id: build_frontend cmd: "cd $HOME/fn_registry/apps/dag_engine/frontend && pnpm install --frozen-lockfile && pnpm build" timeout_s: 180 severity: warning # NOTA: severity warning porque pnpm build falla por API drift conocido. # Cuando se arregle StepTimeline.tsx (Collapse API) y main.tsx (CSS import), # cambiar a severity: critical. # ----------------------------------------------------------------------- # check: build_backend # Por que: valida que el codigo Go compila con CGO + fts5. Es el gate mas # basico — si no compila, ningun otro check tiene sentido. # El binario se escribe en /tmp para no contaminar el directorio # de trabajo (idempotente, no afecta al binario productivo). # ----------------------------------------------------------------------- - id: build_backend cmd: "cd $HOME/fn_registry/apps/dag_engine && CGO_ENABLED=1 go build -tags fts5 -o /tmp/dag_engine_e2e_bin ." timeout_s: 120 # ----------------------------------------------------------------------- # check: migrations_apply # Por que: verifica que las 2 migraciones SQL (001_init, 002_step_function_id) # se aplican correctamente sobre una DB nueva en /tmp. El subcmd # `list` llama store.Open() que dispara applyMigrations() antes de # retornar — si las migraciones fallan, el proceso sale con error. # Idempotente: cada corrida del check crea una DB nueva en /tmp. # NO hay flag --migrate-only en el binario actual. # ----------------------------------------------------------------------- - id: migrations_apply cmd: "rm -f /tmp/dag_engine_e2e.db /tmp/dag_engine_e2e.db-shm /tmp/dag_engine_e2e.db-wal && /tmp/dag_engine_e2e_bin list --db /tmp/dag_engine_e2e.db $HOME/fn_registry/apps/dag_engine/dags_migrated/" timeout_s: 15 expect_exit: 0 # NOTA: depende de check build_backend (usa /tmp/dag_engine_e2e_bin). # Si fn-analizador corre checks en orden declarado, build_backend # debe preceder a migrations_apply. Orden actual es correcto. # ----------------------------------------------------------------------- # check: dag_parse_fn_backup # Por que: valida que el subcmd `validate` parsea y hace topo_sort de un # DAG real sin ejecutarlo. fn_backup.yaml es el DAG mas sencillo # (pipeline de backup). Exit 0 = Validation: PASS. # Exit 1 = errores de validacion (dependencias ciclicas, steps # mal referenciados, etc.). # ----------------------------------------------------------------------- - id: dag_parse_fn_backup cmd: "/tmp/dag_engine_e2e_bin validate $HOME/fn_registry/apps/dag_engine/dags_migrated/fn_backup.yaml" timeout_s: 10 expect_exit: 0 expect_stdout_contains: "Validation: PASS" # NOTA: depende de check build_backend (usa /tmp/dag_engine_e2e_bin). # ----------------------------------------------------------------------- # check: dag_parse_daily_audit # Por que: valida el DAG mas complejo (daily-registry-audit.yaml tiene # multiples steps con dependencies cross-step). Smoke test del # topo_sort sobre un grafo no trivial. # ----------------------------------------------------------------------- - id: dag_parse_daily_audit cmd: "/tmp/dag_engine_e2e_bin validate $HOME/fn_registry/apps/dag_engine/dags_migrated/daily-registry-audit.yaml" timeout_s: 10 expect_exit: 0 expect_stdout_contains: "Validation: PASS" # NOTA: depende de check build_backend (usa /tmp/dag_engine_e2e_bin). # ----------------------------------------------------------------------- # check: smoke_server # Por que: tag 'service' declarado → gate de salud obligatorio. # Arranca el servidor en puerto efimero 8195 (prod=8090 + 105) # con DB en /tmp para no tocar dag_engine.db productivo. # Sin --scheduler para no disparar jobs cron durante el check. # health endpoint /api/dags declarado en service.health_endpoint. # ----------------------------------------------------------------------- - id: smoke_server cmd: "/tmp/dag_engine_e2e_bin server --port 8195 --db /tmp/dag_engine_e2e.db --dags-dir $HOME/fn_registry/apps/dag_engine/dags_migrated/ &" health: "http://127.0.0.1:8195/api/dags" timeout_s: 10 # NOTA: sin flag --scheduler para no disparar jobs reales. # fn-analizador debe matar el grupo de procesos al terminar la suite. # La DB /tmp/dag_engine_e2e.db ya existe (creada por migrations_apply). # ----------------------------------------------------------------------- # check: ops_audit # OMITIDO — dag_engine NO tiene operations.db. # Usa dag_engine.db propia (tablas dag_runs + dag_step_results). # No participa del bucle reactivo via fn_operations. # Si en el futuro se añade operations.db: anadir check con ref: fn-recopilador. # ----------------------------------------------------------------------- # - id: ops_audit # ref: "fn-recopilador:apps/dag_engine" # OMITIDO: sin operations.db # ----------------------------------------------------------------------- # check: tests # OMITIDO — no existen archivos *_test.go en apps/dag_engine/ ni en store/. # Cuando se añadan tests: descomentar y ajustar. # ----------------------------------------------------------------------- # - id: tests # cmd: "cd $HOME/fn_registry/apps/dag_engine && go test -tags fts5 -count=1 ./..." # timeout_s: 120 # OMITIDO: sin *_test.go