[spec] Deepen Mailbox Pipeline and Seal Domain Seams #33
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Lavisys/mailsweep#33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
The command-line interface module (
cli.py) contains more than 600 lines of code with procedural orchestration logic. Subcommands directly instantiate and wire intermediate domain models and tools (ClassificationEngine,SafetyAuditor,UnsubscribeHub,ScanResult). This causes architectural friction:MailboxPipelinedomain coordinator for offline operations (plan,audit,verify,unsubscribe).MailboxPipeline).SafetyAuditorinspects the private attribute_crit_reofClassificationEngine.Solution
Deepen the domain modules and consolidate orchestration seams:
ClassificationEngineby adding public safety query methods, removing private regex access across module seams.MailboxPipelineto support both online and offline operations through unified domain methods.cli.pyto be a thin adapter that parses command arguments and delegates all orchestration toMailboxPipeline.User Stories
MailboxPipelinecoordinator, so that operations remain consistent across CLI, API, and tests.plan,audit,verify,unsubscribe) to run without IMAP connection requirements, so that local snapshots are analyzed safely.ClassificationEngineto expose explicit public safety query methods, so thatSafetyAuditordoes not access private engine internals.MailboxPipelineto provide an offline factory method, so that testing and script automation do not construct invalid gateway instances.cli.pyto contain only argument parsing and output presentation logic, so that domain rules remain localized in domain modules.MailboxPipelineinterface, so that test setup stays concise and high-leverage.Implementation Decisions
MailboxPipelineis the single high-level domain coordinator seam.ClassificationEngineis the single heuristic classification and safety query seam.is_critical_subject(subject)andaudit_safety(items)onClassificationEngine.MailboxPipeline.offline()factory and integrateaudit,unsubscribe, andplanorchestration intoMailboxPipeline.cmd_plan,cmd_audit,cmd_verify, andcmd_unsubscribeincli.pyto delegate toMailboxPipeline.Testing Decisions
MailboxPipelineseam using in-memory test stand-ins (FakeImapTransport,FakeUrlHealthChecker).ClassificationEnginesafety query methods directly with unit test assertions.Out of Scope
Further Notes
Follows ADR-0005 and ADR-0006 architecture principles. Complies with ASD-STE100 language rules.
Implemented deep offline pipeline factory and public safety query methods on ClassificationEngine. Refactored CLI subcommands to delegate through MailboxPipeline. Full test suite passes with 129 tests.