Repository navigation
fix(repair): admit spam scan comments by facts, pass keyword hits as model input - #1777
Conversation
|
🦞👀 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 maintainer review before merge. What this changesThe branch admits unprotected GitHub comments to spam scanning using length, links and minimization, while passing keyword matches to the model as context. Example: An outside author comments “Still hangs for me on the latest release.”
Review scores
ProductKind: Maintenance · Worth it: Yes Merge readiness✅ Ready for maintainer review This PR remains necessary on current main, and neither related PR owns the spam-admission change. No actionable patch defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherClawSweeper scans GitHub comments through event intake and an hourly catch-up scan. Admission selects comments for model classification, which produces audit records without hiding comments or blocking users. flowchart TD
A[GitHub comment events] --> C[Fact-based admission]
B[Hourly comment scan] --> C
C --> D[Protected or short comments skipped]
C --> E[Model receives comment and context facts]
E --> F[Spam classification]
F --> G[Audit records without moderation actions]
Technical reviewBest possible solution: Keep one shared fact-based admission owner and let the model classify comments, preserving protected-author exclusions and audit-only output. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main rejects keyword-free outside comments such as “Still hangs for me on the latest release.” before model classification. This review did not execute target code. Is this the best way to solve the issue? Yes: changing the shared admission predicate addresses both event intake and broad scanning without adding a parallel classifier or configuration option. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e4c173aeed28. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 8, 2026, 8:03 PM ET / October 9, 2026, 00:03 UTC. |
What
Spam scan admission now uses facts only. Keyword patterns no longer decide which comments the model sees.
src/repair/spam-scanner-core.tsshouldSendToCheapModeladmits a comment when its author is not protected and either its body has at least 12 characters, or it has a link or a GitHub minimization.SOLICITATION_PATTERNS, the priced pitch, the URL shortener, the external-link counts, and the technical-context keywords. They still run, and the model gets their results as labelled input indeterministic_factsandtechnical_context_facts. The policy text tells the model these are inputs, not verdicts.outside_author_with_external_linkis now recorded as a plain fact. It no longer depends on another keyword hit.spam-comment-intake.ts) uses the same admission rule. It keeps a forwardedminimized_reason. Its reason text lists the facts.docs/spam-scanner.md,docs/target-dispatcher.md. Changelog:changelog.d/spam-admission-facts-only.md.Batch D, part 2a. Part 1 is #1775. Parts 2b and 2c follow separately.
Why
Maintainer rule (LLM systems): code must not judge with keyword matching. Code selects by facts, and the model judges. In the code-judge inventory (Batch D), the spam-scanner-core keyword admission gate decided which comments the model ever saw. A comment with no listed keyword never reached the model. The maintainer approved this option: admit by facts, and pass keyword hits to the model as labelled input.
Proof (real data)
I fetched 24,818 real
openclaw/openclawcomments from 2026-10-01T22:26Z to 2026-10-08: 24,789 fromgh api repos/openclaw/openclaw/issues/comments?since=…and 29 from…/pulls/comments?since=…. I ran them throughshouldSendToCheapModelfrom a main build and from this branch, with the scanner's default trusted bots. spam-scanner-core is unchanged on main.NONE-association authors, 581 distinct.Tests:
pnpm run check(on ef343c0, before the rebase onto e4c173a): exit 0. That covers static, format, build, lint and all tests (6,947 passed, 0 failed). The rebase brought in #1774 only (close-path files). After the rebase, both spam test files pass.Needs maintainer call
None. The maintainer chose facts-only admission.
Codex review dispositions
minimized_reason, so the minimization exception never fired on the webhook path. Fixed: intake keeps a forwardedminimized_reason, and a test covers it. GitHub webhooks do not carry minimization, so the hourly scan stays the main path for that fact, because it hydrates minimization through GraphQL.Merge Danger
deterministicblock. Revert restores keyword admission.spam-scanner.ymland the event path throughgithub-activity→clawsweeper_spam_comment. The lane stays audit-only (action: none). It never blocks users, hides comments, or labels anything.spam-scanner.ymlActions run and oneinternalmodel call (medium reasoning, one comment). That is ≈175 extra Actions runs and ≈175 small model calls a day.