Skip to content

[Rust] Edit with audit logging in fd5 crate #169

@gerchowl

Description

@gerchowl

Parent: #161

Goal

Extend edit.rs to append an audit entry on every attribute edit.

Spec

  • EditPlan gains: message: Option<String>, author: Author
  • EditResult gains: audit_entry: AuditEntry
  • EditPlan::apply() flow becomes:
    1. Read current content_hash → parent_hash
    2. Read current attribute value → old
    3. Write new attribute value
    4. Create AuditEntry
    5. Append to _fd5_audit_log
    6. Recompute content_hash
    7. Return EditResult with the entry

TDD

  • Test edit creates audit entry with correct parent_hash
  • Test edit preserves existing log entries
  • Test author from identity is recorded
  • Test message defaults to "Edit ."
  • Test content_hash covers the audit log (tampering detected)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corefd5 core libraryaudit-trailAudit trail / provenance chain featureeffort:medium1-4 hoursfeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions