| 1 | # Existing canonical app adoption |
| 2 | |
| 3 | Status: Home capability design approved by independent GPT-6 Astra, |
| 4 | 2026-11-02, after rollback, observation and scope revisions. Production |
| 5 | activation remains gated on the reviewed observation runner and confirmations. |
| 6 | Base: d82341c. Amended 2026-11-16 for 522 Plan 1 digests and the Plan 2 |
| 7 | waiver (see the observation recipe). Amended 2026-11-17 (Paul, discussion |
| 8 | 103): the waiver's delivery evidence is the runner's automated check, and |
| 9 | the negative live checks are dropped for this adoption. Implements |
| 10 | agent-access task 5 and Home discussion 103. Amended 2026-11-20 by Paul’s |
| 11 | approved Equipo native Oficina ID spec, part 3 / E4: Equipo joins canonical |
| 12 | adoption as the seventh app; its app-side contract must be deployed first. |
| 13 | Amended 2026-11-23 (Paul: Base production is https://base.oficina.works): |
| 14 | Base joins as the eighth. Its instance must already serve that host, and |
| 15 | its `base` consumer must be in the credential env manifest with that origin, |
| 16 | before an adoption plan names it. |
| 17 | |
| 18 | The eight existing canonical instances need directory membership and routing |
| 19 | without creating replacement instances, changing their keys, or converting |
| 20 | their existing item permissions to TeamMode. Agent adapters already support |
| 21 | this combination: Home controls delegated team admission; each app resolves |
| 22 | the Home subject and enforces its current local resource permissions. A new |
| 23 | directory membership never grants access to existing content by itself. |
| 24 | |
| 25 | ## Scope and authority |
| 26 | |
| 27 | Extend the signed operator plan with optional `existing_team` (the actual |
| 28 | team SQID, not the dashboard label). It is valid only for create-team or |
| 29 | add-apps plans and only for the eight compiled canonical apps. Both roles show |
| 30 | an explicit existing-app adoption description. The directory requires label |
| 31 | `oficina`, shows the exact canonical hosts, and binds seeding and every |
| 32 | subsequent operation to the plan's SQID. The credential plan binds owner-seed |
| 33 | and the signed provisioning record to that same SQID. Existing-only owner |
| 34 | lookup, typed owner confirmation, two-role fresh authentication, signed |
| 35 | stream ordering, expiration and exact retries remain required. |
| 36 | |
| 37 | Add an `existing_team` column to each role's operator_plans using new |
| 38 | additive migrations. Store only the bounded opaque SQID; no signed plan or |
| 39 | address. The field defaults empty for old plans. Ordinary plan behavior is |
| 40 | unchanged except that `oficina` is reserved: ordinary create-team plans and |
| 41 | native seeding refuse that label. Ordinary add-apps also refuses that label; |
| 42 | only canonical adoption can add apps there. An ordinary retire-apps window |
| 43 | may disable a directory binding, but cannot retire an env-manifest consumer. |
| 44 | Adoption's SQID must decode to exactly one |
| 45 | positive signed-64-bit team ID and re-encode identically. |
| 46 | |
| 47 | Rollback is forward-compatible only after adoption: a pre-adoption binary |
| 48 | rejects canonical live rows and can make the whole chooser fail. Keep an |
| 49 | adoption-capable build as the rollback target. Before any adoption writes, |
| 50 | an older build is permitted only after every adoption window/pending plan |
| 51 | expires. After canonical bindings exist, do not downgrade, restore an old |
| 52 | snapshot, or delete rows to force a downgrade. Disabling delegated access |
| 53 | is the immediate incident response; a separate reviewed recovery is needed |
| 54 | if no adoption-capable binary is usable. App local access and data remain |
| 55 | available independently of the new connection service. |
| 56 | |
| 57 | The canonical binding table is compiled and closed: docs, sheets, slides, |
| 58 | memoria, calendar and calls each use consumer ID equal to app slug and |
| 59 | origin `https://<app>.oficina.works`. Their only label is `oficina`. |
| 60 | Directory read policy admits these exact stored tuples, alongside ordinary |
| 61 | label.app destinations. Merely broadening hostname validation is not the |
| 62 | write path: directory.provision-consumer refuses canonical origins unless |
| 63 | ExecuteHTTP supplies an open adoption window matching the exact tuple and |
| 64 | SQID. Native provision never supplies that authorization. Ordinary HTTP |
| 65 | plans cannot write canonical tuples; adoption plans cannot write new-team |
| 66 | tuples. Existing unique origin/consumer constraints prevent another team |
| 67 | claiming an adopted instance. Provenance fence and owner membership remain. |
| 68 | |
| 69 | Credential register-consumer under an adoption window verifies the |
| 70 | directory signature, exact issuer/directory/app/consumer/origin and pinned |
| 71 | team, then requires that exact ID/origin pair in the immutable env manifest. |
| 72 | It returns the existing union manifest digest without inserting, replacing |
| 73 | or retiring a registration. Partial matches, table consumers, missing env |
| 74 | entries and ordinary windows all refuse. Sign-in registrations and keys |
| 75 | remain unchanged. Ordinary registration continues rejecting env collisions. |
| 76 | |
| 77 | ## Activation and existing access |
| 78 | |
| 79 | Provisioning still creates pending directory/roster bindings and a signed |
| 80 | record, with the existing operation ledger and bounded verification attempt. |
| 81 | Canonical activation uses explicit policy |
| 82 | `oficina/existing-app-activation/v1` under an adoption window; ordinary |
| 83 | activation keeps `oficina/team-activation/v1`. Policy/route mismatch refuses, |
| 84 | including native activation. Both paths retain all attempt, owner, epoch, |
| 85 | record, generation, build, artifact, manifest and configuration digest checks. |
| 86 | |
| 87 | The adoption observation attests the canonical host's exact build, unchanged |
| 88 | existing consumer registration, unchanged storage and identity keys, and |
| 89 | agent configuration bound to the actual team. It does not attest a fresh |
| 90 | isolated database or TeamMode conversion. No TEAM_* settings are enabled, |
| 91 | no content is copied, no existing memberships are inferred, and no existing |
| 92 | local user access is removed. The UI explicitly says that connecting an app |
| 93 | preserves its existing content permissions. This narrows the activation |
| 94 | claim and is a deliberate amendment to team-provisioning-amendment.md §2.6, |
| 95 | §5 and its new-instance-only threat model, not a fake TeamMode probe. |
| 96 | |
| 97 | This implementation adds Home's capability and reviewable operator tooling; |
| 98 | Alta's ordinary instance-creation recipe must not be used for adoption. |
| 99 | Production activation still needs actual signed plans, Home's fresh browser |
| 100 | confirmation, and the historical never-provisioned attestation before the |
| 101 | initial generation. Existing deployment authorization does not stand in for |
| 102 | these product-level confirmations. No production mutation is done by tests. |
| 103 | |
| 104 | Typed owner confirmation applies to create-team only. An add-apps adoption |
| 105 | plan has no owner field; both fresh confirmations instead identify the |
| 106 | existing SQID, exact app hosts and preservation of local permissions. |
| 107 | |
| 108 | ### Observation recipe and activation gate |
| 109 | |
| 110 | The activation evidence is the operator's signed observation; neither Home |
| 111 | nor the platform attests that arbitrary digest fields describe real checks. |
| 112 | The adoption runner must obtain two supported CARLOS snapshots, before any |
| 113 | configuration write and after the process adopts the intended configuration. |
| 114 | Each snapshot records account/app/instance ID, canonical alias and its |
| 115 | target, named/default environment identity, persistent storage identity, |
| 116 | Home issuer/consumer ID, and the complete effective configuration. |
| 117 | |
| 118 | The runner reads configuration only through carlos/platform 522 Plan 1 |
| 119 | (spec `2026-11-02-config-receipts-design.md`, approved rev 6), under an |
| 120 | account-owner `Operate` or `Admin` credential. The doors, all under |
| 121 | `/api/cli/apps/{account}/{app}`: |
| 122 | |
| 123 | - `GET /config?environment=<name>` (omit `environment` for the default |
| 124 | bundle). Returns the layer `version` (`cv1:` plus SHA-256 of the stored |
| 125 | bytes; `none` for an absent layer) and, for every var, `key`, `kind` and |
| 126 | `digest`. Plain vars also carry `value`; secrets never carry their |
| 127 | envelope. |
| 128 | - `GET /config/effective?host=<canonical host>`. Returns the applicable layer |
| 129 | versions (`default`, `environment`, `overlay`; `default` is absent for an |
| 130 | owned environment) and the merged vars, each |
| 131 | with `digest`, `from` and `shadows`. This is the snapshot of the complete |
| 132 | effective configuration and shows if a higher layer covers a key. It shows |
| 133 | stored layers only, not an exec route's `<host>.env` file. |
| 134 | - `PUT /config` with `if_version` set to the baseline layer version, |
| 135 | setting only `AGENT_ISSUER` and `AGENT_TEAM`. Answers with a `receipt`: |
| 136 | `version_before`, `version_after`, `changed`, exact `set`, `unset`, |
| 137 | `unset_absent`, and `digests` for the keys just set. The console must |
| 138 | support atomic conditional puts (S3); otherwise it refuses `if_version` |
| 139 | with 400 and the runner stops. A 412 is a refusal with nothing written. |
| 140 | `if_version` is one non-empty JSON string in the body; there is no |
| 141 | `If-Match`, and it cannot be combined with `exec_delivery`. |
| 142 | |
| 143 | Preservation is proved with 522's `vd1:` per-key digests, not with |
| 144 | HMACs of secret plaintext. A `vd1:` digest is SHA-256 over a var's stored |
| 145 | kind, value, sealed envelope and sealed-to fingerprint. For a secret the |
| 146 | input is the sealed envelope, so the digest says nothing about the plaintext, |
| 147 | and the runner never holds or hashes any secret plaintext. This is sufficient |
| 148 | because the question the gate asks is "has this key changed since the |
| 149 | runner observed it", not "does it equal a value the runner holds". Any write |
| 150 | to an identity or data key stores a new envelope and so a new digest; an |
| 151 | unchanged digest means those stored bytes were not written. Sealing is |
| 152 | randomised, so even re-setting the same plaintext reads as a change, and the |
| 153 | check fails closed. The cost is that the runner cannot confirm that the |
| 154 | stored key is the right key, only that it is the one it first saw. The |
| 155 | before snapshot establishes which key that is, and adoption does not claim |
| 156 | more. Digests of plain vars are as sensitive as their values, since they |
| 157 | let someone test a guess; they stay in the operator journal and are not |
| 158 | pasted into reports or tickets. |
| 159 | |
| 160 | The baseline is the before snapshot's per-key digests and layer versions. |
| 161 | It is captured once, sealed before durable storage, and never rebaselined on |
| 162 | retry. The write and every retry follow 522 spec §4.7. After a 200, require |
| 163 | the receipt's `set` to be exactly `AGENT_ISSUER` and `AGENT_TEAM`, `unset` |
| 164 | empty, and each receipt digest equal to the digest of what was sent. After a |
| 165 | lost answer or a 412, read again and take the first matching branch: all |
| 166 | preserved digests equal the baseline and the new keys equal what was sent |
| 167 | (landed, done); preserved equal and new keys absent (retry with the version |
| 168 | just read); any preserved key changed or gone (stop); new keys partly |
| 169 | present or with another digest or kind (stop and report, do not overwrite). |
| 170 | The after snapshot must preserve every old setting's digest except the |
| 171 | explicitly enumerated AGENT_ISSUER and AGENT_TEAM additions. No TEAM_* |
| 172 | setting may be active before or after; no instance creation or storage swap. |
| 173 | The 522 receipt and digests describe the stored layer. They do not show that |
| 174 | the process has them; see the delivery evidence below. |
| 175 | |
| 176 | Compute environment_binding as base64url SHA256 of a canonical JSON array: |
| 177 | context `oficina/existing-app-observation/v1`, exact account/app/instance, |
| 178 | environment and storage identities, canonical alias target, sorted before |
| 179 | configuration entries with their `vd1:` digests, sorted after entries with |
| 180 | their `vd1:` digests, the layer versions of each snapshot, actual team SQID, connection issuer, reviewed artifact SHA256, and |
| 181 | observed version. Require the canonical HTTPS /api/version body and |
| 182 | X-Carlos-Version to equal that reviewed version, without redirects, and |
| 183 | /healthz success. Fetch the existing credential manifest digest through the |
| 184 | verified adoption registration result. The signed activation retains these |
| 185 | digests and the current bounded verification attempt. |
| 186 | |
| 187 | #### Delivery evidence: 522 Plan 2 waived for this adoption |
| 188 | |
| 189 | 522 Plan 2 (evidence from the running instance that it has the stored |
| 190 | configuration) is not built. Paul ruled on 2026-11-16 (oficina/home |
| 191 | discussion 103 and carlos/platform 522) that it is waived for this Oficina |
| 192 | existing-team adoption only. It is not a precedent for any other adoption, |
| 193 | which still needs Plan 2 or its own ruling. Nothing else in the gate is |
| 194 | waived: Plan 1 snapshots, digests and receipts still apply. |
| 195 | |
| 196 | In its place, delivery evidence is a check per app, made by the runner |
| 197 | after the app restarts with the new configuration. Paul ruled on |
| 198 | 2026-11-17 (discussion 103) that this automated check replaces his |
| 199 | witnessed sign-in; there is no typed confirmation. The check passes only |
| 200 | if: |
| 201 | |
| 202 | - the canonical HTTPS `/api/version` body and `X-Carlos-Version` are |
| 203 | unchanged from the before snapshot and are the reviewed version, with |
| 204 | no redirect; |
| 205 | - `/healthz` succeeds; |
| 206 | - `GET /api/v1/operations` now answers with agent-access's response, |
| 207 | which shows that the app runs the delegated-access code with the new |
| 208 | configuration. That is a move from 404 to 401 or 200. Slides and Calls |
| 209 | already answer 401 from their own middleware, so for them the 401 must |
| 210 | become agent-access's own challenge (a `Bearer` `WWW-Authenticate`, |
| 211 | `Cache-Control: no-store` and a body whose `error.code` is |
| 212 | `unauthenticated`). |
| 213 | |
| 214 | For Base only (Paul, 2026-11-23, oficina/alta discussion 5), the third |
| 215 | bullet is held rather than moved: `GET /api/v1/operations` must answer the |
| 216 | same agent-shaped 401 before and after configure's restart, because it is |
| 217 | Base's own door for Equipo's Assistant and Base reads no agent settings; |
| 218 | every other delivery check is kept (Alta's `docs/base-adoption.md`). |
| 219 | |
| 220 | The runner records the check bound to the identity, delivered version and |
| 221 | configuration it observed; it is void if any of them changes. The check is |
| 222 | part of the signed observation: environment_binding carries it in the |
| 223 | place the witness had. Production activation of an app is blocked until |
| 224 | its check is recorded and still current. |
| 225 | |
| 226 | #### Approved redeploy after configure (amendment, 2026-11-19) |
| 227 | |
| 228 | Status: proposed, for Paul's approval. It changes the first bullet |
| 229 | above for one case only. |
| 230 | |
| 231 | During the production run, docs, slides, calls and memoria were |
| 232 | redeployed to new releases after `configure` had landed their agent keys, |
| 233 | restarted them and recorded their checks. Paul approved those releases, |
| 234 | and the runner's config now names their artifacts. Each stored check is |
| 235 | void, because the served version changed. A new check cannot be made, |
| 236 | because the bullet above requires the version to be unchanged from the |
| 237 | before snapshot. A rollback does not help: `configure` refuses once a |
| 238 | rollback is recorded, and the baseline is never retaken. |
| 239 | |
| 240 | So `configure`, run again for an app whose write has landed and whose |
| 241 | after snapshot exists, may record a new check on a release other than |
| 242 | the before snapshot's. It reads only: it sends no write and no restart. |
| 243 | It records the check only if all of these hold on one fresh observation: |
| 244 | |
| 245 | - the served release changed: the `/api/version` body and |
| 246 | `X-Carlos-Version` both differ from the before snapshot's. If they do |
| 247 | not, the check is the ordinary one above, unchanged; |
| 248 | - `X-Carlos-Version` hashes to the app's reviewed artifact in the |
| 249 | runner's config (the release Paul approved), the body and header name |
| 250 | the same release, there is no redirect, and `/healthz` is 200; |
| 251 | - `GET /api/v1/operations` gives agent-access's own answer, as in the |
| 252 | bullet above, which shows the new process runs with the agent keys; |
| 253 | - the journal's write is landed, and both agent keys are plain vars in |
| 254 | the write layer holding the values it sent; |
| 255 | - every other key and every untouched layer is preserved from the |
| 256 | before snapshot, and the config equals the after snapshot exactly. A |
| 257 | config change that came with the redeploy, including a new key, is |
| 258 | refused; |
| 259 | - the identity equals the before and after snapshots': the same |
| 260 | instance record and record sequence, environment, storage and |
| 261 | canonical domain route. A redeploy keeps the instance record. |
| 262 | |
| 263 | The check records the redeploy with it: the before snapshot's release, |
| 264 | the new one, the approved artifact and the reason. environment_binding |
| 265 | commits to that record as part of the check; a check with no redeploy |
| 266 | binds exactly as before. The activation gate accepts such a check only |
| 267 | if its record is still true: it starts from the before snapshot's |
| 268 | release, ends at the release the check observed, names the artifact the |
| 269 | config approves now, and the fresh probe passes the rules above. The |
| 270 | ordinary freshness rule still applies, so any later change to the |
| 271 | release, identity or config voids the check, and an unapproved release |
| 272 | is refused as before. Anything else gets the ordinary refusal. |
| 273 | |
| 274 | What this does not change: a release that did not change is checked |
| 275 | exactly as before; no new write or restart is allowed; the baseline is |
| 276 | never retaken. One known effect: `rollback-config` waits for the before |
| 277 | snapshot's version, so after a redeploy a rollback's restart cannot |
| 278 | complete. A rollback after a redeploy needs its own reviewed procedure. |
| 279 | |
| 280 | #### Negative live checks: dropped for this adoption |
| 281 | |
| 282 | This document required the runner to check, against oficina-connect, that |
| 283 | a real Home member lacking local app permission stays refused, and that |
| 284 | revoking directory membership or a connection refuses an existing |
| 285 | delegated connection without removing normal local access. Paul ruled on |
| 286 | 2026-11-17 (discussion 103) that these live checks, with their test member |
| 287 | and owner revocation, are dropped for this Oficina adoption. His reason: |
| 288 | revocation is covered by Home's and oficina-connect's own tests. As with |
| 289 | the Plan 2 waiver, this is not a precedent for any other adoption. |
| 290 | |
| 291 | What stays: Plan A's two fresh confirmations, and the Calendar canary. |
| 292 | Plan B activates calendar alone. Plan C, the other six apps, is gated |
| 293 | only on Plan B having activated calendar successfully, and stays refused |
| 294 | if calendar has since been rolled back or disabled. Base, added on |
| 295 | 2026-11-23, is not covered by this waiver: a plan naming `base` runs the |
| 296 | negative live checks above normally. Synthetic proof of |
| 297 | refusal and revocation stays in integration tests. Until the reviewed |
| 298 | snapshot/observation runner exists, production activation is blocked even |
| 299 | if Home capability is deployed. This document does not authorize |
| 300 | hand-constructing observation digests or bypassing a missing snapshot |
| 301 | facility. |
| 302 | |
| 303 | Adoption and Alta share exactly one operator signer, installation, registry |
| 304 | and device on both roles. No native command enrolls a competing stream. |
| 305 | Directory initialize must be sequence 1, before any adoption. Its actual |
| 306 | four-table guard checks roster_generation, roster_consumers, roster_tokens |
| 307 | and roster_operator_receipts; the preflight also checks teams, memberships, |
| 308 | team_instances and both operator streams. Use the shared team-keygen output |
| 309 | only after its own review and CI pass. Existing consumer aliases are checked |
| 310 | against their exact env manifest; no second signer or regenerated keyset is |
| 311 | introduced for the adoption tool. |
| 312 | |
| 313 | This supersedes team-provisioning-amendment.md §4's label.app-only rendering |
| 314 | for adoption plans, §2.6/§5's new-instance activation policy, and §8's claim |
| 315 | that a confirmed provisioner cannot affect existing canonical hosts. An |
| 316 | adoption window explicitly allows binding those eight pre-existing hosts to |
| 317 | one confirmed team, changing directory discovery and delegated admission. |
| 318 | It grants no local content permission and cannot change credential env |
| 319 | registrations, existing storage or keys. The operator signer can falsely |
| 320 | attest observations; that trust is explicit and bounded by confirmation. |
| 321 | |
| 322 | ## Required evidence |
| 323 | |
| 324 | - Signed plan roundtrip/persistence, invalid kind/label/app/SQID, changed |
| 325 | signature and scope, expiry; actual confirmation rendering on both roles. |
| 326 | - Full initialize, owner seed, team seed, canonical provision, existing |
| 327 | registration verification, verify and activate flow with fresh fixtures. |
| 328 | - Ordinary/native provision refusal, other label/team/app/consumer/origin, |
| 329 | new-team origin in adoption mode, registration table/env partial matches, |
| 330 | wrong signature, activation policy substitution and window mismatch. |
| 331 | - Exact replay retains one team/record; no registry duplication; existing |
| 332 | registration and existing local-content authority preserved. |
| 333 | - Directory/agent discovery exposes only live routes for current members; |
| 334 | membership removal revokes discovery. Privacy gates cover plan fields and |
| 335 | no new address/content storage. Existing migrations/gates remain intact. |
| 336 | - Upgrade old pending/open plans, restart and expire new adoption plans; |
| 337 | demonstrate old-reader incompatibility after activation and verify the |
| 338 | forward-compatible rollback build. Observer rejects changed storage, |
| 339 | identity keys, agent team, TeamMode and version body/header mismatch. |
| 340 | - Per app, the runner's automated post-restart delivery check (version |
| 341 | body/header, healthz, /api/v1/operations 404 or app 401 to agent-access's |
| 342 | answer) recorded in place of 522 Plan 2, and Plan C gated on Plan B. |
| 343 | - Independent source/evidence review, meaningful adverse mutations, full |
| 344 | required CI, deployed isolated canary and exact canonical version checks. |
| 345 | |
| 346 | No claim of four-client live acceptance follows from these gates. That is a |
| 347 | subsequent authenticated test after actual team setup and connection rollout. |
| 348 | |