Expand description
smos-application — port traits, transport types, and error hierarchy.
This layer is intentionally IO-free in the same way smos-domain is: it
only defines what the system does (port traits + DTOs) and how it can
fail (errors). Concrete adapters (surreal store, HTTP upstream,
OpenAI-compatible llama-server providers, …) live in smos.
The helpers module hosts protocol-shaped pure functions (HTTP/JSON/regex
parsing) that build on top of the domain value objects. They are NOT domain
concerns — the domain layer is restricted to entities and value objects.
§Lint policy
async_fn_in_trait is allowed workspace-wide for the port traits. The
returned futures do not carry an explicit Send bound on the trait
surface; concrete adapters are written to return Send futures, and use
cases that need Send propagate the requirement via T: Trait + Send + Sync + 'static bounds at the spawn site.
Re-exports§
pub use errors::UseCaseError;
Modules§
- errors
- Error hierarchy at the application/adapter boundary.
- helpers
- Application-layer helpers — protocol-shaped pure functions.
- ports
- Port traits — abstract capabilities the application depends on.
- testkit
- Shared test doubles for
smos-applicationunit tests (refactor slice R4). - types
- Transport / DTO types used at port boundaries.
- use_
cases - Use cases — orchestrations over the port traits.
Macros§
- log_
nonfatal - Log a non-fatal error at WARN and continue.