ODS Platform — 8-check service architecture audit
Ctrl/Cmd + scroll to zoom — drag to pan — double-click to fit — click ⛶ to expand full size
| Rule | File | Line | Description | Fix Required |
|---|---|---|---|---|
| Directory Structure | src/api/split.rs |
11 |
split_pdf_handler() imports and directly calls processing::split::split_pdf()
and emits split.failed / split.completed events from the API handler.
Orchestration logic belongs in a SplitService, not the API layer.
|
Create src/service/split_service.rs.
Move processing call + event emission into SplitService.
Handler calls service only.
|
| Directory Structure | src/api/merge.rs |
— |
merge_pdf_handler() directly calls processing::merge::merge_pdfs()
and emits merge.completed / merge.failed events from the API handler.
Same bypass pattern as split.rs.
|
Create src/service/merge_service.rs. Covered by the same fix cycle. |
| Directory Structure | src/api/rotate.rs |
— |
rotate_pdf_handler() directly calls processing::rotate::rotate_pdf()
and emits rotate.completed / rotate.failed events from the API handler.
Same bypass pattern as split.rs.
|
Create src/service/rotate_service.rs. Covered by the same fix cycle. |
| Issue | Before (3e48f66) | After (4e2570c) | Status |
|---|---|---|---|
| InMemoryProducer mutex events/producer.rs:232 |
.unwrap() — silent panic on mutex poison, in production code path |
.expect("InMemoryProducer events mutex poisoned") — contextual panic message on all three call sites |
FIXED |
| X-Correlation-Id propagation api/split.rs, merge.rs, rotate.rs |
Events used auto-generated corr-{uuid} — inbound correlation IDs were dropped, breaking distributed tracing |
extract_correlation_id(&req) called in all three handlers; result propagated to CloudEvents correlationid field |
FIXED |
| Service layer bypass api/split.rs, merge.rs, rotate.rs |
API handlers call processing directly and emit events from the API layer | Same — not addressed in SEC-FIX-2 | OPEN |