oficina / home Public

Resolve Fable round-1 review of the team provisioning designs

Discussion 92, Claude Fable 5.1, CHANGES REQUIRED. Every blocker and note
applied; round 2 owed on amendment §4/§5 and team-members §2/§5.

- Blocker 1: the approval ceremony moves to Home. Alta submits signed
  plans; Paul opens each role's window on Home's own confirm pages behind
  a fresh sign-in, reading Home's copy and retyping the owner on the
  credential origin. Raw-assertion forwarding removed.
- Blocker 2: credential.register-consumer carries the directory's signed
  provisioning record; provision runs first; the credential role pins the
  directory provisioning key; collisions checked against HOME_CONSUMERS
  plus the table.
- Blocker 3: production evidence recorded (all directory tables empty,
  7 HOME_CONSUMERS entries); the first run is an initialize plan; a present
  generation would need a separately reviewed enrol operation.
- Blocker 4: a second fresh-only handoff consumer at /auth/fresh/start;
  anonymous GET follows the chooser; the 403 claim narrowed.
- Blocker 5: memberships.added_at, day-coarsened, with its migration.
- CARLOS round 1: owned environments are standalone, so Alta's recipes
  copy the shared relay values in; lagged moves by env fork plus explicit
  rebind.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 6db178090060f9f171a8ee46f8d1964e7a598b8a parent 6e5f010
3 files changed, +713 −573
  • implementation/team-members.md +81 −24
  • implementation/team-provisioning-amendment.md +396 −338
  • implementation/team-provisioning-app.md +236 −211

CI cancelled — superseded by a newer push — run details

