# Algorithm contracts whose domain is architecture

> 44 records

This index as JSON: https://banes-lab.com/json/api/facets/algorithms/domain/architecture

## Entries

- [Document Truth Alignment](https://banes-lab.com/records/algorithms/document-truth-alignment.md): For any document that states facts about a codebase, separate invariant facts (counts, paths, names, and the doc-type's structural schema) from variant prose, bind each invariant to a code-derived value through a stable key, compile the document from a template, and gate the output so a stated fact can never drift from the code it describes.
- [Architectural Contract Kernel](https://banes-lab.com/records/algorithms/architectural-contract-kernel.md): For any programmatic system, identify architectural concerns, define explicit contracts for each concern, bind implementations to those contracts, validate invariants, observe behavior, and evolve through versioned change.
- [Responsibility Boundary](https://banes-lab.com/records/algorithms/responsibility-boundary.md): Partition behavior into cohesive units, assign each unit one reason to change, hide internal details, expose only intentional interfaces, and reject cross-boundary leakage.
- [Coupling Control](https://banes-lab.com/records/algorithms/coupling-control.md): Detect dependency directions, invert dependencies toward abstractions, restrict imports to approved boundaries, and preserve autonomy between modules.
- [Interface Contract](https://banes-lab.com/records/algorithms/interface-contract.md): Define explicit interfaces with preconditions, postconditions, invariants, error semantics, version rules, and compatibility guarantees before implementation.
- [Substitutability](https://banes-lab.com/records/algorithms/substitutability.md): Validate that every implementation of an abstraction preserves the abstraction’s behavior, accepts valid parent inputs, returns valid parent outputs, and does not strengthen forbidden constraints.
- [Canonical Data](https://banes-lab.com/records/algorithms/canonical-data.md): Normalize incoming data into a canonical schema, validate types and semantics, preserve one source of truth, and translate at system boundaries only.
- [Domain Boundary](https://banes-lab.com/records/algorithms/domain-boundary.md): Identify bounded contexts, define the ubiquitous language and the owner of each context's model, map the relationships between contexts, and use anti-corruption layers where semantics differ.
- [Self-Description Manifest](https://banes-lab.com/records/algorithms/self-description-manifest.md): Require every component to declare identity, capabilities, contracts, dependencies, configuration, health model, and version metadata in a machine-readable manifest.
- [Runtime Discovery](https://banes-lab.com/records/algorithms/runtime-discovery.md): Discover available components by manifest, convention, registry, or service endpoint; validate discovered candidates against contracts; bind dynamically only after compatibility checks.
- [Extension Point](https://banes-lab.com/records/algorithms/extension-point.md): Define stable extension contracts, register implementations through IoC or plugin registries, isolate plugin failures, and expose deterministic loading order.
- [Construction Boundary](https://banes-lab.com/records/algorithms/construction-boundary.md): Hide object creation behind factories, builders, prototypes, or abstract factories so callers depend on creation contracts rather than concrete constructors.
- [Structural Mediation](https://banes-lab.com/records/algorithms/structural-mediation.md): Insert adapters, facades, proxies, bridges, or decorators where incompatible structure, access control, abstraction separation, or behavior layering is required.
- [Behavioral Dispatch](https://banes-lab.com/records/algorithms/behavioral-dispatch.md): Externalize variable behavior into strategies, template hooks, observers, or mediators while preserving stable orchestration contracts.
- [Architectural Style Boundary](https://banes-lab.com/records/algorithms/architectural-style-boundary.md): Select an architectural style, from a monolith or modular monolith to layered, hexagonal or microservices, by dependency direction, deployment autonomy, domain complexity, team topology, operational maturity and change isolation needs, then enforce the style through boundary rules.
- [Port Adapter](https://banes-lab.com/records/algorithms/port-adapter.md): Place domain logic behind inbound and outbound ports, implement external technology through adapters, and forbid domain dependence on infrastructure.
- [Event Messaging](https://banes-lab.com/records/algorithms/event-messaging.md): Convert state changes into events, classify domain versus integration events, publish through durable channels, consume idempotently, and preserve ordering where required.
- [Saga Compensation](https://banes-lab.com/records/algorithms/saga-compensation.md): For long-running distributed workflows, split work into steps, persist progress, define compensating actions, and recover from partial failure through forward or backward correction.
- [Transaction Boundary](https://banes-lab.com/records/algorithms/transaction-boundary.md): Define atomic state-change boundaries, isolate concurrent mutation, enforce consistency rules, and commit or roll back as a unit.
- [Idempotent Side Effect](https://banes-lab.com/records/algorithms/idempotent-side-effect.md): Assign a stable operation identity, check whether the effect was already applied, execute only once, and return the same semantic result for repeated requests.
- [Deterministic Core](https://banes-lab.com/records/algorithms/deterministic-core.md): Push nondeterminism to system edges, keep core logic pure where possible, use immutable inputs, and make outputs reproducible under identical inputs.
- [Verification Fitness](https://banes-lab.com/records/algorithms/verification-fitness.md): Define executable architecture rules, validate with static analysis, specification tests, property tests, and runtime checks, then block release when critical rules fail.
- [Error Boundary](https://banes-lab.com/records/algorithms/error-boundary.md): Detect invalid state early, fail fast for programmer errors, fail safe for recoverable runtime faults, fail secure for security-sensitive failures, and return typed errors.
- [Resilience Control](https://banes-lab.com/records/algorithms/resilience-control.md): Wrap remote or unreliable calls with timeout, retry, circuit breaker, bulkhead isolation, fallback, and backpressure policies.
- [Recovery Deployment](https://banes-lab.com/records/algorithms/recovery-deployment.md): Continuously health-check services, isolate failed instances, fail over to redundancy, roll back unsafe releases, and use canary or blue-green deployment for controlled exposure.
- [Observability Trace](https://banes-lab.com/records/algorithms/observability-trace.md): Attach correlation and causation identifiers to every operation, emit structured logs, metrics, traces, and audit records, then connect them into an explainable execution graph.
- [Causality Ordering](https://banes-lab.com/records/algorithms/causality-ordering.md): Model events as a dependency graph, assign causal metadata, preserve happens-before relationships with sequence numbers, Lamport clocks or vector clocks where physical timestamps are insufficient, and reject or compensate for invalid ordering.
- [Performance Scaling](https://banes-lab.com/records/algorithms/performance-scaling.md): Measure workload, identify bottlenecks, choose vertical or horizontal scaling, partition load, cache safe data, enforce rate limits, and benchmark continuously.
- [Cache Correctness](https://banes-lab.com/records/algorithms/cache-correctness.md): Cache only data with defined freshness, key identity, invalidation triggers, consistency expectations, and fallback behavior.
- [Portability Environment](https://banes-lab.com/records/algorithms/portability-environment.md): Externalize configuration, standardize protocols, isolate platform assumptions behind adapters, package runtime dependencies, and validate parity across environments.
- [Security Policy](https://banes-lab.com/records/algorithms/security-policy.md): Threat-model the system, reduce attack surface, authenticate identity, authorize actions, validate input, encode output, encrypt data, protect secrets, and enforce policy continuously.
- [Control Plane](https://banes-lab.com/records/algorithms/control-plane.md): Separate control concerns from data execution, centralize policy/configuration/authentication/logging where beneficial, and decentralize runtime execution where autonomy is required.
- [Declarative Metaprogramming](https://banes-lab.com/records/algorithms/declarative-metaprogramming.md): Represent behavior as data, validate the model or DSL, compile or interpret it into runtime behavior, and restrict reflection or code generation behind safety contracts.
- [Streaming Dataflow](https://banes-lab.com/records/algorithms/streaming-dataflow.md): Process data sequentially through bounded pipeline stages, preserve forward-only semantics where required, apply backpressure, checkpoint state where needed, and keep stages stateless unless state is explicitly modeled.
- [RAG Knowledge Boundary](https://banes-lab.com/records/algorithms/rag-knowledge-boundary.md): Retrieve knowledge from indexed sources, validate relevance and freshness, ground generation in retrieved evidence, and distinguish known, inferred, and unsupported output.
- [Architecture Selection Meta-Algorithm](https://banes-lab.com/records/algorithms/architecture-selection-meta-algorithm.md): Given a concern, classify its force type, select the corresponding contract family, compose required invariants, bind implementation patterns, and attach validation gates.
- [Universal Architectural Concern Template](https://banes-lab.com/records/algorithms/universal-architectural-concern-template.md): For any architectural concern, define its intent, boundary, contract, invariants, allowed variation, forbidden leakage, validation strategy, observability model, and evolution policy.
- [Architectural Contract Algebra](https://banes-lab.com/records/algorithms/architectural-contract-algebra.md): <Classify architectural force> → <Declare boundary> → <Define contract> → <Choose pattern> → <Bind implementation> → <Verify invariant> → <Observe runtime> → <Govern evolution>
- [Manifest-Driven Documentation](https://banes-lab.com/records/algorithms/manifest-driven-documentation.md): For a module whose public surface is machine-derivable, make its metadata manifest the single documentation source of truth: authored narrative lives in mandated, shape-validated manifest fields (with self-expanding custom fields), the API surface is collected deterministically from the built type-declarations, one marker-layered document is compiled per module from both, and a governance router runs the context-detection rules on the manifest strings where a manifest governs (rendering each field to its markdown fragment first) and on the document itself where none exists. Beyond the module document, a manifest may declare typed documents — each a form plus concern that routes through the pure location function to a computed path — generated and drift-checked the same way, so the manifest is the single content generator with no separate template mechanism.
- [Consumer Config SSOT](https://banes-lab.com/records/algorithms/consumer-config-ssot.md): For any reusable package that must stay agnostic of the applications consuming it, hardcode zero consumer-specific truths in package source; declare every consumer-specific value in one consumer-owned config of typed sections, load it through a framework the leaf packages never import, and hand each package only the section it needs through an injection surface — so a package drops into any consumer without a literal about that consumer leaking through its source.
- [Finite State Machine](https://banes-lab.com/records/algorithms/finite-state-machine.md): Model behavior as a finite set of states with explicit legal transitions, so illegal state combinations are unrepresentable.
- [Statecharts](https://banes-lab.com/records/algorithms/statecharts.md): Extend a flat state machine with hierarchy and parallel regions, so independent concerns compose without state explosion.
- [Petri Nets](https://banes-lab.com/records/algorithms/petri-nets.md): Model concurrent flow as places, tokens, and transitions, so reachability and deadlock are analyzable before runtime.
- [Queuing Theory](https://banes-lab.com/records/algorithms/queuing-theory.md): Size a system from arrival and service rates, so capacity and wait time are predicted rather than guessed.
