Parent: #161
Goal
Add fd5 edit CLI subcommand that modifies an attribute and appends an audit log entry.
Spec
fd5 edit <file> <path>.<attr> <value> [--message MSG] [--in-place]
- Default: copy-on-write (creates
_edited.h5 copy)
--in-place: edit original file
--message/-m: commit message (optional, defaults to "Edit .")
- Reads identity from
~/.fd5/identity.toml
- Creates
AuditEntry with: parent_hash, timestamp, author, message, changes
- Appends entry to
_fd5_audit_log, then recomputes content_hash
Flow
- Open file (copy or in-place)
- Read current content_hash → parent_hash
- Read current attribute value → old
- Write new attribute value
- Append AuditEntry to
_fd5_audit_log
- Recompute and write content_hash
TDD
- Test edit creates audit entry
- Test edit preserves existing audit log entries
- Test copy-on-write creates new file
- Test in-place modifies original
- Test message defaults
- Test identity is recorded
Parent: #161
Goal
Add
fd5 editCLI subcommand that modifies an attribute and appends an audit log entry.Spec
fd5 edit <file> <path>.<attr> <value> [--message MSG] [--in-place]_edited.h5copy)--in-place: edit original file--message/-m: commit message (optional, defaults to "Edit .")~/.fd5/identity.tomlAuditEntrywith: parent_hash, timestamp, author, message, changes_fd5_audit_log, then recomputes content_hashFlow
_fd5_audit_logTDD