# 🤖 Amendment: the operator endpoint (teams without the maintenance worker)

Existing canonical instances: `existing-team-adoption.md` extends §4's
confirmation rendering, §2.6/§5's activation policy and §8's threat model
for explicitly confirmed adoption plans. It preserves existing registrations
and local content authority; ordinary new-team provisioning stays separate.

**Status:** APPROVED (design), 2026-10-27. Drafted by Claude Opus 5.5 for
Paul. **Reviewed by Claude Fable 5.1 (claude-fable-5-1), 2026-10-27,
discussion 92, APPROVED (design, round 3)** at `93f8209`, after round 1
(CHANGES REQUIRED, 5 blockers) and round 2 (CHANGES REQUIRED, narrow, 3
blockers); round 3's six non-blocking notes are applied (§13).
**Implementation slice 1** (operator HTTP transport, confirm ceremony,
consumer registry, new verbs) **reviewed by Claude Fable 5.1
(claude-fable-5-1), 2026-10-28, discussion 94, APPROVED** at `c880a02`
(round 4, §13). Each superseded file below carries a one-line pointer here.
**Not approved by this verdict, and needing its own review before the code
it gates** (Fable, round 3, verbatim):
1. The shared `handoff` change (`ConsumerConfig.StartPath`) — before the
   Team page and both confirm pages.
2. `carlos/platform` `team-scoped-credentials` (discussion 449) and its
   floor release — before Alta reaches production (Paul's condition on
   ruling 8).
3. Each implementation slice (operator HTTP transport, ceremony pages,
   consumer registry and CSP, new verbs, Team page, resolve, each app's
   roster port, Alta) — whole-code review, CI green, verified canary, per
   AGENTS.md "Shipping cadence".
4. Paul's §12 pre-flight confirmation before the first production
   `initialize`. 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

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** 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)

Each quoted file carries a one-line pointer here (added when slice 1 landed).

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.
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. Its
   `app_version` is therefore the opaque token Alta read on `/api/version`
   (bounded printable ASCII, `^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$`), not a
   40-hex commit Home could treat as attested (§13, Alta review).
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 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, Paul-approved request type registers or retires a consumer; no
   browser request can.
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. 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.

**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

- **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` (Paul's browser, §4; no query — one
  pending plan per role).
- **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, and **must include
  `<role>.inspect`**, which Alta resynchronises from — round 4),
  `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.
- **The role's own keys** (the MAC key, the owner-seed signer, the
  directory's provisioning signer and its roster keys) come from the
  existing reviewed `HOME_OPERATOR_MATERIAL`, the material the native
  command reads (round 4).
- **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); round 2, blockers 1 and
3).**

**Sequencing prerequisite.** Step 2 needs the directory's fresh-only
consumer, which needs a **reviewed change to the shared `handoff` module**
(`team-members.md` §2: today `guard` 404s any start path but the
`StartPath` constant, `handoff/http.go:70-80`, `:107`). That change and its
review land **before** the directory confirm page and the Team page.

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`. **Both roles' plans carry the same
   `plan_id`** (32 random bytes), plus `role`, `kind` (`initialize` |
   `create-team` | `add-apps` | `retire-apps`), `apps` (registry slugs),
   `issued_at`, `expires_at` (≤ 900 s). The **directory** plan adds `label`
   and `display_name` (round 2: so a compromised Alta cannot choose the
   team's name after Paul confirms); the **credential** plan adds `owner`.
   **Home verifies the signature, extracts the closed fields, and never
   persists the signed plan bytes or the address.** Directory writes
   `plan_id`, `kind`, `label`, `apps`, `expires_at`, the display name
   **sealed** (the team-name helper). No digest of the name is kept (round
   3): `seed-team` opens the seal inside its transaction and compares bytes. Credential blind-indexes `owner` with `findOrMintPersonOn`'s
   normalisation (`links.go:156`, existing-only lookup) and writes
   `plan_id`, `kind`, `apps`, `owner_index`, `expires_at`. One pending and
   one open plan per role (`UNIQUE(state)`); a further submit refuses until
   the pending one is confirmed or expires, and **confirming a pending plan
   while a window is open answers 409** until that window expires (round 4) (**up to 15 minutes; no cancel verb** — a convenience
   we skip). **Expired and refused plan rows are deleted** (`secure_delete`
   is on), so a blind index for a never-confirmed plan does not linger.
2. **Paul's browser confirms on the directory**:
   `https://oficina.works/operator/confirm` — **no query**; the page shows
   the role's one pending plan. It sits behind the directory's fresh-only
   consumer (`/auth/fresh/start`, `team-members.md` §2): a session whose
   `auth_time` is older than 300 s or in the future goes through the fresh
   exchange first and returns to `/operator/confirm`. Subject ≠
   `operator_subject` → 404. The page renders **Home's copy**: the first 8
   hex of `plan_id`, kind, label, display name, each app as
   `<label>.<app>.oficina.works`, expiry. [Open window] POST — inside the
   directory's CSRF group — re-checks subject, freshness and plan expiry
   **inside the write**, then opens the directory window for 15 minutes.
   **Inherited gap:** the directory session carries no sign-in method, so a
   recovery-code session and the Keymail no-gesture case of
   `team-members.md` §2 pass here exactly as they pass the Team page; the
   credential page below is where the method is visible and refused.
3. **Then on the credential origin**: `https://id.oficina.works/operator/confirm`
   — **no query**, the role's one pending plan. `/operator/confirm` joins
   `credentialReturn`'s closed list (`signin_return.go:12-17`, exact paths,
   no query). On **GET and POST** it requires: subject = `operator_subject`
   (else 404); `sessions.Fresh(300)`; no future `auth_time`; not
   `keymailWithoutGesture`; and **`Method` not containing `recovery`** (Paul,
   round 2: recovery codes mint `AuthTime: now`, `passkey.go:28-39`, so they
   would satisfy any freshness window; this page refuses them). **A stale
   session** gets a sealed **fresh intent** written before the redirect to
   `/signin` — `assertionIntent{MaxAge: 300, Subject: operator_subject}` with
   a reserved consumer value and a **random nonce** (`readAssertionIntent`
   requires `handoff.ValidNonce`, `assertion_intent.go:34`, and does not
   validate `Consumer`) — which `handleSigninBegin` and the Keymail callback
   already honour (`signin.go:245-247`, `:356-358`), so the sign-in forces a
   real gesture (magic link, or Keymail `prompt=login`) instead of looping.
   `/operator/confirm` consumes the intent on return, **clears the cookie**
   (today only `handleAssertion` does, `exchange.go:110`), and re-checks
   everything above. The reserved consumer value can never reach an
   assertion: `handleAssertion`'s consumer lookup refuses it. **The page renders no account-authored string** (gate
   5): the first 8 hex of `plan_id` (the same plan Paul just opened on the
   directory), kind, app registry names (compiled constants), expiry, the
   first 8 hex of `owner_index`, and "Type the owner's email to confirm".
   The POST — inside the credential CSRF group (`app.go:199`) — re-checks
   subject, freshness, method and expiry **inside the write**, and opens the
   window only if the typed address blind-indexes to `owner_index`.

**Order is advice, not enforced.** Paul is told directory first, then
credential; nothing breaks if he reverses it. An `initialize` plan is
directory-only.

**Mounting.** `/operator/v1` and `/operator/v1/plan` are mounted outside
`csrf.Protect` and before `sessions.Middleware` on both routers, as
`handoff.CallbackPath` is (`directory.go:77`); the no-`Cookie` refusal makes
session middleware a no-op there anyway. `/operator/confirm` is the
opposite: inside each role's session and CSRF groups.

**Nonce and `BindStart`.** Round 0's raw-assertion forwarding is removed:
Home never receives an assertion from Alta, so nothing binds a plan to an
assertion nonce (round 1 found it unbuildable: `handoff.Store.Finish` hands
`Complete` parsed claims and deletes the token, `handoff/http.go:206-230`).
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`,
and `seed-team`'s `display_name` equals, byte for byte, the plan's sealed
display name (opened inside the transaction).
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
`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. Mechanics: `roster.VerifyProvisioning(record, keys, binding)`
  takes the *expected* bindings, so the verb first parses the record's
  claimed consumer, app, team and audience, fixes `issuer` and `directory`
  to the pinned values, verifies with those, and registers only what
  verified. 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. `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` — **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),
  carried in the `initialize` operation's input under Alta's signature, as
  the existing verb has it — not repeated in the plan, which for
  `initialize` carries no label, apps or name (round 4). 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. Restore through the native
  command needs a reviewed profile regeneration first; until then it refuses
  a database that has served over HTTP (round 4).

