refactor(proto): model account transport as a oneof #367

Merged
KofTwentyTwo merged 1 commits from story/ws-a6-account-transport-oneof into dev 2026-07-31 23:13:13 +00:00
1 Commits
Author SHA1 Message Date
James Maes e82d52e530 refactor(proto): model account transport as a oneof
Make an invalid account transport mix unrepresentable: an account now
carries exactly one transport instead of a flat bag of optional
imap/jmap/dav fields.

- proto: AccountConfig gains `oneof transport { ImapSmtpTransport |
  JmapTransport | DavTransport }`; the flat fields (protocol,
  server_host/port, use_tls, imap/smtp tls modes, smtp_host/port,
  collection_url) are removed and their field numbers reserved. Golden
  descriptor regenerated; contract_stability passes.
- core: AccountConfig carries a `Transport` enum; validate() checks the
  active variant and preserves the cleartext-to-remote-host refusal per
  transport.
- store: physical accounts columns stay flat; the existing `protocol`
  column is the transport-kind discriminator. Each variant round-trips.
- daemon: grpc maps core Transport <-> proto oneof both ways; an unset
  transport returns typed VALIDATION_FAILED, never a panic.
- cli: `account add --protocol` gates transport flags; list/show render
  the active transport; --json stays coherent.

Refs #278
2026-07-31 18:10:17 -05:00