Errors
A missing entrypoint, unavailable source, or edited destination is a normal installation outcome. Return that failure to the caller as data.
Result contracts
Why
Workflows need to stop on a failed stage without losing its cause. One Result shape lets selection, retrieval, and writing use the same handling pattern.
Rules
MUST returnResultfrommassaman/controlfor fallible parsing, validation, resource access, and domain operations.[review]
MUST build successful and failed outcomes with that module'sokanderrfunctions.[review]
MUST keep tuple Results and independently invented failure containers out of domain code.[review]
MUST avoid authored exception control flow (throw,try/catch) and custom Error subclasses.[review]
MUST contain third-party throws and promise rejections withattemptorattemptAsyncin the owning adapter.[review]
MUST establish the Result variant withisOk,isErr, or an exhaustive match before accessing its payload.[review]
MUST propagate a failure until the boundary responsible for display or process exit handles it.[review]
MAY convert a Result at that boundary when the framework requires a different contract.[review]
[review]
Result types and failure-path tests establish propagation and classification. Configure syntax checks for authored exception control flow; review checks complete third-party boundaries.
Typed failures
Why
Changing an error's wording should not alter how a caller reacts. A readonly kind field separates the decision from the human-facing message.
Rules
MUST specify the failure type inResult<CONTENT, FAILURE>when callers distinguish failure categories.[review]
MUST combine an Error value with a readonly literalkindfield for a classified failure.[review]
MUST create classified errors through a factory using a fresh Error instance.[review]
MUST base handling on the discriminant, not message fragments, and avoid untyped plain-object arguments toerr.[review]
MUST exhaustively handle a closed failure union.[review]
Read the shared principles for dependency evaluation and the consumer's instructions for installation authorization.
[review]
Result types and failure-path tests establish propagation and classification. Configure syntax checks for authored exception control flow; review checks complete third-party boundaries.
Enforcement
Result types and failure-path tests establish propagation and classification. Configure syntax checks for authored exception control flow; review checks complete third-party boundaries.