Child of PAR-182.
Product rule: deleting issues should not be supported via the agent surface, and destructive delete must be admin-restricted everywhere.
tesks_delete_task (mcp/TaskMcpTools.java:229-241) is fully exposed and unguarded — does an irreversible hard DELETE (PostgresTaskSystem.deleteTask ~540). The TriageService DELETE action (~230-236) likewise. Remove the MCP delete tool (or hard-gate behind an explicit admin permission + disable for the Discord triage path).archived_at already exists in the schema) so deletes are recoverable; reserve true hard-delete for admins only.Acceptance: no agent/MCP path can hard-delete; any retained delete is admin-only and ideally a soft archive.
Soft-archive backend landed with the RBAC work (commit c7d4aa0): TaskSystem.archiveTask sets archived_at + logs an archived event, archived issues are excluded from list/search, and the REST DELETE /issues/{ref} now archives (gated on issue.delete) rather than hard-deleting. Hard-destroy (issue.destroy) remains owner-only and currently has no REST endpoint — a future owner-only "permanently delete" action. UI archive/restore UX is part of PAR-187.
Verified already implemented — acceptance met, no code change needed:
tesks_delete_task is gone — not defined in TaskMcpTools and not in all() (consistent with the tool no longer being exposed to clients). No agent/MCP hard-delete path.TriageService.applyDelete refuses — returns "I can't delete issues — set the status to Done/Cancelled to close it." So the assistant can't delete.DELETE /issues/{ref}: gated on ISSUE_DELETE and routes to archiveTask (recoverable soft-archive via archived_at), not hard delete.PostgresTaskSystem.deleteTask: has no production caller — it's wired to no endpoint or agent path (only exercised by tests). ISSUE_DESTROY (owner-only) is defined but no controller uses it yet, so there is currently no hard-destroy path exposed at all — even safer than the "admin-only" target.Acceptance ("no agent/MCP path can hard-delete; any retained delete is admin-only and ideally a soft archive") satisfied.
Code-complete (pending commit). Removed deletion from both agent surfaces:
tesks_delete_taskfromTaskMcpTools.all()and removed the tool method — agents can no longer hard-delete.applyDeletenow refuses ("set status to Done/Cancelled"),DELETEremoved from the prompt/JSON action set and fromisMutating.Backend
TaskSystem.deleteTaskis retained (now tenant-scoped via PAR-183) for the future admin-gated UI path — see PAR-187. UpdatedTriageApplyTest.deleteViaTriageIsRefusedAndIssueSurvivesto assert refusal + survival. Full suite green.Open decision (carried to the checkpoint): whether UI/admin delete should become a soft-archive (
archived_atexists) with hard-delete reserved for owners, vs. keeping hard-delete admin-only.