Skip to content

symfonic.capabilities.memory.errors

errors

The HMS bridge's error taxonomy.

Three kinds, split by who is wrong and by what the caller can do about it — which is the distinction the bridge's degradation rule is built on.

A contract error means the deployment declared something impossible: a record outside its request's scope, a query for zero memories, a contribution id that would forge a delimiter. No input fixes it, so it propagates.

An unavailable error means the store could not be reached this turn. The next turn may be fine, and a memory system that fails a user's turn because a graph backend blinked has traded the whole product for one recall. The bridge catches it and reports a degraded result.

A scope violation means a call crossed a tenant boundary. It is neither retryable nor a configuration nuisance: it is the failure SEC-TEN-5 exists to prevent, so it is its own class and it always propagates — including out of the bridge, which otherwise swallows backend failures.

MemoryCapabilityError

Bases: Exception

Base for everything this capability raises.

MemoryContractError

Bases: MemoryCapabilityError

A declaration or a call is impossible as stated.

Raised at declaration time wherever the shape is knowable then — a scope, a record, and a query all validate at construction — so a misconfigured deployment fails before its first turn rather than mid-invocation.

MemoryUnavailable

Bases: MemoryCapabilityError

The memory store could not be reached for this operation.

Adapters raise it; the bridge catches it and degrades. It is deliberately not a subclass of :class:MemoryContractError: the bridge's whole degradation rule is "transport degrades, contracts propagate", and a shared base would collapse the two.

ScopeViolation

Bases: MemoryCapabilityError

A memory crossed a scope boundary it is not visible across.

Raised at the port boundary — on what an adapter returned, not only on what a caller asked for. A backend enforces isolation (SEC-TEN-5); the bridge verifies it, because a bridge that trusts the backend has no answer when the backend is the thing that is wrong.