Skip to content

Development

Maxime Gauthier edited this page Apr 30, 2026 · 1 revision

Development

Install

From the bot directory:

gem install bundler -v 2.4.5
bundle install

Install optional groups as needed:

bundle config set --local with redis
bundle config set --local with postgres
bundle config set --local with telemetry
bundle install

Run

bundle exec ruby bot.rb

Test and Lint

bundle exec rspec
bundle exec rubocop

The default specs stub AI providers and optional databases, so they do not require external API calls.

Project Structure

  • bot.rb: process entrypoint
  • environment.rb: environment parsing and validation
  • lib/application.rb: shared application object
  • lib/plugin_registry.rb: plugin discovery, dependency validation, and hook dispatch
  • lib/plugins: built-in plugins
  • lib/moderation: core moderation strategies and stores
  • lib/harassment: harassment-domain runtime, classifiers, repositories, and reports
  • docs/architecture.md: code architecture map
  • docs/data-model.md: persistence and data model notes
  • docs/adrs: architecture decision records

Plugin Contract

Plugins inherit from OpenModBot::Plugin.

The boot hook receives shared runtime context as keyword arguments:

  • app:
  • bot:
  • plugin_registry:

Plugins should require only the keyword arguments they need. Runtime hooks are isolated after boot so one plugin hook failure does not stop unrelated processing.

Clone this wiki locally