fix(helper): require manage-thread permission to close threads - #41
fix(helper): require manage-thread permission to close threads#41SebTardif wants to merge 2 commits into
Conversation
Match /solved default member permissions and refuse close outside the configured helper parent channel. Signed-off-by: Sebastien Tardif <SebTardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 10, 2026, 11:36 PM ET / September 11, 2026, 03:36 UTC (Revision 2). ClawSweeper reviewWhat this changesAdds default moderation permissions to all helper commands, restricts both thread-close aliases to the configured helper forum, and adds three tests. Merge readiness⛔ Blocked before merge - 6 items remain The change remains useful and is absent from current main. The earlier test-location finding is resolved; Discord authorization proof and confirmation of the broader access policy remain outstanding. Priority: P2 Review scores
Verification
How this fits togetherHermit receives Discord helper commands and uses its bot permissions to post notices, archive threads, and lock them. Carbon registers command permissions with Discord, while Hermit checks the thread’s parent before closing it. flowchart TD
A[Discord member] --> B[Discord command permissions]
B --> C[Helper command dispatcher]
C --> D[Fetch target thread]
D --> E[Configured forum check]
E -->|Allowed| F[Post notice and archive and lock]
E -->|Denied| G[Reply without closing]
Decision needed
Why: The sibling moderation command supports overridable defaults, but repository evidence does not establish approval for the additional warning-command and forum restrictions. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Establish an explicit helper moderation policy that preserves intentional administrator delegation and clearly defines warning access and forum scope, with fresh-install and upgrade evidence. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main dispatches helper closing without a root permission default or parent restriction and then uses bot authority to archive and lock. No live Discord reproduction was executed. Is this the best way to solve the issue? Unclear: matching the sibling command is a sound default-permission approach, but it does not impose an unconditional permission requirement, and the broader warning and forum policy needs confirmation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fd6920504d12. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Signed-off-by: Sebastien Tardif <SebTardif@ncf.ca>
What Problem This Solves
/helper closeand/helper close-threadarchive and lock the current Discord thread.HelperRootCommandset nopermission, so anyone who could invoke the command could lock threads they could not lock themselves, in any channel, not only helper forums.Sibling
/solvedalready setspermission = [ManageMessages, ManageThreads]. This change matches that default and, whenHELPER_THREAD_WELCOME_PARENT_IDis set, refuses close unless the thread parent matches that helper forum.Why This Change Was Made
Closing and locking a thread is a moderation action. It should require the same Discord permissions as
/solved, and should stay inside the helper parent when that parent is configured.User Impact
Members without Manage Messages / Manage Threads no longer see
/helper closeas a usable command. In a configured helper forum, close still works for those members. Outside that parent, the command replies that it can only be used in a helper thread.Evidence
Live
bunconstructing the command classes:8192 is
ManageMessages. 17179869184 isManageThreads.Same-repo:
solvedMod.tsis the permission sibling. #36 gated helper-log HTTP, not slash-command ACL.Real behavior proof
/helperclose requires Manage Messages and Manage Threads, matching/solved.C:\tmp\wt-he-f009atab8237d.HelperRootCommandandSolvedModCommandand printedpermission.helper 8192,17179869184matchingsolved,match true./solved./helper closein a non-helper thread. Parent-channel refusal is covered in the suite whenHELPER_THREAD_WELCOME_PARENT_IDis set.