Files
andros ee726cfcb9 Restructure into clean architecture: core use cases behind gateways, Flask and Click as external interfaces
The single-file node grew past the point where one file served it. The
code now follows clean architecture: business logic in core (entities,
gateway Protocols and one use case per operation, returning plain
{type, errors, data} dictionaries; exceptions never cross a layer),
and the outside world in infra (SQLite repository, JSON config, file
blob store, an httpx network gateway carrying the SSRF guard, the
Flask API and a Click CLI). Dependencies always point inwards and are
injected, so swapping Flask, SQLite or httpx touches only infra.

Packaging moves to pyproject.toml with an 'hmtp' console script
(uv run hmtp ...); Docker installs the package and the flush sidecar
calls 'hmtp flush'. requirements.txt is gone.

The wire protocol is byte-identical: all 25 tests pass on a rewritten
harness with no globals (each test node carries its own wiring and
Flask app), and the full CLI flow was exercised over real HTTP,
including attachments, postage, rotation chains and the read endpoint.
Existing node data (config.json, hmtp.db, blobs) needs no migration.
2026-07-29 18:24:30 +02:00
..