Software architecture
accepted ADR-0003 engineering/ADR-0003-architecture
architecture: pattern: monolithicStatus
Section titled “Status”Accepted
What is this file? A question governance asks your repository, with the answer it recommends. While it says
status: proposed, you may edit it freely.revision:dates the question, not the file: you do not fill it, and it only moves when the question changes. rejected is a full answer: when the question does not apply here, rule rejected, remove the wholetraits:block, and say what stands in for it. ADR-0001 explains the mechanics.
Context
Section titled “Context”While this key is empty, an agent adding a module to this repository invents a structure, and invents a different one each time, because it infers from whichever file it has open. Once the value is written, it knows where code goes and what may depend on what.
The question comes early because it is expensive to undo: a directory layout and dependency boundaries change one module at a time, long after anyone stopped thinking about them.
Where the architecture is documented is a separate question, asked by ADR-0010.
Decision
Section titled “Decision”What governance recommends, and why.
| Key | Recommended value | Reason |
|---|---|---|
architecture.pattern |
hexagonal |
it suits agentic work: the domain depends on no I/O, so an agent writes and tests it without a running environment, and changes an adapter without touching the domain |
The reason deserves unpacking, because it is not the usual one. A hexagonal pattern bounds what an agent has to hold in mind to change a rule: the domain alone, with no database, no network, no framework. It is also what makes a change checkable without standing up an environment, so an agent knows whether it broke something instead of assuming it did not.
This recommendation does not bind your repository. It holds for an
application service of moderate size. Under about 500 lines, or for a
repository that is not a service, monolithic is often the honest answer;
and if the question has no object here, rule rejected.
Departure: monolithic instead of hexagonal. ontrack is a CLI (package.json declares a bin, no server), not an application service, and its code is about 900 lines. Its modules under src/ read and write the file system directly; src/commands/ is a thin yargs layer over them. That is one deployable without strong internal boundaries. Ports and adapters would add indirection this repository does not need, which is the cost this ADR names for small repositories.
Consequences
Section titled “Consequences”Positive
Section titled “Positive”- An agent adds a module next to the others in
src/and wires it fromsrc/commands/, without inventing ports or adapters. - No indirection to follow: a command reads top to bottom.
Negative
Section titled “Negative”- Modules that touch the file system are tested against temporary directories rather than in isolation from I/O.
Neutral
Section titled “Neutral”- If ontrack grows a service or a second front end, this ADR is revisited
and
hexagonalreconsidered.
Alternatives Considered
Section titled “Alternatives Considered”hexagonal
Section titled “hexagonal”Ports and adapters: the domain depends on no I/O.
layered
Section titled “layered”Classic layers, each knowing only the next one down.
microservices
Section titled “microservices”Services deployed separately.
monolithic
Section titled “monolithic”One deployable, without strong internal boundaries.
event-driven
Section titled “event-driven”Components communicate through events.
Shared services, coupled through contracts.
References
Section titled “References”- Adapted from surdesrails SDR-0003, revision 1 (its
architecture.patternkey;architecture.documentis asked by ADR-0010). - ADR-0001: how governance ADRs are ruled on.
The key.
| Key | What it holds | Allowed values |
|---|---|---|
architecture.pattern |
the pattern that structures this repository’s code | event-driven, hexagonal, layered, microservices, monolithic, soa |
One key, on purpose. governance does not carry your directory layout, package names or dependency rules: they are decided in your repository and written in this ADR’s body. The trait carries only what an agent must read without interpreting.
An empty key is not an answer: this one is required. The value is written in this file and nowhere else; whoever needs it links here. See ADR-0001 for the check command.
