Skip to content

fix: validate command module contracts during load#243

Merged
uforia merged 1 commit into
mainfrom
fix/command-module-validation
May 31, 2026
Merged

fix: validate command module contracts during load#243
uforia merged 1 commit into
mainfrom
fix/command-module-validation

Conversation

@spierenburg
Copy link
Copy Markdown
Collaborator

@spierenburg spierenburg commented May 18, 2026

What this PR brings

  • Validates command modules during startup before adding them to the command registry.
  • Skips modules whose BINDS or CHANS values are not lists.
  • Skips modules missing a callable process function.
  • Provides a fallback help description if a module does not define HELP.

Why it matters

MatterBot dynamically loads command modules. Without basic contract validation, one malformed module can fail later during command dispatch or help rendering, making the failure harder to connect to the bad module.

This PR fails bad modules early, logs a clear reason, and keeps the rest of the bot usable.

Validation

python3 -m py_compile matterbot.py

@uforia uforia merged commit 807c836 into main May 31, 2026
5 checks passed
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.

2 participants