You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Viewer /api/restore: require a reason, append an audit event, default to merge not force #221
agent:readyHuman-approved for autonomous work by ocsi-fixerbugSomething isn't workingseverity:mediumReal but narrow: robustness, hygiene, or gated behind multiple preconditionsspec:incompleteNot executable: missing repro or no measurable acceptance criterion. Author: add it, or close.store-securityStore boundary: path containment, exposure docs, redaction, trust tiers, durable rejection
src/viewer/server.ts:330-349 reaches the destructive restore primitive with no reason and no audit record, and const mode = body.mode === "merge" ? "merge" : "force" (line 343) makes an absent or misspelled mode select the clobbering path. The viewer enforces requireReason() for delete, block, quarantine and unreject (src/viewer/mutate.ts:49-51); restore requires nothing. The store's own memory_undo records the operation; the HTTP route to the same primitive asks for nothing.
Fix direction
Require a non-empty reason, append one audit event per restore, and invert the default so force must be requested by name. The zod omission itself is accepted (the restore contract is owned by src/undo.ts).
Adjacent issues: #207 (restore drops quarantine/provenance metadata) and #214 (force-undo vs tombstoned values) cover different defects on the same primitive.
Triage 2026-11-03: marked agent:ready. Spec reviewed against main 3d34a63: finding stands — /api/restore is still the one route deliberately outside schema-parse (server.ts:261) with no reason and no audit, and the mode ternary still defaults to the clobbering path. Fix direction states the three criteria (require non-empty reason, one audit event per restore, force only by name). RED/GREEN: a POST without reason / without mode:"force" succeeds on main today (RED); after the fix it must 400 and land the audit line (GREEN). No overlap with open PR #269.
osi-spec-hash: 8ee2966746e14404 2026-11-03T17:21:42Z - acceptance criteria frozen at this text. A later edit to the body changes this hash, and the reviewer will withhold approval until a maintainer replies spec ok.
agent:readyHuman-approved for autonomous work by ocsi-fixerbugSomething isn't workingseverity:mediumReal but narrow: robustness, hygiene, or gated behind multiple preconditionsspec:incompleteNot executable: missing repro or no measurable acceptance criterion. Author: add it, or close.store-securityStore boundary: path containment, exposure docs, redaction, trust tiers, durable rejection
Activity
abogartz commentedon Nov 3, 2026
Triage 2026-11-03: marked
agent:ready. Spec reviewed against main3d34a63: finding stands —/api/restoreis still the one route deliberately outside schema-parse (server.ts:261) with no reason and no audit, and themodeternary still defaults to the clobbering path. Fix direction states the three criteria (require non-empty reason, one audit event per restore,forceonly by name). RED/GREEN: a POST without reason / withoutmode:"force"succeeds on main today (RED); after the fix it must 400 and land the audit line (GREEN). No overlap with open PR #269.ocsi-triager commentedon Nov 3, 2026
osi-spec-hash: 8ee2966746e14404 2026-11-03T17:21:42Z - acceptance criteria frozen at this text. A later edit to the body changes this hash, and the reviewer will withhold approval until a maintainer replies spec ok.