diff --git a/implementation/team-members.md b/implementation/team-members.md
index fbe1dd9..ecdc59e 100644
--- a/implementation/team-members.md
+++ b/implementation/team-members.md
@@ -1,10 +1,12 @@
# 🤖 Team members: the Team page, and roster mode in every app
-**Status:** PROPOSED, 2026-10-27. Drafted by Claude Opus 5.5 for Paul. Not
-reviewed; **no code until a top-model review approves it** (AGENTS.md
-"Review"). Base: Home origin/main `e2ec1ab`; Docs `d867db1`, Sheets
-`af8deeb`, Slides `ebbb08f`, Calendar `00d8e3d`, Meet/Calls `47afcb9`,
-Memoria `521ae24`.
+**Status:** PROPOSED, 2026-10-27. Drafted by Claude Opus 5.5 for Paul.
+**Round 1: reviewed by Claude Fable 5.1 (claude-fable-5-1), 2026-10-27,
+discussion 92 — CHANGES REQUIRED.** Round-1 fixes applied (§10); round 2
+pending on §2 and §5. **No code until a top-model review approves it.**
+Base: Home origin/main `e2ec1ab`; Docs `d867db1`, Sheets `af8deeb`, Slides
+`ebbb08f`, Calendar `00d8e3d`, Calls (repo `oficina/meet`, `cmd/calls`)
+`47afcb9`, Memoria `521ae24`.
**Paul's rulings, 2026-10-27, applied here:** owner-chosen member names,
sealed, refusing `@`; unnamed members show role plus a short ref; **every
member of a team sees its member list, only owners write**; no "you've been
@@ -31,19 +33,41 @@ that app ignores the Team page and keeps admitting by its own allowlist.
- **Route:** `GET /team?team=<sqid>` (ruling 22: team views carry `?team=`).
Linked from the springboard's account menu as "Team" when the signed-in
person is on the selected team.
+- **Signed out:** an anonymous `GET /team?team=<sqid>` follows the chooser
+ (`docs_chooser.go:142-154`): 303 to `/auth/start?return_to=…` with the
+ query preserved (spec §5.6), so a shared team link survives sign-in.
- **Who sees it:** a directory session whose subject has a `memberships`
- row (owner or member) for that team. **Everyone else — a guest, a member
- of another team, a stranger, an unknown or malformed sqid — gets the same
- 404** as an unknown route (gate 4's pattern). No 403 anywhere.
+ row (owner or member) for that team. **Everyone else signed in — a guest,
+ a member of another team, a stranger, an unknown or malformed sqid — gets
+ the same 404** as an unknown route (gate 4's pattern). **The page's own
+ answers are never 403**; `csrf.Protect` and the host check, which run
+ before the handler, keep their own codes.
- **Who writes:** owners only. A member sees no write controls, and a
member's POST to any write route gets the same 404 (gate 21).
-- **Reading needs a session; writing needs step-up.** Every POST checks the
- directory session's `auth_time` is within 300 s and not in the future
- (`fresh-assertion.md`). If it is not, the POST renders the existing
- continuation page to `/auth/start?return_to=%2Fteam%3Fteam%3D<sqid>` with
- `max_age=300` (handoff `StartFresh`), and the person repeats the action
- after returning. The submitted change is **not** retained across the
- step-up (same rule as the chooser's expired-session POST).
+- **Reading needs a session; writing needs a fresh one (round 1, blocker
+ 4).** The directory gains a **second `handoff.Consumer`** on the same
+ store, with `RequireFreshAuth: true`, mounted at its own start path
+ **`/auth/fresh/start`** (the existing consumer at `/auth/start` stays
+ ordinary; `RequireFreshAuth` is per consumer, `handoff/http.go:139-141`).
+ It asks the issuer for `max_age=300` and enforces the five-minute window
+ itself on finish. Every Team-page POST checks the directory session's
+ `auth_time` is within 300 s and not in the future; if not, it renders the
+ existing continuation page to
+ `/auth/fresh/start?return_to=%2Fteam%3Fteam%3D<sqid>`, and the person
+ repeats the action on return. The submitted change is **not** retained
+ across the step-up (the chooser's expired-session rule). The same fresh
+ consumer fronts the operator confirm page (amendment §4).
+ `noscript_test.go`'s route list gains `/team`, `/team/add`,
+ `/team/resolved`, `/team/confirm`, the role/name/remove POSTs and
+ `/auth/fresh/start`.
+- **Inherited gap, stated:** `fresh-assertion.md`'s open rastrillo item
+ applies. The fresh consumer's `max_age=300` makes the issuer refuse a
+ Keymail session with no reported gesture; but a directory session minted by
+ ordinary SSO from such a session inside the last 300 s carries
+ `auth_time = At` and passes a directory-side freshness check. The page
+ inherits that gap until rastrillo lets an assertion carry an absent
+ `auth_time`, exactly as Docs linking does. Writes that arrive through
+ `/auth/fresh/start` are not affected.
- **Scriptless.** Every action is a plain form POST with CSRF; estilo's
`busy.js` is the only script, already on Home's closed list.
- **Shape (estilo, Calma door rules — sky only on the team header):**
@@ -74,10 +98,16 @@ that app ignores the Team page and keeps admitting by its own allowlist.
4. **Epoch bumps** come from the existing `memberships_epoch_*` triggers; no
second increment. Instances see a change within the roster lease
(refresh due 30 s, hard expiry 60 s — `roster-contract.md`).
-5. **Bounds:** 500 members per team (well inside the roster's 10,000 and
+5. **`added_at`** (round 1, blocker 5): `memberships` gains `added_at`
+ (integer day, coarsened per §3.3), written by `directory.seed-team` for
+ the first owner and by `/team/confirm`; rows from before the migration
+ read as unknown and show no date. Additive migration
+ `directorydata/migrations/0002_membership_added_at.sql`; gate 2's static
+ half reads it.
+6. **Bounds:** 500 members per team (well inside the roster's 10,000 and
100-per-page limits; a number with a reason: a team page, not a
directory). 30 writes per owner per hour.
-6. **Call 2 still cannot write `memberships`**, and nothing here changes
+7. **Call 2 still cannot write `memberships`**, and nothing here changes
that.
## 4. Adding someone by email
@@ -104,14 +134,18 @@ resolves and signs.** The address is typed on `id.oficina.works`, never on
gate 5). The intent id rides a sealed `__Host-` cookie, as `/authorize`
does.
3. **Credential, `POST /resolve`.** Normalizes and blind-indexes with the
- sign-in helper; finds the person, or mints a person stub exactly as call
- 2 does for a never-signed-in guest (§6). Rate limited: 20 per subject per
+ sign-in helper; finds the person, or mints a person stub as spec §6
+ describes for a never-signed-in guest, using the helper that exists,
+ `findOrMintPersonOn` (`links.go:156`) — call 2, which §6 names, is not
+ implemented. Rate limited: 20 per subject per
hour, plus the existing per-IP budget. Signs a **member-resolution
receipt**: `{v, purpose:"member-resolve", iss, aud:<directory>,
requester:<session sub>, intent, person_ref, iat, exp ≤ 120 s, jti}` with
- a new dedicated P-256 key (`HOME_RESOLVE_KEY`, pinned on the directory;
- distinct from the assertion, operator and roster keys) under context
- `oficina/home/member-resolve/v1`. Auto-POSTs it to the directory with the
+ a new dedicated P-256 key (private half `HOME_RESOLVE_KEY` on the
+ credential role only) under context `oficina/home/member-resolve/v1`. The
+ directory pins the public half as **`HOME_RESOLVE_PUBLIC_KEY`** — a fourth
+ pinned key beside `HOME_ASSERTION_KEYS`, the operator key and the roster
+ keys — and it joins `NewDirectory`'s key-inequality set. Auto-POSTs it to the directory with the
existing handoff page (static script, Continue button with script off).
The address is dropped. **The response never says whether the person
already existed.**
@@ -157,7 +191,11 @@ only; deleted with the membership row. Names never ride an assertion, call
8, a log or an error string.
**Spec text this changes:** §3.2's "Sealed" list gains "member display
-names"; the README's published list says owners can name members.
+names"; §10's data-model list gains `membership_names` and
+`memberships.added_at`; the README's published list says owners can name
+members. Gate 2's static half reads the `membership_names` migration
+(`directorydata/migrations/0003_membership_names.sql`) and asserts the name
+column is a sealed BLOB.
## 5a. Every member sees the list — RULED 2026-10-27 by Paul
@@ -200,6 +238,13 @@ instances, but not owner status or names.
- **Gate 5** — `/resolve` renders no account-authored string (scan with a
canary team name and member name present in the directory).
- **Gate 9** — no address, member name, team name or person ref fragment in logs.
+- **Step-up route** — a stale-session POST renders the continuation to
+ `/auth/fresh/start`; an assertion through it with `auth_time` 301 s old is
+ refused at finish; the ordinary `/auth/start` consumer is unchanged.
+ Anonymous `GET /team?team=<sqid>` 303s to `/auth/start` with the query
+ preserved.
+- **`added_at`** — seed and confirm write a day value; pre-migration rows
+ render no date; gate 2's static half covers both new migrations.
- **Last-owner** — remove/demote the sole owner refuses; with two owners,
either may leave.
- **Cross-origin** — receipt replay, wrong `aud`, wrong requester (another
@@ -256,4 +301,16 @@ does nothing until the person signs in); suite-wide sign-out.
## 9. Still open
Nothing for Paul in this file; all four questions were ruled on 2026-10-27
-(names, no mail, members read, port order). Review is still owed.
+(names, no mail, members read, port order). Round-2 review is owed on §2 and
+§5.
+
+## 10. Round-1 findings: disposition
+
+Blocker 4 (no route to start a step-up; "no 403 anywhere") → §2: a second
+`handoff.Consumer` with `RequireFreshAuth` at `/auth/fresh/start`, named in
+the noscript route list; anonymous GET follows the chooser; 403 claim
+narrowed to the page's own answers. Blocker 5 (no `added_at`) → §3 rule 5,
+§5 spec-text list. Notes: `findOrMintPersonOn` cited (§4 step 3); freshness
+gap inherited and stated (§2); `HOME_RESOLVE_PUBLIC_KEY` pinned and in the
+inequality set (§4 step 3); `membership_names` in §10 and gate 2 (§5);
+Calls repo named (status). None declined.
diff --git a/implementation/team-provisioning-amendment.md b/implementation/team-provisioning-amendment.md
index b76976e..a2b2bbe 100644
--- a/implementation/team-provisioning-amendment.md
+++ b/implementation/team-provisioning-amendment.md
@@ -1,33 +1,37 @@
# 🤖 Amendment: the operator endpoint (teams without the maintenance worker)
-**Status:** PROPOSED, 2026-10-27. Drafted by Claude Opus 5.5 for Paul. Not
-reviewed. **No code until a top-model review approves this file** (AGENTS.md
-"Review") and Paul answers the pre-flight question in §12. Direction approved
-in principle by Paul, 2026-10-27: "the provisioning app creates teams, owners
-and consumer registrations through a narrow, authenticated Home endpoint,
-instead of the blocked platform-117 maintenance worker."
-**Base:** origin/main `e2ec1ab`. Companion files:
-`team-provisioning-app.md` (the caller, called **Alta** below) and
-`team-members.md` (the Team page).
-**Paul's rulings, 2026-10-27, applied here:** two-key approval (Alta's
-signature **and** his fresh Home sign-in on every run); ruling 8 re-ruled
-for Alta, conditional on CARLOS team-scoped credentials; the owner must
-already exist (`existing_only`); team labels are never reused. One
-pre-flight question remains open (§12).
+**Status:** PROPOSED, 2026-10-27. Drafted by Claude Opus 5.5 for Paul.
+**Round 1: reviewed by Claude Fable 5.1 (claude-fable-5-1), 2026-10-27,
+discussion 92 — CHANGES REQUIRED (5 blockers, non-blocking notes).** Round-1
+fixes are applied below (§13 maps each finding); **round 2 is pending** on
+§4 and §5 here and §2/§5 of `team-members.md`. **No code until a top-model
+review approves this file** (AGENTS.md "Review") and Paul gives the
+pre-flight confirmation in §12. Direction approved in principle by Paul,
+2026-10-27: "the provisioning app creates teams, owners and consumer
+registrations through a narrow, authenticated Home endpoint, instead of the
+blocked platform-117 maintenance worker."
+**Paul's rulings, 2026-10-27, applied here:** two-key approval on every run;
+ruling 8 re-ruled for Alta, conditional on CARLOS team-scoped credentials;
+the owner must already exist (`existing_only`); team labels are never reused.
+**Base:** origin/main `e2ec1ab`. Companions: `team-provisioning-app.md` (the
+caller, **Alta**) and `team-members.md` (the Team page).
---
-## 1. What changes, in one paragraph
+## 1. What changes
Every operator verb in `internal/operator` runs today only inside a platform
maintenance worker that does not exist (platform discussion 117). This
-mounts **the same engine and verbs** behind one HTTP route per Home role,
-callable only by one pinned external signer (Alta) **and** only inside a
-short approval window opened by Paul's fresh Home sign-in. It adds consumer
-registration and retirement verbs, and moves the credential consumer list
-out of the 16-entry `HOME_CONSUMERS` env var into the credential database.
-**Home still holds no platform credential** (spec §7's load-bearing fact):
-Alta creates instances; Home records facts about its own resources.
+mounts **the same engine** behind one HTTP route per Home role, callable only
+by one pinned external signer (Alta), and only inside an approval window that
+**Paul opens on Home itself**, after a fresh sign-in, against Home's own copy
+of the plan. The engine is unchanged; **the verbs are wrapped** (a window
+check, and on the directory a provenance fence, inside each mutation). It
+adds consumer registration and retirement verbs and a stream read, and moves
+the credential consumer list out of the 16-entry `HOME_CONSUMERS` env var
+into the credential database. **Home still holds no platform credential**
+(spec §7's load-bearing fact): Alta creates instances; Home records facts
+about its own resources.
## 2. Approved text this supersedes (quoted)
@@ -36,360 +40,414 @@ Each quoted file gains a one-line pointer here when this lands.
1. `home-provisioner.md`: *"Implement a separate local Go command,
`oficina provision`, callable directly by a human. … Every maintenance
mutation still requires its actual browser session, CSRF, current
- account-owner lookup and `requireFreshAuth`."* — Replaced by §4: Alta's
- signature plus Paul's fresh Home assertion.
-2. `home-provisioner.md`, "Signed private operation contract": *"The fixed
- operator entry point is enabled only for maintenance execution of the
- immutable configured release. Normal HTTP startup does not expose it. Tests
- must prove direct app requests cannot invoke it."* — Replaced: normal HTTP
- startup exposes `POST /operator/v1` **only when** `HOME_OPERATOR_HTTP` is
- configured (§3); tests prove it is absent otherwise.
-3. `home-operator-seed.md`, "Transport and command boundary": *"Platform
- discussion 117 owns stopping traffic and all background work, holding the
- database lease … The command never starts an HTTP server, sends mail or
- makes network calls."* — Replaced for this path. The engine serializes
- with `BEGIN IMMEDIATE` on the serving process's own writer, so
- `home-operator-open.md`'s fenced-identity proof is moot here.
-4. `roster-contract.md`: *"This module … adds no public bootstrap route and
+ account-owner lookup and `requireFreshAuth`."* — Replaced by §4.
+2. `home-provisioner.md`: *"The fixed operator entry point is enabled only
+ for maintenance execution of the immutable configured release. Normal
+ HTTP startup does not expose it. Tests must prove direct app requests
+ cannot invoke it."* — Replaced: HTTP startup exposes `/operator/v1`
+ **only when** `HOME_OPERATOR_HTTP` is configured (§3).
+3. `home-provisioner.md`, "Registry custody and persistence": *"Init creates
+ random device and registry IDs plus signing/encryption keys, and stores
+ the keys only in an age scrypt-encrypted credential file … The
+ independent floor backend writes signed immutable sequence/head files"*
+ and its two-phase floor CAS. — Replaced by Alta's sealed SQLite plus
+ **Home's per-role stream head as the rollback arbiter**: Home refuses any
+ sequence that is not previous + 1, so a rolled-back Alta is refused and
+ resynchronises through `<role>.inspect` (§5).
+4. `home-operator-seed.md`: *"Platform discussion 117 owns stopping traffic
+ and all background work, holding the database lease … The command never
+ starts an HTTP server, sends mail or makes network calls."* — Replaced
+ for this path; the engine serializes with `BEGIN IMMEDIATE` on the
+ serving process's own writer, so `home-operator-open.md`'s
+ fenced-identity proof is moot here.
+5. `home-operator-seed.md`: *"The invocation must be authorized outside the
+ request. … The platform must provide an authenticated invocation context
+ or equivalent private launch configuration before command wiring is
+ approved; an environment boolean supplied by the caller is
+ insufficient."* — Replaced by §4: Alta's pinned signature **and** a
+ window Paul opened on Home, with the pins in reviewed
+ `HOME_OPERATOR_HTTP` configuration.
+6. `home-operator-seed.md`: *"The verified operator context must attest
+ successful exact-host/body/header build verification, assertion
+ registration, isolated instance database/config, and the reviewed
+ TeamMode acceptance gates. A string supplied by the request is not that
+ attestation."* — **Weakened, said so:** on this path
+ `ActivationEvidence` is Alta's signed observation through the CARLOS
+ console plus the credential role's registry digest
+ (`team-provisioning-app.md` §7), not a platform attestation.
+7. `roster-contract.md`: *"This module … adds no public bootstrap route and
no runtime operator mutation transport. Live provisioning/restore remains
gated on supported fenced maintenance (platform discussion117) or a
- separately reviewed genuinely fresh first-boot path."* — This file is that
- separately reviewed transport, for provisioning only. **Restore stays
- gated** (§6).
-5. `home-provisioner.md` step 6: *"Register the exact consumer with credential
- Home by updating its bounded immutable HOME_CONSUMERS manifest … Current
- source allows16 entries/8192bytes … stop at the bound. Scalable
- registration is separate work."* — Replaced by §7.
-6. `team-entry.md`: *"No request can register or alter a consumer."* and
+ separately reviewed genuinely fresh first-boot path."* — This file is
+ that transport, **for provisioning only; restore stays gated**.
+8. `home-provisioner.md` step 6: *"Register the exact consumer with
+ credential Home by updating its bounded immutable HOME_CONSUMERS manifest
+ … stop at the bound. Scalable registration is separate work."* —
+ Replaced by §7.
+9. `team-entry.md`: *"No request can register or alter a consumer."* and
*"pilot bootstrap is not a web administration endpoint."* — Narrowed: one
- signed, approved request type can register or retire a consumer; no
+ signed, Paul-approved request type registers or retires a consumer; no
browser request can.
-7. `directory-runtime.md`: *"There is currently no exported network writer
- that can mark an instance live."* — Now there is exactly one, §5.
-8. Spec §10: the first owner is *"seeded by the drain with the person the
- sealed queue payload §7 already carries."* — Widened: the owner may also
- come from an **operator-authored plan** (Paul types it into Alta), as
- `home-provisioner.md` already allowed for synthetic pilots. The queue
- (call 4) is untouched and still drained by a human.
-9. `operator/verification.go` `ActivationEvidence.EnvironmentBinding` and
- `ManifestDigest` were specified as maintenance-environment facts. On this
- path they are Alta's observations through the CARLOS console and the
- credential role's consumer-registry digest
- (`team-provisioning-app.md` §7). Same fields, weaker provenance, said so.
+10. `directory-runtime.md`: *"There is currently no exported network writer
+ that can mark an instance live."* — Now there is exactly one (§5).
+11. Spec §10: the first owner is *"seeded by the drain with the person the
+ sealed queue payload §7 already carries."* — Widened: the owner may also
+ come from an **operator-authored plan**. The signup queue is untouched
+ and still drained by a human.
**Rulings this touches:**
- **Ruling 8 — RE-RULED for Alta by Paul, 2026-10-27.** Its Rejected column
read *"A standing console token in a web-facing app."* Its reason (§7) —
an RCE on Home's sign-in surface must never reach instance creation —
- still holds: Home holds no CARLOS credential. The re-ruling, to be added
- to spec §1 as its own row when this lands: **a web-facing app other than
- Home (Alta) may hold CARLOS credentials, on condition that CARLOS gains
- team-scoped credentials** — able to create, configure, restart and delete
- instances, set env and secrets, and attach and detach domains **only** for
- named, non-default environments and the instances bound to them, never
- the app's default bundle or instances on it. **Alta does not ship to
- production until that credential exists.** Rejected: a separate CARLOS
- account for team instances; accepting today's app-wide reach. CARLOS
- design: `carlos/platform` branch `team-scoped-credentials`,
- `implementation/team-scoped-credentials.md`.
+ still holds: Home holds no CARLOS credential. Re-ruling, to be added to
+ spec §1 as its own row: **a web-facing app other than Home (Alta) may hold
+ CARLOS credentials, on condition that CARLOS gains team-scoped
+ credentials** that act **only** on named, non-default environments and the
+ instances bound to them. **Alta does not ship to production until that
+ credential exists.** Rejected: a separate CARLOS account; accepting
+ today's app-wide reach. CARLOS design: `carlos/platform` branch
+ `team-scoped-credentials` (role `team`).
- **Ruling 7** is unaffected: Alta is the human gate and never auto-drains
- the signup queue (§14's three conditions are unmet).
+ the signup queue.
-**Not superseded:** §0 the one rule; §2.2's four never-dos; ruling 4 (the
-pepper stays on the credential role); ruling 19 (labels reserved suite-wide);
-ruling 23 (roster written only by an owner behind step-up, **or seeded with
-the first owner**); `home-operator-seed.md`'s *"The directory cannot request
-address resolution over HTTP"* — nothing here lets the directory ask the
-credential role anything.
+**Not superseded:** §0; §2.2's four never-dos; ruling 4 (pepper on the
+credential role only); ruling 19; ruling 23; `home-operator-seed.md`'s
+*"The directory cannot request address resolution over HTTP."*
## 3. Where it lives and how it is switched on
-- **Route:** `POST /operator/v1` and `POST /operator/v1/approve` on each
- role's own origin — `id.oficina.works` (credential verbs only) and
- `oficina.works` (directory verbs only); `allowedAction` already splits
- verbs by role.
-- **Off unless configured.** `HOME_OPERATOR_HTTP` (JSON, ≤ 8 KiB, closed
+- **Routes, per role, each on its own origin** (`id.oficina.works` for
+ credential verbs, `oficina.works` for directory verbs):
+ `POST /operator/v1` (signed operation or signed inspect challenge),
+ `POST /operator/v1/plan` (Alta submits a signed plan, §4),
+ `GET` + `POST /operator/confirm?plan=<id>` (Paul's browser, §4).
+- **Off unless configured.** `HOME_OPERATOR_HTTP` (JSON ≤ 8 KiB, closed
fields) per role: `version`, `role`, `origin`, `installation`, `registry`,
- `device`, `public_key`, `key_id`, `actions` (≤ 8, subset of §5's allowlist),
- `operator_subject` (Paul's person ref), `approver_origin` (Alta's exact
- origin), `prefilter_token_sha256`. Absent → the route is not mounted (404,
- indistinguishable from any unknown path). Malformed → boot refuses.
-- **Separate key from every other key.** Alta's operator public key must
- differ from the assertion key, owner-seed signer, directory provisioning
- signer and roster keys (`NewDirectory`/`NewCredential` already refuse
- equality; extend to the HTTP loader).
-
-## 4. Authentication: two keys, neither sufficient alone
-
-A request is accepted only if **all** of these hold, checked in this order,
-before any database write:
-
-1. **Not a browser.** Refuse if the request carries `Cookie`, `Origin`,
- `Sec-Fetch-Site` or `Sec-Fetch-Mode`. No CORS. `Content-Type:
- application/json`, body ≤ 64 KiB (existing `BodyLimit`), read with a hard
- limit before parsing.
-2. **Prefilter bearer** (`Authorization: Bearer`, 32 random bytes, compared by
- SHA-256 in constant time). This is a cheap DoS filter so unauthenticated
- bodies never reach the verifier. **It is not authority** and is documented
- as such.
-3. **Alta's signature** — the existing `Verifier.Verify` wrapper, unchanged:
- pinned P-256 key, context `oficina/home/operator-input/v1`, ≤ 300 s
- validity, exact role/origin/installation/registry/device, per-role
- sequence = previous + 1 against the role's stored head.
-4. **An open approval window covering this operation** (new; replaces "fresh
- console approval"). See below.
-
-**The approval window.** `POST /operator/v1/approve` takes
-`{plan, assertion}`:
-
-- `plan` is a closed JSON object signed by Alta's same key under a new
- context `oficina/home/operator-plan/v1`: `plan_id` (32 random bytes),
- `role`, `kind` (`create-team` | `add-apps` | `retire-apps` |
- `initialize`), `label`, `apps` (subset of the compiled registry), `owner`
- (**credential plan only** — the address, transported privately; never
- stored, see below), `nonce`, `issued_at`, `expires_at` (≤ 900 s). Alta
- signs one plan per role with the same `nonce`; the directory's plan has no
- `owner` field, so the address never reaches the directory.
-- `assertion` is a normal Home browser assertion (wire v1) that Paul's
- browser carried to Alta after a **step-up** (`max_age=300`,
- `fresh-assertion.md`). Home verifies it with its own pinned keys:
- `iss` = credential origin, `aud` = the configured `approver_origin`,
- `sub` = the configured `operator_subject`, `auth_time` within 300 s and not
- in the future, `nonce` = `plan.nonce`, `jti` unused in **this role's own**
- `operator_approval_jti` table (self-pruning, like every verifier's).
-- On success the role stores one `operator_approvals` row: `plan_id`, `kind`,
- `label`, `apps`, `expires_at`, and on the credential role
- `owner_index` = the **blind index** of the address (the value `people`
- already stores; no new column class). The address itself is dropped after
- hashing. One open window per role at a time; a second refuses.
+ `device`, `public_key`, `key_id`, `actions` (≤ 8), `operator_subject`
+ (Paul's person ref), `prefilter_token_sha256`; **credential role also**
+ `directory_provisioning_public_key` (the directory's
+ `oficina/roster/provisioning/v1` key, which the credential role pins for
+ the first time — §5). Absent → no route mounted (404 like any unknown
+ path). Malformed → boot refuses.
+- **Separate keys.** Alta's key differs from the assertion, owner-seed,
+ directory-provisioning, roster and resolve keys (`NewDirectory` /
+ `NewCredential` already refuse equality; the HTTP loader extends it).
+- **`allowedAction`** (`protocol.go:130-141`) is a closed switch and grows:
+ `credential.register-consumer`, `credential.retire-consumer`,
+ `credential.inspect`, `directory.disable-consumer`.
+
+## 4. Authentication: Alta's key and Paul's confirmation on Home
+
+An operation is accepted only if **all** hold, in order, before any write:
+
+1. **Not a browser.** Refuse `Cookie`, `Origin`, `Sec-Fetch-*`. No CORS.
+ `application/json`, ≤ 64 KiB, read with a hard limit before parsing.
+2. **Prefilter bearer** (32 bytes, SHA-256 constant-time compare) — a DoS
+ filter, **not authority**.
+3. **Alta's signature** — `Verifier.Verify`, unchanged: pinned P-256 key,
+ context `oficina/home/operator-input/v1`, ≤ 300 s, exact
+ role/origin/installation/registry/device, sequence = previous + 1.
+4. **An open window on this role admitting the verb and its input** (below).
+
+**The ceremony (round 1, blocker 1 — option (b)).**
+
+1. **Alta submits a plan to each role**, `POST /operator/v1/plan` (same
+ transport checks 1–2), signed by Alta's key under context
+ `oficina/home/operator-plan/v1`: `plan_id` (32 random bytes), `role`,
+ `kind` (`initialize` | `create-team` | `add-apps` | `retire-apps`),
+ `apps` (registry slugs), `issued_at`, `expires_at` (≤ 900 s); the
+ **directory** plan adds `label`; the **credential** plan adds `owner`
+ (the address, private, never stored). Home stores it **unopened**:
+ directory keeps `label`, `apps`, `kind`; credential keeps `kind`, `apps`
+ and `owner_index` = the blind index (`findOrMintPersonOn`'s normalisation
+ and index, `links.go:156`; existing-only lookup), dropping the address.
+ One pending and one open plan per role; a third refuses.
+2. **Paul's browser confirms on the directory first**:
+ `https://oficina.works/operator/confirm?plan=<id>`. It sits behind the
+ directory's **fresh consumer** (the second `handoff.Consumer` with
+ `RequireFreshAuth: true`, `team-members.md` §2): a session whose
+ `auth_time` is older than 300 s or in the future is sent through the
+ fresh exchange first. Subject ≠ `operator_subject` → 404. The page renders
+ **Home's copy**: kind, label, each app as `<label>.<app>.oficina.works`,
+ expiry. [Open window] POST (CSRF, freshness re-checked) opens the
+ directory window for 15 minutes. The page then links on.
+3. **Then on the credential origin**:
+ `https://id.oficina.works/operator/confirm?plan=<id>`, behind the
+ credential session's own freshness — `sessions.Fresh(300)` plus the
+ `fresh-assertion.md` rules (no future `auth_time`; a Keymail session with
+ no reported gesture never counts); stale sends Paul through sign-in with
+ `/operator/confirm` added to `credentialReturn`'s closed list. Subject ≠
+ `operator_subject` → 404. **The page renders no account-authored
+ string** (gate 5): kind, app registry names (compiled constants), expiry,
+ the first 8 hex of `owner_index`, and a field "Type the owner's email to
+ confirm". The POST opens the window only if the typed address
+ blind-indexes to `owner_index` — so a compromised Alta cannot swap the
+ owner under Paul's nose.
+
+**Nonce and `BindStart`.** The raw-assertion forwarding of round 0 is
+removed: Home never receives an assertion from Alta, so nothing binds a plan
+to an assertion nonce. (Recorded because round 1 found it unbuildable:
+`handoff.Store.Finish` hands `Complete` parsed claims and deletes the token,
+`handoff/http.go:206-230`; `RequireFreshAuth` is per consumer, not per
+request, `http.go:139-141`.) Alta's own Home sign-in is an ordinary
+consumer.
+
+**Window semantics.** A window admits **any number** of operations whose
+verb is allowed for its `kind` (§5) and whose input is inside it, until it
+expires; it never widens or extends. Directory: label matches, app ∈ `apps`.
+Credential: `owner-seed`'s address blind-indexes to `owner_index`;
+`register-consumer`'s record app ∈ `apps`. **An expired owner receipt needs a
+new `owner-seed` operation** under a live window — replay returns the same
+expired receipt by design (`credential.go:66`, `home-operator-seed.md`
+"never renews authority"). No `Oficina-Plan` header: one open window per role
+makes it redundant.
**The owner must already exist** (Paul, 2026-10-27): over this endpoint
-`credential.owner-seed` accepts only `existing_only: true`, so a typo or a
-never-signed-in address refuses and mints no person stub. The native
-command's other mode is not reachable here.
-
-Each `/operator/v1` request then names `plan_id` in a header
-(`Oficina-Plan`), and the role checks — inside the engine's transaction — that
-the window is open and the verb's decoded input is inside it: the label
-matches; the app is in `apps`; for `credential.owner-seed`, the input
-address's blind index equals `owner_index`. A window never widens and is never
-extended; expiry or `kind` mismatch refuses.
-
-**Why this shape.** Alta's key alone does nothing without Paul freshly
-signing in; Paul's assertion alone does nothing without Alta's key and is
-bound to one plan. It is "operator key + fresh console approval" with Home's
-own step-up as the console. **Said plainly rather than counted as a fix:** a
-compromised Alta *plus* Paul signing in to it opens a window for the
-attacker's plan. §8 bounds that window.
-
-## 5. Verbs: reused, new, and refused
-
-Existing verbs are **reused unchanged** — engine, idempotency by
-`operation_id`, sealed results, per-role stream, receipts, 10,000-operation
-cap, exactly as in `engine.go`. Each verb and the window kinds admitting it:
-
-| Role | Verb | Window kinds |
-|---|---|---|
-| credential | `credential.owner-seed` | create-team |
-| directory | `directory.inspect` (signed challenge, read-only) | any |
-| directory | `directory.seed-team` | create-team |
-| directory | `directory.provision-consumer` | create-team, add-apps |
-| directory | `directory.verify-consumer` | create-team, add-apps |
-| directory | `directory.activate-consumer` | create-team, add-apps |
-| directory | `directory.initialize` | initialize (once per installation) |
-| credential | `credential.register-consumer` **(new)** | create-team, add-apps |
-| credential | `credential.retire-consumer` **(new)** | retire-apps |
-| directory | `directory.disable-consumer` **(new)** | retire-apps |
-| both | `<role>.inspect` stream read **(new / extended)** | any |
-
-`directory.initialize` keeps its own precondition (no generation, no
-consumer, no tokens, no bootstrap receipt) and its `baseline_attestation`,
-which becomes Paul's explicit typed attestation in Alta, signed in the plan.
-It is reachable only under an `initialize` window, as the directory stream's
-first operation.
-
-**One stream per role.** The engine stores a single operator identity per
-role (`<role>_operator_state`: installation, registry, device, key) and
-refuses any other once one has acted. Whichever signer acts first — Alta
-here, or the native Linux command — owns that role's stream. Production has
-neither today. Re-enrolment is out of scope, so choosing Alta is choosing it
-for restore-time operations too, until a reviewed re-enrolment exists.
-
-**New verbs** (each with its own review and tests):
-
-- `credential.register-consumer {consumer_id, origin}` — inserts into the
- credential `consumers` table (§7); origin must be
- `https://<window label>.<window app>.oficina.works`; ID or origin
- collision refuses; returns the registry digest
- (`oficina/home/consumer-manifest/v1`) for activation evidence.
+`owner-seed` accepts only `existing_only: true`; an unknown address refuses
+and mints no stub.
+
+**Why this shape.** Alta's key alone cannot act without Paul confirming on
+Home; Paul's confirmation is of **Home's copy** of the plan, so a compromised
+Alta cannot show him one plan and execute another. What remains: Paul
+approves the plan Alta submitted — a compromised Alta can submit a plausible
+one and hope he confirms it. §8 bounds that.
+
+**Not an operator view.** The confirm pages show the operator's own plan,
+not anyone's data; they render only to `operator_subject`. They do grow Home
+by two pages; that is the cost of not trusting Alta's rendering.
+
+## 5. Verbs, windows and fences
+
+| Role | Verb | Kinds | Status |
+|---|---|---|---|
+| credential | `credential.owner-seed` (existing-only) | create-team | wrapped |
+| credential | `credential.register-consumer` | create-team, add-apps | **new** |
+| credential | `credential.retire-consumer` | retire-apps | **new** |
+| credential | `credential.inspect` | any (no window) | **new** |
+| directory | `directory.initialize` | initialize | wrapped |
+| directory | `directory.inspect` (+ stream) | any (no window) | **extended** |
+| directory | `directory.seed-team` | create-team | wrapped |
+| directory | `directory.provision-consumer` | create-team, add-apps | wrapped |
+| directory | `directory.verify-consumer` | create-team, add-apps | wrapped |
+| directory | `directory.activate-consumer` | create-team, add-apps | wrapped |
+| directory | `directory.disable-consumer` | retire-apps | **new** |
+
+- **`credential.register-consumer` is derivative of a fenced directory
+ write (round 1, blocker 2).** Its input is the directory's **signed
+ provisioning record** from `directory.provision-consumer`
+ (`directory.go:307-314`, context `oficina/roster/provisioning/v1`). The
+ credential role verifies it with the pinned
+ `directory_provisioning_public_key`, checks `issuer` = itself and
+ `directory` = the configured directory, requires the record's app ∈ the
+ window's `apps`, and registers **exactly** the record's consumer ID and
+ audience. The audience was produced by the directory's `ValidateRoute`
+ against the team's own stored label, under the provenance fence. Collision
+ is checked against **`HOME_CONSUMERS` ∪ table**, on ID and origin. Returns
+ the registry digest (§7). So Alta's order is provision first, register
+ second.
+- **What the credential role sees.** It never sees labels in its plans any
+ more; it sees hostnames only inside verified directory records. What it
+ cannot know is whether a label is taken — that is the directory's fence,
+ and the record is the only path in.
- `credential.retire-consumer` — marks a table consumer `retired`;
- `/authorize` and sign-out refuse it. Env-manifest entries are out of reach.
+ `/authorize` and sign-out refuse it. `origin` stays UNIQUE, so **a retired
+ app hostname is dead at Home for good** — the same rule as labels never
+ being reused (Paul, 2026-10-27). Re-adding a retired app to a team is not
+ supported. Env-manifest entries are out of reach.
- `directory.disable-consumer` — `team_instances.state = disabled`,
`roster_consumers.enabled = 0`, receipt with the existing `disable` value.
-- `<role>.inspect` — the signed read-only challenge, plus the role's stream
- `(sequence, head)`, so an Alta that lost its database can resume.
-
-The credential role cannot see labels, so a window naming a taken label
-could register a credential consumer for a sibling host of an existing team.
-It receives only assertions addressed to itself, and the directory fence
-below keeps it out of the chooser and roster. Alta seeds the team (which
-fails on a taken label) before registering any consumer.
-
-**Provenance fence (new, load-bearing).** Every directory verb except
-`inspect` and `initialize` may touch only a team whose `seed-team` committed
-through this HTTP stream, recorded in a new `operator_http_teams(team_id,
-operation_id)` table in the same transaction as the seed. **Paul's existing
-teams, and any team that existed before this migration, are unreachable
-from this endpoint.** That is the code form of Paul's 2026-10-27 ruling that new
-people never touch his existing apps.
-
-**Refused here, permanently or until their own design:** any membership
-write other than the seed's first owner (that is the Team page behind
-step-up — spec §10, `team-members.md`); rename; relabel; restore or generation change;
-token rotation; ownership transfer; team deletion; any read of memberships,
-names or people; any verb on a team outside the provenance fence.
+- `<role>.inspect` — **new code** on the credential role (it has no
+ `Inspect` today) and an extension on the directory (today it returns no
+ stream and refuses when stored pins differ, `inspect.go:105-110`): returns
+ generation (directory), next team id/sqid (directory), the role's
+ `(sequence, head)`, and its pending/open plan id and expiry (no plan
+ contents). It does **not** report label freedom; `seed-team`
+ refusing a taken label is the check.
+- **Provenance fence (directory).** Every directory verb except `inspect`
+ and `initialize` may touch only a team whose `seed-team` committed through
+ this HTTP stream (`operator_http_teams(team_id, operation_id)`, written in
+ the seed's transaction). Production has **no teams today** (§12), so the
+ fence protects an empty set now and every future team not created here.
+- **`directory.initialize`** keeps its precondition (no generation, no
+ consumer, no tokens, no bootstrap receipt — `directory.go:160-168`) and its
+ `baseline_attestation`, which is Paul's typed confirmation in Alta (§12),
+ signed in the plan. It must be the directory stream's **first operation**:
+ the engine requires `initial_authority = true` at sequence 1
+ (`engine.go:160-163`), and every other directory verb refuses `Initial`.
+- **One stream per role.** The engine stores one operator identity per role
+ and refuses any other once one has acted. Alta will own both streams.
+ **Restore therefore needs Alta's key material** (or a separately reviewed
+ re-enrolment) until such a design exists — the native Linux command can act
+ only with Alta's pins and key.
+
+**Refused, permanently or until their own design:** any membership write but
+the seed's first owner (Team page — spec §10, `team-members.md`); rename;
+relabel; label release; retired-consumer reactivation; restore or generation
+change; token rotation; ownership transfer; team deletion; any read of
+memberships, names or people.
## 6. What the endpoint may not do
-- **Return anything readable:** only the engine's existing result JSON
- (ids, outcome, epoch, signed record, bearer, owner receipt) — no address,
- name or member list. Replay returns the same sealed result.
-- **Log content:** a fixed verb label, outcome code and operation-id prefix
- only (gate 9).
-- **Restore, rotate keys or re-initialize:** restore stays gated on 117.
-- **Act for a browser:** no cookie read, no session minted; the approval
- assertion is consumed, never exchanged for a session.
+Return anything readable beyond the engine's result JSON (ids, outcome,
+epoch, signed record, bearer, owner receipt); log anything but a fixed verb
+label, outcome code and operation-id prefix (gate 9); restore, rotate keys
+or re-initialize; act for a browser (no cookie read, no session minted on
+`/operator/v1`).
## 7. Consumers beyond the 16-entry limit
-The 16-entry/8 KiB cap exists because the credential origin's CSP names every
-manifest origin in `form-action` (`security.go`, `runtime.go:102`). Two
-changes remove the cap without widening the CSP:
-
-1. **Per-response `form-action`.** The handoff page (the only credential page
- that posts cross-origin) sets `form-action 'self' <directory>
- <that consumer's origin>` for that one response. Every other credential
- page keeps `form-action 'self' <directory>`. Sign-out's allowlist reads the
- same registry. No wildcard, ever.
-2. **A credential-role `consumers` table** — `consumer_id` (PK, existing
- `consumerName` rule), `origin` (UNIQUE, exact canonical HTTPS),
- `state` (`active` | `retired`), `created_at` (day-coarsened),
- `operation_id`. Written only by §5's two credential verbs. Loaded at boot
- and reloaded in-process after each committed write; the effective registry
- is `HOME_CONSUMERS` ∪ table, and an ID or origin present in both refuses
- boot. Hard cap 4,096 rows, written in the migration as a CHECK-backed
- trigger with its reason (a typo-loop in Alta, not a scale target).
-
-`HOME_CONSUMERS` keeps the directory and Paul's existing consumers, unchanged.
-The directory needs nothing new here: `team_instances` and `roster_consumers`
-are already rows with no count cap. **All new tables, both roles, are
-additive:** credential `consumers`, `operator_approvals`,
-`operator_approval_jti`; directory `operator_approvals`,
-`operator_approval_jti`, `operator_http_teams`.
+The cap exists because the credential origin's CSP names every manifest
+origin in `form-action` (`security.go`, `runtime.go:102`).
+
+1. **Per-response `form-action`.** The handoff page **and the
+ `signoutConfirm` page** (a same-origin POST that redirects to a preview
+ consumer) set `form-action 'self' <directory> <that one consumer's
+ origin>`. Every other credential page keeps `'self' <directory>`.
+2. **A credential `consumers` table** — `consumer_id` (PK), `origin`
+ (UNIQUE), `state` (`active` | `retired`), `created_at` (day),
+ `operation_id`; written only by §5's two credential verbs; cap 4,096
+ (a trigger with its reason: a runaway Alta, not a scale target).
+3. **Readers see the union through one atomic pointer.** The effective
+ registry is an immutable map (`HOME_CONSUMERS` ∪ active table rows) held
+ in an `atomic.Pointer`, swapped after each committed write. Every reader
+ uses it: `exchange.go:41,78`, `security.go:13`, `signout.go:173`,
+ `dashboard_config.go:72`.
+4. **Collision refuses boot** (an ID or origin in both). That takes the
+ credential origin — and suite sign-in — down, which is correct and goes
+ in the runbook: remove the env entry, redeploy.
+
+Production `HOME_CONSUMERS` holds 7 entries today (§12); **Alta becomes the
+8th env entry** before the table lands. The directory needs nothing new
+here: `team_instances` and `roster_consumers` are rows already.
+
+**New tables (additive):** credential `consumers`, `operator_plans`
+(pending/open, kind, apps, owner_index, expiry); directory `operator_plans`
+(kind, label, apps, expiry), `operator_http_teams`; both keep
+`<role>_operator_state` / `_results` unchanged.
## 8. Threat model: a compromised provisioner
-Assume an attacker holds Alta's operator key, its prefilter token and its
-CARLOS service credentials.
-
-- **Without Paul's fresh sign-in:** nothing at Home. No window opens. On
- the CARLOS side, today's `operate`/`instance` pair would let an attacker
- rewrite the default bundle Paul's own instances run on and delete them —
- **which is why ruling 8's re-ruling is conditional**: in production Alta
- holds only team-scoped credentials, which reach Alta's own environments
- and instances and nothing of Paul's. Home cannot bound that risk; CARLOS
- does.
-- **With one window (Paul signs in to a compromised Alta):** for 15
- minutes, one label, the plan's apps: one new team owned by an existing
- person of the attacker's choosing, consumers at
- `<that label>.<app>.oficina.works`, activated. Costs: a label squatted for
- good (labels are never released) and audiences valid only at themselves;
- no person stubs, since owner-seed is existing-only here. **Cannot:** touch any existing
- team, instance or consumer (provenance fence); add a member anywhere; read
- any membership, name, address or content; mint a session; retire
- `HOME_CONSUMERS` entries; rename.
-- **Phishing, recorded:** a new team's consumer can be an attacker-run
- instance; it receives an unreversible `sub` and nothing else Home holds —
- the exposure every instance already has. **Replay:** single-sequence
- requests, single-use approval `jti`, nonce-bound plans.
-- **Compromised Home origins** are unchanged from §13a: the credential
- origin can sign in as anyone (including as Paul to approve a window — no
- worse than its existing power); the directory can already add members.
-
-## 9. The one rule and gates 1, 2, 9
+An attacker holds Alta's operator key, prefilter token and CARLOS
+credentials.
+
+- **Without Paul confirming on Home:** nothing at Home. On CARLOS, the
+ team-scoped credential reaches only Alta's own environments and instances
+ (ruling 8's condition); Home cannot bound that, CARLOS does.
+- **If Paul confirms a plausible attacker plan:** for 15 minutes, the label
+ and apps **Paul saw on Home**, and the owner whose address **Paul typed**:
+ a new team, consumers at `<that label>.<app>.oficina.works`, activated.
+ Costs: a label and hostnames squatted for good (never reused). **Cannot:**
+ create a consumer for any existing team's hostnames (the credential role
+ registers only from a directory record, and the directory fence admits
+ only teams this stream seeded); add a member anywhere; read any
+ membership, name, address or content; mint a session; touch
+ `HOME_CONSUMERS`; rename.
+- **Victim class, named:** the owner Paul typed — possibly Paul himself —
+ sees an attacker-run team in their chooser for those apps and may sign in
+ to it, handing that instance their `sub` and whatever they then type
+ there. Phishing, recorded, bounded by Paul having confirmed that label.
+- **Replay:** single-sequence requests; plans single-use and expiring.
+- **Compromised Home origins** are as in §13a of the spec; the directory
+ role now holds the provisioning signer in its serving process (before,
+ only in the operator command) — a directory compromise could sign
+ provisioning records, but registration still needs Alta's key and a
+ credential window Paul opened.
+
+## 9. The one rule and gates
- **No readable address at rest.** The address reaches the credential role
- twice (approve, owner-seed), is blind-indexed with the sign-in helper and
- dropped. Approval rows hold the blind index; result rows hold
- `HMAC(idempotency key, input)` and a sealed, address-free result. The
- directory sees only person refs. The falsifiable form gains nothing:
- consumers are hostnames, approvals are labels and blind indexes.
-- **Gate 1** drives the whole HTTP sequence with canary addresses and names
- and scans both databases, WAL and SHM. **Gate 2** gains owner-seed-over-
- HTTP and approve as two more address paths — *extended, not replaced*.
- **Gate 9** captures every log line and error across the same drive,
- hostile refusals included. **Gate 10** covers both routes' responses.
+ three times (plan, confirm, owner-seed), is blind-indexed and dropped.
+ Plans hold the blind index; result rows hold `HMAC(idempotency key,
+ input)` and a sealed, address-free result. The directory sees person refs
+ only.
+- **Spec §3.2's plaintext list gains:** consumer origins in the credential
+ DB (hostnames, which contain labels — never secret, and `HOME_CONSUMERS`
+ already held them); plan labels and app slugs in the directory DB; plan
+ kinds, apps and blind indexes in the credential DB; `memberships.added_at`
+ (day) from `team-members.md`.
+- **Gate 1** drives the whole sequence (plan, both confirms, every verb)
+ with canary addresses and names; scans both databases, WAL and SHM.
+ **Gate 2** gains plan-submit, confirm and owner-seed-over-HTTP as address
+ paths — *extended, not replaced*. **Gate 5** scans the credential confirm
+ page with canary labels present. **Gate 9** captures every log line,
+ hostile refusals included. **Gate 10** covers every new route.
## 10. Tests required before merge
-1. **Mounting:** route absent without `HOME_OPERATOR_HTTP`; each role
- refuses the other's verbs; Host-header spoofing refused.
-2. **Transport:** browser markers refuse; > 64 KiB refuses before parse;
- wrong content type refuses; bad prefilter → identical fixed 401.
-3. **Signature:** wrong key or context, expired, sequence gap, changed input
+1. **Mounting:** no routes without `HOME_OPERATOR_HTTP`; role separation;
+ Host spoofing refused.
+2. **Transport:** browser markers, size, content type, prefilter (fixed 401).
+3. **Signature:** wrong key/context, expired, sequence gap, changed input
under a used sequence; exact replay after expiry returns the stored
result and mutates nothing.
-4. **Approval:** wrong `aud` or `sub`, `auth_time` 301 s old or in the
- future, nonce mismatch, reused `jti`, expired plan, a second window while
- one is open, a plan signed by another key.
-5. **Scope:** other label, app outside `apps`, owner whose blind index
- differs, verb outside `kind`, window expiring mid-run; provenance fence
- refuses every directory verb on a pre-existing team with the unknown-team
- code.
-6. **Registry:** 17th and 4,097th consumer; env/table collision refuses
+4. **Ceremony:** plan signed by another key; third plan refused; confirm by
+ a non-operator subject → 404; directory confirm with stale or future
+ `auth_time`; credential confirm with a stale session, a Keymail session
+ with no gesture, a mistyped owner address; confirm after plan expiry.
+5. **Scope:** other label, app outside `apps`, verb outside `kind`, window
+ expiring mid-run, expired owner receipt then a fresh `owner-seed`.
+6. **Blocker 2:** `register-consumer` without a record, with a record signed
+ by another key, for an app outside the window, for an origin in
+ `HOME_CONSUMERS`; a record for a pre-existing team is unobtainable
+ (fence).
+7. **Registry:** 17th and 4,097th consumer; env/table collision refuses
boot; retired consumer refused at `/authorize` and sign-out; the handoff
- page's CSP names exactly one consumer origin.
-7. **Mutation:** removing the approval check, the provenance check or the
- blind-index comparison each fails a named test.
-8. **Privacy and survival:** gates 1, 2, 9, 10 per §9; existing sessions,
- assertion keys and team ciphertexts survive the additive migrations
- (reopen with the old binary).
-9. **Canary:** on deployed previews, Alta creates `alpha` and `beta` with
- synthetic owners; each owner sees only their team; Paul's existing
- consumers keep working throughout.
+ and `signoutConfirm` CSPs name exactly one consumer; concurrent reads
+ during a swap (race detector).
+8. **Mutation:** removing the window check, the fence, the record
+ verification or the typed-owner comparison each fails a named test.
+9. **Privacy and survival:** gates per §9; existing sessions, keys and team
+ ciphertexts survive the additive migrations (reopen with the old binary).
+10. **Canary** on deployed previews: Alta creates `alpha` and `beta`; each
+ owner sees only their team; the seven existing consumers keep working.
## 11. Alternatives rejected
-- **`carlos run` against Home's database** (a `run`-role credential with a
- fixed command list). It exists today, but it runs beside the serving
- process with no fence and no launch context, `operatorlaunch` would refuse
- it, and it is a database edit from outside the app in all but name.
-- **Alta writing Home's database directly**, or holding any Home key that
- signs assertions, receipts or roster pages. That makes Alta a third Home
- origin.
-- **Signature only, no approval window** — rejected by Paul, 2026-10-27:
- it turns Alta's stored key into a standing ability to mint teams and
- owners.
-- **Waiting for platform 117.** Still blocked at platform `57aec0a`
- (`maintenance-exec.md`: final design approval pending; no command, no
- route). The native Linux command stays for restore, which this does not
- cover.
-
-## 12. Ruled, and the one pre-flight question
-
-**Ruled by Paul, 2026-10-27:** two-key approval on every run (§4); owner
-must already exist (§4); **team labels are never reused** — no label
-release verb will be built, and a retired team keeps its label for good
-(ruling 19 already reserves it; this makes the reservation permanent);
-ruling 8 re-ruled for Alta, conditional (§2).
-
-**Still open — a pre-flight question for Paul before the first production
-run:** has production's directory ever been initialized with a roster
-generation? Alta's first act is a signed `directory.inspect`. If it reports
-no generation, the first run is an `initialize` plan carrying Paul's typed
-attestation that this directory database has **never** issued a roster
-generation or consumer record (the attestation `home-provisioner.md`
-requires; Home cannot prove historical absence after a possible restore).
-If Paul cannot attest that, initialization stays unavailable and the
-restore procedure — still gated on platform 117 — is the only path.
+- **Forwarding Paul's assertion from Alta to Home** (round 0) — unbuildable
+ with the shared consumer, and Paul would approve Alta's rendering, not
+ Home's copy.
+- **`carlos run` against Home's database** — no fence, no launch context; a
+ database edit from outside in all but name.
+- **Alta writing Home's database or holding a Home signing key** — a third
+ Home origin.
+- **Signature only** — rejected by Paul: Alta's key would be a standing
+ ability to mint teams.
+- **Waiting for platform 117** — still blocked at platform `57aec0a`.
+
+## 12. Pre-flight facts and the confirmation Paul gives
+
+**Evidence, 2026-10-27, 21:06 UTC** — read-only `carlos db query --app
+oficina` on a restored replica copy, transaction 3140: production directory
+has `teams` = 0, `memberships` = 0, `team_instances` = 0,
+`roster_generation` = 0, `roster_consumers` = 0, `roster_tokens` = 0,
+`directory_operator_state` = 0, `directory_operator_results` = 0. So
+`directory.initialize`'s four-empty-tables precondition holds, and **Alta's
+first production run is an `initialize` plan**.
+
+**Required pre-flight confirmation:** Paul confirms, against that evidence,
+that this directory database has **never** issued a roster generation or
+consumer record (Home cannot prove historical absence after a possible
+restore; `home-provisioner.md`). Alta signs that confirmation as
+`baseline_attestation`.
+
+**If a generation were ever present,** `initialize` refuses and no other
+directory verb can open the stream (blocker 3). That needs a separately
+reviewed `directory.enrol` first operation; it is **not designed here**.
+
+**Production `HOME_CONSUMERS`** (credential role, `oficina-id`, as
+`HOME_CONSUMERS_BASE64`) holds **7** entries: calendar, calls, directory,
+docs, memoria, sheets, slides. Alta is added as the 8th env consumer before
+§7's table lands; the 16 cap applies until then.
+
+## 13. Round-1 findings: disposition
+
+Blocker 1 → §4 (option b). Blocker 2 → §3, §5, §8. Blocker 3 → §5, §12.
+Blocker 4 → `team-members.md` §2. Blocker 5 → `team-members.md` §3, §5; §9.
+Non-blocking: supersessions §2 items 3, 5, 6; "verbs wrapped" §1, §5;
+`allowedAction` §3; header dropped §4; window semantics and receipt renewal
+§4; inspect is new code and reports no label freedom §5; retired hostnames
+dead for good §5; atomic swap, union readers, `signoutConfirm`, runbook §7;
+victim class §8; §3.2 list §9; stream ownership and restore §5;
+`HOME_CONSUMERS` count §12. Alta and Team-page notes are applied in those
+files. None declined.
diff --git a/implementation/team-provisioning-app.md b/implementation/team-provisioning-app.md
index 1c1d637..41d02f1 100644
--- a/implementation/team-provisioning-app.md
+++ b/implementation/team-provisioning-app.md
@@ -1,128 +1,129 @@
# 🤖 Alta: the team provisioning app
-**Status:** PROPOSED, 2026-10-27. Drafted by Claude Opus 5.5 for Paul. Not
-reviewed; **no code until a top-model review approves it and
-`team-provisioning-amendment.md`** (Home side). Facts below were read at
-origin/main: Home `e2ec1ab`, carlos platform `57aec0a`, Docs `d867db1`,
-Sheets `af8deeb`, Slides `ebbb08f`, Calendar `00d8e3d`, Meet/Calls `47afcb9`,
-Memoria `521ae24`. It replaces `oficina/teams/provision-team.py` (Track 1,
-written today) and keeps that script's central rule: **deny by default — a
-team instance inherits nothing from the app's default bundle unless the key
-is on that app's SHARED list.**
+**Status:** PROPOSED, 2026-10-27. Drafted by Claude Opus 5.5 for Paul.
+**Round 1: reviewed by Claude Fable 5.1 (claude-fable-5-1), 2026-10-27,
+discussion 92 — CHANGES REQUIRED.** Round-1 fixes are applied (§14);
+round 2 pending. **No code until a top-model review approves this file and
+`team-provisioning-amendment.md`.** Facts read at origin/main: Home
+`e2ec1ab`, carlos platform `57aec0a`, Docs `d867db1`, Sheets `af8deeb`,
+Slides `ebbb08f`, Calendar `00d8e3d`, Calls (repo `oficina/meet`,
+`cmd/calls`) `47afcb9`, Memoria `521ae24`. It replaces
+`oficina/teams/provision-team.py` (Track 1, 2026-10-27).
**Paul's rulings, 2026-10-27, applied here:** ruling 8 re-ruled for Alta on
-condition of team-scoped CARLOS credentials, and **Alta does not ship to
-production until they exist** (§3); every run needs Paul's fresh Home
-sign-in; the owner must have signed in once before the team is created;
-team labels are never reused; Slides ships without uploads; team instances
-share the mail relay; team dashboards stay blank; Memoria is in the
-`oficina` account.
+condition of CARLOS team-scoped credentials, and **Alta does not ship to
+production until they exist** (§3); every run needs Paul's fresh sign-in,
+now given on Home's own confirm pages; the owner must have signed in once;
+labels — and retired app hostnames — are never reused; Slides ships without
+uploads; team instances share the mail relay; team dashboards stay blank;
+Memoria is in the `oficina` account.
---
## 1. What it is
A Paul-only web app that creates a **team**: one CARLOS instance per app,
-each with its own config environment and fresh keys, attached at
-`<team>.<app>.oficina.works`, registered with Home as a consumer, and a Home
+each bound to its own **standalone** config environment with fresh keys,
+attached at `<team>.<app>.oficina.works`, registered with Home, plus a Home
team with its first owner. First run: label `lagged`, owner
`till@lagged.biz`, apps docs, sheets, slides, calendar, calls, memoria.
- **Name:** **Alta** (*dar de alta*, to enrol). Repo
`/Users/paulcampbell/amadan.net/oficina/alta`, module
`amadan.net/oficina/alta`, CARLOS app `alta`.
-- **Host:** `https://alta.oficina.works` (proposed; alternative: only its
- `alta.bds.oncarlos.com` route, unlisted). Never in Home's app registry,
- never a team instance, never in the chooser.
-- **Stack:** rastrillo (`amadan.net/rastrillo/rastrillo`, never the old
- github path), estilo chrome and door, Calma rules, attribute spelling,
- scriptless except estilo's `busy.js`. One binary, `CGO_ENABLED=0`,
- hibernates (it is used a few times a month).
-- **Not Home.** It holds the CARLOS credentials Home must never hold (spec
- §7's load-bearing fact). Home holds only Alta's public key.
+- **Host:** `https://alta.oficina.works` proposed (not ruled; alternative:
+ its `alta.bds.oncarlos.com` route only). Never in Home's app registry or
+ chooser.
+- **Stack:** rastrillo (`amadan.net/rastrillo/rastrillo`), estilo chrome and
+ door, Calma rules, attribute spelling, scriptless except estilo's
+ `busy.js`. One binary, `CGO_ENABLED=0`, hibernates.
+- **Not Home.** It holds CARLOS credentials Home must never hold (spec §7).
+ Home holds only Alta's public key.
## 2. Who can use it
-- **Sign-in:** Home sign-in only (it is a consumer, `ALTA_HOME_*` via
- `home/connect`). No local magic link, no allowlist of addresses.
-- **Who:** exactly one person ref, `ALTA_OPERATOR_SUBJECT` (Paul's). Any
- other valid Home identity gets the same 404 as an unknown page.
-- **Every run needs a step-up** (`max_age=300`): Paul's fresh assertion is
- what opens Home's approval window (amendment §4). Reading status pages
- needs only a session (idle 30 min, absolute 12 h).
+- **Sign-in:** Home sign-in only (an ordinary consumer, `ALTA_HOME_*` via
+ `home/connect`). No local magic link, no address allowlist.
+- **Who:** exactly one person ref, `ALTA_OPERATOR_SUBJECT` (Paul's); any
+ other identity gets the same 404 as an unknown page.
+- **Every run is confirmed on Home.** Alta submits signed plans; Paul then
+ opens each Home role's window on Home's own confirm pages, behind Home's
+ fresh sign-in, reading Home's copy of the plan and retyping the owner's
+ address on the credential origin (amendment §4). Alta never handles an
+ assertion beyond its own sign-in. Status pages need only an Alta session
+ (idle 30 min, absolute 12 h).
## 3. Credentials it holds, and their reach
-**Ruling 8 re-ruled for Alta — Paul, 2026-10-27.** Spec ruling 8 rejected
-"a standing console token in a web-facing app". Paul re-ruled it for Alta:
-a web-facing app **may** hold CARLOS credentials, **on condition** that
-CARLOS gains **team-scoped credentials** — a credential that can create,
-configure, restart and delete instances, set env and secrets, and attach and
-detach domains **only** for named, non-default environments and the
-instances bound to them, never the app's default bundle or instances on it.
-**Alta must not ship to production until that credential exists.**
-Rejected: a separate CARLOS account for team instances (doubles release
-work); accepting today's app-wide `instance` + `operate` reach (one RCE in
-Alta reaches Paul's production config and instances). The CARLOS design is
-on branch `team-scoped-credentials` of `carlos/platform`,
-`implementation/team-scoped-credentials.md` (role `tenant`, scope = the
-environments the credential's scope owns).
-
-**With that credential**, Alta holds **one per app**, minted by Paul:
-
- carlos services create --account oficina --role tenant --app docs --scope alta alta-docs
- … sheets, slides, calendar, calls, memoria (6 credentials)
-
-Stored as Alta secrets `ALTA_CARLOS_<APP>`, presented as `Authorization:
-Bearer` to `https://console.carloku.com/api/cli/apps/oficina/<app>/…`.
-Memoria is in the `oficina` account like the others (its `lagged` instance
-was provisioned there on 2026-10-27; its README's `--account bds` is stale).
-The hand-made `lagged` environments are handed to Alta's scope with the
-person-only `carlos env adopt` the CARLOS design proposes.
+**Ruling 8 re-ruled for Alta — Paul, 2026-10-27.** A web-facing app other
+than Home may hold CARLOS credentials **on condition** that CARLOS gains
+team-scoped credentials acting **only** on named, non-default environments
+and the instances bound to them. **Alta does not ship to production until
+that credential exists.** Rejected: a separate CARLOS account; accepting
+today's app-wide `instance` + `operate` reach. CARLOS design:
+`carlos/platform` branch `team-scoped-credentials` — role **`team`**, scope
+= the environments the scope owns, and **owned environments are
+standalone**: they never inherit the app's default bundle.
-**Before it exists** (development and preview only, never production):
-Alta may run against a sandbox account with today's `instance` + `operate`
-pair. §8's guards are written for that period and stay afterwards as
-defence in depth.
+**In production**, one credential per app, minted by Paul:
-**Home.** `ALTA_OPERATOR_KEY` (P-256, signs operator requests and plans,
-context `oficina/home/operator-input/v1` and `…/operator-plan/v1`),
-`ALTA_OPERATOR_PREFILTER` (32 bytes), plus `ALTA_OPERATOR_INSTALLATION`,
-`_REGISTRY`, `_DEVICE` (random, generated once, pinned on Home).
+ carlos services create --account oficina --role team --app docs --scope alta alta-docs
+ … sheets, slides, calendar, calls, memoria (6 credentials)
-**Its own:** `ALTA_ORIGIN`, `ALTA_INSTANCE_KEY`, `ALTA_DEK` (seals rows).
+Stored as Alta secrets `ALTA_CARLOS_<APP>`, sent as `Authorization: Bearer`
+to `https://console.carloku.com/api/cli/apps/oficina/<app>/…`. Memoria is in
+the `oficina` account like the others (its `lagged` instance was provisioned
+there on 2026-10-27; its README's `--account bds` is stale).
+
+**Before that credential exists** — development and previews only, against
+a throwaway sandbox account. **The sandbox never holds production
+`instance`, `operate` or `team` tokens**, and no Alta deployment with
+production Home pins runs against it. §8's guards were written for this
+period and remain defence in depth; they are not the fence (the fence is
+CARLOS's scope and Home's provenance fence).
+
+**Home:** `ALTA_OPERATOR_KEY` (P-256; contexts
+`oficina/home/operator-input/v1` and `…/operator-plan/v1`),
+`ALTA_OPERATOR_PREFILTER` (32 bytes), `ALTA_OPERATOR_INSTALLATION`,
+`_REGISTRY`, `_DEVICE` (random once, pinned on Home). **Shared values** Paul
+supplies at setup because owned environments inherit nothing (§5):
+`ALTA_SHARED_SMTP_*` (relay host, port, user, password, from) and
+`ALTA_SHARED_CARLOS_RELAY` — Alta secrets, sealed again at rest when copied
+into its plan records. **Its own:** `ALTA_ORIGIN`, `ALTA_INSTANCE_KEY`,
+`ALTA_DEK`.
## 4. What it stores
SQLite, sealed where marked:
-- `teams` — label, sealed display name, team sqid (after seed), state.
-- `owner_inputs` — **sealed** owner address, deleted when the team is live.
- Alta needs it for owner-seed and for the stopgap allowlists (§5); once
- both are written it has no further use.
-- `runs` / `steps` — the state machine (§6): step key, state, attempt count,
- CARLOS request ids, Home operation ids, timestamps, a fixed error code.
+- `teams` — label, sealed display name, team sqid, state; **every label ever
+ used** stays (labels are never reused; Alta refuses a plan naming one).
+- `owner_inputs` — **sealed** owner address; used for the credential plan,
+ owner-seed and the stopgap allowlists (§5).
+- `runs` / `steps` — the state machine (§6).
- `operator_requests` — **sealed** exact signed request bytes per Home
- operation, kept so a lost result is recovered by exact replay (Home's
- engine returns the stored result and does nothing twice). This is how Alta
- avoids storing the roster bearer: it re-fetches it by replay when an app
- is ported later.
-- `operator_streams` — per Home role: last sequence and head digest. If
- Alta's DB is lost, it re-reads both through a signed `inspect` (amendment
- §5) rather than guessing.
-
-**Never stored:** generated app keys (sealed straight to the console's
-`secrets_pubkey` and sent; existence is checked by key name, never value),
-CARLOS tokens (env only), roster bearers, any team content, any log line
-with an address, label or key.
+ operation, kept so a lost result is recovered by exact replay (and so the
+ roster bearer is re-fetched by replay, never stored).
+- `operator_streams` — per Home role: sequence and head; re-read through a
+ signed `<role>.inspect` if Alta's DB is lost.
+
+**Deleted at step 13** once `seed-team` has committed and every stopgap
+allowlist is written: the `owner_inputs` row, the **credential plan** and
+the **`owner-seed` request** rows (both contain the address; neither replay
+is needed after the seed). After that Alta holds no address.
+
+**Never stored:** generated app keys (sealed to the console's
+`secrets_pubkey` and sent; existence is checked by name), CARLOS tokens (env
+only), roster bearers, team content; no log line carries an address, label,
+key or shared value.
## 5. Per-app recipes
-Each app gets environment `<team>` on that app (environments are per app).
-**Rule, enforced in code and re-checked by `audit`:** every key in the app's
-default bundle (env and secrets) must, in the team environment, be either
-**SET** to a team value, **GENERATED** fresh (32 random bytes, base64), on
-the app's **SHARED** list, or **BLANKED** (`""` as an env value). A key not
-in the recipe and not blanked is a refusal, not a warning.
+Each app gets an environment **owned by scope `alta`**, named `<team>` (for
+`lagged`, `lagged-team`, §6). Owned environments are standalone, so **the
+recipe is the instance's entire config**: nothing reaches it from the
+default bundle, and every value it needs is SET, GENERATED, or **COPIED IN**
+from Alta's sealed shared values. `audit` checks the environment holds
+exactly the recipe's keys; an extra key is a refusal.
Common to every app (`<P>` = DOCS, SHEETS, SLIDES, CALENDAR, CALLS,
MEMORIA):
@@ -132,126 +133,140 @@ MEMORIA):
| `<P>_ORIGIN` | SET `https://<team>.<app>.oficina.works` |
| `<P>_INSTANCE_KEY` | GENERATED |
| `<P>_HOME_ISSUER` | SET `https://id.oficina.works` |
-| `<P>_HOME_CONSUMER_ID` | SET `<team>-<app>` (Paul's is never inherited) |
+| `<P>_HOME_CONSUMER_ID` | SET `<team>-<app>` (the directory record's consumer) |
| `<P>_HOME_KEYS_BASE64` | SET from Alta's pinned copy of Home's public assertion keys |
| `<P>_HOME_DEK_BASE64` | GENERATED |
| `HOME_DIRECTORY_ORIGIN` | SET `https://oficina.works` |
-| `OFICINA_DASHBOARD_TEAM` | BLANKED — team dashboards stay blank for now (Paul, 2026-10-27) |
-| `CARLOS_SMTP_*` | SHARED — team instances share the suite's mail relay (Paul, 2026-10-27) |
+| `OFICINA_DASHBOARD_TEAM` | not set — team dashboards stay blank (Paul) |
+| `CARLOS_SMTP_HOST/PORT/USER/PASS/FROM` | COPIED IN from `ALTA_SHARED_SMTP_*` — the shared relay (Paul) |
-Per app (allowlist = the owner's address only, the Track 1 stopgap, until
-the app has roster mode — `team-members.md` §7):
+Per app (allowlist = the owner's address only, until the app has roster
+mode — `team-members.md` §7):
-| App | GENERATED | SET | SHARED | Notes |
+| App | GENERATED | SET | COPIED IN | Notes |
|---|---|---|---|---|
-| Docs | `DOCS_CONTENT_KEY`, `DOCS_TEAM_ROSTER_TOKEN` (from Home, not random) | `DOCS_ALLOWED_ADDRESSES=""` (team mode permits empty); `DOCS_TEAM_ID`=sqid, `DOCS_TEAM_DIRECTORY_ORIGIN`, `DOCS_TEAM_PROVISIONING_BASE64` (signed record), `DOCS_TEAM_OPERATOR_KEYS_BASE64` (directory provisioning public key) | `DOCS_SMTP_*` (Docs reads no `CARLOS_SMTP_*`), `DOCS_SAMPLE_DOCUMENTS` | Team mode writes a fingerprint marker; the instance can never go back to allowlist mode |
+| Docs | `DOCS_CONTENT_KEY`; `DOCS_TEAM_ROSTER_TOKEN` (Home's bearer) | `DOCS_ALLOWED_ADDRESSES=""`; `DOCS_TEAM_ID`, `_DIRECTORY_ORIGIN`, `_PROVISIONING_BASE64` (signed record), `_OPERATOR_KEYS_BASE64` (directory provisioning public key) | `DOCS_SMTP_*` from the shared relay (Docs reads no `CARLOS_SMTP_*`); `DOCS_SAMPLE_DOCUMENTS` only if Paul wants it | Team mode writes a fingerprint marker; no way back to allowlist mode |
| Sheets | `SHEETS_DEK` | `SHEETS_OWNERS`=owner | — | |
-| Slides | — (no DEK in Slides) | `SLIDES_ALLOWED_ADDRESSES`=owner | `SLIDES_SMTP_*` if present | **Ships without uploads** (Paul, 2026-10-27: object storage is not approved on the account). Every `CARLOS_STORE_*` key is BLANKED, so uploads answer 503 and Paul's bucket, if one is ever bound, never reaches a team. Private per-instance storage is a later run |
-| Calendar | `CALENDAR_DEK` | `CALENDAR_ALLOWED_ADDRESSES`=owner | `CALENDAR_SMTP_*` if present | `CARLOS_CONTROL_SOCKET`/`ADMIN_TOKEN` are platform-set per instance |
-| Calls | `CALLS_DEK` | `CALLS_ALLOWED_ADDRESSES`=owner | `CARLOS_RELAY` (TURN, app-level), `CALLS_ZONE`, `CALLS_QUALITY_REPORTS` | APNs vars are not read by `main.go`; BLANKED anyway |
-| Memoria | `MEMORIA_DEK` | `MEMORIA_OWNERS`=owner; `MEMORIA_TEAM`=label | — | **AI off:** `MEMORIA_AI` BLANKED, `MEMORIA_TENSORX_KEY` BLANKED (Paul's key never reaches a team), `MEMORIA_SIBLINGS` and every `MEMORIA_SIBLING_TOKEN_*` BLANKED (they point at Paul's apps), `MEMORIA_ALLOW_LOGGED_MAIL` BLANKED. Memoria boots without an origin, so `audit` checks `MEMORIA_ORIGIN` explicitly |
-
-**Two console facts the recipe depends on** (verify before code): a
-named environment can override but **not remove** an inherited key, and an
-empty **secret** is refused while an empty **env** value is allowed — so
-BLANKED is an env-kind `""` over an inherited secret, as Track 1 does today.
-And the environment must be written **before** the instance is created, or
-the first boot runs on Paul's inherited keys and allowlist.
+| Slides | — | `SLIDES_ALLOWED_ADDRESSES`=owner | — | **No uploads** (Paul: object storage not approved on the account); no `CARLOS_STORE_*`, so uploads answer 503 |
+| Calendar | `CALENDAR_DEK` | `CALENDAR_ALLOWED_ADDRESSES`=owner | — | `CARLOS_CONTROL_SOCKET`/`ADMIN_TOKEN` are platform-set |
+| Calls | `CALLS_DEK` | `CALLS_ALLOWED_ADDRESSES`=owner; `CALLS_ZONE`; `CALLS_QUALITY_REPORTS` | `CARLOS_RELAY` from `ALTA_SHARED_CARLOS_RELAY` | APNs vars are not read by `main.go`; not set |
+| Memoria | `MEMORIA_DEK` | `MEMORIA_OWNERS`=owner; `MEMORIA_TEAM`=label; `MEMORIA_ORIGIN` | — | **AI off**: `MEMORIA_AI`, `MEMORIA_TENSORX_KEY`, `MEMORIA_SIBLINGS`, `MEMORIA_SIBLING_TOKEN_*`, `MEMORIA_ALLOW_LOGGED_MAIL` simply absent — nothing to blank now. Memoria boots without an origin, so `audit` checks it |
**AI for a team** stays off until that team's owner asks and Paul agrees;
-TensorX is ZDR and "treated as local" for Paul's data (ruling 2026-09-19),
-which says nothing about another owner's.
+TensorX's ZDR ruling (2026-09-19) covers Paul's data, not another owner's.
+
+**Label regex.** Alta uses `^[a-z][a-z0-9-]{1,30}[a-z0-9]$`, deliberately
+tighter than Home's `ValidLabel` (1–63), so every derived host
+(`<label>-<app>.bds.oncarlos.com`, `<label>.<app>.oficina.works`) stays
+well inside DNS limits.
## 6. The state machine
-One **run** per (team, plan). Steps execute in order; each is
-**probe → act → verify → record**, so a crash anywhere resumes by probing.
-Nothing is inferred from a timeout; nothing is deleted to "clean up".
+One **run** per (team, plan). Each step is **probe → act → verify →
+record**; a crash resumes by probing; nothing is inferred from a timeout;
+nothing is deleted to "clean up".
-| # | Step | Probe (idempotency) | Act |
+| # | Step | Probe | Act |
|---|---|---|---|
-| 0 | Preflight | label regex `^[a-z][a-z0-9-]{1,30}[a-z0-9]$`, not reserved; signed `inspect`: generation present, label free; console: env/instance/domain absent **or** already bound to this team | — |
-| 1 | Approve | an open window for this plan? | step-up → sign plan → `POST /operator/v1/approve` on both roles |
-| 2 | Owner | sealed receipt stored? | `credential.owner-seed` with `existing_only: true` — the owner must have signed in once (Paul, 2026-10-27); an unknown address fails here and nothing is created |
-| 3 | Team | team sqid stored? | `directory.inspect` → `directory.seed-team` with the receipt |
+| 0 | Preflight | label regex; never used before; signed `inspect` on both roles (generation, stream heads); console: environment and instance absent, or already bound to this team's owned environment | — |
+| 1 | Initialize (first production run only) | `inspect` reports a generation? | `initialize` plan with Paul's typed baseline attestation (amendment §12); Paul confirms on Home; `directory.initialize` |
+| 2 | Plan | open window on both roles? | sign and `POST /operator/v1/plan` to each role; show Paul the two Home confirm links; poll each role's `inspect` (it reports the open plan's id and expiry) until both windows are open |
+| 3 | Owner | sealed receipt stored **and `expires_at` in the future**? | `credential.owner-seed` (`existing_only: true`); expired → a **new** operation |
+| 4 | Team | team sqid stored? | `directory.seed-team` with the receipt (a taken label refuses here) |
| per app: | | | |
-| 4 | Credential consumer | Home replay of the stored request | `credential.register-consumer` `<team>-<app>` |
| 5 | Directory consumer | replay | `directory.provision-consumer` → signed record + bearer (pending) |
-| 6 | Environment | `GET /config?environment=<team>`: keys present, generated keys present by name | `PUT /config` with the recipe; **never regenerate** an existing key (a new DEK orphans sealed data) |
-| 7 | Instance | `GET /instances/<team>-<app>.bds.oncarlos.com`: exists and bound to `<team>` | `POST /instances {host, environment:<team>}`; 409 → probe again; bound elsewhere → stop |
-| 8 | Domain | `GET /domains`: `state` (never legacy `status`) | `POST /domains {host:<team>.<app>.oficina.works, route:<instance host>}`; poll to `state=live` (≤ 30 min, then park) |
-| 9 | Serving | `/api/version` body on the public origin equals the app's current release **and** the instance list's `update_report.serving` agrees (`X-Carlos-Version` alone can run ahead of the process) | `POST /restart/scope {host}` if config changed after start |
-| 10 | Verify | roster-mode apps only | `directory.verify-consumer` (600 s window); poll `GET /api/team` until `roster:"ok"` |
-| 11 | Activate | roster-mode apps only | `directory.activate-consumer` with evidence (§7) |
-| 12 | Audit | — | §5's rule against the live listings; then delete the sealed owner address |
-
-Apps without roster mode stop after step 9 with their directory row
+| 6 | Credential consumer | replay | `credential.register-consumer` **carrying step 5's record** |
+| 7 | Environment | `GET /config?environment=<env>`: owned, keys present by name | `PUT /config` with the recipe; **never regenerate** an existing key |
+| 8 | Instance | `GET /instances/<team>-<app>.bds.oncarlos.com`: bound to `<env>` | `POST /instances {host, environment}` (socket-backed kind); 409 → probe; bound elsewhere → stop |
+| 9 | Domain | `GET /domains`: `state` (never legacy `status`) | `POST /domains {host:<team>.<app>.oficina.works, route}`; poll to `state=live` (≤ 30 min, then park) |
+| 10 | Serving | `/api/version` body on the public origin = the app's release, and `update_report.serving` agrees | `POST /restart/scope {host}` if config changed after start |
+| 11 | Verify | roster-mode apps only | `directory.verify-consumer` (600 s); poll `GET /api/team` until `roster:"ok"` |
+| 12 | Activate | roster-mode apps only | `directory.activate-consumer` with evidence (§7) |
+| 13 | Audit | — | §5's exact-keys rule; delete §4's address-bearing rows |
+
+Apps without roster mode stop after step 10 with their directory row
**pending** (not in the chooser — `roster-contract.md`), reachable at their
own URL with Home sign-in and the owner allowlist. When an app gains roster
-mode, an **add-apps** run replays step 5 for the bearer and continues at 6.
-
-**Approval windows last 15 minutes**; domains and cold starts can outlast
-one. A run that parks after step 8 resumes later under a fresh step-up and a
-new window of kind `add-apps` for the same label and apps.
-
-**Adopting Track 1.** If `lagged` instances already exist from
-`provision-team.py` (env `lagged`, owner allowlist, no Home), steps 6–7
-probe them as "bound to this team", keep every existing generated key, and
-add the Home keys. Docs switching to team mode then needs Till to **link**
-his existing local Docs account to his Home identity (the existing
-account-link flow) or his Track 1 documents stay under the old principal.
-
-## 7. Activation evidence (what step 11 signs)
-
-The existing `ActivationEvidence` fields, filled without platform 117:
-`app_version` from `/api/version`; `artifact_digest` from the instance
-record's serving build; `environment_binding` = SHA-256 over Alta's
-canonical recipe for this instance (key names, kinds, and SHA-256 of each
-SET value — never generated values); `credential_manifest_digest` from step
-4's result; `alias_host` from step 8. The amendment records that these mean
-"what Alta observed through the console", not a maintenance environment
-binding.
-
-## 8. Guards in Alta's own code
-
-- Every console call goes through one client that refuses: an empty
- environment name (the default bundle); an environment not equal to a
- label in `teams`; a host not of the form `<label>-<app>.bds.oncarlos.com`
- or `<label>.<app>.oficina.works` for a label in `teams`; any DELETE not in
- a deprovision run. Unit-tested with mutation tests.
+mode, an **add-apps** run replays step 5 for the bearer and continues.
+
+**Windows last 15 minutes and admit any number of in-scope operations.** A
+run that parks (domains, cold starts) resumes under a new plan of kind
+`add-apps` for the same label and apps, confirmed again on Home.
+
+**Moving the `lagged` stopgap** (six instances bound to hand-made
+environment `lagged`, which a record references and so can never become
+owned): per app, Paul runs `carlos env fork --from lagged --to lagged-team
+--scope alta` (copies only `lagged`'s own keys, so the DEKs Till's data is
+sealed with survive); Alta's step 7 completes `lagged-team` with the full
+recipe (shared values copied in, Home values set); once every box is at the
+CARLOS floor release, Paul rebinds each instance with `PATCH {environment:
+lagged-team, scope: alta}`. Till's databases stay. Docs switching to team
+mode then needs Till to **link** his local Docs account to his Home identity
+(the existing account-link flow) or his Track 1 documents stay under the old
+principal. Fallback if `env fork` is cut from the CARLOS slice: new hosts and
+fresh keys, domains re-pointed, and Till's stopgap content is lost — Paul's
+call at that point.
+
+## 7. Activation evidence (step 12)
+
+`ActivationEvidence` fields, with their encodings (`verification.go`):
+
+- `app_version` — the 40-hex commit in `/api/version`'s body; an app
+ reporting anything else cannot be activated until it does.
+- `artifact_digest` — base64url (no padding) of SHA-256 over the exact
+ serving-build identifier string in the instance record's
+ `update_report.serving`.
+- `environment_binding` — base64url of SHA-256 over Alta's canonical recipe
+ JSON for this instance: sorted key names, each with kind and the SHA-256 of
+ its SET value (generated and copied-in secrets contribute their name and
+ kind only).
+- `credential_manifest_digest` — returned by step 6: base64url of SHA-256
+ over Go `encoding/json.Marshal` of `["oficina/home/consumer-manifest/v1",
+ [[id, origin], …]]`, entries sorted by unsigned UTF-8 byte order of
+ consumer ID (the compatibility checker's definition).
+- `alias_host` — step 9's host.
+
+They mean "what Alta observed through the console", not a platform
+attestation; the amendment §2 item 6 says so.
+
+## 8. Guards in Alta's own code (defence in depth, not the fence)
+
+- One console client refuses: an empty environment; an environment not
+ owned per Alta's records; a host not `<label>-<app>.bds.oncarlos.com` or
+ `<label>.<app>.oficina.works` for a label in `teams`; any DELETE outside a
+ deprovision run. Mutation-tested.
- Logs carry step keys and fixed codes only.
-- One run at a time (a process lock row); Home serializes per role anyway.
+- One run at a time (a lock row); Home serializes per role anyway.
## 9. Deprovisioning ("retire apps")
-Order, each step probe-first: `directory.disable-consumer` (bearer dead,
-tile gone) → `credential.retire-consumer` (no more sign-in) → `DELETE
-/domains/<team>.<app>.oficina.works` (the platform does not detach a claim
-when its instance is deleted) → `DELETE /instances/<host>`. What survives,
-and says so on the confirm page: the parked database replica and any private
-bucket (purged only by a CARLOS operator; re-creating the same host is
-refused until then), the environment bundle (Alta blanks its generated keys
-**only** after the purge), and the Home team row, roster and label (ruling
-19). **Labels are never reused** (Paul, 2026-10-27): a retired team's label
-stays reserved for good, and Alta refuses a plan naming any label it has
-ever used. A confirm page names the team, lists each app, and requires
-typing the label.
+Probe-first, in order: `directory.disable-consumer` →
+`credential.retire-consumer` → `DELETE /domains/<team>.<app>.oficina.works`
+(CARLOS does not detach a claim when its instance goes) → `DELETE
+/instances/<host>`. What survives, stated on the confirm page: the parked
+database replica (purged only by a CARLOS operator; the host cannot be
+re-created until then), the owned environment (no delete verb exists), and
+the Home team row, roster and label. **Labels and retired app hostnames are
+never reused** (Paul, 2026-10-27; amendment §5). The confirm page names the
+team, lists each app, and requires typing the label.
## 10. One-time setup (Paul, person-only)
-1. When CARLOS ships team-scoped credentials: mint the six (§3), adopt
- the `lagged` environments into scope, `carlos secrets set --app alta`.
-2. Per app zone: wildcard DNS `*.<app>.oficina.works` → the deployment, and
- either a wildcard certificate claim or per-name certificates. Check
- whether console.carloku.com runs with `CARLOS_HOST_CLAIM`, which refuses
- catch-all and wildcard claims; explicit per-host attach is what Alta uses.
-3. Till signs in once at `https://oficina.works` (owner-seed is
- `existing_only`).
-4. Home: `HOME_OPERATOR_HTTP` on both roles with Alta's public key and
- Paul's person ref; enable the directory roster endpoint with its signing
- keys; add `alta` to `HOME_CONSUMERS` (it is not a team instance).
-5. If `inspect` reports no roster generation, an `initialize` run with
- Paul's typed attestation, once.
+1. When CARLOS ships team-scoped credentials and every box is at its floor:
+ mint the six `team` credentials; `carlos secrets set --app alta`.
+2. Supply the shared values (`ALTA_SHARED_SMTP_*`,
+ `ALTA_SHARED_CARLOS_RELAY`) as Alta secrets.
+3. Per app zone: wildcard DNS `*.<app>.oficina.works` → the deployment, and
+ per-name or wildcard certificates (check `CARLOS_HOST_CLAIM`; Alta uses
+ explicit per-host attach).
+4. Till signs in once at `https://oficina.works`.
+5. Home: add `alta` as the 8th `HOME_CONSUMERS` entry; set
+ `HOME_OPERATOR_HTTP` on both roles (credential role including the
+ directory provisioning public key); enable the directory roster endpoint
+ with its signing keys.
+6. Give the amendment §12 pre-flight confirmation; Alta's first run is the
+ `initialize` plan.
+7. For `lagged`: `env fork` per app, then the explicit rebinds (§6).
## 11. UI sketch (estilo, scriptless)
@@ -259,20 +274,19 @@ typing the label.
Alta [Paul ▾]
──────────────────────────────────────────────────────────────────
Teams [New team]
- lagged Lagged 6 apps live 4 · pending 2 [Open]
+ lagged Lagged 6 apps live 1 · pending 5 [Open]
New team
Label [lagged ] → lagged.docs.oficina.works …
Name [Lagged ]
Owner email [till@lagged.biz] (must have signed in at oficina.works once)
Apps [x] Docs [x] Sheets [x] Slides [x] Calendar [x] Calls [x] Memoria
- [Review plan]
+ [Submit plan to Home]
- Plan · lagged (confirm with a fresh sign-in)
- Home: seed team "lagged", owner by email, 6 consumers
- docs env lagged: set 11 · generate 4 · shared 6 · blank 9 [details]
- …
- [Sign in again and run]
+ Plan · lagged — confirm on Home
+ 1. Open oficina.works/operator/confirm (label, apps) ✓ open
+ 2. Open id.oficina.works/operator/confirm (retype the owner) ◷ waiting
+ docs env lagged-team: set 12 · generate 4 · copied in 5 [details]
Run · lagged refresh to update
docs ✓ consumer ✓ env ✓ instance ✓ domain ✓ serving ✓ live
@@ -281,26 +295,37 @@ typing the label.
[Audit] [Retire apps…]
```
-No live updates: the run page is a plain GET; refresh to see progress.
+No live updates: plain GETs; refresh to see progress.
## 12. Tests before merge
-Recipe: for each app, a fixture default bundle with every key the app reads
-plus an unknown key — the unknown key must refuse the plan; generated keys
-never regenerate on a second run. State machine: crash injection after
-every act, against a fake console and a real Home on a preview — resume
-reaches the same end state with no duplicate instance, consumer or team.
-Guards: §8 mutation tests. Privacy: no address, key or label in logs;
-sealed owner address gone after step 12. End to end on previews: two
-synthetic teams, both owners sign in, each sees only their team, Paul's
-existing instances unchanged (config digest before and after).
+Recipe: for each app, the environment equals the recipe exactly (an extra
+key refuses); generated keys never regenerate; shared values never appear in
+logs or plan displays. State machine: crash injection after every act,
+against a fake console and a real Home on a preview — resume reaches the
+same end state with no duplicate instance, consumer or team; an expired
+owner receipt leads to a new owner-seed, not a stuck step 4. Guards: §8
+mutation tests. Privacy: no address after step 13 anywhere in Alta's DB
+(scan for the canary owner address). End to end on previews: two synthetic
+teams; each owner sees only their team; Paul's instances unchanged (config
+digest before and after).
## 13. Still open
-1. **Production gate:** CARLOS team-scoped credentials
- (`carlos/platform` branch `team-scoped-credentials`) — design, review,
- build. Alta ships to production only after.
-2. Host for Alta: `alta.oficina.works`, or unlisted on oncarlos.com only
- (not ruled).
-3. The Home pre-flight question in `team-provisioning-amendment.md` §12
- (roster generation initialization).
+1. **Production gate:** CARLOS team-scoped credentials and their floor
+ release (`carlos/platform` branch `team-scoped-credentials`), including
+ `env fork` for the `lagged` move.
+2. Alta's host (not ruled).
+3. Paul's pre-flight confirmation (amendment §12).
+
+## 14. Round-1 findings: disposition
+
+Approval moved to Home (§2, §6 step 2). Provision before register, record
+carried (§6 steps 5–6). Initialize as the first run (§6 step 1). Receipt
+expiry probed (§6 step 3). `inspect` no longer claims label freedom (§6
+step 0). Owner-seed request and credential plan rows deleted (§4). Activation
+encodings (§7). Label regex tighter on purpose (§5). Sandbox never holds
+production tokens (§3). Guards are defence in depth (§8). Calls repo named
+(status). CARLOS round 1: standalone environments → recipes copy shared
+values in (§3, §5); `lagged` moves by fork + explicit rebind (§6). None
+declined.