ADR 0005: Workspace layout and layer import contracts
- Status: Accepted.
- Date: 2026-11-12
- SDD: 5 (distribution table and repository layout), 12.4; requirements
ADC-MOD-002,ADC-PIN-001,ADC-CI-002
Context
The SDD ships Agentic-Datacenter as eight distributions with a fixed "may import" rule for each, six of them under one import name, agentic-datacenter. Stage 0 has to turn that table into something a build can fail on, before there is any code to get wrong.
Decision
- One uv workspace. The root
pyproject.tomlis not a distribution. Members arepackages/*. One committeduv.lock. agentic-datacenteris a namespace package.agentic_datacenter.core,.plant,.supervisory,.net,.governanceand.scenarioscome from six distributions. There is noagentic-datacenter/__init__.pyanywhere; each distribution owns one sub-package.agentic_datacenter_remoraandagentic_datacenter_iec61850are ordinary top-level packages.- Declared dependencies follow the SDD table exactly. A distribution depends only on the Agentic-Datacenter distributions it may import.
- Optional packages are opt-in. The root depends on the six core distributions.
agentic-datacenter-remoraandagentic-datacenter-iec61850are installed through the dependency groupsremoraandiec61850. - One forbidden-import contract per distribution, in the root
pyproject.toml, plus one that keeps REMORA out of everything exceptagentic_datacenter_remora. The contracts forbid direct imports only: a package may reach a lower layer through one it is allowed to import.
| Contract | Forbids |
|---|---|
| Core | Importing any other Agentic-Datacenter package |
| Plant | Anything but core |
| Supervisory | Anything but core |
| Net | Plant, governance, scenarios and both optional packages |
| Governance | Plant, net, scenarios and both optional packages |
| Scenarios | Both optional packages |
| REMORA binding | Anything in Agentic-Datacenter but governance |
| IEC 61850 | Anything in Agentic-Datacenter but core and supervisory |
| REMORA isolation | remora and servers imported from any package other than agentic_datacenter_remora |
Verification
uv run --all-groups lint-imports: 9 contracts kept.- With a REMORA import added to
agentic_datacenter.coreand a plant import added toagentic_datacenter.supervisory, the two matching contracts were reported broken and the other seven kept. The changes were then removed. uv syncwithout groups installs the six core distributions and no REMORA.
Consequences
- The contracts need every root package to be importable, so the contract check runs with all groups installed. The jobs that test without REMORA or without the IEC 61850 package (
ADC-PIN-001,ADC-IEC-005) need a contract file that leaves those packages out; that is Stage 1 CI work. - The harness may not import a gate binding. A binding is found through the
agentic_datacenter.gatesentry-point group (SDD 5.3), which is what lets a gate outside this repository be benchmarked unchanged (ADC-BEN-005). - "May import: governance, REMORA" is read strictly for the binding: it may not import
agentic_datacenter.coreoragentic_datacenter.supervisorydirectly. If the binding turns out to need a core type, governance re-exports it or the SDD table is changed. - Three contracts cannot be written until their code exists and are added in the stage that creates it: plant modules independent of each other (Stage 1), the protocol library confined to
agentic_datacenter_iec61850(Stage 6), andagentic_datacenter_remoralimited toremora.sdk(Stage 8). - Cross-package tests live in the top-level
tests/directory; a package's own tests live inside the package. Neither exists at Stage 0.