988e901066
Añade campos params y output al frontmatter YAML de las 506 funciones del registry. Cada parámetro tiene descripción semántica (qué representa, unidades, rango típico) y cada función describe qué produce su output. Permite a agentes razonar sobre cadenas de composición (ej: prices → log_return → sharpe_ratio) sin leer código.
1.1 KiB
1.1 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| assert_file_exists | function | bash | shell | 1.0.0 | impure | assert_file_exists(file_path: string) -> string | Verifica que un archivo existe en el filesystem. Imprime su tamaño en bytes a stdout. Sale con exit code 1 si el archivo no existe. |
|
false | error_go_core |
|
tamaño del archivo en bytes | false | bash/functions/shell/assert_file_exists.sh |
Ejemplo
source functions/shell/assert_file_exists.sh
size=$(assert_file_exists /home/lucas/fn_registry/registry.db)
echo "Tamaño: $size bytes"
Notas
La función se sourcea, no se ejecuta directamente. Usa stat -c%s para obtener el tamaño en bytes (compatible con GNU coreutils / Linux).
Output limpio: solo el número de bytes a stdout. Los errores van a stderr.
No usa set -e internamente — el caller controla el flujo con el exit code de retorno.