docs: cerrar issue 0031 — expand file tools

Mover issue a completed/ y actualizar indice en README.md.
Todas las tareas del issue implementadas y testeadas (44 tests).
This commit is contained in:
2026-04-08 23:04:45 +00:00
parent 3adaeb0f8c
commit d31162dde8
2 changed files with 33 additions and 0 deletions
+1
View File
@@ -36,3 +36,4 @@ afectados y notas de implementacion.
| 24b | Security loader: shell/security/ | [0024b-security-loader.md](completed/0024b-security-loader.md) | completado |
| 24c | Security integration + cleanup | [0024c-security-integration.md](completed/0024c-security-integration.md) | completado |
| 25 | Catálogo cron + scaffolder | [0025-cron-scaffolder.md](completed/0025-cron-scaffolder.md) | completado |
| 31 | Expandir file tools (write, list, append, delete) | [0031-expand-file-tools.md](completed/0031-expand-file-tools.md) | completado |
@@ -0,0 +1,32 @@
# 0031 — Expandir tools/file/ con write, list, append, delete
## Objetivo
Ampliar el paquete `tools/file/` con operaciones de escritura, listado, append y borrado. Mantener el patron deny-by-default, validacion de symlinks, y respetar el flag `read_only` del config.
## Estado: completado
Implementado en rama `issue/0031-expand-file-tools`.
### Archivos creados/modificados
- `tools/file/validate.go` — NEW: validatePath(), validateWritePath(), resolveReal() extraidos de file.go
- `tools/file/write.go` — NEW: write_file tool (crea/sobreescribe, MkdirAll, limite 1MB)
- `tools/file/list.go` — NEW: list_directory tool (plano/recursivo, limite 500 entries)
- `tools/file/append.go` — NEW: append_file tool (append o crear, limite 10MB total)
- `tools/file/delete.go` — NEW: delete_file tool (solo archivos, nunca directorios)
- `tools/file/file.go` — refactored: removidas funciones movidas a validate.go
- `tools/file/write_test.go` — NEW: 11 tests
- `tools/file/list_test.go` — NEW: 9 tests
- `tools/file/append_test.go` — NEW: 11 tests
- `tools/file/delete_test.go` — NEW: 9 tests
- `agents/runtime.go` — registro condicional de las 4 tools nuevas
### Seguridad
- Deny-by-default en todas las tools (AllowedPaths vacio = todo denegado)
- ReadOnly gate: write/append/delete solo se registran si ReadOnly == false
- Path traversal protegido via resolveReal() + prefix validation
- Symlink escape protegido via EvalSymlinks
- Solo archivos en delete (nunca directorios)
- Limites de tamano: 1MB write, 10MB append total, 64KB read output, 500 entries list