**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 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 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)**, in their own migration sets
(`oficina_<role>_operator_http`, applied through `Runtime.ServingSchema()`;
round 4): credential `consumers` (with an `app` column, a compiled registry
slug, so `retire-consumer` can check the window's apps), `operator_plans`
(plan_id, pending/open, kind, apps, owner_index, expiry); directory
`operator_plans` (plan_id, pending/open, kind, label, apps, sealed display
name, expiry), `operator_http_teams`; both keep
`<role>_operator_state` / `_results` unchanged. No table ever holds signed
plan bytes or an address.

## 8. Threat model: a compromised provisioner

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.
  **Existence oracle:** the existing-only lookup at plan submit tells
  Alta's key holder whether an address has a person — `owner-seed` already
  does, so nothing new.
- **Compromised Home origins** are as in §13a of the spec. **Three signers
  move into serving processes** (before, they lived only in the operator
  command): the directory's provisioning signer; the credential role's
  owner-seed signer; and the credential role's resolve key
  (`team-members.md` §4). A directory compromise could sign provisioning
  records and a credential compromise could sign owner receipts or member
  resolutions — but each origin's compromise already concedes more (§13a),
  and registration or seeding still needs Alta's key and a window Paul
  opened.

## 9. The one rule and gates

- **No readable address at rest.** The address reaches the credential role
  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*; on the plan-submit path it asserts the
  **signed plan bytes and the canary address are absent** from the file, WAL
  and SHM, and that an expired plan's row is gone. **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:** 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. **Ceremony:** plan signed by another key; a second pending plan
   refused; differing `plan_id`s across roles refused at confirm (round 4:
   unbuildable across two databases; each confirm POST refuses any id but
   the one its GET showed, and Paul compares the prefix on both pages); confirm by
   a non-operator subject → 404; directory confirm with stale or future
   `auth_time`; credential confirm with a stale session (a fresh intent is
   written and the forced sign-in returns to `/operator/confirm` — no loop
   for a Keymail identity), a Keymail session with no gesture, a
   **recovery-code session** (refused), a mistyped owner address; confirm
   after plan expiry; `seed-team` with a display name not matching the
   plan's sealed name byte for byte; expired plan rows deleted; a fresh
   intent with a missing or invalid nonce is ignored (no loop — plain
   sign-in); the fresh-intent cookie is cleared after a successful confirm;
   the reserved consumer value in a fresh intent is refused by
   `handleAssertion`'s consumer lookup (it can never mint an assertion).
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
   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

- **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. Review findings: disposition

**Round 1.** 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.

**Round 2.** Blocker 1 (plan bytes) → §4 step 1, §9 gate 2, §10.4. Blocker
2 (fresh consumer not mountable) → §4 sequencing prerequisite,
`team-members.md` §2. Blocker 3 (credential confirm loop, lost target) → §4
step 3 (no query, `credentialReturn`, sealed fresh intent, GET and POST
re-checks). Recovery-code sessions refused on the credential page; the
directory's inherited gap stated (§4 step 2). Same `plan_id` on both roles,
shown on both pages (§4). Display name bound by the directory plan (§4,
window semantics). Order advisory; 15-minute block, no cancel (§4). Three signers
in serving processes (§8). Mounting outside CSRF and sessions (§4).
`VerifyProvisioning` mechanics (§5). Existence oracle (§8). Alta and Team
page notes applied in those files. None declined.

**Round 3 (APPROVED, design).** Non-blocking notes applied: `name_digest`
dropped, byte comparison in `seed-team` (§4, §7); fresh intent with random
nonce, cleared on consumption, reserved consumer refused by
`handleAssertion` (§4 step 3, §10.4); §10.4 additions (invalid nonce
ignored, cookie cleared). The `lagged-team` blank keys, PLATFORM timing and
Docs prefix preflight are applied in `team-provisioning-app.md` §6.

**Round 4 (implementation, discussion 94).** Whole-code review of branch
`operator-http` by Claude Fable 5.1 (claude-fable-5-1) at `2f1cac8`: CHANGES
REQUIRED (narrow); the three blockers — registration admission equal to the
registry reload's, a test of `retire-consumer`'s app scope, and this entry —
are fixed on the same branch. Deviations from the text above, each with the
review's ruling:

1. The new tables live in their own migration sets, applied by
   `Runtime.ServingSchema()`; `Runtime.Schema()` and the frozen
   compatibility, admission and legacy-diagnostic profiles are unchanged, and
   the native command refuses a database carrying them (§5's restore
   sentence). **Accepted** — restore stays gated and platform 117 does not
   exist. The legacy diagnostic skips exactly this set, so a true mismatch is
   not hidden behind a standing false one.
2. `consumers.app`, a compiled slug under a `CHECK`. **Accepted** (§7).
3. §10.4's cross-role `plan_id` refusal is unbuildable; each confirm POST
   carries the id its GET showed and refuses any other. **Accepted** — the
   buildable half of round 2's ask, and tested.
4. `baseline_attestation` stays in `initialize`'s signed input. **Accepted**
   (§5).
5. A stale, future, Keymail-without-gesture or recovery session on the
   credential page is redirected to sign-in with the fresh intent rather than
   shown a refusal page; no window opens. **Accepted.**
6. An open window makes a second confirm answer 409 until it expires.
   **Accepted** (§4).
7. The role's own keys from `HOME_OPERATOR_MATERIAL`. **Accepted** (§3).
8. `<role>.inspect` required in `actions`. **Accepted** (§3).
9. `TestNoHandlerSetsItsOwnCSP` exempts `security.go`, whose
   `setConsumerPolicy` may only add one registered consumer to form-action.
   **Accepted.**

**Alta review (oficina/alta discussion 1, Claude Fable 5.1, mismatch ruling
5).** `directory.activate-consumer` required `app_version` to be a 40-hex
commit, a leftover of the platform-attestation design that item 6 of §2
already weakened: every app's `/api/version` answers `git describe --tags
--always`, so no team instance could be activated. `version()` now admits
the observed token, `^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$`; the field's name,
type and canonical encoding, and every other activation check, are
unchanged. Rejected: stamping 40-hex into each app's Makefile, which takes
away the human version Paul reads on `/api/version` to confirm a deploy.

**For a later amendment (design note, not a deviation):**
`credential.retire-consumer` is app-scoped, not team-scoped — the credential
role sees no labels — so a confirmed `retire-apps` window admits retiring any
table consumer of those apps for any team, and the credential page cannot
show Paul which. The mirror of `register-consumer`'s record derivation would
be a directory-signed `disable` receipt. Weigh it before a second team
exists.
