architecture-enforces-structural-and-operational-safety

IN derived (depth 3)

Architectural safety is enforced along two independent dimensions: structurally, the central network dependency is contained within clean three-layer boundaries preventing cross-layer corruption; operationally, every mutation path is atomic and isolated preventing within-layer partial state — neither dimension alone is sufficient, but together they eliminate both classes of corruption.

Summary

The system stays safe from corruption through two complementary guardrails: the layered architecture keeps the heavily-shared network module from leaking changes across boundaries, while the API layer makes every write operation all-or-nothing so no layer can end up half-updated. You need both — without structural containment, a single bad import could ripple everywhere; without atomic mutations, even well-separated layers could corrupt themselves internally.

Justifications

SL — Structural containment (layer boundaries) and operational containment (atomic mutations) are orthogonal safety dimensions that together prevent all corruption vectors

Antecedents (all must be IN):

  • central-dependency-is-safely-contained — Despite `network.py` being imported by virtually every module in the codebase, the three-layer architecture with clean boundaries ensures this central coupling does not create cross-cutting mutation paths — layer separation contains the dependency's blast radius so that the hub topology does not compromise architectural integrity.
  • api-layer-ensures-atomic-isolated-mutations — The API layer enforces mutation safety through four mechanisms: context-managed load/save, per-function transaction scope, write-flag gating to prevent unintended persistence, and dict-only returns that prevent callers from holding live network references.

Dependents

These beliefs depend on this one:

Details