feat: funciones bash audit_registry_paths y validate_registry_paths

Pipeline para auditar file_path del registry contra disco y función shell para validar paths individuales.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 03:23:47 +02:00
parent f61a4c4b18
commit e7a00e221e
4 changed files with 283 additions and 0 deletions
@@ -0,0 +1,67 @@
---
name: audit_registry_paths
kind: pipeline
lang: bash
domain: pipelines
version: "1.0.0"
purity: impure
signature: "audit_registry_paths([output_file: string]) -> void"
description: "Audita file_path de todas las functions y types en registry.db, verifica que cada ruta apunte a un archivo existente en disco, y genera un txt con las rutas rotas para que agentes puedan corregirlas."
tags: [registry, audit, validation, paths, launcher, pipeline, bash]
uses_functions:
- assert_command_exists_bash_shell
- assert_file_exists_bash_shell
- validate_registry_paths_bash_shell
- report_execution_json_bash_shell
- exit_with_status_bash_shell
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: []
tested: false
tests: []
test_file_path: ""
file_path: "bash/functions/pipelines/audit_registry_paths.sh"
---
## Ejemplo
```bash
# Con default (genera broken_paths.txt en la raiz)
./bash/functions/pipelines/audit_registry_paths.sh
# Con ruta personalizada
./bash/functions/pipelines/audit_registry_paths.sh /tmp/broken.txt
# Desde fn run (pipeline launcher)
fn run audit_registry_paths
```
## Flujo
1. `assert_command_exists` — verifica que `sqlite3` esta disponible
2. `assert_file_exists` — verifica que `registry.db` existe y reporta su tamano
3. `validate_registry_paths` (functions) — itera todas las functions, verifica cada file_path
4. `validate_registry_paths` (types) — itera todos los types, verifica cada file_path
5. Genera `broken_paths.txt` con formato legible para agentes
6. `report_execution_json` — imprime JSON de ejecucion a stdout
7. `exit_with_status` — exit code segun resultado
## Formato de salida
```
# Broken file_path entries in registry.db
# Generated: 2026-04-03T10:00:00Z
# Total: 11 broken paths
#
# Format: id | file_path (in .md) | domain | table
# ---
## Functions (11)
cdp_click_go_browser | functions/infra/cdp_click.go | browser | functions
```
## Notas
El archivo de salida es consumible por agentes: cada linea tiene el ID de la funcion/tipo y el file_path que necesita correccion. El agente puede leer el .md correspondiente, encontrar el archivo real en disco, y actualizar el campo `file_path`.