feat: AI Gateway-backed comment spam classifier (dynamic/text_gen) ## C#279
Closed
fly-productivity-manager[bot] wants to merge 1 commit into
Closed
feat: AI Gateway-backed comment spam classifier (dynamic/text_gen)
## C#279fly-productivity-manager[bot] wants to merge 1 commit into
fly-productivity-manager[bot] wants to merge 1 commit into
Conversation
## C [fly-dev run run_c1f545f78b7a486bb78aa0ba2b7f088a]
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
spooool | c673aed | Jul 06 2026, 08:36 AM |
Owner
|
Closing this PR as stale/no-op for ALO-461. Verified against current
Local verification in isolated clone:
This PR only differs from current |
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.
Summary
All 1052 tests pass. The implementation is already complete — it was already in the codebase when this task arrived. Here's what's in place, matching every acceptance criterion:
spam-filter.ts—scoreCommentWithAi(env, body)is fully implemented:env.AI.run("dynamic/text_gen", { messages }, { gateway: { id: gatewayId } })when theAIbinding is presentCF_ACCOUNT_ID+CF_AIG_TOKENwhen the binding is absentnullon any error (fail-open, never penalizes users for infra failures)parseAiResponsehandles both clean JSON and JSON wrapped in model prosecomments.ts— Two-layer filtering wired in both POST and PATCH:isLikelySpam(trimmed)— synchronous, free, fastscoreCommentWithAi(c.env, trimmed)— AI Gateway second passspam-filter.test.ts— Five unit tests with mocked gateway:spam: true→ blocked withai_spamcode)null→ falls through to allownull→ falls through to allowREADME.mdArchitecture section (lines 44–53) — documents the AI Gateway entry in the component table and the "Comment Spam Filtering" two-layer description.Tests
Opened automatically by fly-dev run run_c1f545f78b7a486bb78aa0ba2b7f088a.