# `Cairnloop.Governance.ToolActionEvent`
[🔗](https://github.com/szTheory/cairnloop/blob/main/lib/cairnloop/governance/tool_action_event.ex#L1)

Append-only audit event record for governed tool proposals.

Mirrors `ReviewTaskEvent` exactly (D-20, D-21). Every state transition on a
`ToolProposal` is recorded here alongside it in the same transaction.

## Append-Only Invariant

This schema is **insert-only**. There is no `update/1` or `delete/1` function.
The `updated_at: false` timestamp option enforces this at the schema level (Pitfall 4).
App discipline (no update/delete API) enforces it at the application level.

Phase 16 adds execution event types (`:execution_started`, `:execution_succeeded`,
`:execution_attempt_failed`, `:execution_failed`) to `@event_type_values` without
changing this schema's structure (D16-08).

# `changeset`

Changeset for inserting an append-only `ToolActionEvent`.

Required fields: `tool_proposal_id`, `event_type`, `to_status`, `actor_id`.
`from_status` is optional — it is nil for `proposal_created` events (first event has
no prior status). Nil `metadata` is coerced to `%{}`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
