Skip to content

Define the InboxDriver contract, driver manager and mailbox/connection config #2

Description

@jbagsik

Parent

#1

What to build

The seam the whole extraction hangs off, plus the test harness moox/mail-inbox currently does not have.

Define the inbox driver contract in moox/mail-inbox: claiming a message for processing, settling it with an outcome of Processed, Failed or Ignored, fetching a resumable page of messages against an opaque cursor, and reading an attachment's content. Add a driver manager resolved from the container, and the configuration shape where a mailbox names a driver and references a connection by name — a plain string, never a class.

Ship an in-memory fake driver alongside it: scripted messages in, settled outcomes recorded and inspectable. Nothing in the package uses the contract yet; this ticket only makes it exist and proves it is implementable.

Stand up the package's first Pest harness while you are here, following the layout moox/e-billing already uses (a TestCase, a container-only case, Feature and Unit directories, fixture builders under a support directory). Do not copy any layout from moox/mail-inbox — it has none.

Acceptance criteria

  • The contract expresses outcomes, not destinations: no method takes a folder name, and no driver is required to have a concept of folders
  • Ignored is a first-class outcome, distinct from Failed, and documented as "recognised and deliberately not processed"
  • The cursor is opaque: the contract types it as a plain string and the package never inspects or parses it
  • A mailbox entry resolves to a driver through the manager using only configuration strings
  • Several connections and several mailboxes can be configured, and two mailboxes may reference different connections
  • There is no direction field; a mailbox's role follows from which configuration it appears in
  • The in-memory fake driver satisfies the contract, returns scripted pages, and records settled outcomes for assertion
  • A Pest suite exists and runs green with no network access
  • README documents the contract and the configuration shape; CHANGELOG records the new public surface

Blocked by

None — can start immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentSpec is ready for an agent to implement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions