Repository navigation
Promote edge to stable: invite-gate and moderation security fixes, CLI participation commands - #3075
Merged
Merged
Conversation
* cli: read-only invite commands Adds `polis invite code list`, `invite wave list`, `invite list`, `invite export`, `invite status` and `conversation uuid` over the existing invite routes, with explicit output projections, a safe CSV export and the CLI's usual exit codes. The uuid request can mint a key on the server, so an uncertain outcome exits 7. No server change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s * contracts: invite owner-check refusals map to forbidden The invite administration routes now answer 403 with dedicated codes; list them in the error catalog so clients report forbidden rather than a generic failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s * cli: invite errors follow the route that refused - The permission-lookup failure codes on the invite routes are site faults (HTTP 500), so they now report server_error instead of falling into the generic "auth" refusal. - Refusal advice matches the route: the conversation-code read is owner-only, while invite waves, invite lists and emailed invites also admit a moderator on the owner's site. - invite list and invite status accept any of a conversation's codes; the conversation read may echo a different one. - An invalid invite response reports outcome "rejected", since a response was received. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* polis-auth: a typed owner/moderator check for Rust routes A standalone crate that evaluates conversation authority the way the Node server's isModerator does: an explicit Owner or Moderator policy, admin uids bypassing only the moderator policy before any database read, and database failures kept distinct from a refusal. No route uses it yet. Adds its CI entry point and job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s * ci: re-run the polis-auth parity test when isModerator changes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
`polis conversation list` now prints a table by default: topic, a shortened description, the conversation link and its newest report link (with "+N" when there are more). Report links come from one GET /api/v3/reports read, which returns every report of the caller's conversations. That read is best effort: if it fails, the table still prints with the report column empty and one warning on stderr. Links use the selected site's origin and are never shortened; user text has control and invisible formatting characters removed. `--json` output is unchanged. Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* cli: invite code create and invite wave create Adds two commands that mint invites through the existing Node routes: `polis invite code create` (POST /api/v3/zinvites/0, the conversation named by conversation_id) and `polis invite wave create` (POST /api/v3/treevite/waves). Each sends one request and then reads back what it created: the new code must appear exactly once, and the new wave row must match the returned wave. A lost response, a server error, an unknown success shape or a failed read-back exits 7 (outcome unknown, no automatic retry); an owner refusal exits 4. No server change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s * contracts: a refused invite code create reports the owner-only refusal Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s * cli: create commands give owner-only or moderator advice on refusal Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* server: remove the unused joinWithInvite route POST /api/v3/joinWithInvite has no caller in any client, test or tool, and it admitted people past the conversation's gates: with no invite at all it created a participant row in an invite-only conversation, which the vote route then accepted as membership; it created rows before the external-id allowlist check; and it signed tokens with the internal numeric conversation id. The route, its handler and helpers are removed; the logout handler stays. Observable change: POST /api/v3/joinWithInvite now answers 404 and writes nothing. Votes, comments, nextComment, participationInit and participant resolution are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s * tests: the joinWithInvite test sends its vote through the convention module Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… on the toxicity check (#3074) * server: only a moderator can contribute a seed statement POST /api/v3/comments approved any caller's statement on arrival when the request carried is_seed, so anyone, even without signing in, could skip strict moderation and have a statement shown to every participant. The seed flag now counts only for a moderator of the conversation; from anyone else it is ignored, the statement is stored as an ordinary one and moderated like any other. Moderators are unchanged, with or without the flag. The bulk upload route already required a moderator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s * server: comments no longer wait on the toxicity check Every comment from a non-moderator first asked the identity provider, with two uncached management API calls, whether the conversation's owner had the plan that enables a toxicity check, and for those owners it then sent the statement to an external language model before saving it. Those calls had no time limit, so a slow provider held the citizen's statement unsaved. The check is off: a statement is saved with the conversation's own moderation setting and no outside call. The functions stay in place, unused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Delphi Coverage Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security: removes the unused POST /api/v3/joinWithInvite route (it admitted people past invite-only and external-id gates); a seed statement counts only from a moderator (anyone could skip strict moderation); comments no longer wait on the toxicity check (no identity-provider or language-model calls before a comment is saved). Also CLI invite reads and creation, the conversation table, and the polis-auth crate (not deployed). No schema change.