feat(#143): wire is_deleted end-to-end for proposal comments
Child of #141 (framework-wide CRUD/delete idiom). MusehubProposalComment already had an is_deleted column with nothing using it -- no delete endpoint, no CLI command. Mirrors the existing, working issue-comment delete pattern (musehub_issues.delete_comment / DELETE /repos/{id}/issues/{n}/comments/{id}), plus the --hard flag and --include-deleted list convention #141 calls for, neither of which existed anywhere in the codebase yet -- this is their first implementation.
Server: - musehub_proposals.delete_comment(session, comment_id, proposal_id, hard=False) -- soft-delete (sets is_deleted) by default; hard=True actually removes the row. - musehub_proposals.list_proposal_comments gained include_deleted (default False, matching existing behavior). - DELETE /repos/{repo_id}/proposals/{proposal_id}/comments/{comment_id} -- soft-delete requires owner or write/admin collaborator (_guard_repo_owner, same guard as comment creation's state-changing actions). ?hard=true requires the stricter owner-or-admin-collaborator check (_guard_admin, imported from repos.py) per #141's 'gated to owner/admin' framework-wide convention. - GET .../comments?include_deleted=true requires the same _guard_repo_owner check (403 for anyone without write access), since showing soft-deleted content is an audit-log capability, not a public read.
6 new tests: soft-delete excludes from list but not include_deleted=true; hard-delete actually removes the row (verified via direct DB query); 404 on a nonexistent comment; 403 for a non-owner/non-collaborator; and the key differential-guard test -- a write (non-admin) collaborator can soft-delete but is correctly rejected from hard-delete. 229 tests across proposals/collaborators/authz-sweep/mcp-write-tools pass with zero regressions.
CLI wiring (muse hub proposal comment delete/--include-deleted) is a companion change in the muse repo, committed separately.
Semantic Changes
11 symbols
0 comments
muse hub commit comment sha256:52ab8032b6bf2313b627a3d858051072dfd3f21f5f2d79bee113928f12510f99 --body "your comment"
No comments yet. Be the first to start the discussion.