feat(web): SC-12 audit log surface + revision restore #650
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!650
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/634"
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?
Cross-cutting revision history endpoint + updated HistoryTab with global view, scope filter, and diff-vs-now fix.
Test plan
handleAgentConfigAllRevisionsunit tests cover kind/scope/comment/pagination filters and name storagerenderForInstancepersists tosecret_access_logand surfaces via HTTP handlerCloses #634
CI green. Three issues:
behavior —
apps/web/src/features/agent-config/history-tab.tsxline 323:latestRevisionBody = revisions[0]?.body_snapshotuses the first row of the global query (most-recently-changed artifact across all kinds). When a user clicks "View diff vs. now" on any revision in global view, it diffs that revision against a snapshot from a random other artifact. Fix: gate the "View diff vs. now" button withcanRestore(i.e. only show it in per-artifact mode whererevisions[0]is reliably the current state of the same artifact), or fetch the current artifact body on demand.missing AC — Issue #634 AC requires "Filter row: ... date range." The backend supports
from_ts/to_tsbut no date range inputs are wired in the UI. The filter row needs from/to date pickers.behavior —
apps/server/src/http/handlers/agent-config-routes.tsline 1305: theqclause only searchescomment LIKE ?. The frontend label/placeholder says "Comment / name search" / "Filter by comment or name…" but name is not searched. Either addOR name LIKE ?to the clause or correct the label to "Comment search".CI green. Three issues:
behavior —
apps/web/src/features/agent-config/history-tab.tsxline 323:latestRevisionBody = revisions[0]?.body_snapshotuses the first row of the global query (most-recently-changed artifact across all kinds). When a user clicks "View diff vs. now" on any revision in global view, it diffs that revision against a snapshot from a random other artifact. Fix: gate "View diff vs. now" to per-artifact mode only (add anisPerArtifactguard alongsidecanRestore), or fetch the current artifact body on demand.missing AC — Issue #634 AC requires "Filter row: ... date range." The backend supports
from_ts/to_tsbut no date range inputs exist in the UI.behavior —
apps/server/src/http/handlers/agent-config-routes.tsline 1305:qonly searches thecommentcolumn. The frontend label says "Comment / name search" but name is not searched. Either addOR name LIKE ?or correct the label to "Comment search".Addressed all three:
canDiff={isPerArtifact}onRevisionRow/RevisionActionMenu; the menu item is hidden in global view.<input type="date">pickers to the filter row (hidden in per-artifact mode), wired tofromTs/toTsin the global query.(comment LIKE ? OR name LIKE ?)inhandleAgentConfigAllRevisions.All three addressed:
canDiff={isPerArtifact}, so it only appears in per-artifact mode whererevisions[0]reliably reflects the current state of the same artifact.fromTs/toTsinfetchAllAgentConfigRevisions. Inputs carrymax/minconstraints to prevent invalid ranges.qclause changed to(comment LIKE ? OR name LIKE ?)so artifact names are searched alongside comments.All three prior findings addressed.
canDiff={isPerArtifact}correctly gates diff-vs-now to per-artifact mode; date range inputs present; search coverscomment OR name. CI green.