| SR-F-01 (Four Layers) |
Setup has four layers, each a workspace folder under .devcontainer/ and a root module: bootstrap (<bootstrap-repo>), project setup (<setup-repo>), and the site repository’s nonprod and prod roots. A layer is applied only after the layer before it. |
BR-1.2 |
| SR-F-02 (Bootstrap Layer) |
The bootstrap layer creates the one central private state bucket (live state under workloads/, retention-locked copies under history/) and the credential that the project-setup layer uses. It is run once by a person with the one hand-created bootstrap credential, using a local encrypted state first and then migrating the state into its bucket, per workspace rule 10 section 2. |
BR-1.2, BR-1.3 |
| SR-F-03 (Project-Setup Layer) |
The project-setup layer creates, for each environment, a state-access credential limited to the central bucket and a deployer credential limited to that environment’s zone. Dev and prod must use different zones. It is applied by a person only. |
BR-1.2, BR-1.4 |
| SR-F-04 (Environment Layers) |
The non-production and production layers each declare only their own workload resources: storage, hosting project, the site’s DNS records (apex and www) and routes. The domain’s mail records are not site resources and are declared with the zone (SR-F-13). Each has its own root module, state key and passphrase. |
BR-1.3, BR-1.4 |
| SR-F-05 (One Account, Two Zones) |
Both environments live in one Cloudflare account. Production uses the apex of <domain>; non-production uses the apex of <test-domain>, a separate zone. Each zone has its own certificate and settings. The test domain is a separate registered domain, not a subdomain, because a subdomain is a record inside the production zone and zone-scoped permission would cover both environments; see ADR-INFRA-010. |
BR-1.1, BR-1.5 |
| SR-F-06 (Per-Environment Resources) |
Each environment has its own storage bucket and its own Pages project. Names follow <project>-<environment>-... per SR-INFRA-007, with non-production mapped to the dev environment value. |
BR-1.4 |
| SR-F-07 (Token Hierarchy) |
Each layer’s credential can create or change only the resources its module declares. The deployer credentials hold no permission to create credentials. Only the bootstrap and project-setup credentials may hold the token-management permission; their lifetimes are in SR-NF-08. |
BR-1.2, BR-1.3 |
| SR-F-08 (Values as References) |
Every layer has its own vault, <project>-<environment>. A person’s run receives the layer’s values from its 1Password Environment through the host wrapper, and a workflow from the vault through that environment’s read-only service account, per SR-INFRA-002. No workspace holds a value in its environment, mounts or image. |
BR-1.3 |
| SR-F-09 (Workspace Contents) |
Each .devcontainer/ folder carries the toolchain and the code of its own layer. There is no production workspace: production layers are applied only by GitHub Actions, and no container can apply production, per SR-INFRA-004 SR-F-03 and SR-F-06. |
BR-1.3 |
| SR-F-10 (Registrar Nameserver Step) |
After the zone exists, the registrar’s nameserver records are changed by hand to the two nameservers the zone reports. The step is documented in internal docs/infra/ and verified by a successful zone activation check. It is not automated. |
BR-1.6 |
| SR-F-13 (Mail Records With the Zone) |
The project-setup layer declares each zone’s mail records (MX with priority, SPF and DMARC TXT, DKIM CNAME) in email.tf of its module, from the input email_dns_records keyed by project, in each environment’s root. Names are relative to the zone, so no domain is written in code. Records are never proxied and carry a per-record TTL (1 for automatic, or 60 to 86400 seconds). They are applied in the same run as the zone, before the registrar nameserver step (SR-F-10), so the domain answers mail queries from the moment it is pointed at the provider. A record type other than MX, TXT or CNAME, an MX without a priority, a CNAME on the apex, or a project not in domains fails the plan. |
BR-1.7 |