Skip to content

Add strategy-based post selection and comment safety valve#9

Merged
fumikito merged 6 commits intomainfrom
feature/comment-strategies
Feb 25, 2026
Merged

Add strategy-based post selection and comment safety valve#9
fumikito merged 6 commits intomainfrom
feature/comment-strategies

Conversation

@fumikito
Copy link
Member

Summary

Closes #8

  • Replace raw SQL post selection with strategy-based WP_Query selection (Boswell_Strategy_Selector)
  • Add 4 filter hooks for external customization: boswell_comment_strategies, boswell_select_post_args, boswell_post_context, boswell_should_comment
  • Enrich AI prompt with post date, categories, and "Why This Post" context section
  • Add wp boswell strategies CLI command and --strategy option to wp boswell run
  • Remove deprecated select_post() method and boswell_select_post filter
  • Add Wiki documentation for strategy customization

Test plan

  • npm test — 58 tests pass (12 new strategy tests + 3 commenter context tests)
  • composer lint — No PHPCS errors
  • wp boswell strategies lists registered strategies with weight/probability
  • wp boswell run --persona=persona --strategy=recent generates a comment using the specified strategy
  • boswell_should_comment filter returning false blocks comment on all paths (cron, CLI, MCP, REST)

🤖 Generated with Claude Code

fumikito and others added 6 commits February 25, 2026 12:56
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
@fumikito fumikito merged commit dfe4de8 into main Feb 25, 2026
6 checks passed
@fumikito fumikito deleted the feature/comment-strategies branch February 25, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ストラテジーベースの投稿選択とコメント制御

1 participant