Roll back to a prior manifest — one-click oncall mitigation
manifests
Roll back to a prior manifest — one-click oncall mitigation
One-click rollback to a prior manifest version.
Closes discovery/cuj17_oncall_paged_3am/no-manifest-rollback-endpoint
(filed at improve#609, consumed improve#610). Pre-fix oncall users
had to (1) look up the previous manifest_id, (2) re-register with
that hash, (3) hope the auto-revert path inside register_manifest
catches it. That’s 3-step cognitive work at 3am. Now: one POST.
Flow:
- Load the target manifest. Org-scoped (404 if not in caller’s org).
- If target is already
status=active, return 400. - Find the current active manifest for the same agent.
- Atomically: mark current_active = ‘superseded’, target = ‘active’.
- Write an AuditLog row with action=‘manifest.rollback’, target_id= the manifest being deactivated, metadata=which manifest is now active.
- Return the now-active manifest.
Optional body: {"reason": "..."} is recorded in audit_log.metadata_json.
POST
Roll back to a prior manifest — one-click oncall mitigation