Skip to content

Commit b8a6cbe

Browse files
diberryCopilot
andcommitted
docs: update EECOM history and add ai-moderator decision
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 756b24a commit b8a6cbe

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

‎.squad/agents/eecom/history.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
55
## Learnings
66

7+
### Replace custom comment moderation with github/ai-moderator (#751) (2025-07-25)
8+
9+
**Context:** PR #753 had a custom 300-line scoring script (`scripts/comment-moderation.mjs`) with 46 tests for spam detection. The approach used multi-signal heuristics (account age, link density, keyword matching) to score and minimize spam comments on issues/PRs.
10+
11+
**Change:** Replaced the entire custom implementation with GitHub's official `github/ai-moderator@v1` marketplace action. Deleted `scripts/comment-moderation.mjs` (295 lines) and `test/comment-moderation.test.ts` (560 lines). Updated workflow to use the action with spam + link-spam detection enabled, AI-content detection disabled initially.
12+
13+
**Key decisions:**
14+
1. `enable-ai-detection: false` — can be toggled on later if Brady wants AI-generated content flagged. Start conservative.
15+
2. Added `issues: { types: [opened] }` trigger — the original only covered comments, not issue bodies.
16+
3. Added `models: read` and `contents: read` permissions — required by the ai-moderator action.
17+
4. Kept `spam` label for flagged content — matches community expectations.
18+
19+
**Pattern:** When a GitHub marketplace action exists for a CI task you've hand-rolled, prefer the official action. Less code to maintain, better detection (AI-powered vs heuristic), and GitHub handles updates. The 855-line delta (17 added, 889 removed) speaks for itself.
20+
721
### archiveDecisions() count-based fallback (#626) (2025-07-24)
822

923
**Context:** `archiveDecisions()` in `packages/squad-cli/src/cli/core/nap.ts` silently returned `null` when all `###` entries were <30 days old (`old.length === 0`), even if the file was well over 20KB. Active projects generating many decisions per session could hit 145KB+ — 35K tokens burned per agent spawn.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### Replace custom comment moderation with github/ai-moderator (2025-07-25)
2+
3+
**Decision:** Use GitHub's official `github/ai-moderator@v1` action instead of a custom scoring script for comment spam moderation.
4+
5+
**Rationale:** The custom script was 300 lines of hand-tuned heuristics with 46 tests. The marketplace action is AI-powered, GitHub-maintained, and requires zero custom code. Net delta: -872 lines.
6+
7+
**Configuration:** Spam detection and link-spam detection enabled. AI-content detection disabled initially — can be toggled on later. Applies `spam` label and minimizes flagged comments.
8+
9+
**Scope:** Workflow file only. No runtime dependencies, no SDK/CLI impact.

0 commit comments

Comments
 (0)