AT-7: Audit log + revision restore for agent type edits #749

Closed
opened 2026-05-02 17:26:09 +00:00 by claude-desktop · 0 comments
Collaborator

As an operator, I want every write to agent_type* tables to create a config_revision row matching the SC-12 contract, and I want the existing history tab to surface the new kinds, so that botched agent-type overrides are debuggable + restorable from the dashboard without manual SQL.

Acceptance criteria

Audit log

  • Every INSERT / UPDATE / DELETE on agent_type, agent_type_container, agent_type_routing writes to config_revision with kind{ agent_type, agent_type_container, agent_type_routing }.
  • Each revision carries created_by, created_at, optional comment, and a snapshot of the row body.

History UI

  • The history tab + per-artifact revision viewer surface the new kinds without code changes (the existing UI is kind-agnostic).
  • Restore writes a new revision (so restores are auditable) whose body equals the targeted revision's snapshot.

Tests

  • Unit: restore writes a new revision pointing at the source revision's id.
  • Smoke: open history → restore → verify the editor reflects the restored body.

Out of scope

  • Tracking dispatch-side resolver hits (already covered by task_history).

References

  • Spec: specs/config-to-db.md § Story AT-7.
  • Precedent: SC-12.
  • Blocked by: AT-1, AT-6.
As an operator, I want every write to `agent_type*` tables to create a `config_revision` row matching the SC-12 contract, and I want the existing history tab to surface the new kinds, so that botched agent-type overrides are debuggable + restorable from the dashboard without manual SQL. ## Acceptance criteria ### Audit log - [ ] Every `INSERT` / `UPDATE` / `DELETE` on `agent_type`, `agent_type_container`, `agent_type_routing` writes to `config_revision` with `kind` ∈ `{ agent_type, agent_type_container, agent_type_routing }`. - [ ] Each revision carries `created_by`, `created_at`, optional `comment`, and a snapshot of the row body. ### History UI - [ ] The history tab + per-artifact revision viewer surface the new kinds without code changes (the existing UI is kind-agnostic). - [ ] Restore writes a new revision (so restores are auditable) whose body equals the targeted revision's snapshot. ### Tests - [ ] Unit: restore writes a new revision pointing at the source revision's id. - [ ] Smoke: open history → restore → verify the editor reflects the restored body. ## Out of scope - Tracking dispatch-side resolver hits (already covered by `task_history`). ## References - Spec: `specs/config-to-db.md` § Story AT-7. - Precedent: SC-12. - Blocked by: AT-1, AT-6.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#749
No description provided.