Orchestrata Ultimate › Gates › architecture

Gate: architecture

At a glance

Purpose Refuse an import that breaks the 6-layer model (a lower layer importing a higher one, a Layer-3 service importing a concrete peer).
Where it runs The scripts/gates.py battery (registered as architecture); scripts/health_check.py; CI's architecture-check job (uv run --no-project python scripts/architecture_checker.py src/ --strict, .gitlab-ci.yml).
Trigger A battery run, a health check, a CI pipeline.
Exact command python scripts/architecture_checker.py (battery argv: [sys.executable, "scripts/architecture_checker.py"], input root src).
Blocks Exit 1 on any violation, 0 clean.
Ruling / ADR RUL-008 declares gate scripts/architecture_checker.py check_di_instantiation as one of its mechanisms. The edge-level ratchet beside it is ADR-0056.
Last recorded verdict ok: true in the primary checkout's .cache/gates.json (file last written 2026-09-22 10:01 local). wt-MAP-PRECOMMIT has no .cache/gates.json.

What it refuses

An import that breaks the layer model — a lower layer importing a higher one, or a Layer-3 domain service importing a concrete peer service instead of a protocol.

Why it exists

The module docstring is a single line: "Architecture checker — validates import rules, module boundaries, and layering constraints." No motivating incident is recorded in the source — origin not recorded in the source beyond the layer doc it enforces. The in-file comments do record the authority chain:

"Based on architecture-standards.md (the authoritative layer doc — this LAYER_ASSIGNMENTS table is the enforcement source; architecture-standards.md mirrors it for humans and MUST be kept in sync when this table changes)."

The layer model it enforces:

Layer Name Members (examples from LAYER_ASSIGNMENTS)
0 Vocabulary ("no orchestrata imports") core.domain, core.protocols, core.enums, core.interfaces, core.base, types, models, interfaces, exceptions
1 Infrastructure core.config, core.logging, core.tracing, core.monitoring, core.patterns, core.state, core.threading, core.adapters, core.redis_factory, core.graph_factory, di, …
2 Communication cxp, postman, memory
3 Domain Services ("no concrete peer imports") agents, governance, knowledge_graph, providers, verification, llm, drivers, …
4 Orchestration (kernel/orchestrator tier)
5 Interface (gateway/CLI tier)

How it runs

Typical failures and how to fix them

Wiring