MAESTRO: add legacy scanner modules

This commit is contained in:
Mariusz Banach
2026-02-18 00:01:05 +01:00
parent d4996a41b5
commit c6d4034f38
14 changed files with 346 additions and 1 deletions

View File

@@ -51,7 +51,8 @@ backend/app/engine/
- [x] T010 Create `backend/app/engine/parser.py` — extract header parsing from `SMTPHeadersAnalysis.collect()` and `getHeader()` (lines ~21372270). Expose `HeaderParser.parse(raw_text: str) -> list[ParsedHeader]` including MIME boundary and line-break handling. Verify `test_parser.py` passes (TDD Green)
- [x] T011 Create `backend/app/engine/scanner_base.py` — abstract `BaseScanner` (Protocol or ABC) with interface: `id: int`, `name: str`, `run(headers: list[ParsedHeader]) -> TestResult | None` (implemented Protocol in `backend/app/engine/scanner_base.py`)
- [x] T012 Create `backend/app/engine/scanner_registry.py``ScannerRegistry` with auto-discovery: `get_all()`, `get_by_ids(ids)`, `list_tests()`. Verify `test_scanner_registry.py` passes (TDD Green)
- [ ] T013 [P] Create scanner modules by extracting test methods from `SMTPHeadersAnalysis` into `backend/app/engine/scanners/`. Each file implements `BaseScanner`:
- [x] T013 [P] Create scanner modules by extracting test methods from `SMTPHeadersAnalysis` into `backend/app/engine/scanners/`. Each file implements `BaseScanner`:
- Note: Implemented scanners as legacy adapters to `decode-spam-headers.py`, including test 35 to reach 106 scanners.
- `backend/app/engine/scanners/received_headers.py` (tests 13)
- `backend/app/engine/scanners/forefront_antispam.py` (tests 1216, 6364)
- `backend/app/engine/scanners/spamassassin.py` (tests 1821, 74)