# std.logic — reusable, ready-to-use composite failure gates.
#
# ETDL already has AND/OR/NOT/XOR/VOTING as native gate types (see
# `docs/reference/standard-library.md`'s core-vs-library rule: this library
# does not redefine them). This module used to provide named composition
# PATTERNS over placeholder inputs (`SignalA`/`SignalB`/`SignalC`) a caller
# had to override every one of to get anything useful out of — that shape
# was reworked, not just extended, because a pattern nobody can use
# without fully overriding it is not meaningfully reusable: the caller
# types just as much either way. See design/adr in etdl-specification for
# the decision record on why library content stays scoped to Basic
# Events/Gates rather than gaining a templating mechanism to fix this the
# other way.
#
# Instead, this module composes REAL, already-useful `std.events` basic
# events (see that module) into named OR gates over one failure domain —
# "any network-layer failure," "any auth failure," and so on. These are
# genuinely usable as-is: `std.logic.AnyNetworkFailure` needs no
# overriding to mean something, because every input it OR's together
# already has a real illustrative probability from `std.events`. A
# document can reference one directly as a Gate input or Fault Tree
# `rootCause`, or override any individual `std.events` leaf it composes
# (the standard "local declaration wins" rule) to tune just that one
# mechanism's probability without touching this file.
#
# This file is ordinary ETDL: the same `components` schema (`gates`) any
# document already uses. No native (Rust) component.
etdl: "1.0.0"
library:
name: std.logic
version: "1.0"
description: >-
Ready-to-use composite failure gates (AnyNetworkFailure,
AnyAuthFailure, AnyResourceExhaustion, AnyDatabaseFailure,
AnyMessagingFailure, AnyResilienceTrip), each an OR gate over real
std.events basic events — no overriding required to use as-is.
dependsOn:
- name: std.events
version: "1.0"
components:
gates:
AnyNetworkFailure:
type: OR
description: "true when any network-layer failure mechanism occurs"
inputs:
- "std.events.NetworkTimeout"
- "std.events.ConnectionRefused"
- "std.events.DnsResolutionFailure"
- "std.events.TlsHandshakeFailure"
- "std.events.ConnectionResetByPeer"
- "std.events.RequestTimeout"
- "std.events.UpstreamServiceUnavailable"
AnyAuthFailure:
type: OR
description: "true when any authentication or authorization failure mechanism occurs"
inputs:
- "std.events.AuthenticationFailed"
- "std.events.AuthorizationDenied"
- "std.events.CertificateExpired"
- "std.events.TokenExpired"
AnyResourceExhaustion:
type: OR
description: "true when any process/resource exhaustion mechanism occurs"
inputs:
- "std.events.ProcessCrash"
- "std.events.DiskFull"
- "std.events.DiskQuotaExceeded"
- "std.events.OutOfMemory"
- "std.events.ConnectionPoolExhausted"
- "std.events.ThreadPoolExhausted"
AnyDatabaseFailure:
type: OR
description: "true when any database failure mechanism occurs"
inputs:
- "std.events.DatabaseDeadlock"
- "std.events.DatabaseConnectionLost"
- "std.events.DatabaseQueryTimeout"
AnyMessagingFailure:
type: OR
description: "true when any messaging failure mechanism occurs"
inputs:
- "std.events.MessageQueueFull"
- "std.events.SerializationFailure"
- "std.events.DeserializationFailure"
- "std.events.MessageDeliveryTimeout"
AnyResilienceTrip:
type: OR
description: "true when any resilience pattern (rate limit, retry budget, circuit breaker) trips"
inputs:
- "std.events.RateLimited"
- "std.events.RetriesExhausted"
- "std.events.CircuitBreakerOpen"