oficina / alta Public

Clarify Equipo rollout recovery and existing-run prerequisites

Co-Authored-By: Codex GPT-6-Astra <noreply@openai.com>
claude agent, operated by paul@keymail.dev 5001cd0db37e715ddaaf41606a7a189ef77e6b42 parent e5d5b07
4 files changed, +41 −6
  • adopt/delivery.go +1 −1
  • cmd/alta-adopt/main.go +1 −1
  • docs/equipo-adoption.md +37 −2
  • provision/adopt.go +2 −2

CI passed — run details

CI log
=== vet ===
go vet ./...
=== fmt ===
=== test ===
CGO_ENABLED=0 go test ./...
ok  	amadan.net/oficina/alta/adopt	(cached)
ok  	amadan.net/oficina/alta/carlosop	(cached)
?   	amadan.net/oficina/alta/carlosop/fakecarlos	[no test files]
ok  	amadan.net/oficina/alta/cmd/alta	(cached)
ok  	amadan.net/oficina/alta/cmd/alta-adopt	(cached)
ok  	amadan.net/oficina/alta/console	(cached)
?   	amadan.net/oficina/alta/console/fakeconsole	[no test files]
ok  	amadan.net/oficina/alta/homeop	(cached)
ok  	amadan.net/oficina/alta/homeop/fakehome	(cached)
ok  	amadan.net/oficina/alta/internal/web	(cached)
ok  	amadan.net/oficina/alta/provision	(cached)
=== compat ===
cd homecompat && go vet ./... && CGO_ENABLED=0 go test ./...
ok  	amadan.net/oficina/home/altacompat	(cached)
diff --git a/adopt/delivery.go b/adopt/delivery.go
index ebf203f..7d16101 100644
--- a/adopt/delivery.go
+++ b/adopt/delivery.go
@@ -18,7 +18,7 @@ import (
// OpsShape is what GET /api/v1/operations answers, reduced to the shapes
// adoption tells apart. Slides, Calls and Equipo already answer their own 401 there
-// (an app middleware, {"error":"unauthorized"}), so a bare 401 proves
+// (an app middleware with a non-agent error body), so a bare 401 proves
// nothing: only agent-access's own answer counts, in exactly the shape
// agent-access writes it (agent-access f08bfc1, http.go Authenticate,
// writeFailure and writeJSON).
diff --git a/cmd/alta-adopt/main.go b/cmd/alta-adopt/main.go
index 69277d7..f389091 100644
--- a/cmd/alta-adopt/main.go
+++ b/cmd/alta-adopt/main.go
@@ -1,6 +1,6 @@
// Command alta-adopt is the existing-team adoption runner (Home
// implementation/existing-team-adoption.md): a local operator command
-// that adopts the six canonical Oficina apps into the Home directory team
+// that adopts the canonical Oficina apps into the Home directory team
// labelled oficina. It is never built into or deployed with alta.
//
// Home's half runs in Alta's own engine, on Alta's one operator signer,
diff --git a/docs/equipo-adoption.md b/docs/equipo-adoption.md
index e8d0af6..ae8def9 100644
--- a/docs/equipo-adoption.md
+++ b/docs/equipo-adoption.md
@@ -10,6 +10,8 @@ executed against production with writes during implementation.
- Land and deploy the reviewed Home `native/equipo-in-directory` change to
**both** `oficina` and `oficina-id`; verify their `X-Carlos-Version`.
- Land this Alta change and build `make adopt` on the operator Mac.
+ Before deleting Home's source branch after a squash merge, re-pin Alta's
+ test-only `homecompat` module to the Home merge commit and pass `make ci`.
- The separately implemented Equipo adoption contract below must be
deployed at `https://equipo.oficina.works`, with its existing instance,
storage and access policy preserved. Its native exchange must also be
@@ -78,6 +80,7 @@ prints no credentials. Do not run concurrently with another manifest edit.
```sh
python3 - <<'PY'
import base64, json, subprocess
+from pathlib import Path
base = ['carlos', 'env']
args = ['--account', 'oficina', '--app', 'oficina-id']
text = subprocess.check_output(base + ['list'] + args, text=True)
@@ -94,15 +97,43 @@ if manifest.get('equipo') == origin:
print('Equipo already has the exact canonical env registration')
else:
assert len(manifest) < 16, 'Env registry is full'
+ backup = Path.home() / '.oficina-id-consumers-before-equipo.b64'
+ with backup.open('x', encoding='ascii') as saved:
+ saved.write(values['HOME_CONSUMERS_BASE64'] + '\n')
+ backup.chmod(0o600)
manifest['equipo'] = origin
encoded = base64.b64encode(json.dumps(manifest, separators=(',', ':')).encode()).decode()
subprocess.run(base + ['set'] + args + ['HOME_CONSUMERS_BASE64=' + encoded], check=True)
print('Added equipo -> https://equipo.oficina.works; restart the credential service')
PY
carlos restart --account oficina --app oficina-id
+curl --fail --silent --show-error -D - https://id.oficina.works/healthz
```
-Re-run the two public checks. Expected: Equipo and Docs both 303 after the
+Expected health: 200 and `X-Carlos-Version` naming the reviewed Home release.
+The backup is public consumer metadata; the exclusive create prevents
+overwriting the previous manifest. If it already exists, inspect it before
+another attempt. Keep it until health and consumer checks pass.
+
+If this manifest change makes the credential service unhealthy, restore the
+saved value immediately (only if no intervening manifest edit occurred),
+restart, and check health before investigating. This rolls back the manifest
+change, not an adoption or deployment:
+
+```sh
+python3 - <<'PY'
+import base64, json, subprocess
+from pathlib import Path
+old = (Path.home() / '.oficina-id-consumers-before-equipo.b64').read_text().strip()
+assert isinstance(json.loads(base64.b64decode(old, validate=True)), dict)
+subprocess.run(['carlos', 'env', 'set', '--account', 'oficina', '--app',
+ 'oficina-id', 'HOME_CONSUMERS_BASE64=' + old], check=True)
+PY
+carlos restart --account oficina --app oficina-id
+curl --fail --silent --show-error -D - https://id.oficina.works/healthz
+```
+
+On success, re-run the two public checks. Expected: Equipo and Docs both 303 after the
process restarts. Home's native `assert` then accepts exactly
`https://equipo.oficina.works`, with no port, slash, suffix or case variants.
A complete native check still needs a real device grant and the deployed
@@ -137,7 +168,9 @@ this session, as the original adoption runbook requires.
Expected status: the `oficina` team is seeded, the original six apps'
register steps are done, calendar has completed activation, and Equipo has
-no steps yet. If Equipo is already registered, skip Plan A below. If it is
+no steps yet. No `oficina` run may be `planned`, `running` or `parked`:
+finish or resolve it before opening another Plan A, which supersedes an
+unfinished run. If Equipo is already registered, skip Plan A below. If it is
already active, stop here: no repeat adoption is needed.
Add the reviewed release's digest to `artifacts`, preserving every other
@@ -171,6 +204,8 @@ on other instances, team-mode config, unreviewed release, or an unexpected
operations response stops the run. Fix the reported cause, never remove the
gate or edit the journal. All Equipo config and release preparation belongs
before the first `configure`, which captures an immutable baseline.
+An unscoped `preflight` now includes Equipo and will refuse until its
+separate contract is deployed; use the explicit `--app equipo` above.
## 3. Register Equipo against the already seeded team
diff --git a/provision/adopt.go b/provision/adopt.go
index 62a9e92..62f618b 100644
--- a/provision/adopt.go
+++ b/provision/adopt.go
@@ -46,7 +46,7 @@ const adoptionName = "Oficina"
// - DisableAdopted: an ordinary retire-apps window on the directory
// alone, directory.disable-consumer and nothing else.
//
-// None of them touches the console or an instance: the six instances,
+// None of them touches the console or an instance: the existing instances,
// their environments and their keys are not Alta's.
// adoptionSteps is an adoption run's per-app pipeline: Plan A, a
@@ -61,7 +61,7 @@ func adoptionSteps(kind string) []string {
return []string{StepVerify, StepActivate}
}
-// StartAdoption opens Plan A for the six canonical apps. existing_team is
+// StartAdoption opens Plan A for the canonical apps. existing_team is
// the SQID the directory proposes now, read here; Home seeds the team at
// it or not at all.
func (e *Engine) StartAdoption(ctx context.Context, name, owner string) (int64, error) {