2026-09-06 10:43:16 -05:00
|
|
|
# Architecture Policy
|
|
|
|
|
|
2026-09-27 19:46:41 +00:00
|
|
|
**Base Policy Version:** 1.2
|
2026-09-06 10:43:16 -05:00
|
|
|
|
2026-09-27 19:46:41 +00:00
|
|
|
**Last Updated**: 2026-09-27
|
2026-09-06 10:43:16 -05:00
|
|
|
|
|
|
|
|
## Base Policy Template
|
|
|
|
|
|
2026-09-25 15:54:56 +00:00
|
|
|
This document is the base template for the canonical architecture policy.
|
|
|
|
|
Repositories that implement this policy should:
|
2026-09-06 10:43:16 -05:00
|
|
|
|
2026-09-25 15:54:56 +00:00
|
|
|
1. Replace the application-specific guidance below with the repository's
|
|
|
|
|
purpose, adopted architectural constraints, and relevant non-goals;
|
|
|
|
|
2. Distinguish rules governing development from descriptions of implemented
|
|
|
|
|
structure. Keep proposed changes and implementation status in their canonical
|
|
|
|
|
documents under the [documentation policy](documentation.md);
|
2026-09-27 19:46:41 +00:00
|
|
|
3. Reference supporting documents when they contain useful information;
|
2026-09-25 15:54:56 +00:00
|
|
|
4. Update the `Last Updated` field to the current date; and
|
|
|
|
|
5. Remove this heading (`Base Policy Template`) and the associated text.
|
2026-09-06 10:43:16 -05:00
|
|
|
|
2026-09-27 19:46:41 +00:00
|
|
|
This template requires substantial customization. Select topics relevant to
|
|
|
|
|
the application from the examples below.
|
2026-09-06 10:43:16 -05:00
|
|
|
|
2026-09-25 15:54:56 +00:00
|
|
|
## Purpose And Ownership
|
2026-09-06 10:43:16 -05:00
|
|
|
|
2026-09-25 15:54:56 +00:00
|
|
|
The adopted policy defines the application's purpose and the architectural
|
|
|
|
|
constraints contributors must follow. It owns system boundaries, responsibility
|
|
|
|
|
and dependency rules, established invariants, and explicit non-goals.
|
2026-09-06 10:43:16 -05:00
|
|
|
|
2026-09-25 15:54:56 +00:00
|
|
|
Describe the concrete package inventory and implementation mechanics in internal
|
|
|
|
|
documentation. Link to canonical public contracts for their exact behavior and
|
2026-09-27 19:46:41 +00:00
|
|
|
to ADRs for decision rationale.
|
2026-09-06 10:43:16 -05:00
|
|
|
|
2026-09-25 15:54:56 +00:00
|
|
|
## Architectural Approach
|
|
|
|
|
|
|
|
|
|
Hexagonal architecture is strongly recommended, including encapsulating external
|
|
|
|
|
integrations and APIs within internal adapters. Keep domain and application
|
|
|
|
|
logic independent of external integration details, and make dependency direction
|
|
|
|
|
clear in the adopted policy.
|
|
|
|
|
|
2026-09-27 19:46:41 +00:00
|
|
|
Implement that separation with proportionate, idiomatic code. Choose interfaces
|
|
|
|
|
and package layout to serve the application's actual boundaries. Use adapters
|
|
|
|
|
for collaborators with external integration responsibilities.
|
2026-09-25 15:54:56 +00:00
|
|
|
|
|
|
|
|
## Adopted Constraints And Implemented Structure
|
|
|
|
|
|
2026-09-27 19:46:41 +00:00
|
|
|
An adopted architectural constraint governs development, including future
|
|
|
|
|
functionality. For example, a rule that external integrations belong behind
|
|
|
|
|
adapters applies whenever such integrations are introduced. Describe current
|
|
|
|
|
structure from implemented behavior.
|
2026-09-25 15:54:56 +00:00
|
|
|
|
|
|
|
|
Describe implemented structure accurately. Keep proposals and implementation
|
|
|
|
|
status in the roadmap, and significant decisions and their rationale in ADRs.
|
|
|
|
|
When an accepted decision requires changing existing structure, identify that
|
2026-09-27 19:46:41 +00:00
|
|
|
transition through those documents. Describe the target structure as implemented
|
|
|
|
|
when the corresponding changes land.
|
2026-09-25 15:54:56 +00:00
|
|
|
|
|
|
|
|
Constraints must reflect deliberately selected requirements and decisions.
|
|
|
|
|
Do not promote incidental implementation choices into architectural invariants.
|
|
|
|
|
|
|
|
|
|
## Application-Specific Topics
|
|
|
|
|
|
|
|
|
|
Replace this guidance with the relevant decisions for the application, such as:
|
|
|
|
|
|
|
|
|
|
- its purpose, overall system shape, and responsibility boundaries;
|
|
|
|
|
- dependency direction and the treatment of external integrations;
|
|
|
|
|
- whether a library provides a flexible API for varied consumers or an
|
|
|
|
|
opinionated API that enforces deliberately selected conventions;
|
|
|
|
|
- whether orchestration supports a full DAG or an ordered sequence of stages;
|
|
|
|
|
- any deliberately selected libraries that form an architectural dependency;
|
|
|
|
|
- established invariants that future changes must preserve; and
|
|
|
|
|
- explicit architectural non-goals.
|
|
|
|
|
|
|
|
|
|
## Trust Boundaries And Threat Scope
|
|
|
|
|
|
|
|
|
|
Where useful, state the trust boundaries and threat scenarios relevant to the
|
|
|
|
|
application's adopted requirements, along with scenarios it explicitly excludes.
|
|
|
|
|
For example, distinguish handling untrusted application input from defending
|
|
|
|
|
against a privileged actor concurrently modifying the host filesystem.
|
|
|
|
|
|
2026-09-27 19:46:41 +00:00
|
|
|
Threat exclusions define the scope of the adopted requirements. Base defenses
|
|
|
|
|
and guarantees on those requirements and raise unsettled scope for a deliberate
|
2026-09-25 15:54:56 +00:00
|
|
|
decision under the [agent policy](agents.md).
|
|
|
|
|
|
2026-09-27 19:46:41 +00:00
|
|
|
Keep this discussion proportionate to the application. A separate threat
|
|
|
|
|
assessment or security document is optional when adopting this template.
|
|
|
|
|
Configuration, operations, and internal documents retain ownership of credential supply,
|
2026-09-25 15:54:56 +00:00
|
|
|
runtime handling, and implementation mechanisms under the documentation policy.
|