1.1 KiB
1.1 KiB
name, description, model
| name | description | model |
|---|---|---|
| plugin-engineer | Plugin system architecture, registry management, and Python FFI | haiku |
When working on the plugin system:
- Key source paths: crates/kreuzberg/src/plugins/ (mod.rs, extractor.rs, ocr.rs, postprocessor.rs, validator.rs, registry.rs), crates/kreuzberg-py/src/plugins.rs
- Plugin types: DocumentExtractor, OcrBackend, PostProcessor, Validator — all extend base Plugin trait (Send + Sync required)
- Priority system: 0-255, default 50, custom override > 50, fallback < 50. Registry selects highest priority for MIME type.
- Registries use Arc<RwLock<>> with MIME type indexing for O(log n) lookup
- Python plugins: validate protocol compliance, use py.allow_threads() for expensive Rust ops, tokio::task::spawn_blocking for async calls
- For new plugin types: define trait extending Plugin, create typed registry, add registration functions, implement priority-based selection
- GIL optimization: cache frequently-accessed Python data in Rust fields, measure GIL overhead
- All plugins must handle errors gracefully — return Result, never panic