feat(agent-types): AT-7 audit log + revision restore for agent-type edits #777
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!777
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/at-7-audit-log-restore"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every write to
agent_type,agent_type_container, andagent_type_routingnow creates aconfig_revisionrow withkind∈{agent_type, agent_type_container, agent_type_routing}. A newPOST /api/agent-types/revisions/:id/restoreendpoint restores snapshots and writes an auditable revision. The global history tab surfaces the new kinds without UI changes;revKindMapupdated so restore works from the history view for new kinds.Closes #749
Test plan
GET /agent-config/revisions?kind=agent_type*returns 200Revision tracking correct on all 6 handlers (INSERT/UPDATE/DELETE × 3 tables); transactions wrap snapshot + write atomically. Restore writes prior state as the new revision with comment referencing source id — matches SC-12 pattern and all 18 unit tests pass.
Nit (non-blocking):
handleUpsertContainerandhandleUpsertRoutingwrite a revision even whensets.length === 1(no-op PUT with no recognised fields) — spurious but harmless audit entry.