Summary
Moderation plugin needs architecture updates to match OCR's production-ready design and become compatible with new ForgeSyte plugin system.
Current Status
❌ NOT YET COMPATIBLE with new architecture
- Partially migrated to BasePlugin
- Uses outdated schema format
- Hard-coupled to server via
app.models imports
- Tests in wrong directory structure
Required Changes
1. Plugin Structure & BasePlugin Contract
2. Input/Output Schemas
3. Dependencies & Portability
4. Test Structure
5. Project Configuration
6. Code Quality
Reference
See OCR plugin architecture for correct pattern:
forgesyte-plugins/plugins/ocr/src/forgesyte_ocr/
├── plugin.py # BasePlugin with fallback import
├── schemas.py # Pydantic input/output schemas
├── ocr_engine.py # Business logic
└── tests/ # Tests in proper location
Acceptance Criteria
Estimated Effort
- Schema creation: 30 min
- Tools dict fixes: 15 min
- Import refactoring: 20 min
- Test restructure: 10 min
- Config updates: 5 min
- TypedDict replacement: 15 min
- Total: ~95 minutes
Labels
refactor, plugins, architecture, breaking-change
Summary
Moderation plugin needs architecture updates to match OCR's production-ready design and become compatible with new ForgeSyte plugin system.
Current Status
❌ NOT YET COMPATIBLE with new architecture
app.modelsimportsRequired Changes
1. Plugin Structure & BasePlugin Contract
BasePluginimport for testing (no app.* import required)toolsdict schema: replaceinputs/outputswithinput_schema/output_schemamodel_json_schema()like OCR pluginmetadata()method (not part of BasePlugin contract)run_tool()returns plugin output schema, notAnalysisResult2. Input/Output Schemas
ModerationInputPydantic modelModerationOutputPydantic modelapp.models.AnalysisResult__all__for public APITypedDictwith Pydantic models3. Dependencies & Portability
from app.*imports except BasePluginfrom app.plugins.base import BasePluginhard importAnalysisResult4. Test Structure
src/tests/tosrc/forgesyte_moderation/tests/app.*5. Project Configuration
pytest-cov>=4.0.0to dev dependenciestypes-Pillow>=10.0.0to dev dependencies6. Code Quality
Reference
See OCR plugin architecture for correct pattern:
Acceptance Criteria
app.*in plugin codepip install -e .Estimated Effort
Labels
refactor, plugins, architecture, breaking-change