Expand description
Soma’s product-domain invariants (plan section 6.2): the action catalog, error taxonomy, scope/token-budget policy, and CLI provider-validation rules shared identically across REST, CLI, and MCP dispatch.
Split out of soma-contracts in PR 13 rather than soma-application
because soma-service (a dependency of soma-application during the
PR 12 strangler migration) also builds its static-Rust provider catalog
directly from these types; every consumer (application, service, api,
cli, mcp, integrations, runtime, apps/soma) can already depend on
soma-domain without creating a cycle. See the per-module
“module-placement rationale” notes (e.g. the bottom of actions.rs) for
the full reasoning.
Modules§
- actions
- Soma’s own action catalog: the invariant action-spec table below and request-parsing shared identically across REST, CLI, and MCP dispatch.
- authz
- Provider-dispatch authorization: safety-class → scope affinity, caller trust discipline, and structured security decisions.
- errors
- Structured tool/service error DTO shared by REST and MCP error rendering.
- provider_
validation - Soma policy layered over provider-core’s transport-neutral validation.
- scopes
- Canonical Soma authorization scope constants.
- token_
limit - Response size cap — prevents context-window exhaustion in MCP clients.
Structs§
- Principal
- An authenticated caller identity and the scopes it holds.
- Request
Id - A validated request identifier: non-empty, bounded in length, and free of control characters.
- Scope
Set - A deduplicated, order-stable set of scope strings.
- Trace
Context - W3C Trace Context propagation fields carried with a request.
Enums§
- Authorization
Mode - How the request’s authorization was established.
- Confirmation
- Whether a destructive operation has been explicitly confirmed by the caller.
- Request
IdError - Reasons a
RequestIdcan fail validation. - Surface
- The entry point through which a request reached the service.