Skip to content

Latest commit

 

History

History
17 lines (9 loc) · 3.94 KB

REPLY-RULES.md

File metadata and controls

17 lines (9 loc) · 3.94 KB

Reply Rules

Optional, off by default. The signed-in account owner writes up to ten public rules (200 characters each) and may enable recent manually hidden examples. Owner consent and a current per-comment reader checkbox are required. Enabling or changing the configuration makes a new notice revision; stale forms must reload. The read action get_reply_rules works through REST/MCP. Owner configuration set_reply_rules is deliberately dashboard-only, like other human consent actions.

The existing hold-all/hold-links decision wins before AI. Otherwise a single Cloudflare-hosted Qwen3 30B request classifies the comment. Input contains public rules, comment text and at most three complete eligible examples of up to 1,000 characters. Names, emails and account, comment, reader or session identifiers are not added. Authored comment text may contain personal information. Gateway logging/cache are off; no external URL fetch or model fallback. Provider requests may run outside the account region.

Examples come from at most the newest 30 hidden comments created within 30 days, in the same account/newsletter, with a current manual creator decision, an active author, matching consent/body hash and an explicit recorded example-use choice. A comment consenting only to classification before examples were enabled is excluded. AI-only hides, restored, deleted and anonymized comments are excluded. This is inference with examples, not model training. Input strings are untrusted data, never instructions.

Strict JSON accepts only decision, confidence and a known public rule ID (or learned when examples exist). Allow requires at least 0.90, hide at least 0.95. These are unverified model scores, not measured accuracy. Other results, failures, missing provider, no usable examples or exhausted quota are held for human review. Hide reasons quote only a public written rule or use fixed generic example wording. Readers see their own reason on the issue page. AI hides send no separate decision email. Existing manual moderation can approve/reverse them and keeps its ordinary notification rules.

Every started inference counts against the account's shared daily AI allowance, including provider/format failures and the 12-second response deadline. No automatic retry. A deadline stops waiting; it cannot promise cancellation of remote computation. Existing per-reader/day/IP comment limits still apply. Configuration, current subscriber/account access and the reader session are checked again after inference. Parent availability is rechecked. Edits compare the original status, body hash and update timestamp, so an intervening human hide is preserved. These are fresh checks and a same-row edit comparison, not a transaction locking several D1 rows or the remote model.

Newsletter config, per-comment consent timestamp/hash/example-use choice and bounded decision metadata stay in account-scoped D1 documents. Existing indexes support the bounded example query; no new migration is needed. The private account export includes settings and comment metadata. Comment removal by its author or contact anonymization clears consent/decision metadata; ordinary account purge removes records. Historical AI scores may remain with a comment after a human decision as audit context; the human status is authoritative.

Tests use a stub binding, fake timers and synthetic readers. They verify current consent, owner/API/team boundaries, held settings, provider failures and quota, strict decisions, example eligibility, session/access/config changes, concurrent moderation, forms, anonymization, exports and six-language phrase parity. Real inference quality, multilingual semantic review, latency and adversarial evaluation remain release QA; no real model request or reader email was made during the build.

Model parameters: Cloudflare Qwen3 reference. The app uses the existing Workers AI binding and daily allowance, in Cloud and self-hosted mode.