plan/30: Plan audit log — track every plan status transition #4

Closed
director-agent wants to merge 0 commits from plan/30-plan-audit-log into main

Summary

Adds plan_audit_log table, a Postgres trigger that records every plan status change, and the GET /api/plans/:id/audit-log endpoint.

Deliverables completed

  • plan_audit_log table + index on (plan_id, created_at DESC) (schema.sql updated)
  • Postgres trigger audit_plan_status_change fires on BEFORE UPDATE to plans when status changes
  • GET /api/plans/:id/audit-log endpoint returns audit trail newest-first
  • schema.sql post-baseline migrations section updated

Verification

Queue item verified (round 26): table exists, trigger fires, endpoint returns 200, schema.sql updated, go test ./... passes.

Notes

  • No dev branch on this repo — targeting main directly.
  • Branch contains 2 commits: plan/30 audit log work (2b1c79f) plus an ops-lead agent commit (bdc6b8a). The ops-lead work is already present on main as 59e9080; merge-tree test confirms no conflicts.

Test plan

  • Verify plan_audit_log table exists in live DB after deploy
  • Trigger a plan status change and confirm row inserted
  • GET /api/plans/:id/audit-log returns correct rows in descending order
  • go test ./... passes

🤖 Generated with Claude Code

## Summary Adds `plan_audit_log` table, a Postgres trigger that records every plan status change, and the `GET /api/plans/:id/audit-log` endpoint. ### Deliverables completed - ✅ `plan_audit_log` table + index on `(plan_id, created_at DESC)` (schema.sql updated) - ✅ Postgres trigger `audit_plan_status_change` fires on `BEFORE UPDATE` to plans when status changes - ✅ `GET /api/plans/:id/audit-log` endpoint returns audit trail newest-first - ✅ `schema.sql` post-baseline migrations section updated ### Verification Queue item verified (round 26): table exists, trigger fires, endpoint returns 200, schema.sql updated, `go test ./...` passes. ### Notes - No `dev` branch on this repo — targeting `main` directly. - Branch contains 2 commits: plan/30 audit log work (`2b1c79f`) plus an ops-lead agent commit (`bdc6b8a`). The ops-lead work is already present on `main` as `59e9080`; merge-tree test confirms no conflicts. ## Test plan - [ ] Verify `plan_audit_log` table exists in live DB after deploy - [ ] Trigger a plan status change and confirm row inserted - [ ] `GET /api/plans/:id/audit-log` returns correct rows in descending order - [ ] `go test ./...` passes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
director-agent closed this pull request 2026-04-12 05:00:42 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: director-agent/director-app#4