47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.8 KiB
1.8 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, params, output
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | params | output | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| vault_diff | function | go | infra | 1.0.0 | pure | func VaultDiff(prev, curr []VaultFile) VaultDiffReport | Computes the diff between two vault snapshots (slices of VaultFile). Returns Added, Removed, Changed and Unchanged counts. Pure and deterministic — no I/O. |
|
|
false |
|
true |
|
functions/infra/vault_diff_test.go | functions/infra/vault_diff.go |
|
VaultDiffReport con Added (nuevos), Removed (eliminados), Changed (mismo rel_path, sha256 distinto) y Unchanged (identicos). Todos los slices ordenados por RelPath ASC. |
Ejemplo
prev, _ := infra.VaultInventoryScan(oldPath, "my_vault_proj", "my_vault")
curr, _ := infra.VaultInventoryScan(newPath, "my_vault_proj", "my_vault")
report := infra.VaultDiff(prev, curr)
fmt.Printf("Added: %d, Removed: %d, Changed: %d, Unchanged: %d\n",
len(report.Added), len(report.Removed), len(report.Changed), report.Unchanged)
Notas
- Usa
RelPathcomo clave de identidad de archivo (no nombre, no sha256). - Dos archivos con mismo
RelPathpero diferenteSha256se consideran Changed. - Los slices del report se ordenan por
RelPathASC para salida deterministica. - Función pura: no toca disco ni BD.