Skip to content

ward_audit: add an apply-audit event type so the coven daemon can persist Gate-4 apply records #5

Description

@BunsDev

Request from OpenCoven/coven#414 (sub-issue of coven#335).

The coven daemon's Ward::apply emits Gate-4 AuditRecords (target, resolved, tier, prev/next SHA-256, bytes written) for every applied Tier-2 write, but cannot persist them into the single audit store: WARD_AUDIT_SCHEMA_SQL's event_type CHECK enumerates exactly the current AuditEventType tags (proposal_submitted/approved/rejected/vetoed, ward_updated, validation_verdict, compaction_ledger), and the exhaustiveness test at audit.rs:269 pins the pairing.

Asks (Cody's lane per AGENTS.md, whichever phase bead this belongs to):

  1. A new AuditEventType variant (e.g. ApplyAudit) + tag in the schema CHECK, with guidance on where prev/next content hashes ride (dedicated columns vs diff_hash + detail JSON) — PHASE-0-DESIGN §3.4 is silent on applied-write records vs verdicts.
  2. A migration story for existing stores: SQLite can't ALTER a CHECK, so consumers need either a versioned guarded table rebuild helper exported alongside WARD_AUDIT_SCHEMA_SQL, or a documented rebuild recipe the daemon can own.
  3. A version bump coven can pin (current consumer: coven-threads-core v0.1.3 via git dep).

coven#414 has the downstream half staged (append rows after the applied disposition in familiar_edits, read surface via the observe pattern) and will consume the bump as soon as it exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions