satz workflows

Three walkthroughs, in the order most estates meet them, each a section of this page, and after them three shorter ones: workload estates beside the estate, how a workload estate — in HCL or in Satz — reads what the estate publishes and changes what it shares, continuous verification, the transpile check and the compliance report run as CI gates, and scanning with Prowler, the second opinion satz joins with its own report. Every command has its own reference section in the README; this page is the order to run them in.

From nothing to applied. The estate is written, the folder, infrastructure project and state bucket are bootstrapped, the identity layer is applied as the signed-in person, the state and the identity move to the estate account, and only then packs go in, one at a time. Its prerequisites section describes the fresh-organization case — a super admin creating the identity layer, an Organization Administrator on the organization — because a new organization has one principal, the super admin who created it, and Google grants that principal Organization Administrator. That is the strongest case, not what satz needs in general; the last paragraph below says what it needs.

Adopting an organization that already exists. Folders, projects, groups and policies are already live. satz import discovers them into an estate from a state file or from the organization itself, the hierarchy is refined by hand, satz transpile and tofu plan hold the result against what is live, and satz adopt resolves the ids of what exists so the plan reads no changes rather than replace. Once it does, the infrastructure is changed through the estate from then on; nothing is recreated on the way.

Workload packs. The packs a workload estate takes one at a time from a pack source — the satz repository, or a repository or folder config.toml names: get-pack fetches one into packs_dir and records where it came from, update-pack brings a fetched pack up to date and leaves an edited one as it is, a pack the repository wrote itself is written by no command, and publish-pack copies one the repository wrote into a folder source for other estates.

Keeping presets current. The loop that runs for the life of an estate. check-presets reports which packs are behind upstream, edited locally or changed only in what they ask; get-presets installs what is missing and refreshes what the estate does not use; merge-presets reconciles the rest — a pack behind upstream is refreshed, one you edited becomes an X.local.satz fork with the delta beside it in X.diff.satz, and the estate is repointed. The filename suffix says who owns each file.

satz-studio is the desktop app beside satz. It drives the same binary and the same estate files, so every step below can be taken either way, and the diagrams show both: the commands in the terminal, and the views in the app. What the app does not run itself — bootstrap and apply, which create as the human and ask for approval — it hands to the terminal as a command line to copy.

What satz needs, and where. satz holds no key or password of its own: it runs as the signed-in person until the switch to the estate account, and as that account afterwards. Before bootstrap creates anything it tests the permissions it needs on the scope root — the organization, or a folder — and on the billing account, and names what is missing. With a folder as the scope root (customer_organization_id = "folders/<id>") the estate installs under that folder: the permissions are tested there, organization-root operations are skipped, and an operator granted on the folder is not asked for organization admin. What satz needs is the right to do its work where its root is — create the folder and the project, link billing — and nothing above it. The one exception is Google's: roles/orgpolicy.policyAdmin is granted at organization level only, so an estate that declares organization policies on its folder needs that grant from an organization administrator before its first apply. The details, including what bootstrap self-grants and when it stops instead, are under Bootstrap the organization.


From nothing to applied

Five steps, in this order. Each one is a section below.

  1. Write the estate — satz init with the bootstrap values, or satz interview <name>.satz --create to be asked for them one at a time. Either way the file carries the same commented pack menu, so a pack is added by uncommenting its line, by answering its question, or by satz merge-presets writing the line for a pack the library gained since. The menu is written from presets/pack-graph.json, the pack graph that ships with the presets; with no graph in presets_dir the file is written without pack lines, and satz get-presets then satz merge-presets write the whole menu where it goes. Every line stands at the top level of the file, before the estate's own resources, under the phase its pack can be adopted in; the one exception is a pack that is a bare list of labeled bodies — essential contacts — whose line is written inside the map of its resource type. A pack that reads a param another pack declares — the central alerts, which default their project to the logsink's, Sentinel and the findings mail — has its line written after that pack's, because a param is known from the line that declares it on.

  2. Bootstrap the organization — satz bootstrap, which creates the folder, the infrastructure project, the billing link, the foundation APIs and the state bucket, then transpiles and imports what it made.

  3. Apply as yourself — satz transpile, then plan and apply. This is still deployment_mode = "local": the run authenticates as the signed-in person, and it creates the identity layer — the groups, the estate account and its roles.

  4. Switch to the estate account — satz migrate … --mode cloud, which moves the state into the bucket and makes every later command impersonate the estate account. From here nothing runs as a human.

  5. Then add packs — the CIS baseline and whatever else the estate needs, one at a time, each with its own plan and apply. Presets come after step 4: the bootstrap scaffold has to exist and the state has to be in the bucket before a pack creates anything on top of it. Keeping presets current is that loop.

    An estate the interview wrote already lists every pack, each as a commented use line under the phase it can be adopted in — the map first, then the security-group model, then what depends on the groups, and so on. satz add-preset <estate> <gate> adds a pack: it binds the gate, makes the line active, and refuses while a pack it needs is off, naming it; satz remove-preset binds the gate false. Answering that pack's question in satz interview switches its line on the same way, and satz presets shows every pack with its answer, its line and what it needs. satz merge-presets writes the line for a pack the library has gained since the estate was written, so the list stays the library's rather than one person's memory of it. A question this estate has answered true whose line is still commented — or missing — is reported at every transpile, because otherwise the answer is bound and nothing writes it. The answer is the estate's own params {} binding: a default in the map or in a pack is the library's proposal, so a bootstrap skeleton — every line commented, nothing answered — transpiles clean at validation_level = "error", and satz presets is where the proposals are read.

    A pack can name one command to run once it is on: the CIS org-policy packs name satz adopt <estate> --execute --import, because Google sets some of their policies on every new organization and an apply that creates a policy that exists stops on 409 POLICY_ALREADY_EXISTS. satz prints that notice when the pack goes on, the transpile warns at its use line, and transpile --apply and bootstrap refuse until the estate binds the notice's param true — which adopt --execute --import does itself when the run covers every type and nothing is left unresolved. A pack used under several names asks once per use: the estate binds <name>.<param> = true for each, and adopt --execute --import binds every use's.

STEPS 1–3 · AS THE SIGNED-IN PERSON (ADC) deployment_mode = local · the state is a file in hcl/ STEPS 4–5 · AS THE ESTATE ACCOUNT deployment_mode = cloud · the state is in the bucket 1 · write the estate asked one at a time, or given 2 · bootstrap folder, project, bucket 3 · apply as yourself the identity layer is created 4 · the estate account state and identity move 5 · add packs one pack per plan and apply SATZ in the terminal satz init … bootstrap values as flags — or — satz interview x.satz --create asks the 18 questions one at a time; every pack line is written, commented, under its phase satz bootstrap x.satz the prerequisites check: permissions on the scope root and the billing account, first then: folder · project · billing link · APIs · state bucket; transpile + import … --dry-run the same, read-only satz transpile x.satz satz plan satz apply as your own credentials; this apply creates the identity layer: the groups, the estate account and its named roles satz migrate x.satz --mode cloud deployment_mode = cloud, tofu init -migrate-state: the state moves into the bucket; provider and backend act as the account satz plan → No changes satz whoami x.satz names the account it ran as uncomment a pack's use line, or answer its question: satz interview x.satz satz merge-presets writes the line for a pack the library gained since satz transpile x.satz satz plan · satz apply one pack per apply, as the estate account SATZ-STUDIO the desktop app — it drives the same satz binary; what it does not run itself, it hands to the terminal the start screen writes the estate or opens its folder: Create · Open Create runs satz init Decisions the bootstrap questions one at a time — why, reversal, blast — and satz's own writer binds each answer Apply → bootstrap the command line with its arguments, to copy or to open in the terminal bootstrap never runs inside the app: it creates as the person, after its own check Apply → transpile, plan run in the app, the log streamed as it comes Apply → apply in the terminal, with its approval prompt Messages the transpile's messages, at the file and line they name in the terminal: satz migrate x.satz --mode cloud Apply · the first card who is signed in, read through satz_whoami; the estate account runs every call from here on Presets switch a pack on or off; merge-presets writes the line of a pack that is new Decisions the questions a pack brings Apply → transpile, plan in the app; apply in the terminal, one pack at a time Every step ends with a plan that reads No changes before the next begins. satz-studio needs satz on the PATH at its minimum version; an older one is refused.
The five steps of an estate's life, each as satz commands in the terminal and as satz-studio: write the estate, bootstrap, apply as yourself, switch to the estate account, add packs one at a time; steps 1–3 run as the signed-in person with a local state, steps 4–5 as the estate account with the state in the bucket

Prerequisites

The executing user needs:

Authenticate, then write the estate and the folder structure around it:

gcloud auth application-default login

satz init \
  --customer-id "C0example" \
  --customer-shortname "acme" \
  --billing-account-infra "012345-6789AB-CDEF01" \
  --customer-domain "example.com" \
  --customer-organization-id "123456789012" \
  --iac-user "admin@example.com" \
  --interview

--interview fetches the preset library before the estate is written and asks for what the flags leave out. Without it the estate names a compliance catalog the directory does not hold yet, and its transpile is refused until satz get-presets has fetched the library.

Without the flags, satz interview <name>.satz --create writes the estate and asks for the same bootstrap values one question at a time, offering the derived ones as defaults; an agent does the same over MCP. It runs in a directory that holds config.toml, the library (satz get-presets) and the provider schema (satz update-schema), and takes the file's name inside yaml_dir: acme.satz, where satz/acme.satz is refused as a path that would create satz/satz/acme.satz. Both end at the file init would have written, and satz interview describes the rules they share: an answer is a param the estate binds, and nothing below runs while one is missing.

Bootstrap the organization

bootstrap refuses while any question the estate's packs declare is unanswered, and while a pack's severity = error notice is unacknowledged; --dry-run transpiles, prints it and goes on.

Before it asks for a sign-in, bootstrap checks the params it is about to use: customer_shortname, billing_account_infra, infra_project_name and infra_bucket_name are present — each is the estate's own value, and the only default is the one estate-core declares — the organization id is a number, the billing account reads XXXXXX-XXXXXX-XXXXXX, and the project id and bucket name are shaped the way Google accepts them. A failure names the param and the flag that sets it, and nothing is called, so an empty value never reaches a URL. Then, before any permission is tested, the organization itself is resolved: one that is not visible to the caller is reported as that, with the ones that are listed, rather than as a wall of missing permissions. Where the estate binds customer_id as well, the two are cross-checked, so an organization belonging to a different directory customer is named before anything is created. The state bucket is created in default_region; an estate that binds none gets europe-west3, the default presets/estate-core.satz declares, and bootstrap prints the line default_region not set — using europe-west3, the documented default.

bootstrap creates the bootstrap's infrastructure — the infrastructure folder, the infrastructure project, the billing link, the foundation APIs (which tofu needs enabled before its first run) and the state bucket — then runs transpile, init and the first imports, so what it created is under management from the start.

satz bootstrap C0example.satz

Prerequisites check. Before anything is created, bootstrap verifies the signed-in person against first_admin and tests the required PERMISSIONS — never roles — with testIamPermissions:

Where Permission Supplied by
scope root resourcemanager.folders.create (only when infra_folder_name is set) roles/resourcemanager.folderAdmin
scope root resourcemanager.projects.create roles/resourcemanager.projectCreator
scope root orgpolicy.policies.create (the estate's policies, at first apply) roles/orgpolicy.policyAdmin
billing account billing.resourceAssociations.create roles/billing.user

Folder-scoped installs. Set customer_organization_id = "folders/<id>" and the estate installs under that folder: permissions are tested there, and org-root operations are skipped, so an operator granted on the folder is not asked for organization admin. Google grants roles/orgpolicy.policyAdmin only at organization level: on a folder scope a missing orgpolicy.policies.create is reported as advisory, and folder-level organization policies need an organization-level grant before their first apply.

Dry run. satz bootstrap <estate> --dry-run is read-only: it prints the plan, verifies the signed-in person and runs the same prerequisites check (a would-be self-grant is reported, not executed). Without a sign-in the plan still prints and the skipped check is named (prerequisites check: SKIPPED).

What bootstrap does NOT do: it creates no service account and grants no IAM beyond the self-grant above — the estate account and its grants are declared in the estate and come into being on the first tofu apply. It removes nothing either: the domain's default Project Creator and Billing Account Creator grants, which the project creation above runs on, are taken off by a later satz apply, once the security-group model has granted the first admin the two roles explicitly (the default grants).

What follows. bootstrap ends by naming the next commands with the estate's own values, in this order: satz update-prerequisites <estate>; satz transpile <estate> --plan, then --apply, as you in local mode, which creates the groups, the estate account and its roles; satz migrate <estate> --mode cloud, which moves the state into the bucket and checks the estate account for Groups Admin — a Workspace role, not an IAM grant. It asks the estate account first, as itself, and stops there when it holds the role; only when it does not is your sign-in asked, and when your account holds the role migrate assigns it to the estate account through the Admin SDK, given a sign-in with the role-management scope. Otherwise it says what is missing and names the admin-console path; and satz whoami <estate> followed by a plan that must read "No changes". migrate, get-presets and adopt --execute end with their next command the same way.

The sign-in line. Every live command prints one line before its first API call — signed in as: <identity> (user sign-in | impersonated service account | service account key), quota project <p> — so a wrong per-customer sign-in shows before the first call instead of as a later 403. satz whoami is the explicit check (--offline for the file-only view; a user's sign-in file stores no identity, so the online form resolves it via token introspection). satz whoami <estate> answers the other question — the identity that estate's live commands actually run as. On a cloud-mode estate that is its estate account, and the line names the relation: runs as: svc-iac-…@… — impersonated by you@…. A local-mode estate — the state after bootstrap, because the first apply creates the account — runs as you, and the line names the account it declares and the command that switches to it: runs as: you@… — local mode; satz migrate <estate> --mode cloud makes every run impersonate svc-iac-…@…. Without an estate the line says none was given. Both halves print together, because a live command uses both, and online it CHECKS them: one generateAccessToken (token discarded) for whether the signed-in person may act as that account, and one projects.get for whether the quota project is reachable. Given an estate that transpiles, it also tests the permissions the estate's resource types need (testIamPermissions on the organization, the infrastructure project and the billing account) and names each missing one with the role that carries it. --offline reads the estate file alone and says the checks were not made rather than implying they passed.

Quota project. Set the sign-in's quota project to a project the caller can reach, normally the infrastructure project:

gcloud auth application-default set-quota-project <infra_project_name>

A quota project the caller cannot see — for example a typo — does not work: commands that only print it accept it, and every API call then fails with UserProjectInvalid, or report-compliance with "live inventory unavailable". Live commands check it once before the work and refuse with the project named.

Impersonation. On a deployment_mode = "cloud" estate, every live command impersonates the estate's estate account ({svc_iac_account}@{infra_project_name}.iam.gserviceaccount.com) — exactly the identity tofu applies with — so the human needs no organization-wide read roles, only roles/iam.serviceAccountTokenCreator on the SA (normally via membership in svc-iac-users). --no-impersonate opts out; bootstrap never impersonates (at the bootstrap the SA may not exist yet); a sign-in that already impersonates is used as-is. The sign-in line names the SA the calls actually run as. An estate whose params do not parse, whose deployment_mode is neither local nor cloud, or whose cloud mode has no value for svc_iac_account or infra_project_name, names no identity: whoami, migrate and every live command refuse it with the reason, and none runs as the signed-in person instead.

Greenfield: a tenant with no organization yet. Google creates the Organization resource for a Workspace/Cloud Identity domain when a NEW Google Cloud user signs in to the console and accepts the terms, or when an EXISTING user creates their first project or billing account (documented). A customer new to Google Cloud whose admin has signed in to the console and accepted the terms therefore already has an organization: satz init derives its id, and plain satz bootstrap is the path. --greenfield is for a tenant where nobody has signed in yet, and uses the second trigger:

  1. satz init --customer-id <C0…> — derives every derivable init value from the sign-in alone (identity → first_admin + customer_domain, organizations:search → organization id + directory customer id, billingAccounts.list → the single open account; explicit flags always win, nothing is guessed). With no organization visible, the estate is written with an empty customer_organization_id.

  2. satz bootstrap <estate> --greenfield — leaves the question of the organization's id open, the one question a bootstrap does not need answered then (every other is answered first), creates the infrastructure project WITHOUT a parent (the trigger), polls organizations:search until the new organization appears (matched by its directoryCustomerId, never "the first organization"), writes its id into the estate at once, puts the project under it — Google attaches the project to the organization it provisions, and satz moves it only when it stands elsewhere — and continues with the normal prerequisites check and build. The admin signs in to the Google Cloud console once and accepts the terms of service before the run; the dry run says so. A run that stopped after the organization appeared is continued by the same command: it finds the directory customer's organization and the project, writes the id and goes on. If the organization never appears, the timeout names the console sign-in, and the project stays for the next run.

    A super admin holds the new organization's IAM rights without a role bound to them. The console's organization setup binds roles/resourcemanager.organizationAdmin to the admin explicitly, and the greenfield run does the same right after the organization appears; satz reads and writes an organization's IAM policy through Resource Manager v1, which honors the implicit rights that grant relies on. A bootstrap that fails with FAILED_PRECONDITION names the terms of service: the admin signs in to the console once, accepts them, and runs it again. A sign-in with no quota project is told the command that names the infrastructure project as one.

An estate whose customer_organization_id has no value (none) or is empty fails with exactly this guidance instead of a bare "missing organization id". A transpile of such an estate writes no HCL code when anything would stand under the organization — a folder with no parent, a project in no folder, a grant on the organization — and names the same two ways out; satz transpile --check and the interview still judge it, and with --greenfield the id is in the estate before the transpile runs.

Transpile, plan, apply

Bootstrap already transpiled and initialized. After any later edit to the estate, transpile it again and read the plan:

satz transpile C0example.satz --plan
satz transpile C0example.satz --apply

--plan and --apply run tofu in hcl/ through satz plan and satz apply, with the API prerequisites check and, on the apply, the default grants before tofu starts. tofu plan and tofu apply typed in hcl/ run neither.

The first apply creates the identity layer: the Cloud Identity groups, their IAM roles (Token Creator among them) and the rest of the infrastructure project. Once the security-group model is in, its apply grants the first admin Project Creator and Billing Account Creator explicitly, and the apply after that takes the domain's default entries for the two roles off the organization (the default grants).

tofu applies hcl/ as satz wrote it, with one exception that needs an argument: an organization policy the state holds with rules while the estate declares it reset = true. The API refuses to switch such a policy to reset in place (400 Cannot set PolicyRules if reset is true), so the apply has to replace it. satz plan and satz apply add the -replace; for an apply that does not run through satz, main.tf names it in a comment above each policy it declares reset:

# Declared reset: while the state holds its rules, the API refuses the in-place update (Cannot set PolicyRules if reset is true).
# satz plan and satz apply add the replace; a bare apply needs: tofu apply -replace=google_org_policy_policy.iam_disableServiceAccountKeyUpload_superseded
resource "google_org_policy_policy" "iam_disableServiceAccountKeyUpload_superseded" {

A policy the state holds without rules, or does not hold yet, needs no -replace.

A pack added later can write a resource type the estate account holds no role for. The transpile names the role, and satz update-prerequisites C0example.satz writes it into the estate's grant list. The apply then creates the grant and the resources that need it in one pass; a resource that meets a permission error on the role just granted is created by running the apply again once the grant has taken effect, which takes up to a few minutes.

The API prerequisites check

The estate's google provider carries user_project_override = true with billing_project = <infrastructure project>, so Google bills every call it makes to that project and wants the API enabled there; a project's own alias bills to that project. tofu apply refreshes every resource in state before it creates anything, and an API the estate declares as a google_project_service but the billed project has off stops that refresh — before the declaration that would enable it is created.

satz plan and satz apply enable them first. They read the written providers.tf for every project a provider bills to and the service account the default provider impersonates, read main.tf for the services declared on each of those projects, ask Service Usage which are off and switch those on, as the estate's estate account — the identity the estate grants roles/serviceusage.serviceUsageAdmin — through the default provider's project: the Service Usage calls bill to the infrastructure project, so a project with serviceusage.googleapis.com off has its APIs switched on as well. satz transpile --plan and --apply do the same. A project node's project is checked when the state holds its google_project or an import block adopts it; otherwise the run creates it, its services come after it, and the check says so and goes on. The default provider's project is always checked. One line per project:

APIs on corp-data-001: not checked — google_project.data is neither in the state nor adopted by an import block, so this run creates it and its 2 declared API(s) after it
APIs on corp-infra-001: 14 declared, all enabled

and a change names every API:

APIs on corp-infra-001: 14 declared, 2 off — enabling them, because the refresh is billed to this project and runs before anything is created
  enabled cloudasset.googleapis.com
  enabled essentialcontacts.googleapis.com

The enable is a live change outside tofu's state. The declared google_project_service records an API that is now already on and its create is idempotent, so the plan that follows shows no change for it.

compute.googleapis.com is the one API the check does not always switch on. Google creates the default network the moment Compute is switched on in a project where compute.skipDefaultNetworkCreation is not in force, so where the estate declares that policy enforcing, the check reads the organization's effective policy first and switches Compute on only when it already enforces the constraint. Otherwise Compute is left to the apply, in which the Compute service waits for the policy, and the line says so:

APIs on corp-infra-001: 14 declared, 2 off — enabling 1 of them, because the refresh is billed to this project and runs before anything is created
  enabled cloudasset.googleapis.com
  left to the apply: compute.googleapis.com — the estate declares `google_org_policy_policy.compute_skipDefaultNetworkCreation` enforcing and the organization does not enforce it yet; the apply creates the policy and switches Compute on after it, so the project gets no `default` network

satz bootstrap does the same at the bootstrap, where nothing is live yet, and lists Compute under Deferred to the estate. A plan that then stops on a Compute read — resources imported into a project while Compute is off on the project their reads are billed to — needs the policy applied first, or Compute switched on by hand with the gcloud services enable line and the default network that creates deleted by hand.

Where the enable cannot succeed — the identity holds no serviceusage.services.enable, the Service Usage API is itself off on the billed project, an organization policy forbids it — the run stops before tofu and prints the command that does it by hand:

APIs on corp-infra-001: satz could not enable them: 403 PERMISSION_DENIED …
  cloudasset.googleapis.com
  essentialcontacts.googleapis.com
enable them and run this again:
  gcloud services enable cloudasset.googleapis.com essentialcontacts.googleapis.com --project corp-infra-001

satz --no-api-preflight plan skips it: satz asks Service Usage nothing and enables nothing. update-prerequisites writes the declaration into the estate and enables nothing either; it prints the same gcloud services enable line, one per project, for the APIs it adds. The reasoning is in ADR 0036 and, for the other projects a provider bills to,

ADR 0072.

The default grants

A new organization grants roles/resourcemanager.projectCreator and roles/billing.creator to domain:<customer domain>: every user in the directory creates projects and billing accounts. The security-group models grant the two roles to the first admin explicitly, beside the groups that hold them, and satz apply takes the domain's entry off each of the two roles once every holder the estate declares for that role on the organization is live. It runs after the APIs, before tofu, as the same identity; it reads the organization and the domain from the written terraform.tfvars and the declared holders from main.tf — every unconditional google_organization_iam_member of the two roles. One line per declared role:

default grants on organizations/123456789012:
  left in place: domain:example.com holds roles/resourcemanager.projectCreator — user:admin@example.com declared and not live yet; the apply grants it and the next apply removes the domain's entry
  left in place: domain:example.com holds roles/billing.creator — user:admin@example.com declared and not live yet; the apply grants it and the next apply removes the domain's entry

and on the apply after that:

default grants on organizations/123456789012:
  removed domain:example.com from roles/resourcemanager.projectCreator — restore with: gcloud organizations add-iam-policy-binding 123456789012 --member=domain:example.com --role=roles/resourcemanager.projectCreator
  removed domain:example.com from roles/billing.creator — restore with: gcloud organizations add-iam-policy-binding 123456789012 --member=domain:example.com --role=roles/billing.creator

The removal is one write under the policy's etag, retried on a concurrent change, and it touches nothing else: a holder the estate does not declare stays, whatever role it holds; a domain entry held under a condition is reported and left; an estate that declares "domain:{customer_domain}" a holder of one of the roles in its own grant map keeps it, and the line reads kept: the estate declares domain:example.com a holder of roles/billing.creator. satz plan prints apply would remove … and writes nothing. A folder-scoped estate, a workload estate and an estate that declares no holder of either role are named and skipped; a policy that cannot be read stops the command. A domain entry restored by hand is removed again on the next apply, with the line printed. --no-api-preflight skips this step with the APIs. The reasoning is in ADR 0081.

Switch to the estate account, and apply as it

Steps 1–3 ran as the signed-in person. This is where that ends: the state moves into the GCS bucket and every later command impersonates the estate's estate account.

DEPLOYMENT_MODE = LOCAL steps 1–3: as yourself the signed-in person Application Default Credentials, gcloud's satz transpile → hcl/ provider blocks with no impersonation satz plan · satz apply tofu runs as the user; this apply creates the identity layer: the groups, the estate account, its named roles state: a file in hcl/ on this machine only satz migrate x.satz --mode cloud deployment_mode = cloud rewritten in the estate tofu init -migrate-state moves the state providers and backend written again with impersonate_ service_account DEPLOYMENT_MODE = CLOUD from step 4: as the estate account the signed-in person the same credentials — now only to impersonate the estate account svc_iac_account in infra_project_name satz plan · satz apply tofu runs as the estate account: every provider block and the gcs backend carry impersonate_service_account state: the GCS bucket read and written as the estate account, never as a person satz whoami x.satz prints which of the two a run uses. In satz-studio Apply's first card says who is signed in; migrate itself runs in the terminal. When the written backend changes, tofu refuses the next command until re-initialized; migrate re-initializes by itself.
Local and cloud side by side: as yourself with a local state file in steps 1–3, then satz migrate --mode cloud moves the state into the bucket and makes provider and backend impersonate the estate account, which runs everything from step 4 on

Switch the state to the GCS bucket and the identity to impersonation:

satz migrate C0example.satz --mode cloud

migrate rewrites the estate's deployment_mode, switches to impersonating the estate account and runs tofu init -migrate-state. An estate without svc_iac_account or infra_project_name is refused before the file is touched, naming the param: the estate account is the one those two name. Impersonation applies to both halves of the run: every provider block gets impersonate_service_account, and so does the gcs backend, so the state bucket is read and written as the estate account rather than as the signed-in person.

When the written backend changes, tofu refuses the next command until it is re-initialized: run tofu init -reconfigure once in hcl/. migrate re-initializes by itself.

Then check that the estate account can run the plan — this is the first apply that authenticates as the estate account rather than as a person, which is what the whole sequence is for:

satz plan

A plan that reads No changes here means the estate, the state and the organization agree, and the estate is ready for its first pack. satz whoami C0example.satz prints the account the run used, which from now on is the estate account, impersonated by the human who typed the command: runs as: svc-iac-…@… — impersonated by you@….

The params init writes

The same params, each with its question, are presets/estate-core.satz — what satz interview asks when there are no flags. An estate init wrote from its flags binds all of them but customer_longname, which it writes as none, and workload_folder_name; init --interview and satz interview ask for those two, and an estate the interview wrote is complete when it says so.

Param Default Description
infra_folder_name "Infrastructure" Display name for the top-level folder. Leave "" to create the project in the root.
infra_project_name "{customer_shortname}-infra-001" The unique id for the infrastructure project.

| infra_bucket_name | "{customer_shortname}-infra-001-state" | The GCS bucket for Terraform state. | | customer_id | (from CLI) | The Workspace customer id (e.g. C01234567). | | customer_organization_id | none | The numeric Google Cloud organization id. | | customer_domain | none | The customer's primary domain (e.g. example.com). | | first_admin | (from --iac-user) | Local part of the first admin's address; members are built as user:{first_admin}@{customer_domain}. | | customer_longname | none | The full legal name of the customer entity. | | customer_shortname | none | A unique slug for the customer. Names that must be globally unique derive from it. | | svc_iac_account | "svc-iac-001" | The primary estate account. | | estate_account_user_group | "svc-iac-users" | The estate account user group. | | billing_account_infra | none | The billing account id (e.g. 012345-6789AB-CDEF01). | | deployment_engine | "tofu" | The IaC tool: tofu or terraform. | | deployment_mode | "local" | local for the bootstrap (the signed-in person); cloud after it (impersonation). Switched by satz migrate. | | default_region | "europe-west3" | Default region for regional resources. | | default_zone | "europe-west3-a" | Default zone for zonal resources. | | workload_folder_name | unbound: answered in satz interview or satz-studio | Required: the display name of the workload folder, directly under the organization, which holds the delegated resources of workloads. An empty answer is refused. | | compliance_frameworks | ["cis-gcp-5.0"] | The frameworks this customer is HELD TO, as catalog ids from presets/catalogs/ (cis-gcp-4.0, cis-gcp-5.0, iso27001-2022) — a contract, an auditor, a regulator. Not what the estate claims, which comes from its packs. A value naming no catalog is refused by the transpile. |

Tear the estate down

The provider protects the two nodes the tree is built from: a project's deletion_policy is PREVENT and a folder's deletion_protection is true unless the estate says otherwise, and satz writes neither attribute by itself. A tofu destroy is therefore refused — first for the project, then, once that is settled, for the folder.

Both are ordinary attributes. Declare them, apply each one on its own, then destroy:

# 1. the project: deletion_policy = "DELETE" in every google_project body
satz transpile C0example.satz
satz apply --config . -target=google_project.infra

# 2. the folder: deletion_protection = false in every google_folder body
satz transpile C0example.satz
satz apply --config . -target=google_folder.shared

# 3. the destroy the two edits allow
satz apply --config . -destroy
google_folder {
  shared {
    display_name        = "Shared"
    deletion_protection = false
  }
}

google_project {
  infra {
    project_id      = "acme-infra-001"
    deletion_policy = "DELETE"
  }
}

Each attribute has to be in the state before the destroy reads it, which is what the two targeted applies are for: a destroy run against a state that still holds the protection is refused whatever the configuration says. The edits stay in the estate — declared in git, visible in a plan, and the reason a project is destroyable is the line that made it so.


Adopting an organization that already exists

Discover

Capture what is there. From an existing Terraform/OpenTofu state:

tofu show -json > state.json
satz import state.json -o migration-discovery.satz

Every estate is bound to an organization, and a state carries its number only where a resource names it (organizations/<n>, org_id) or a top-level folder hangs under it. A state of folders and projects nested under a folder outside it names none, and the import is refused with nothing written — name it:

satz import state.json --organization 123456789012 -o migration-discovery.satz

Or straight from Google Cloud, with no state at all:

satz import organizations/123456789012 -o migration-discovery.satz

The sweep reads the organization as you, signed in, and your account needs roles/cloudasset.viewer on it. On an organization satz set up, that role is the estate's estate account's: name the estate with --as and the sweep reads as that account, the one tofu applies with.

satz import organizations/123456789012 --as C0example.satz -o migration-discovery.satz

The run prints as whom it sweeps before the first request, and a refusal repeats it. --as needs an estate that impersonates a service account: a local-mode estate impersonates none, and --no-impersonate keeps any estate off its account, so both are refused — the sweep would read as your own sign-in, which the bare form does. --as and --into sweep only the organization the estate is bound to (customer_organization_id) or a folder or project inside it; a folder or project is walked up through Resource Manager as the estate's identity, and a scope in another organization, or one whose organization cannot be read, is refused before the sweep.

From a directory of .tf files the organization is the one the configuration names — a literal organizations/<n> parent, an org_id, an organization policy's parent. A variable the configuration uses as the organization and declares with no default — org_id = var.org_id, the form vendor-generated onboarding scripts ask for — binds to the organization --organization <n> names, and its param is written as customer_organization_id. A configuration that names none, and every --wrap-all import, which converts nothing, is refused with nothing written until --organization <n> names it:

satz import ./terraform --wrap-all --organization 123456789012 -o migration-discovery.satz

The resource types marked import: true in presets/import-config.yaml are the default set. --all takes every type the source can deliver instead: from a state file every row, live every row with an asset_type. --only narrows either set, and --exclude leaves types out (--all --exclude "google_*_iam_member"). The table is the provider's resource types at its provider_version — google and google-beta, 1280 rows: 449 with their Cloud Asset Inventory name (derived from the type name, checked against Google's list, presets/cai-asset-types.txt, and asked of ListAssets), 439 that Cloud Asset does not serve as assets (IAM members, org-policy v1 shapes, the types ListAssets refuses; state shape only), 392 marked TODO/UNKNOWN (Cloud Asset does not inventory them, or the name could not be derived — scripts/update_import_config.py prints what it tried). A copy of the table with your own import: flags, passed with --import-config, is the repeatable form. A grant one principal holds on two folders or two projects is refused, because the map form writes one address per member and role; --on-collision counter writes the second and later as labeled resources with a running number, and says which.

Google retires asset types, and presets/cai-asset-types.txt is a snapshot of what it served when the file was refreshed. A type the API does not serve makes it refuse the whole request of a hundred types it stands in, naming none of them: satz asks the request again in halves until the refusal is down to that one type, leaves it out and fetches the other 99. The run ends by naming each such type with the rows that asked for it, so what the estate is short of is on the screen; refresh the table or leave the rows out with --exclude. A scope the sign-in may not read, a connection that broke, and a sweep in which every type asked for was refused — a scope ListAssets cannot read, however few types were asked — end the run with nothing written.

A live resource whose provider block would not plan is never written: a required attribute the asset data lacks is derived where it can be (parent, org_id/folder/project from the asset path, a service account's account_id from its email) and the resource is otherwise skipped with the attribute named. An attribute the estate says by where the resource STANDS — the enclosing project, folder or organization, and an organization policy's parent — is no hole: the asset data never carries it and the transpile writes it from the node the resource is written under.

What is not there to import is left out and listed as not live: a folder or project that is no longer ACTIVE (Cloud Asset lists a deleted one for 30 days), everything inside one — its grants, its log buckets, a resource no row maps, which --generate-unmapped is not asked for either — and a service that is not enabled. Cloud Asset goes on listing a switched-off service as ENABLED, so every service the sweep found is confirmed with Service Usage per project; one it does not report enabled is left out, and a project whose services cannot be read is named with its services written as Cloud Asset lists them.

A resource written inside a project is served by that project's own provider, which bills its calls to the project, so the project needs the resource's API on. The same Service Usage request asks for every API the resources inside the project need; one the project has off is added to its project_service list with the import id it has once it is on, and the run names each:

import: 1 API(s) added to a project's `project_service` list — the project has it off and resources imported into it need it; `satz plan` and `satz apply` switch it on through the infrastructure project before `tofu` starts:
  logging.googleapis.com on acme-log-001 — needed by google_logging_project_bucket_config

satz plan switches it on before tofu refreshes anything (the API prerequisites check), and the plan imports it with the rest. Under --into, an API the estate declares on that project already is left to the estate. A tofu plan run directly needs the gcloud services enable <api> --project <project> first.

Given an estate (--into, --as), every read the run makes — the sweep, Service Usage, Cloud Billing, Resource Manager, the lookups --into resolves the estate with — is billed to the estate's infra_project_name, and the run switches on there any of the APIs those reads call that is off (cloudasset, cloudbilling, cloudidentity, cloudresourcemanager, orgpolicy, serviceusage) once the scope is checked and before the sweep. A workload project is never switched on by the import itself. An estate that binds no infra_project_name reads with the caller's quota project, and the run says so.

A subnet's local route, which states a nextHopNetwork no argument of google_compute_route sets, is listed as platform-managed. A type the provider has no import for (importable: false on its row: a service account key) is not swept, and the run names it.

The API's shape is written in the provider's: a wrapper { fingerprint, items } is its items where the attribute is a set (an instance's tags) and a map where it is a map (metadata); a plural list whose singular is a block is that block (networkInterfaces → network_interface, accessConfigs → access_config); an instance's disks are its boot_disk and attached_disk blocks, each naming its disk by source; a disk's type self-link is the type's name and its source image and size are image and size; a DNS zone's visibility is lower case. A log bucket config names its parent the way the provider holds it — projects/<id>, folders/<n>, organizations/<n> — and a reference that names a project by its number (an alert policy's notification channels) names it by its id where the sweep read that project. A disk's architecture is left out and listed: the provider does not read it back on import, and written it forces a replacement. Where the asset's parent does not decide between two rows whose types name none, the provider schema does: a type with a project argument serves a project, one with a parent of its own an organization or a folder — a project's network firewall policy and a hierarchical one share a Cloud Asset type.

Import ids of live resources are the asset path, with the project named by id (the provider keeps a project NUMBER on import and the declared id would then force a replacement) and a DNS zone by its name, rendered through the import-config row's import_id template where it has one — the same id --generate-unmapped writes and --into subtracts by. An empty string is carried on a required attribute (expiration_policy.ttl = "" is never expires) and dropped on an optional one, which the provider reads as unset. Verified on a test organization with folders, projects, services, buckets, IAM, organization policies, org/folder/project log sinks, a service account and an essential contact: tofu plan = every resource imported, nothing added or destroyed.

Refine the estate

The discovered estate transpiles as-is and mirrors the live layout in the language's own forms: projects sit in their folders and resources in their projects, folders are labeled by display name, grants are member → roles maps with one line per edge, services are the project's project_service list, an organization policy is its bare constraint with a spec { … } block, and the organization is referenced as customer_organization_id wherever its number was written. What the platform owns — the built-in _Default and _Required log sinks on every container, the grants of Google's service agents, the legacy bucket grants, Google-created service accounts — is not in the file; the import lists each group under the skip: pattern of the import-config row that took it, and a copy of the table without that pattern imports it. A subnet's local route is listed as platform-managed, and what is not live — a deleted folder or project, what is inside one, a service that is not enabled — as not live.

The params block is the bootstrap vocabulary init writes, bound from what the platform states and what the sweep implies: the sign-in gives customer_id, customer_domain, first_admin and a single open billing account; the service account granted organizationAdmin at the organization gives svc_iac_account and infra_project_name, and that project its folder, its versioned bucket and its billing account; the members give estate_account_user_group; the regional resources give default_region; the leading token of the project and bucket names gives customer_shortname, unless --customer-shortname says. A value a rule chose carries // inferred: with the rule and its evidence; a value nothing states is left out and reported with how to bind it. Every bound literal is referenced wherever the body repeats it, the way the library spells it, so the estate already speaks the packs' vocabulary.

What is left is what only a person decides:

Reconcile

Generate the HCL and hold it against the live organization:

satz transpile migration-discovery.satz
cd hcl/ && tofu plan

A plan that says replace where it should say no changes means the labels or the resource ids do not line up. Two ways to fix it: declare "import-id" in the estate to bind the existing resource, or tofu state mv to move the existing state onto the new address. satz adopt resolves those ids for you where it can — natural-key lookups for folders, groups, memberships and organization policies, IAM grants against the live IAM policy of what they are granted on, import_id/match_on rules for the rest — and never guesses: one candidate resolves, several is ambiguous.

A pack the estate uses under names writes each resource once per use, as <name>__<label>; satz adopt resolves each address, and the table names the use. --execute writes no "import-id" into the pack: one line serves every use, so the resource is listed with --execute --import, which imports each address into the state. A pack used without a name and then under one moves every address it writes from <label> to <name>__<label>: adopt reads that as a state move, the same live object under a new address, and --execute --import runs the state mv.

Let satz take over

When tofu plan shows no changes, or only intended ones, the migration is complete; from then on the infrastructure is changed through the estate.

The estate account reaches the adopted folders and projects, hand-made ones included, through the roles it holds at the organization: every folder and project inherits them. satz update-prerequisites <estate> writes each role the adopted resource types need that the estate does not grant it yet into the estate; --report-only names them and writes nothing.


Workload estates beside the estate

satz builds the organization: the folders, the infrastructure project, the shared network, the organization policies. The workloads in it are built by workload estates that depend on parts of this estate's interface, each with its own repository, config, state and pipeline, often maintained by a different team, and written in HCL or in Satz (the term). The estate whose interface they read is the organization's estate. A workload estate reads what the organization's estate publishes and never changes its HCL or its state.

What the estate publishes

An export statement (language §6.17) names one value. satz transpile writes each one twice:

An export outside every interface block is a core export, and every interface carries it. An estate that uses presets/estate-core.satz publishes the core exports without writing any: organization_id, customer_domain, customer_shortname, default_region, infra_project_id and iac_service_account. An estate satz init writes also exports infra_folder, and workload_folder once workload_folder_name is answered.

workload_folder is the parent of every delegated folder and delegated project: folders/<number> of the folder the answer workload_folder_name = "<name>" declares directly under the organization. The organization's estate creates a team's folder under it, one per entry of delegated_folders, and the team's workload estate creates its folders and projects inside the folder it was given, delegated_folder of that folder's interface:

resource "google_folder" "payments" {
  display_name = "payments"
  parent       = module.satz.delegated_folder
}

satz interview and satz-studio write the section that declares and publishes it when workload_folder_name is answered; init leaves it open. The folder block stands at the top level, so its parent is the organization; to put the workload folder inside another folder — a top-level folder named after the organization — move the workload_folder { … } block into that folder's block, and the interface's lookup follows the parents. An estate without the section adds it by hand, with workload_folder_name bound to the folder's display name — the folder itself and its lookup:

google_folder {
  workload_folder {
    display_name = workload_folder_name
  }
}

export "workload_folder" = "${{google_folder.workload_folder.name}}" description "The workload folder, directly under the organization, that holds the delegated resources of workloads: folders/<number>"

The transpile refuses, at the line to edit, a workload_folder_name bound "", a name with no export "workload_folder", and a name beside an export of the organization.

Google refuses a second folder of one name under one parent, so a folder the customer already has is imported first: satz adopt <estate> --execute --import finds it by its display name under the organization and writes its id into the estate.

Every resource of one kind is one export. export "folders" = all google_folder publishes a map keyed by each folder's label in the estate, so a workload estate reads module.satz.folders["payments"] and a folder the estate adds later arrives as a new key:

resource "google_project" "payments" {
  project_id = "acme-payments-001"
  name       = "payments"
  folder_id  = module.satz.folders["payments"]
}

The README lists the keys. private = true in a resource's body keeps it out of every map, out of everything written for a workload estate, and refuses an export that names it; the estate satz init writes marks its state bucket and its estate account that way. An estate whose google_storage_bucket.state or google_service_account.provisioner lacks the line publishes it in such a map; add private = true to both before exporting all google_storage_bucket or all google_service_account.

What one workload estate reads goes into an interface block named for it, in the estate or in a pack; the same interface in two files is one interface:

interface "payments" {
  export "folder"  = "${{google_folder.payments.name}}" description "The payments folder, folders/<number>"
  export "network" = "${{google_compute_network.shared.self_link}}"
}

A pack used under a name (language §6.9) publishes its core exports under the use's prefix: export "bucket" of showcase-bucket.satz, used as reports and as scratch, is the outputs reports__bucket and scratch__bucket, each reading its own use's bucket, and every interface carries both. An interface "<x>" block of the use's pack is the use's own interface, the folder <use>-<x>: interface "bucket" of showcase-bucket.satz writes interfaces/outgoing/reports-bucket/ and interfaces/outgoing/scratch-bucket/, each with its use's values, which a workload estate reads as "${{interface.reports-bucket.bucket_name}}". A named use's interface is never common, and a named use exports no all <type>.

A set several workload estates read — the shared network, the DNS zones — is a common interface: declared once, marked interface "<name>" common { … }, or declared by the pack that builds it, which makes it common without the word. The common interfaces are the library every workload estate's folder carries. A workload estate's interface also takes one with use interface, and then its own interface carries those exports beside its own:

interface "network" common {
  export "host_project" = "${{google_project.net_host.project_id}}"
  export "vpc"          = "${{google_compute_network.shared.self_link}}"
}

interface "payments" {
  use interface ["network", "dns"]
  use interface "logging" when want_payments_logging
  export "folder" = "${{google_folder.payments.name}}"
}

A pack that removes or renames an export, or changes the shape of its value, breaks every workload estate that reads it: that is a breaking change, with an entry under ## Breaking changes in presets/CHANGELOG.md, and the release that ships it is a minor one.

The interface folder a workload estate takes

satz transpile writes the outgoing half of interfaces_dir (interfaces, a key of config.toml) whole, and never touches the other half, interfaces/incoming/, where an estate keeps the folders it took from others:

interfaces/outgoing/
  common/                       the library alone, for a workload estate without an interface of its own
    README.md
    core/      README.md  hcl/  satz/
    network/   README.md  hcl/  satz/
  payments/                     the workload estate "payments" takes this folder whole
    README.md                   its interfaces; the estate, the satz version, the content hash
    payments/  README.md  hcl/  satz/   its own interface: its exports, the core ones, those it uses
    core/      README.md  hcl/  satz/   every common interface, always
    network/   README.md  hcl/  satz/

A workload estate takes its interface folder whole, interfaces/outgoing/<name>/, into its own repository or beside its code, and takes it again after every change of the organization's estate. The folder holds the workload estate's own interface and the whole library, never another one's, so it is one snapshot and nothing in it is picked by hand. An interface the workload estate does not read costs nothing: HCL evaluates a module's lookups only where the configuration sources it, and a Satz estate reads only the files it uses. The folder's README.md names the estate, the satz version that wrote it and a content hash of every other file in it, so two copies are the same when their hashes are.

satz copy-interfaces takes the folders. In the workload repository, with the organization's repository on the same disk:

satz copy-interfaces payments.satz --from <the organization's estate>

--from is the organization's estate folder, its config.toml or its estate file; the command finds interfaces/outgoing/ where that config's interfaces_dir says. The folders are exactly the ones the workload estate reads: every use path under interfaces/incoming/<folder>/, in the estate file and in each file it uses. A folder the organization's estate does not publish is refused, naming it and the folders it has; an estate that reads none has nothing to copy and is refused. Each folder is copied whole: a file the new folder lacks is removed, and .DS_Store, Thumbs.db, names ending in ~ and .<name>.swp are left out. Before anything is written the estate is transpiled with the new folders; when that check fails nothing is copied and the command exits non-zero with the transpile's messages. The new folders are written beside the old ones and then swapped in, so a failure on the way leaves the old ones. A folder under interfaces/incoming/ the estate does not read is reported as a warning and left as it is. The report names per folder the files added, removed and changed and, for an interface file that changed, the values that moved, in the words of CHANGES.md:

copy-interfaces — satz/payments.satz reads 2 interface folder(s) from ../acme/interfaces/outgoing
  delegation-payments: changed — 1 added, 0 removed, 4 changed
    added   delegation-payments/CHANGES.md
    changed README.md
    changed delegation-payments/README.md
    changed delegation-payments/hcl/outputs.tf
    changed delegation-payments/satz/interface.satz
    value  `delegation-payments`: `estate_account_user_group` has a new value.
  payments: unchanged
check: satz/payments.satz transpiles with these folders
copied 1 folder(s) into interfaces/incoming: delegation-payments

--report-only prints the same report and the check, and writes nothing; --format json is the report as data. A workload repository with no checkout of the organization's repository on its disk takes the folders by hand: each interfaces/outgoing/<folder>/ copied whole over interfaces/incoming/<folder>/, files the new copy lacks removed.

What changed, and what to do about it. When a transpile changes a value of an interface, the interface's folder gains CHANGES.md beside its README.md: the previous satz/interface.satz on disk against the new one, written as the todo a workload estate follows, in both spellings —

## To do

- [ ] Replace `module.satz.folder` / `${{interface.folder}}` with `…team_folder`: renamed, the same `google_folder.team`.
- [ ] `number` is now looked up (`data.google_project.infra`): your plan needs resourcemanager.projects.get.
- [ ] `folders` lost the key `"old"`: `module.satz.folders["old"]` fails at plan.

## Also changed

- `folders` gained the key `"new"`.

A rename is an export that went and one that came naming the same resources in the same shape; an export gone, a map key lost, an attach point dropped, a value now looked up and a shape that changed are the other todos; a new export, a key or an attach point gained, a value now static, an export that now names other resources and one whose value changed are information. A description edit is no change, and an interface the transpile did not change has no file. One transpile is one step, so nothing accumulates: a workload estate that moves several commits of the organization's estate at once reads the file's history in the estate's repository. The file is not in the folder's content hash.

Every interface has the same two forms, with the same values:

<name>/README.md travels with both: the snippets above, every value with the interface it comes from, how it is obtained and what it takes. The HCL code's tofu output names a workload estate's values <interface>__<export>, with - written _ (payments__folder).

Delegating a project, and a workload estate on satz

A delegated project is one entry of delegated_projects in presets/delegated-projects.satz, and it names the delegation whose estate account works in it — one entry of delegations in presets/delegation.satz:

params {
  delegations = [
    { name = "payments" estate_account_user_group = "payments-owners@example.com" },
  ]
  delegated_projects = [
    { name = "payments" delegation = "payments" },
  ]
}

use "presets/delegation.satz" when use_delegation
use "presets/delegated-projects.satz" when use_delegated_projects

satz add-entry <estate> delegations name=payments estate_account_user_group=payments-owners@example.com and satz add-entry <estate> delegated_projects name=payments delegation=payments write the two entries: each is checked against the pack's declaration and kept only when the estate transpiles. satz set-entry <estate> delegated_projects name=payments budgets=true changes one field of an entry and leaves the others, --unset <field> gives a field back to the declaration's default, --rename <key> changes the key, and satz remove-entry <estate> delegated_projects payments removes the entry; both work on an entry the estate writes in its own params, are held to the same declaration and are kept only when the estate transpiles. A comment inside the changed entry is not kept.

Per entry of delegations the base declares the delegation's infrastructure project {customer_shortname}-deploy-payments, inside it the estate account svc-deploy-payments and the state bucket, the estate account user group at the entry's estate_account_user_group address, created empty, and the grants (the group reads that project and may act as the estate account), and publishes the interface delegation-payments. Per entry of delegated_projects the preset declares the Google project {customer_shortname}-payments-001 under delegated_projects_folder — the workload folder unless the estate names another — with no account and no bucket in it, the grants (the delegation's estate account takes the project's IAM and its services, so its workload estate grants its own account the rest, on the project), and the project's interface, written once per entry. A second entry that names the same delegation, { name = "shop-backend" delegation = "shop" }, is a second project for the same account: one account works in several projects, and one estate reads them all, each by the name of its interface folder. The account's calls are billed to the delegation's infrastructure project, so an API a call needs is in apis of the delegation's entry. The transpile refuses an entry whose estate_account_user_group is not an address <name>@<domain> or whose name is not lowercase letters, digits and - starting with a letter, naming the entry and the value, and an entry of delegated_projects that names a delegation no entry of delegations declares:

each delegated_projects by name {
  interface "{each.name}" {
    export "project_id"              = "${{google_project.{each.name}.project_id}}" attach ["google_project_iam_member"] description "The project's Google project"
    export "project_number"          = "${{google_project.{each.name}.number}}" description "Its number, looked up"
    export "delegated_project_roles" = delegated_projects_roles description "The roles the delegation's account holds on the project"
    export "delegated_budgets"       = each.budgets description "Whether the account may manage budgets for this project"
  }
}

The interface delegation-payments carries the estate account: infrastructure_project_id, estate_account, the account's id estate_account_id, state_bucket, the estate account user group, and delegated_billing_roles and delegated_apis.

An entry is the estate's own, or the workload estate's request: contributes_delegated_projects = [ … ] in a small pack of the workload estate's, checked with satz check-request and vendored into the estate by pull request (language §6.17). The pull request is the request's review; the apply creates the project; satz transpile writes interfaces/outgoing/delegation-payments/ and interfaces/outgoing/payments/. Two entries of one name are refused.

A workload estate's natural set is often what stands under its folder: export "team_projects" = all google_project under google_folder.team_a publishes that map, and a Google project added under the folder later arrives as a new key. private google_storage_bucket.logs in the estate keeps one resource — a pack's included — out of every export.

satz interfaces acme.satz --format text --out - lists every export and interface there is to pick from. An interface declared in two files is one interface, so the estate adds to a workload estate's interface with a block of the same name in its own file:

interface "payments" {
  use interface "network"
  export "archive_project_id" = "${{google_project.archive.project_id}}" attach ["google_project_iam_member"]
}

A workload, in HCL or in Satz, that brings its own Google project gets an interface written by hand, interface "billing" { … }, and no entry.

A workload estate on satz starts from its interface folders: the delegation's own and one per delegated resource the estate works in. In its own directory:

satz init --from <the estate>/interfaces/outgoing/delegation-payments <the estate>/interfaces/outgoing/payments
satz transpile payments.satz

init --from copies each folder into interfaces/incoming/, unless it stands there already, and writes config.toml and satz/payments.satz from the interface files — no sign-in is needed. A refused run writes nothing, so the corrected run succeeds in the same folder without --force. Exactly one of the folders is a delegation's own, because an estate runs as one estate account; every other is a delegated folder or project, any number of them. --name names the estate, which otherwise takes the delegation's name. It writes the delegation's estate account and state bucket as reads of the delegation's folder — infra_project_name = "${{interface.delegation-payments.infrastructure_project_id}}", svc_iac_account = "${{interface.delegation-payments.estate_account_id}}", infra_bucket_name = "${{interface.delegation-payments.state_bucket}}" — so a copy of the folder after a change of the organization's estate changes them too; a folder that publishes no estate_account_id was copied from an older transpile and is refused. It reads the core export default_region (an organization's estate without estate-core.satz publishes none and is refused) and writes it, default_zone, deployment_engine, deployment_mode = "cloud", the gcs backend on the bucket under <name>/state, the providers, the use of each interface file, and at the end, as comments, the read for each folder and project the other folders give: an export whose targets name a google_folder is read as folder_id, one that names a google_project as project, a static export before a looked-up one, and an export the delegation's own folder carries as well — a core or common export — is no such parent. satz reads svc_iac_account and infra_project_name as the values they read wherever it names the estate account, {svc_iac_account}@{infra_project_name}.iam.gserviceaccount.com — the providers, the backend, the prerequisites and every live call; a value the organization's estate looks up cannot name the account and is refused there, naming the param. The estate transpiles as the delegation's estate account, and its resources read a value by the name of its interface folder, ${{interface.<folder>.<value>}} — project = "${{interface.payments.project_id}}" on each — and are held to the interface's rules at every transpile. An estate with several delegated resources names each the same way, ${{interface.data-lake.project_id}} beside ${{interface.data-mart.project_id}}. satz checks no role in a workload estate: the account's roles are the organization's to grant, through the delegation pack that created what the estate builds in, and satz update-prerequisites <estate> --report-only lists those its resource types need, for the organization's team. The interface's README.md lists each export with its value and what may be attached to; CHANGES.md beside it, after a change of the organization's estate, says what to do about it. After such a change the workload's team takes the folders again with satz copy-interfaces (below).

Delegated access: a folder for a team

A delegation is two packs in two estates. A delegation pack stands in the organization's estate: it creates what one kind of workload is given — a folder, a project — and grants the delegation's estate account its roles on exactly that; what it creates stays in the organization's state, which creates, deletes and grants it. A workload pack stands in the workload estate: it reads what was given from the interface folder and builds inside it as the delegation's estate account, in the workload's state. Nothing the delegation pack created is imported into the workload's state. presets/delegated-folders.satz and presets/delegated-projects.satz are the ready-made delegation packs; a workload with needs of its own ships its own pair (ADR 0101).

A workload's own pair is named after the workload: <workload>-delegation.satz for the organization's estate and <workload>-workload.satz for the workload estate (catalog-delegation.satz, catalog-workload.satz). A delegation pack that says multiple holds one instance of the workload — its project, its grants, its interface — and the organization's estate uses it once per instance, each a named use (language §6.9): use "packs/catalog-delegation.satz" named books. Its interface "project" is then the folder books-project, which that instance's workload estate copies; a second use music writes music-project for a second workload estate. The pack can add the instance's own delegation to the flat list delegations through contributes_delegations = [{ name = <param> … }], read inside the use, so deleting its use line removes the instance and its delegation together. The procedure between the two teams — writing the pair, the pack source, the named use, the interface folders copied back — is delegated access: the procedure for both sides.

A workload that creates Google projects and folders — with templates of its own, in OpenTofu or in Satz, each with its own state — runs as an estate account of its own, never as the organization's estate account. presets/delegation.satz creates it per entry of delegations: the delegation's infrastructure project, inside it the estate account svc-deploy-<name> and the bucket its states live in. Each entry of delegated_folders in presets/delegated-folders.satz is a folder the pack creates for one delegation, under the workload folder or the parent the entry names, and the account's roles are granted on that folder alone: folder and project creation and deletion, the IAM of its projects, API enablement. It holds no access control on a folder, so it cannot widen its own rights, and one account may work in several folders that share no root. Beside that it is billing user on the billing account, so a new project can be linked, and holds roles/browser on the organization, which is what the interface's lookups need. The delegation's estate account user group may act as the estate account and nothing else. The role sets are params; a delegation's APIs and billing roles are fields of its entry.

The workload's pipeline impersonates the estate account and keeps its state in the delegation's bucket. It reads the organization through the two interface folders it took — its estate account with what was delegated to it, delegation-<name>, and its folder — and never the organization's state: a looked-up value asks the Google API for the live resource with the workload's own estate account (the packs).

Static values and lookups

An export whose value satz knows at transpile time — a param, a Google project id satz writes, a service account's email built from its account id — is a literal. The workload estate's plan makes no API call for it.

An export of an attribute only the cloud knows — a folder's folders/<number>, a Google project's number — is a lookup: a data source that reads the resource back by what satz writes on it (a folder by its display name under its parent, a Google project by its id). The lookup runs through the workload estate's own provider and account, so that account needs read permission on what it looks up; the README names the permission per lookup. A workload estate without it fails its own plan, and the state of the organization's estate is not involved. An interface holds only the lookups its own values read.

A workload estate written in Satz gets both through interface.tf in its written hcl/: locals { interface = { … } } holding every value it read, and the data blocks the looked-up ones need. main.tf reads local.interface.<folder>__<value> — or local.interface.<value> for a value read without a folder's name — providers.tf reads the same names under local.interface_static (the values satz knows — a provider cannot wait for a lookup it runs), and neither carries a value of the organization itself, so that file is the one place the organization stands in the workload estate's HCL — and the one file that changes when the workload estate is pointed at another organization.

Writing to shared infrastructure

A workload estate changes something the organization's estate owns in one of two ways, and never by editing the estate's HCL or state.

Attach — the write lives in the workload estate's own state. The provider has additive resources for joining something another state owns, and the workload estate declares them in its own configuration:

# a Google project of the workload's, attached to the estate's shared VPC host project
resource "google_compute_shared_vpc_service_project" "payments" {
  host_project    = module.satz.network_host_project
  service_project = google_project.payments.project_id
}

# the Google project in the estate's service perimeter
resource "google_access_context_manager_service_perimeter_resource" "payments" {
  perimeter_name = module.satz.perimeter_name
  resource       = "projects/${google_project.payments.number}"
}

# a role on the workload's folder, one member at a time
resource "google_folder_iam_member" "payments_deployer" {
  folder = module.satz.payments_folder
  role   = "roles/resourcemanager.projectCreator"
  member = "serviceAccount:deployer@acme-payments-001.iam.gserviceaccount.com"
}

The exports network_host_project and perimeter_name stand for what the estate publishes when it has a shared VPC or a perimeter. satz grants with *_iam_member only, which adds a member and removes none, so a workload estate's grant and the estate's live

side by side.

An attach point is an export that says which attachments it takes. attach [ … ] after the value names the attachment resource types a workload estate may create against it:

interface "payments" {
  export "network_host_project" = "${{google_project.net_host.project_id}}" attach ["google_compute_shared_vpc_service_project"]
  export "perimeter_name"       = "${{google_access_context_manager_service_perimeter.main.name}}" attach ["google_access_context_manager_service_perimeter_resource"]
  export "payments_folder"      = "${{google_folder.payments.name}}" attach ["google_folder_iam_member"] description "The payments folder"
}

Each interface's README lists its exports and what each takes — a table when one of them is an attach point, prose otherwise: every one is read, an attach point also takes the types it names. The types an export may name, and what each conflicts with in the estate, are presets/attach-points.yaml, built into satz. The transpile refuses the estate's own authoritative form of a membership a workload estate attaches to:

attachment the estate must not
google_access_context_manager_service_perimeter_resource set the perimeter's status.resources; and its lifecycle { ignore_changes = [status[0].resources] } must be written, or the estate's apply removes what workload estates attach
google_<node>_iam_member declare google_<node>_iam_policy or google_<node>_iam_binding on the exported node
google_compute_shared_vpc_service_project, google_network_connectivity_spoke — the provider has no authoritative form

The same rules hold whichever form a workload estate is written in:

A workload estate written in HCL: satz check-consumer <dir> [<estate>], offline: it reads the .tf files under the workload repository's directory and transpiles the organization's estate in memory. A value reads the estate when it is module.<name>.<export> of a module whose source ends in <interface>/hcl, local.interface.<export> or local.interface_static.<export> as the interface.tf a workload estate's transpile writes names it, or a literal equal to a value the estate publishes or an identity it writes; anything else is the workload estate's own. Each message names the workload estate's file and line, and any message exits 1. A workload estate runs it in its CI against a checkout of the estate; an agent runs satz_check_consumer.

A workload estate written in Satz: its own transpile, against the interface files it uses — they carry the attach points and the central resources the rules need, so the organization's estate is not read. A value reads the organization's estate when it is "${{interface.<folder>.<value>}}", "${{interface.<value>}}" or a literal equal to a value it publishes or an identity it writes. Each message is an error of the kind interface-use at the resource's line, and satz transpile refuses the estate as it refuses any other error.

Contribute — the write goes into the organization's estate. Where no attachment resource exists, or the change needs coordination — a subnet whose range must not overlap another's, a new folder — the change is an entry in the organization's estate, applied by satz, and the estate then exports the result, the workload estate's subnet or folder, for the workload estate to read. A workload estate gives its entries as a pack the organization's estate uses, which fills a list param through a contributes_<param> param — vendored into the organization's estate by pull request, as the next section says.

What a workload estate may ask for is declared. A list param that takes requests carries an entries statement — the field that names an entry and the fields an entry may carry — and every interface's README.md lists them under What you may request. The workload's team writes its entries as a small pack:

pack requests_payments version "1.0"

params {
  contributes_event_topics = [
    { name = "payments" retention = "86400s" },
  ]
}

checks it with satz check-request <file> <organization's estate> against a checkout of the organization's estate — the lists, then the estate's transpile with the file in place — and its pipeline opens a pull request that copies the file into the organization's estate's repository (satz/requests/<workload>.satz) and adds its use line. The review of that pull request is the change's approval, the git history of the organization's estate its record, a refused request a closed pull request; the apply makes the change, and an each over the list turns the entry into a resource the interface publishes. The file is vendored, not used from the workload repository: a use of a path that points there would put the workload's team's next edit on the next apply of the organization's estate with no review.

A list param of a named use takes no request: it is the use's own, which the organization's estate binds as <name>.<list> — satz add-entry <estate> reports.bucket_archives name=old writes reports.bucket_archives = [{ name = "old" }] into its params, and satz set-entry and satz remove-entry change and remove its entries by the same dotted name. satz check-request refuses a contributes_<list> that names it, naming the list as the estate binds it, and no interface's README offers it under What you may request.

The change notice

A workload estate learns that an exported value changed through the form of notice the estate chooses. The map asks it as question oneof interface_notice, which is not required: none of its options is an answer, and every option is off by default. Each option is one form; Pub/Sub is the one satz has.

option pack what a workload estate subscribes to
interface_notice_pubsub presets/interface-notice.satz the topic interface_topic names: one message per apply that changes an exported value; the object interface_object names holds the new values
params {
  interface_notice_pubsub = true
}

use "presets/interface-notice.satz" when interface_notice_pubsub

The workload estate writes the subscription in its own state — a push to its CI's webhook or a pull from a runner (the pack).


Continuous verification

scripts/fleet-v1.sh checks, when run, whether every estate transpiles on the current binary. Two Cloud Build triggers check each estate continuously, and also whether the live organization matches it:

trigger when runs fails when
satz-check every push to main satz transpile --check <estate> the estate no longer transpiles
satz-compliance nightly, Cloud Scheduler satz report-compliance <estate> --format json --out - --fail-on <statuses> a witness is DRIFTED or NOT ENFORCED

Both are one pack:

use "presets/ci/verification-runner.satz"
use "presets/ci/verification-runner-grant.satz"

The runner is a service account of its own and holds nothing about the estate. Inside the build, satz's first act is to exchange the runner's identity for the estate's estate account — exactly what it does on a workstation — and the grant pack is the one IAM binding that permits it. satz whoami inside the build reports the same identities it reports on a workstation.

Where the runner lives:

The build steps are inline in the trigger — there is no cloudbuild.yaml in the estate repository. Whoever controls the build file controls what runs as the runner; in the hosted shape that file would sit in a repository the MSP does not own. Here the pipeline is defined by whoever applies the pack. The steps install satz from the release at build time (ci_satz_release, default latest) and, for the nightly run, tofu, because update-schema needs it.

(An estate written by satz init already enables cloudasset.googleapis.com in its infrastructure project — the CIS pack claims CIS 5.0 §2.14 against exactly that resource, so a require cis-gcp-5.0 reporting it as a broken claim is the same fact reaching you earlier than the nightly run would.)

Before the first nightly run, enable Cloud Asset Inventory on the estate's infrastructure project and grant an asset-viewer role at organization level: report-compliance needs both. unverified is not in the default --fail-on set, so a run without them fails only on drift. The pack writes nothing back; the result is the exit code and the build log. Committing evidence to the watched repository needs write access the runner does not have by default.

Scanning with Prowler

Prowler is a second opinion: it reads the live organization and reports what it finds, where satz reports what the estate declares and verifies its own witnesses. Putting the two together is what makes a FAIL on a verified witness a CONTESTED row rather than a number in a different tool.

satz does not run Prowler. The scan spends API quota in every project of the estate, and Prowler reads as whoever is signed in rather than as the estate's estate account, so starting it is the operator's decision. What satz answers is how to point it at this estate:

satz prowler C0example.satz

Stdout is the command line and nothing else — paste it, or pipe it: satz prowler C0example.satz | pbcopy. What the line cannot say goes to stderr: the command to run afterwards, a scan that is not narrowed to projects because no project id resolved, each project left out of --project-ids by its address because its id is built from a reference to another resource ("acme-${{google_folder.x.folder_id}}"), which only an apply resolves, and a framework this estate names that Prowler has no equivalent of. Every argument comes from what the estate declares — the organization id, the project ids (a {param} in an id is its value, as everywhere in the transpile), and the frameworks it names.

--compliance is the UNION of two sources: the frameworks the estate is HELD TO (compliance_frameworks, the language reference) and the frameworks its packs CLAIM. They are different facts — an estate can claim CIS controls while its customer is audited against ISO 27001 — and the export an auditor reads has to cover both. An estate that binds no compliance_frameworks is scanned for what its packs claim, and stderr says that is all the line had. A framework satz ships a catalog for but Prowler has no equivalent of is NAMED as unmapped rather than mapped to something that looks close: a wrong --compliance argument scans the wrong control set.

--format json is the same answer for an agent, and satz_prowler serves it over MCP.

Where a scan's output goes:

evidence/prowler/<UTC date>/<scope>-<UTC date>T<HH>-<MM>Z.ocsf.json

evidence/ sits beside the estate and is git-ignored — a scan's output is full of a customer's project ids and findings. The date is UTC so two people in two time zones scanning on the same day write into one directory rather than two that look like two scans, and <scope> is org or projects after how the scan was narrowed. The file name carries the UTC minute satz prowler ran in, the same shape as the history entries report-compliance writes, with dashes for colons so the name is valid on every platform. The path is known before the scan runs because --output-directory and --output-filename are both passed: without them Prowler names the file after the moment it ran, and nothing downstream can predict it.

Run satz prowler again before each scan — a rescan after an apply included. Prowler appends to an output file that already exists: a second scan run from the first one's command lands after the first array's closing ], and the file holds two runs' findings and no longer parses. report-compliance, triage and remediation-plan refuse such a file, naming the line, column and byte offset where the second run begins.

Then fold the export back in — any of the three read the same file:

satz report-compliance C0example.satz --prowler evidence/prowler/2026-09-13/org-2026-09-13T08-30Z.ocsf.json \
  --format markdown --out evidence/held-to.md
satz report-compliance cis-gcp-4.0 C0example.satz --prowler evidence/prowler/2026-09-13/org-2026-09-13T08-30Z.ocsf.json \
  --format markdown --out evidence/cis-4.0.md
satz triage cis-gcp-4.0 C0example.satz --prowler evidence/prowler/2026-09-13/org-2026-09-13T08-30Z.ocsf.json \
  --format markdown --out evidence/triage.md
satz remediation-plan cis-gcp-4.0 C0example.satz --prowler evidence/prowler/2026-09-13/org-2026-09-13T08-30Z.ocsf.json

satz reads the OCSF export of Prowler 5 only, and checks the version the export carries: an older one is refused by its version rather than read as empty.

The security review and the documentation package

Two skills in skills/ do the two things an agent does beside satz and satz's binary does not: judge and author (ADR 0003). skills/security-review/ runs a CIS GCP Foundations v5.0 security review of one organization and writes its two deliverables; skills/estate-documentation/ writes a customer's documentation package from the estate. Each is a folder (SKILL.md, scripts/, references/, assets/) and a zip of the same folder, skills/<name>.skill.

Installing a skill

The customer folder the skills read

Both skills start from a customer's shortcode and read the folder ~/projects/ccc/<shortcode>/ (CCC_ROOT names another root): the organization's repository <shortcode>-C<dirid>/ with its config.toml (yaml_dir names the estate directory, satz/ when absent), the estate file inside it, hcl/ and interfaces/outgoing/; beside it the workload repositories — a satz workload estate (a config.toml and a .satz that uses an interface.satz) or an HCL project (.tf files that read module.satz.<export>); and audit/, which the review owns. Everything else there is left alone. The view the organization's estate has of its projects is satz interfaces <estate>.satz --format json --out -, which is where the skills read the projects' ids and lists.

Running the review

Phase 0 discovers the scope and checks the tools and the identity, with no cloud call but whoami:

python3 $SKILL/scripts/discover_scope.py acme --scan-date 2026-09-27 --write ~/projects/ccc/acme/audit/tools/scope.yaml
cd ~/projects/ccc/acme/acme-C0example && satz --config . whoami C0example.satz

Phase 1 creates the evidence live and read-only, as the estate's estate account: Prowler one service at a time with a deadline (scripts/prowler_scan.sh, the own project ids from phase 0 including the workloads'), then scripts/satz_evidence.sh — satz report-compliance with Checkov, triage and require for the organization's estate, and per workload the interface check (satz check-consumer on its HCL, satz transpile --check on a satz project). Nothing in this phase changes the organization. Phase 2 builds the two documents offline from scope.yaml and the evidence (scripts/build_audit.py, then scripts/verify_outputs.py): the checklist of every control with its status, and the remediation plan of satz presets and gcloud steps, with a section per workload. The pack, its use line, the gcloud commands that meet and check a control and the risk of leaving it open come from the measures of each control in satz's report and require output — the packs' own claims (ADR 0073); assets/measures.yaml holds what the skill authors: the German prose, the phases, the grouping of controls into plan sections, and the gcloud steps of the controls no pack claims. The documents are reproducible from scope and evidence and carry no local path; a change of wording goes into scope.yaml or assets/measures.yaml, a changed command for a pack's control into that pack's claim, never into the document. The skill's SKILL.md carries the whole procedure and its rules.

Building the documentation package

uv run --with python-docx --with matplotlib python3 $SKILL/scripts/build_estate_documentation.py --shortcode acme --index 01

The script finds the estate repository and its estate file, runs satz questions … --format xlsx and --format pdf for the decisions, reads the facts from the estate and its hcl/main.tf, draws the diagram of the organization, its folders, projects and workloads, and writes the short description with the facts, the group model, the enabled services, the organization policies, the compliance framework and the workloads — their Google projects, what each reads through its interface and what the estate lets a project request. The review's two documents are copied in from audit/; the package refuses to be written while one of the four files is missing. Nothing in the package is written by hand: a change goes into the estate and the package is rebuilt.

Workload packs

A workload pack is one .satz file an estate beside the organization uses to build a workload: a pack with a pack <id> version "…" header that stands alone — no gate in the estate map, no node in the pack graph, no claim in a catalog. A workload estate keeps its packs in one folder, packs_dir (packs/ beside config.toml unless the config names another), and that folder holds two kinds:

a pack in packs_dir whose it is what writes it
with a row in packs_dir/origin.toml fetched from a source satz update-pack
without a row the repository's own no command

origin.toml is the origin record: one row per fetched pack, with its id, the name of the pack source it came from, for a GitHub source the repository (github), the folder of it where that is not packs (path) and the commit the file was read at, for a folder source the folder relative to the folder that holds origin.toml (folder), the version it stated and the SHA-256 of the file as fetched. It is committed with the estate. The row decides whose a pack is; its name does not, so a pack the repository wrote stays its own when a source gains a pack of the same id.

[[pack]]
id = "project-budget"
source = "satz"
github = "tjirsch/satz"
commit = "0123456789abcdef0123456789abcdef01234567"
version = "1.0"
sha256 = "…"

[[pack]]
id = "data/warehouse"
source = "shared"
folder = "../../shared-packs"
version = "2.1"
sha256 = "…"

A row names a source by its name, and config.toml says where that source is, so every clone of the repository follows the row to the same place. get-pack, update-pack, publish-pack and satz packs hold every row to the config.toml of the estate they run in, before they read or write anything, and refuse:

detach-pack and pack-source remove read the record without that check.

A pack's id is its path under its source's folder without .satz: packs/workload-project.satz is workload-project.

One packs folder, several estates

Several estates may share one packs folder — a repository with packs/ at its top and one estate per customer under estates/<customer>/, each with its own config.toml:

packs/                  origin.toml and the packs
shared-packs/           a folder source
estates/acme/config.toml
estates/example/config.toml

Each estate names the packs folder and declares the sources in its own config.toml, the one place its configuration is kept:

packs_dir = "../../packs"

[[pack_source]]
name = "shared"
dir  = "../../shared-packs"    # relative to this config.toml

The record is one file for all of them, so its rows have to mean the same from each estate. A row writes a folder source's folder relative to the folder that holds origin.toml — folder = "../shared-packs" here — and that is the same folder whichever estate fetched the pack. Every estate that reads the record declares each source a row names, under the same name, pointing at the same repository or, for a dir, at a folder that resolves to the same folder on disk; ../../shared-packs and ../.././shared-packs/ are the same folder, and ../other-packs is another. An estate that lacks a source, or points it elsewhere, is refused by the commands above, naming the row and the line of its config.toml to fix.

The pack sources

A pack source is a GitHub repository or a folder, with a name. The satz repository's packs/ on main is the source satz, which every estate has without listing it. Every other source is a [[pack_source]] table of the estate's config.toml:

[[pack_source]]
name   = "official"
github = "acme/satz-packs"    # owner/repository; its packs are under packs/
# ref  = "v2"                 # a branch or tag; the repository's default branch without it
# path = "catalog/packs"      # the folder that holds the packs, instead of packs/

[[pack_source]]
name = "shared"
dir  = "../shared-packs"      # a folder, relative to config.toml

A name is a lowercase letter followed by lowercase letters, digits and -, used once, and not satz. A table names exactly one of github and dir; ref and path stand only beside github. Every command refuses a config.toml that breaks one of these rules, naming the table and what is wrong.

satz pack-source add official --github acme/satz-packs [--ref v2] [--path catalog/packs]
satz pack-source add shared --dir ../shared-packs
satz pack-source list [--format text|json]
satz pack-source remove shared

add writes the table and remove deletes it; the rest of config.toml, its comments included, stays as it is. add --dir is refused for a folder that is not there; add --github contacts nobody. remove is refused while a row of origin.toml names the source — detach-pack those packs first.

A GitHub source is read at the commit its branch or tag points at when the command runs: one API request for the commit, one for the listing that satz packs and get-pack --all need. A repository config.toml names is read with the GitHub sign-in of the machine — the token gh auth token prints, or GITHUB_TOKEN where gh is not signed in — so a private repository works for everyone signed in to an account that can read it. A private repository that answers without a sign-in is refused with gh auth login. satz writes the token nowhere. The satz repository is read without it: a file comes from raw.githubusercontent.com and costs no API request.

The commands

satz packs --format text --out -          # what is here, what every source holds, and what each declares and reads
satz packs --source shared --format json --out -
satz packs --local --format json --out -  # only packs_dir, no pack source read
satz get-pack workload-project            # fetch one pack from satz, record its origin
satz get-pack data/warehouse --source shared
satz update-pack workload-project         # bring it up to date from the source its row names
satz update-pack --all --report-only      # what an update of every fetched pack would do
satz detach-pack workload-project         # keep it as the repository's own
satz review-pack packs/my-pack.satz --format text --out -
satz publish-pack data/warehouse --source shared   # copy the repository's own pack into a folder source

satz packs reads every pack source — satz first, then the ones config.toml lists — or the one --source names, and lists each pack of packs_dir with its state and source, and each pack a source holds that packs_dir does not, once per source that holds it. --local reads no pack source and lists only the packs of packs_dir: the repository's own as own, a fetched one as edited when its file's sha256 is not the one its row records and as not-checked when it is, with the source and commit its row records. upstream_version is null and sources is empty; each row carries its declarations and its reads matched against the estate as in the full listing. --local with --source is refused. get-pack reads satz unless --source names another. update-pack reads, for each pack, the source its row names; with --source it reads only that one, and a pack of another source is reported as not checked.

What a pack declares, and what it reads

satz packs describes each pack by its own declarations, read from its parse: what it takes, what it gives, and what it reads from the interface folders of the estate that uses it. A pack is not of a kind — a folder pack, a project pack. The delegated resource may be a folder, a project, one VM or anything else an interface folder exports, and a pack fits an estate when the estate's interface folders give every value it reads.

field what it holds
params each param the pack declares: name; default, the value as the pack writes it in Satz ("europe-west3", [1, 2], "${{interface.project_id}}"), or null where it declares the param none; question, whether a question asks for it; prompt and why, that question's prompt and why, null where no question asks or it has no why
list_params each entries <list param> statement: param, key, fields, and defaults per field in Satz
exports each export: name; interface, the interface "<name>" block it stands in as written (an interface an each writes is named by its pattern, ks-{each.id}), or null for a core export; description, its description "…", or null
reads each ${{interface.<folder>.<value>}} and ${{interface.<value>}} the pack writes in a param, a resource or an export — a comment reads nothing: folder (null for the bare form), value, param (the param whose value the read is, or null), how the estate gives it, and description, the description of the export that gives it

The estate is the one --estate names, or the one estate in yaml_dir, and its interface folders are the ones its transpile uses. The report lists them in interface_folders, each as name, estate (the organization's estate that wrote it) and exports, each value it exports as name and description (null where the export has none); the text form prints one line per folder with the names of its values. A read is matched by the transpile's own rule:

met_by lists the folders that give the value, and description is the description of the export that gives it — of the first folder in met_by where several give it — or null where that export has none. Where no folder gives it, met_by is empty, description is null and unmet_reason is the refusal the transpile would print — no used interface folder of that name, the folder has no such value, two folders carry it differently, or the estate uses no interface folder. A pack a source holds and packs_dir does not is matched the same way, so the list says before the fetch whether it fits. The text form prints one line per kind a pack declares, and a not given: line per read the estate does not give.

get-pack matches each pack it fetches against the estate the same way and prints a warning per read the estate does not give — the transpile refuses that read once the estate uses the pack; the pack is fetched all the same, and --format json carries the reasons in unmet. review-pack --against <estate> judges the pack inside the estate, whose transpile refuses a read the estate does not give; without --against, the review's estate uses a stand-in interface folder per folder the pack names, and review for its bare reads, each giving every value read as an example.

get-pack writes packs_dir/<id>.satz and the row, and prints the use line that reaches the file — for a pack whose header says multiple, use "…" named <name>, where the estate writes the use's name in place of <name> (a line pasted as it stands is refused). It is refused when packs_dir already holds a pack of that id, and when packs_dir is under none of the config's include_dirs — use resolves against those folders, so an estate whose packs are shared by several estates names the shared folder in both keys:

packs_dir    = "../../packs"
include_dirs = [".", "satz", "../../packs"]

update-pack compares three things: the row, the local file and the source's file.

the local file the source's file what update-pack does
as fetched the same nothing: current
as fetched another overwrites the local file and updates the row: updated
changed since it was fetched any leaves the file as it is, prints its difference to the source's file and exits 1: edited
any gone leaves the file as it is and exits 1: gone

For an edited pack there are two ways on: --take-upstream overwrites it with the source's file, and detach-pack removes its row, after which it is the repository's own. Nothing forks a pack and nothing rewrites an estate's use lines; one packs_dir serves any number of estates.

review-pack holds a workload pack to the bar of review-preset without the two checks that belong to the preset library — the changelog row and the adoption rule.

A workload pack is one file. A script an action of the pack runs is not fetched with it.

Publishing a pack to a folder source

A pack the repository wrote itself is developed and tested where it is used: a file in packs_dir without a row in origin.toml, used by the estate, transpiled and planned with it. publish-pack then copies it into a folder pack source, where other estates fetch it with get-pack --source:

satz pack-source add shared --dir ../shared-packs   # once: the folder the packs are shared in
satz publish-pack data/warehouse --source shared [--estate team.satz] [--force]
satz update-pack data/warehouse --report-only        # current: the row follows the source

The pack goes to the place get-pack --source shared reads it from — data/warehouse becomes ../shared-packs/data/warehouse.satz, its folders created. Before anything is copied, the pack clears review-pack's bar inside the estate it was tested in — the one --estate names, or the one estate in yaml_dir: it is formatted, the estate transpiles with it and writes resources from it, and the rest of that bar holds. Then publish-pack writes the pack's row in origin.toml — source, folder, version and sha256, the row get-pack --source shared writes — so from then on the pack is a fetched one: update-pack compares it with the source, an edit here is reported as edited, and the next change is made in the source's folder, or here and published again after detach-pack.

the source's folder holds what publish-pack does
no file of that id copies the pack: copied
the same file copies nothing and writes the row: identical
another file refuses, naming both files; --force copies the pack over it: overwritten

It is refused for a GitHub source and for satz — a GitHub source is written by a pull request to its repository — and for a pack that has a row in origin.toml: a pack fetched from somewhere is detach-packed first to publish it as the repository's own. --format json prints id, version, source, location (the folder as config.toml writes it), path (the file in it), action and estate.

Keeping presets current

How to tell whether a newer preset exists, what to do about it, and which command to reach for.

the library presets/ on the satz repository's main branch; a push publishes a pack satz get-presets installs what is missing, refreshes what the estate does not use; in-use: refused the estate's presets/ X.satz upstream's pristine copy X.local.satz your fork, never touched X.diff.satz fork vs pristine, rewritten on every merge the suffix says who owns the file satz check-presets x.satz read-only; per pack, the version line and the content comparison: clean · STALE · fork EDITED (variables only | structural) dropped · missing locally drift in an [included] pack exits non-zero satz merge-presets behind upstream, unedited → refreshed in place edited, and upstream changed its meaning → forked to X.local.satz, the estate repointed, the delta in X.diff.satz — proven by an identical transpile comment or format changes only → taken in place, no fork a pack the library gained → its use line written, commented, under its phase --adopt takes upstream in place; --report-only writes nothing the estate file use "presets/estate-core.satz" // after the switch to the estate account // use "presets/cis/CIS-GCP-Foundation-4.0.satz" params { … } a pack is on when its use line is uncommented; answering its question true uncomments it, and nothing re-comments it satz questions x.satz --unanswered what a new pack, or a new version of one, asks; bootstrap and apply refuse while any question is open satz interview x.satz one question at a time; each answer is bound as a param; a pack question answered true uncomments its use line --accept-defaults binds every default satz transpile → plan → apply one pack per apply, as the estate account the transpile reports a question answered true whose use line is still commented, or missing: an answer nothing writes After every satz release: back to check-presets. A pack the estate includes changes only as a fork: a change of meaning forks, a change of comments is taken in place. SATZ-STUDIO the same loop through the app's views — satz's own writer binds answers and toggles the lines Presets every pack of satz's pack graph, the packs that need another below it; a pack is switched on and off by add-preset and remove-preset Decisions the questions a pack brings, with why, reversal and blast; satz's own writer binds each answer; the sidebar counts the ones still open Commands palette · Apply check-presets, get-presets, merge-presets, transpile, plan — run in the app with the log streamed; apply in the terminal Messages · Agent the transpile's messages at their file and line, incl. a true answer with no line; Agent sets an external client up on the estate with satz mcp
The pack loop: the library, the estate's presets folder with pristine, fork and diff files, check-presets and its states, merge-presets and what it writes into the estate file, then questions, interview and one apply per pack; below, the same loop through satz-studio's Presets, Decisions, commands palette, Apply and Messages

Files and owners

There is one presets/ folder per estate, and the filename suffix declares who owns the file:

file owner what may happen to it
X.satz upstream overwritable — this is a pristine copy
X.local.satz you never touched by any command
X.diff.satz the tool the current fork-vs-pristine delta, rewritten each merge-presets run
a file the library dropped nobody removed by merge-presets, or forked when the estate uses it

Nothing else belongs in the folder. A file that is none of these — not the library's, not a fork, not a delta, not on the library's list of dropped files — is never deleted: merge-presets and check-presets warn about it by path, and it is moved out by hand.

Two more facts:

The three commands

command reads writes estate-aware protects you
get-presets upstream missing + unused files yes yes (refuses in-use; --force overrides)
check-presets <estate> both nothing yes n/a (read-only)
merge-presets both pristine names + forks + diffs yes yes

get-presets populates the library: it installs what is missing and refreshes what the estate does not use. A pristine pack the estate does use is refused, naming the two commands that fit instead, because changing it changes what the organization enforces. --force overrides, listing each in-use pack as it overwrites it. The library is every file under presets/, whatever its kind — packs, docs, data, the scripts a pack's action runs, shell or Python — except a hidden file or folder (.DS_Store, .git) and Python's __pycache__; get-presets and merge-presets take the same set.

check-presets <estate> is the read-only report. It walks the estate's use graph, so packs the estate actually includes are tagged [included], and drift in an included pack exits non-zero — that is the CI gate.

merge-presets updates the library, and a preset the estate includes changes only as a fork the run reports. When upstream has moved semantically, it preserves your current content as X.local.satz, repoints the estate's use at that fork, proves the repoint by transpile identity, refreshes the pristine X.satz, and writes X.diff.satz — the exact delta adopting upstream would make. A change of comments and formatting alone is taken in place, without a fork. Every file of the library that is not a pack — the docs, the catalogs and other data, the .txt lists, the scripts a pack's action runs, shell or Python — is upstream's: it is replaced by upstream's copy and counted as an artifact, never parsed and never forked. It also writes the commented use line for every pack the pristine source's pack-graph.json offers and the estate has no line for, each where the graph's order puts it — after the pack before it, inside the block the graph names — so --pristine-dir <dir> writes the lines of THAT directory's graph. A pristine source without a graph gets a note and no line; a graph that places a pack in a block this binary's scaffold does not have is refused before anything changes.

When the library drops a file

The library lists every file it carried and carries no more in presets/dropped-files.txt, one path under presets/ per line. merge-presets and check-presets read the list from the library they compare with and refuse a library without it — a library folder that never dropped a file carries it empty — and a line naming a file the library carries.

in the estate's presets/ merge-presets check-presets
X.satz dropped, the estate does not use it removes it, and a folder left empty dropped
X.satz dropped, the estate uses it forks it to X.local.satz, repoints the estate, proves the repoint by transpile identity, removes X.satz; exits non-zero DROPPED [included], exits non-zero
X.diff.satz of a dropped X.satz removes it: there is nothing left to compare the fork with dropped
X.local.satz of a dropped X.satz keeps it, and says the original is gone in the run that removes X.satz or X.diff.satz fork, saying the original is gone
a file of no kind above keeps it, WARNING naming it WARNING naming it

A fork of a dropped pack is the estate's own file: no release changes it, and no adoption delta is written for it. A used dropped pack whose X.local.satz exists already is refused, naming the fork: the estate's use is pointed at that fork, or the fork moved aside, before the next run.

When a pack line has no gate

Every pack but estate-core and the map is switched by a gate, and a no switches it off only through a line written use "…" when <gate>. An active line of such a pack written without when creates the pack's resources whatever the answer says. The transpile reports each one as an ungated-pack message with its file and line, satz presets lists the line as ungated, and satz remove-preset refuses to switch the pack off through it.

The message names both halves of the edit: write use "<path>" when <gate> on that line, and bind <gate> = true in the estate's own params { }. The line creates the pack's resources, and the binding keeps them once the gate decides; satz remove-preset is what switches it off afterwards. No command writes the when.

When a release moves a pack

A pack the library moved lives at its new path, and the release's entry under Breaking changes names the use line to edit. No command rewrites the line or moves the files beside it. The old path is on the library's list of dropped files, so an estate whose use still names it is treated as any estate that uses a dropped file: check-presets reports DROPPED [included] and exits non-zero, and merge-presets forks the copy to X.local.satz and repoints the estate. Once the estate's use names the new path, merge-presets removes the copy at the old one and its .diff.satz, and keeps a .local.satz there (see When the library drops a file).

Is it stale, or edited?

Find out first, without touching anything:

satz --config <estate-dir> check-presets satz/<ESTATE>.satz --format text --out -

The GitHub API allows 60 unauthenticated requests an hour, and each run spends one. Without network access to GitHub, or with the quota spent, compare against a local checkout:

satz --config <estate-dir> check-presets --pristine-dir ~/projects/satz/presets satz/<ESTATE>.satz --format text --out -

check-presets reports two independent things: the version line says whether a newer release exists; the content comparison says whether anyone edited this copy.

Drift in an [included] preset exits non-zero — that is the CI gate.

To choose between adopting and merging, compare the local file with the release it claims to be:

# what release does the local file claim to be?
grep -m1 '^pack' <estate>/presets/cis/CIS-GCP-Foundation-4.0.satz     # -> version "1.5"

# is it byte-identical to that release?
cd ~/projects/satz
git log --format=%H -- presets/cis/CIS-GCP-Foundation-4.0.satz \
  | while read c; do
      v=$(git show $c:presets/cis/CIS-GCP-Foundation-4.0.satz | grep -m1 '^pack')
      echo "$c $v"
    done | head           # find the commit that carried v1.5
git show <that-commit>:presets/cis/CIS-GCP-Foundation-4.0.satz > /tmp/pristine-1.5.satz
diff /tmp/pristine-1.5.satz <estate>/presets/cis/CIS-GCP-Foundation-4.0.satz
result meaning what to run
no diff STALE — unchanged since that release adopt: copy the pristine file in
diff EDITED — a real local change merge-presets — let it fork and give you X.diff.satz

Without a baseline merge-presets cannot tell the two apart, so it forks. For an edited pack that is correct; for a stale one it moves the estate onto a fork it does not need. Adopt stale packs explicitly.

Adopt, merge, or fork

Your copy is stale — adopt

satz --config <estate-dir> merge-presets --adopt CIS-GCP-Foundation-4.0 --report-only
satz --config <estate-dir> merge-presets --adopt CIS-GCP-Foundation-4.0

It overwrites the pristine name in place, leaves the estate's use alone, and prints the HCL code delta — which resources appear or disappear, by address. --adopt all does every pack that is merely BEHIND, and refuses one that differs at the same version: that is an edit, and it has to be named. A fork+repoint needed in the same run is deferred to a separate run: the repoint is proven by transpile identity, and an adoption changes the output, so the two cannot share a run.

merge-presets does not regenerate hcl/. Continue with the normal gates:

satz --config <estate-dir> transpile satz/<ESTATE>.satz

cd <estate-dir>
git status --short          # only presets/ + hcl/ should move
git diff hcl/main.tf        # THIS is the real review — the HCL code delta
satz --config . require cis-gcp-4.0 satz/<ESTATE>.satz --format text --out -   # compare with the previous verdicts
satz --config . check-presets --pristine-dir ~/projects/satz/presets satz/<ESTATE>.satz --format text --out -

Then read the plan before applying:

cd hcl && tofu plan

Adoption is only a no-op when the moved default is one your estate overrides, or the pack is not used at all. Otherwise expect a real plan and gate it with a runbook.

Your copy is edited — merge

cd <estate-dir>
git status --short                      # must be clean: auto-repoints refuse a dirty estate
satz --config . merge-presets --report-only   # preview every planned action
satz --config . merge-presets

Afterwards you have X.local.satz (your content, now the thing the estate uses — a repointed line keeps its named <name> and its when), a refreshed pristine X.satz, and X.diff.satz telling you exactly what adopting upstream would change. Read the diff; adopt when you are ready by pointing the estate's use back at the pristine name and deleting the fork.

Exit code is non-zero when anything needs attention — a fork was created, a fork's upstream moved, or a repoint was refused. That is the CI signal.

The estate runs a fork already

If the estate uses X.local.satz, copying pristine over X.satz changes nothing it writes. The change has to be made in the fork. Do not refresh the pristine sibling: it is the fork's baseline for the next merge, and overwriting it loses the record of where the fork branched.

Rules of thumb

When upstream stops answering: the GitHub quota

All three commands read the preset library from GitHub, and GitHub's unauthenticated REST quota is 60 requests per hour, per IP — shared with satz self-update. A sweep across a fleet can exhaust it, which also blocks self-update until the quota resets.

When the quota is exhausted, satz says:

GitHub API rate limit reached (60 requests/hour, unauthenticated). Retry in ~48
minutes, set GITHUB_TOKEN, or compare against a local checkout with
`--pristine-dir <checkout>/presets`.

Three ways around it:

One invocation costs two API requests: the commit main points at, and the whole preset subtree in a single tree response; the files themselves come from a host that is not rate-limited.

A 403 that is not the quota — a private repo, a bad token — reports as a plain status instead, because waiting an hour would not fix it.