Skip to content

Software architecture

accepted ADR-0003 engineering/ADR-0003-architecture

Decided traits
architecture:
pattern: monolithic

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 whole traits: block, and say what stands in for it. ADR-0001 explains the mechanics.

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.

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.

  • An agent adds a module next to the others in src/ and wires it from src/commands/, without inventing ports or adapters.
  • No indirection to follow: a command reads top to bottom.
  • Modules that touch the file system are tested against temporary directories rather than in isolation from I/O.
  • If ontrack grows a service or a second front end, this ADR is revisited and hexagonal reconsidered.

Ports and adapters: the domain depends on no I/O.

Classic layers, each knowing only the next one down.

Services deployed separately.

One deployable, without strong internal boundaries.

Components communicate through events.

Shared services, coupled through contracts.

  • Adapted from surdesrails SDR-0003, revision 1 (its architecture.pattern key; architecture.document is 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.