Merge branch 'base-adoption' into main
Merge branch 'base-adoption' into main Base becomes adoptable into an Oficina team at https://base.oficina.works: CanonicalOrigin and provision.Apps (adoption-only, prefix BASE), and the held-door delivery rule for Base's operations door, approved by Paul 2026-11-23 (discussion 5). homecompat pinned to Home main b4e00f1. Reviewed by Claude Fable 5.2 (approved; S1 and nits fixed in 30bd397). CI passed at 3e47f59.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 files changed,
+494
−39
README.md+11 −4adopt/base_test.go+156 −0adopt/delivery.go+16 −4adopt/delivery_test.go+17 −6adopt/deliverycheck.go+2 −1adopt/homeidentity_test.go+1 −1adopt/rehearsal_test.go+2 −0adopt/snapshot.go+6 −2adopt/snapshot_test.go+4 −1cmd/alta-adopt/main_test.go+6 −4docs/base-adoption.md+129 −0homecompat/adopt_flow_test.go+2 −0homecompat/adopt_test.go+1 −1homecompat/canonical_test.go+32 −0homecompat/compat_test.go+1 −1homecompat/go.mod+3 −3homecompat/go.sum+8 −8homeop/fakehome/fakehome.go+1 −1homeop/protocol.go+1 −1provision/adopt_test.go+1 −1provision/apps.go+1 −0provision/base_test.go+93 −0
CI passed — run details
CI log
=== vet === go vet ./... === fmt === === test === CGO_ENABLED=0 go test ./... ok amadan.net/oficina/alta/adopt 22.388s ok amadan.net/oficina/alta/carlosop (cached) ? amadan.net/oficina/alta/carlosop/fakecarlos [no test files] ok amadan.net/oficina/alta/cmd/alta 0.172s ok amadan.net/oficina/alta/cmd/alta-adopt 36.862s ok amadan.net/oficina/alta/console (cached) ? amadan.net/oficina/alta/console/fakeconsole [no test files] ok amadan.net/oficina/alta/homeop 0.003s ok amadan.net/oficina/alta/homeop/fakehome 0.045s ok amadan.net/oficina/alta/internal/web 0.110s ok amadan.net/oficina/alta/provision 11.703s === compat === cd homecompat && go vet ./... && CGO_ENABLED=0 go test ./... go: downloading amadan.net/oficina/home v0.1.1-0.20261123215544-b4e00f18d5dd go: downloading amadan.net/oficina/home/handoff v0.0.0-20261123215544-b4e00f18d5dd go: downloading amadan.net/oficina/home/roster v0.0.0-20261123215544-b4e00f18d5dd ok amadan.net/oficina/home/altacompat 0.643s
diff --git a/README.md b/README.md| index caa67bc..ac0c16e 100644 |
| --- a/README.md |
| +++ b/README.md |
| @@ -216,11 +216,11 @@ recorded here instead (Fable's rulings on oficina/alta #1): |
| pair Paul sets by hand (see Profiles). |
| - **§11, Help**: the account menu has no Help items yet (no Colophon page). |
| -## Adopting the six existing apps (`alta-adopt`) |
| +## Adopting the existing apps (`alta-adopt`) |
| `alta-adopt` is a second binary, run on Paul's machine and never deployed. |
| -It joins the seven canonical apps (docs, sheets, slides, calendar, calls, |
| -memoria, equipo at `https://<app>.oficina.works`) to a Home directory team |
| +It joins the eight canonical apps (docs, sheets, slides, calendar, calls, |
| +memoria, equipo, base at `https://<app>.oficina.works`) to a Home directory team |
| labelled `oficina`, named "Oficina", so oficina-connect can route an |
| assistant's calls to them. On CARLOS it writes two keys per app, |
| `<P>_AGENT_ISSUER = https://connect.oficina.works` and |
| @@ -236,6 +236,12 @@ For adding Equipo to the already adopted `oficina` team, use |
| Alta does not yet offer a recipe for new Equipo instances. Its app-side |
| adoption contract must be deployed before `configure`. |
| +Base joins the same way, adoption-only, by |
| +[the Base rollout](docs/base-adoption.md). Its operations door already |
| +answers agent-access's challenge before adoption, so its delivery check |
| +holds that door instead of watching it move (Paul approved the rule |
| +2026-11-23). |
| + |
| ### Before the first run |
| The shared production keyset comes first, before the CARLOS credential |
| @@ -318,7 +324,8 @@ run it again if it stops (`status` shows where every run is). |
| would go to. `artifact-mismatch` means the app is not serving the |
| release reviewed in `artifacts`. `operations-<shape>` means its |
| `/api/v1/operations` does not answer as it should before adoption: a |
| - 404, or for Slides, Calls and Equipo their own 401. |
| + 404, for Slides, Calls and Equipo their own 401, or for Base its own |
| + agent-shaped 401. |
| 5. **Initialize.** Run `alta-adopt initialize --apply` and type the |
| attestation. Confirm on |
| [https://oficina.works/operator/confirm](https://oficina.works/operator/confirm) |
diff --git a/adopt/base_test.go b/adopt/base_test.go| new file mode 100644 |
| index 0000000..0bbe91c |
| --- /dev/null |
| +++ b/adopt/base_test.go |
| @@ -0,0 +1,156 @@ |
| +package adopt |
| + |
| +import ( |
| + "net/http" |
| + "testing" |
| + |
| + "amadan.net/oficina/alta/provision" |
| +) |
| + |
| +// baseOps401 is Base's own operations door answering a request with no |
| +// host token, byte for byte as carlos/base 3f8e6d1 writes it |
| +// (internal/operations/operations.go serve and fail): Base serves |
| +// Equipo's Assistant there in agent-access's shapes, before any adoption. |
| +func baseOps401(w http.ResponseWriter) { |
| + w.Header().Set("Cache-Control", "no-store") |
| + w.Header().Set("WWW-Authenticate", "Bearer") |
| + w.Header().Set("Content-Type", "application/json") |
| + w.WriteHeader(http.StatusUnauthorized) |
| + _, _ = w.Write([]byte("{\"error\":{\"code\":\"unauthenticated\",\"message\":\"Base did not accept this token.\"}}\n")) |
| +} |
| + |
| +// Base's door already gives agent-access's challenge, so the strict |
| +// classifier cannot tell it from agent-access. That is why Base's |
| +// baseline is agent-401 and not a 404 or an app 401. |
| +func TestBaseDoorIsAgentShapedBeforeAdoption(t *testing.T) { |
| + if got := probeOf(t, &site{version: "v1", header: "v1", health: 200, ops: baseOps401}).Ops; got != OpsAgent401 { |
| + t.Fatalf("Base's own door classified %q", got) |
| + } |
| +} |
| + |
| +// The held-door rule (Paul approved, 2026-11-23, docs/base-adoption.md): |
| +// Base's door answers agent-access's challenge before configure and must |
| +// still answer it, and only it, after the restart. Every other move is |
| +// refused, an unauthenticated 200 included. |
| +func TestBaseAdoptionDelivery(t *testing.T) { |
| + app, ok := provision.AppBySlug("base") |
| + if !ok { |
| + t.Fatal("Base missing") |
| + } |
| + if AgentKeys(app) != ([2]string{"BASE_AGENT_ISSUER", "BASE_AGENT_TEAM"}) { |
| + t.Fatal("wrong Base agent keys") |
| + } |
| + if BaselineOps(app) != OpsAgent401 { |
| + t.Fatal("Base's baseline is its own door's agent-shaped 401") |
| + } |
| + before := Delivery{Version: "v1.0.0", Header: "v1.0.0", Health: 200, Ops: OpsAgent401} |
| + after := before |
| + if err := Delivered(app, before, after); err != nil { |
| + t.Fatalf("held door refused: %v", err) |
| + } |
| + for _, shape := range []OpsShape{OpsApp401, OpsAbsent, OpsAgent200, OpsOther} { |
| + after.Ops = shape |
| + if Delivered(app, before, after) == nil { |
| + t.Fatalf("Base delivered with %s", shape) |
| + } |
| + } |
| + for _, shape := range []OpsShape{OpsApp401, OpsAbsent, OpsAgent200, OpsOther, ""} { |
| + before.Ops = shape |
| + if Delivered(app, before, Delivery{Version: "v1.0.0", Header: "v1.0.0", Health: 200, Ops: OpsAgent401}) == nil { |
| + t.Fatalf("Base delivered from a %q baseline", shape) |
| + } |
| + } |
| + // The rest of the check is not relaxed for Base. |
| + held := Delivery{Version: "v1.0.0", Header: "v1.0.0", Health: 200, Ops: OpsAgent401} |
| + for name, now := range map[string]Delivery{ |
| + "version": {Version: "v1.0.1", Header: "v1.0.0", Health: 200, Ops: OpsAgent401}, |
| + "header": {Version: "v1.0.0", Header: "v1.0.1", Health: 200, Ops: OpsAgent401}, |
| + "health": {Version: "v1.0.0", Header: "v1.0.0", Health: 503, Ops: OpsAgent401}, |
| + "redirect": {Version: "v1.0.0", Header: "v1.0.0", Health: 200, Ops: OpsAgent401, Redirected: true}, |
| + } { |
| + if Delivered(app, held, now) == nil { |
| + t.Fatalf("Base delivered with a changed %s", name) |
| + } |
| + } |
| + // A rollback restart holds the same door, as for every app. |
| + if err := Reverted(held, held); err != nil { |
| + t.Fatalf("Base rollback refused: %v", err) |
| + } |
| +} |
| + |
| +// Preflight admits Base only with its door giving agent-access's |
| +// challenge: a 404 or an app 401 means the canonical host is not serving |
| +// the Base release whose door the held rule describes. |
| +func TestPreflightHoldsBaseToItsDoor(t *testing.T) { |
| + for _, c := range []struct { |
| + ops func(w http.ResponseWriter) |
| + want string |
| + }{ |
| + {baseOps401, ""}, |
| + {agent401, ""}, |
| + {nil, "operations-absent"}, |
| + {app401, "operations-app-401"}, |
| + {agent200(`{"operations":[]}`), "operations-agent-200"}, |
| + } { |
| + x := newCarlosFixture(t, "base") |
| + x.site.ops = c.ops |
| + _, codes := x.preflight(t, nil) |
| + if c.want == "" { |
| + wantCodes(t, codes) |
| + continue |
| + } |
| + wantCodes(t, codes, c.want) |
| + } |
| + // On a resume, with both agent keys the journal's own, the exemption |
| + // for a door that has moved does not apply: Base's door never moves, |
| + // so it must still give the challenge, never a 200 without a token. |
| + keys := AgentKeys(appNamed(t, "base")) |
| + mine := map[string]string{keys[0]: Issuer, keys[1]: fixtureSQID} |
| + for _, c := range []struct { |
| + ops func(w http.ResponseWriter) |
| + want string |
| + }{ |
| + {baseOps401, ""}, |
| + {agent200(`{"operations":[]}`), "operations-agent-200"}, |
| + {nil, "operations-absent"}, |
| + } { |
| + x := newCarlosFixture(t, "base") |
| + for k, v := range mine { |
| + x.f.SetVar("base", "", k, v) |
| + } |
| + x.site.ops = c.ops |
| + _, codes := x.preflight(t, mine) |
| + if c.want == "" { |
| + wantCodes(t, codes) |
| + continue |
| + } |
| + wantCodes(t, codes, c.want) |
| + } |
| +} |
| + |
| +// The runner's whole delivery check records for Base with its door |
| +// held, and refuses when the door stops answering as it did. |
| +func TestCheckDeliveryRecordsBaseWithItsDoorHeld(t *testing.T) { |
| + w := newCheckFixture(t, "base") |
| + w.site.ops = baseOps401 |
| + if err := w.check(); err != nil { |
| + t.Fatalf("Base check refused: %v", err) |
| + } |
| + if _, ok, err := w.s.DeliveryCheck(t.Context(), "base"); err != nil || !ok { |
| + t.Fatalf("no check recorded (ok %v, err %v)", ok, err) |
| + } |
| + for name, ops := range map[string]func(http.ResponseWriter){ |
| + "absent": nil, |
| + "app-401": app401, |
| + "open": agent200(`{"operations":[]}`), |
| + "503": respond(http.StatusServiceUnavailable, map[string]string{"Cache-Control": "no-store", "Content-Type": "application/json"}, `{"error":{"code":"unavailable","message":"Base could not answer. Try again."}}`), |
| + "redirect": respond(http.StatusFound, map[string]string{"Location": "/signin"}, ""), |
| + } { |
| + w := newCheckFixture(t, "base") |
| + w.site.ops = ops |
| + if err := w.check(); err == nil { |
| + t.Fatalf("Base check recorded with its door %s", name) |
| + } |
| + w.noCheck(t) |
| + } |
| +} |
diff --git a/adopt/delivery.go b/adopt/delivery.go| index 7d16101..2a333a5 100644 |
| --- a/adopt/delivery.go |
| +++ b/adopt/delivery.go |
| @@ -21,7 +21,8 @@ import ( |
| // (an app middleware with a non-agent error body), so a bare 401 proves |
| // nothing: only agent-access's own answer counts, in exactly the shape |
| // agent-access writes it (agent-access f08bfc1, http.go Authenticate, |
| -// writeFailure and writeJSON). |
| +// writeFailure and writeJSON). Base's own door, which serves Equipo's |
| +// Assistant on a Base host token, already writes that exact shape. |
| type OpsShape string |
| const ( |
| @@ -36,10 +37,19 @@ const ( |
| // (Paul, 2026-11-17, Home discussion 103): Slides, Calls and Equipo their own |
| // middleware's 401, every other app a 404. Preflight refuses any other |
| // baseline, and Delivered holds each app to its own transition. |
| +// |
| +// Base is the one held door (Paul approved, 2026-11-23, |
| +// docs/base-adoption.md): its /api/v1/operations is already agent-shaped |
| +// before adoption (carlos/base internal/operations: a Bearer challenge, |
| +// no-store, error.code unauthenticated), and Base reads neither agent key, |
| +// so no restart can move it. Its baseline is agent-401 and Delivered |
| +// requires agent-401 still, never a 200 without a token. |
| func BaselineOps(app provision.App) OpsShape { |
| switch app.Slug { |
| case "slides", "calls", "equipo": |
| return OpsApp401 |
| + case "base": |
| + return OpsAgent401 |
| } |
| return OpsAbsent |
| } |
| @@ -251,8 +261,9 @@ func sameServing(before, now Delivery) error { |
| // version and header, no redirect, health 200, and the operations door |
| // moved as app's must (Paul, 2026-11-17). Before, it answered as |
| // BaselineOps(app) says; now, a 404 must have become agent-401 or |
| -// agent-200, and Slides' and Calls' own 401 must have become agent-401, |
| -// agent-access's challenge. |
| +// agent-200, Slides', Calls' and Equipo's own 401 must have become |
| +// agent-401, agent-access's challenge, and Base's agent-401 must still be |
| +// agent-401 (the held door: for Base this proves no delivery of the keys). |
| func Delivered(app provision.App, before, now Delivery) error { |
| if err := sameServing(before, now); err != nil { |
| return err |
| @@ -262,7 +273,8 @@ func Delivered(app provision.App, before, now Delivery) error { |
| // opsMoved is Delivered's operations-door rule: the door answered before |
| // as BaselineOps(app) says, and now gives agent-access's own answer as |
| -// app's must. |
| +// app's must. A 200 counts only from a 404, so Base's held door (an |
| +// agent-401 baseline) passes only as agent-401. |
| func opsMoved(app provision.App, before, now Delivery) error { |
| if before.Ops != BaselineOps(app) { |
| return errors.New("adopt: the operations door did not answer before the change as this app's does") |
diff --git a/adopt/delivery_test.go b/adopt/delivery_test.go| index 3753933..18f2114 100644 |
| --- a/adopt/delivery_test.go |
| +++ b/adopt/delivery_test.go |
| @@ -324,24 +324,32 @@ func TestDeliveredRefusesVersionOrHeaderChange(t *testing.T) { |
| } |
| // The operations door must move as the app's must (Paul, 2026-11-17): for |
| -// four apps a 404 to agent-access's challenge or list, for Slides and |
| -// Calls their own 401 to agent-access's challenge, and nothing else. |
| +// four apps a 404 to agent-access's challenge or list, for Slides, Calls |
| +// and Equipo their own 401 to agent-access's challenge, for Base its own |
| +// agent-shaped 401 held (approved 2026-11-23, docs/base-adoption.md), and nothing else. |
| func TestDeliveredHoldsEachAppToItsTransition(t *testing.T) { |
| d := func(ops OpsShape) Delivery { return dl("v1", "v1", 200, ops) } |
| for _, a := range provision.Apps { |
| t.Run(a.Slug, func(t *testing.T) { |
| var good, bad [][2]OpsShape |
| - if a.Slug == "slides" || a.Slug == "calls" || a.Slug == "equipo" { |
| + switch a.Slug { |
| + case "base": |
| + good = [][2]OpsShape{{OpsAgent401, OpsAgent401}} |
| + bad = [][2]OpsShape{{OpsAgent401, OpsAgent200}, {OpsAgent401, OpsOther}, {OpsAgent401, OpsApp401}, |
| + {OpsAgent401, OpsAbsent}, {OpsAbsent, OpsAgent401}, {OpsApp401, OpsAgent401}} |
| + case "slides", "calls", "equipo": |
| good = [][2]OpsShape{{OpsApp401, OpsAgent401}} |
| bad = [][2]OpsShape{{OpsApp401, OpsAgent200}, {OpsApp401, OpsOther}, {OpsApp401, OpsApp401}, |
| {OpsAbsent, OpsAgent401}, {OpsAbsent, OpsAgent200}} |
| - } else { |
| + default: |
| good = [][2]OpsShape{{OpsAbsent, OpsAgent401}, {OpsAbsent, OpsAgent200}} |
| bad = [][2]OpsShape{{OpsAbsent, OpsOther}, {OpsAbsent, OpsApp401}, {OpsAbsent, OpsAbsent}, |
| {OpsApp401, OpsAgent401}, {OpsApp401, OpsAgent200}} |
| } |
| for _, before := range []OpsShape{OpsOther, OpsAgent200, OpsAgent401, ""} { |
| - bad = append(bad, [2]OpsShape{before, OpsAgent401}) |
| + if before != BaselineOps(a) { |
| + bad = append(bad, [2]OpsShape{before, OpsAgent401}) |
| + } |
| } |
| for _, c := range good { |
| if err := Delivered(a, d(c[0]), d(c[1])); err != nil { |
| @@ -360,8 +368,11 @@ func TestDeliveredHoldsEachAppToItsTransition(t *testing.T) { |
| func TestBaselineOps(t *testing.T) { |
| for _, a := range provision.Apps { |
| want := OpsAbsent |
| - if a.Slug == "slides" || a.Slug == "calls" || a.Slug == "equipo" { |
| + switch a.Slug { |
| + case "slides", "calls", "equipo": |
| want = OpsApp401 |
| + case "base": |
| + want = OpsAgent401 |
| } |
| if got := BaselineOps(a); got != want { |
| t.Fatalf("%s: %q, want %q", a.Slug, got, want) |
diff --git a/adopt/deliverycheck.go b/adopt/deliverycheck.go| index b151749..7591d20 100644 |
| --- a/adopt/deliverycheck.go |
| +++ b/adopt/deliverycheck.go |
| @@ -30,7 +30,8 @@ import ( |
| // (check-not-delivered): the canonical HTTPS /api/version body and |
| // X-Carlos-Version unchanged, no redirect, /healthz 200, and GET |
| // /api/v1/operations moved as the app's must: a 404 to agent-access's |
| -// challenge or list, Slides' and Calls' own 401 to its challenge; |
| +// challenge or list, Slides', Calls' and Equipo's own 401 to its |
| +// challenge, Base's challenge held (BaselineOps); |
| // - the served release, X-Carlos-Version, hashes to artifact |
| // (check-artifact-mismatch); |
| // - the fresh identity equals the after snapshot's |
diff --git a/adopt/homeidentity_test.go b/adopt/homeidentity_test.go| index 8d30b9a..c4ed04b 100644 |
| --- a/adopt/homeidentity_test.go |
| +++ b/adopt/homeidentity_test.go |
| @@ -37,7 +37,7 @@ func secretHome(x *carlosFixture) { |
| // The adoption tuple's consumer is the bare slug for each of the six apps. |
| func TestAdoptionConsumerIsTheBareSlug(t *testing.T) { |
| - want := []string{"docs", "sheets", "slides", "calendar", "calls", "memoria", "equipo"} |
| + want := []string{"docs", "sheets", "slides", "calendar", "calls", "memoria", "equipo", "base"} |
| if len(provision.Apps) != len(want) { |
| t.Fatalf("%d apps", len(provision.Apps)) |
| } |
diff --git a/adopt/rehearsal_test.go b/adopt/rehearsal_test.go| index 51403ec..83e0077 100644 |
| --- a/adopt/rehearsal_test.go |
| +++ b/adopt/rehearsal_test.go |
| @@ -262,6 +262,8 @@ func (r *rehearsal) site(w http.ResponseWriter, req *http.Request) { |
| agent401(w) |
| case BaselineOps(a) == OpsApp401: |
| app401(w) |
| + case BaselineOps(a) == OpsAgent401: |
| + baseOps401(w) // Base's own door, held through adoption |
| default: |
| http.NotFound(w, req) |
| } |
diff --git a/adopt/snapshot.go b/adopt/snapshot.go| index 802cab4..cf037fe 100644 |
| --- a/adopt/snapshot.go |
| +++ b/adopt/snapshot.go |
| @@ -314,7 +314,8 @@ func inherits(eff carlosop.Effective, writeLayer string, keys [2]string) bool { |
| // BaselineOps(app) says, or, on a resume, both agent keys are the |
| // journal's own (as above) and the door gives agent-access's answer: |
| // a baseline Delivered could never move on is refused before it is |
| -// journalled. |
| +// journalled. The resume exemption never applies to a held door |
| +// (Base's): it must still give the challenge, never a 200. |
| // |
| // An error is a read that failed; it is not a refusal to guess past. |
| func Preflight(ctx context.Context, c *carlosop.Client, h *http.Client, app provision.App, mine map[string]string) (Snapshot, []string, error) { |
| @@ -370,7 +371,10 @@ func Preflight(ctx context.Context, c *carlosop.Client, h *http.Client, app prov |
| if d.Health != http.StatusOK { |
| add("healthz") |
| } |
| - if d.Ops != BaselineOps(app) && !(bothOurs && d.Ops.agentShaped()) { |
| + // The resume exemption is for a door that moves. A held door (Base's |
| + // agent-401 baseline) never moves, so it must still answer as before. |
| + moved := bothOurs && d.Ops.agentShaped() && !BaselineOps(app).agentShaped() |
| + if d.Ops != BaselineOps(app) && !moved { |
| add("operations-" + string(d.Ops)) |
| } |
| return snap, sortedSet(codes), nil |
diff --git a/adopt/snapshot_test.go b/adopt/snapshot_test.go| index 2a1c469..2223d0a 100644 |
| --- a/adopt/snapshot_test.go |
| +++ b/adopt/snapshot_test.go |
| @@ -83,8 +83,11 @@ func newCarlosFixture(t *testing.T, slug string) *carlosFixture { |
| t.Cleanup(c.Close) |
| s := &site{version: valueVersion, header: valueVersion, health: 200} |
| - if BaselineOps(app) == OpsApp401 { |
| + switch BaselineOps(app) { |
| + case OpsApp401: |
| s.ops = app401 |
| + case OpsAgent401: |
| + s.ops = agent401 |
| } |
| srv := httptest.NewTLSServer(s.handler()) |
| t.Cleanup(srv.Close) |
diff --git a/cmd/alta-adopt/main_test.go b/cmd/alta-adopt/main_test.go| index 5c30b29..9315ae1 100644 |
| --- a/cmd/alta-adopt/main_test.go |
| +++ b/cmd/alta-adopt/main_test.go |
| @@ -204,10 +204,12 @@ func (r *rig) site(w http.ResponseWriter, req *http.Request) { |
| case "/healthz": |
| w.WriteHeader(http.StatusOK) |
| case "/api/v1/operations": |
| - if !r.serving(slug) { |
| - // Slides and Calls answer their own middleware's 401 before |
| - // adoption; the others have no such route. |
| - if a, _ := provision.AppBySlug(slug); adopt.BaselineOps(a) == adopt.OpsApp401 { |
| + // Base's own door already answers the challenge below, before |
| + // adoption and after it (the held door). |
| + if a, _ := provision.AppBySlug(slug); !r.serving(slug) && adopt.BaselineOps(a) != adopt.OpsAgent401 { |
| + // Slides, Calls and Equipo answer their own middleware's 401 |
| + // before adoption; the others have no such route. |
| + if adopt.BaselineOps(a) == adopt.OpsApp401 { |
| w.WriteHeader(http.StatusUnauthorized) |
| _, _ = io.WriteString(w, `{"error":"unauthorized"}`) |
| return |
diff --git a/docs/base-adoption.md b/docs/base-adoption.md| new file mode 100644 |
| index 0000000..6069a94 |
| --- /dev/null |
| +++ b/docs/base-adoption.md |
| @@ -0,0 +1,129 @@ |
| +# Add Base to the existing Oficina team |
| + |
| +Status: **approved by Paul, 2026-11-23** (relayed by the coordinating |
| +agent; oficina/alta discussion 5). Implementer: Claude Opus 5.5, |
| +2026-11-23. Authority: Paul's 2026-11-23 decision that Base production is |
| +`https://base.oficina.works`, so Base's native app finds it in team |
| +`oficina`'s directory. Home's matching change is `base-in-directory` |
| +(`9dd7fc0`, review #157). Nothing here was run against production. |
| + |
| +Base joins canonical adoption exactly as Equipo did |
| +([the Equipo rollout](equipo-adoption.md)), with one difference: its |
| +delivery check. That difference is the rule below, which Paul approved on |
| +2026-11-23. |
| + |
| +## The rule: Base's operations door is held, not moved |
| + |
| +**What the delivery check proves for the other seven apps.** `configure` |
| +writes `<P>_AGENT_ISSUER` and `<P>_AGENT_TEAM`, restarts the canonical host, |
| +and records a check only if the app now serves the same reviewed release, |
| +healthy, with its identity and configuration exactly the after snapshot's, |
| +**and** `GET /api/v1/operations` has moved from its baseline (a 404, or the |
| +app's own 401) to agent-access's challenge. agent-access mounts only when |
| +the app reads both keys, so that move is the evidence, in place of 522 |
| +Plan 2, that the running process holds the new keys. When Home then makes |
| +the directory row live, oficina-connect's delegated calls for the team |
| +reach an app that verifies them against connect. |
| + |
| +**Why Base cannot pass it.** Base's `/api/v1/operations` already answers |
| +agent-access's exact challenge (`WWW-Authenticate: Bearer`, `no-store`, |
| +`error.code = unauthenticated`): it is Base's own door for Equipo's |
| +Assistant, authenticated by a Base host token (carlos/base |
| +`internal/operations`, mounted outside the site middleware by |
| +`withOperations`). agent-access writes the same bare `Bearer`, so no |
| +unauthenticated probe can tell them apart. And Base reads neither |
| +`BASE_AGENT_ISSUER` nor `BASE_AGENT_TEAM`, so nothing could move anyway. |
| +Preflight would refuse Base with `operations-agent-401`. |
| + |
| +**The rule.** Base's baseline is agent-access's challenge, and the check |
| +requires the same challenge after the restart. Everything else in the |
| +check is unchanged. In code: `BaselineOps(base) = agent-401` |
| +(`adopt/delivery.go`); `Delivered` then admits only agent-401 to agent-401 |
| +for Base, and refuses a 404, an app 401, any other answer, and a 200 |
| +without a token. On a resume, preflight's exemption for a door that has |
| +already moved (both agent keys the journal's own) does not apply to Base: |
| +its door must still give the challenge. |
| + |
| +**What it keeps for Base.** The reviewed release, unchanged across the |
| +restart, with no redirect and `/healthz` 200; the instance, environment, |
| +storage and domain route unchanged; every other config key preserved and |
| +the config exactly the after snapshot's, with both agent keys stored as |
| +sent; Home identity (`BASE_HOME_ISSUER = https://id.oficina.works`, |
| +`BASE_HOME_CONSUMER_ID = base`); the door still closed to callers without a |
| +token. Preflight also refuses Base unless its door answers the challenge, |
| +so a host not serving Base's release is caught before anything is written. |
| +The check stays void on any later change, as for every app. |
| + |
| +**What it gives up for Base.** |
| + |
| +1. **No evidence that the process has the keys.** For Base this is moot: |
| + Base never reads them. They are written, but they do nothing. |
| +2. **No evidence that the restart happened.** The old process answers the |
| + same as the new one, so the first probe after the restart can pass. |
| + The same holds for `rollback-config`: `Reverted` waits for the door's |
| + baseline shape, which Base's door never left, so a rollback also |
| + completes on its first probe. Both matter only for item 1, which is |
| + moot. |
| +3. **No delegated access through connect.** Once Base's row is live, |
| + oficina-connect may route team `oficina`'s delegated calls to |
| + `https://base.oficina.works/api/v1`. Base refuses them with its 401, |
| + because it accepts only its own host tokens. It fails closed: nothing is |
| + exposed, and Equipo's Assistant keeps reaching Base on host tokens as |
| + today. What adoption buys Base is the directory listing that its native |
| + app needs. It does not give Base connect-routed assistants. |
| + |
| +If Base later reads the two keys (agent-access's remote verifier on its |
| +door), the keys already stored would take effect at that release. That |
| +release needs its own review and its own evidence. This check cannot |
| +supply that evidence, because the challenge looks the same. |
| + |
| +**Alternatives rejected.** |
| + |
| +- *A per-app probe path* (a new Base door that answers only once the keys |
| + are set). Base would have to build a door nobody calls, only so that Alta |
| + has something to watch. The Equipo contract rules that out ("a fake |
| + public list added only to satisfy Alta is not an integration"). It also |
| + needs a Base change. |
| +- *Base reads the keys and gates something on them.* The only meaningful |
| + gate is accepting connect's delegated bearer on its door: the real |
| + integration, mapping a Home person to a Base member. That restores item 3 |
| + in substance. But agent-access's challenge is the same bare `Bearer`, so |
| + the probe still sees no move. The evidence would need a new, configured- |
| + only signal in Base's or agent-access's challenge. That is a Base design |
| + change, and the right one only if Paul wants connect-routed assistants |
| + in Base. |
| +- *Skip `configure` for Base* (write no inert keys). Honest, but the |
| + activation gate, the observer and Home's signed `environment_binding` all |
| + require a write, an after snapshot and a recorded check. That is a larger |
| + change to a reviewed design. |
| +- *Make Base's own door answer an app 401 before adoption.* That breaks |
| + Equipo's Assistant, which reads Base's operations today. |
| + |
| +**Home's design must say the same.** `implementation/existing-team-adoption.md`, |
| +"Delivery evidence", lists each app's move. It needs one more sentence for |
| +Base, the held door, as Paul rules it. This branch changes Alta only. |
| + |
| +## Rollout differences from Equipo's |
| + |
| +Follow [the Equipo rollout](equipo-adoption.md) with `base` for `equipo` |
| +and `BASE_` for `EQUIPO_`, and Base's own runbook (carlos/base |
| +`.superpowers/sdd/2026-11-23-base-native/base-oficina-works-runbook.md`, |
| +steps 1-9) for the order. In particular: |
| + |
| +- Home `base-in-directory` is merged and deployed to **both** `oficina` and |
| + `oficina-id`. Alta's `homecompat` is re-pinned to Home's **merge commit** |
| + (it pins `9dd7fc0` on this branch), and `make ci` passes, before this |
| + branch merges. |
| +- Base serves `https://base.oficina.works`: domain attached, and |
| + `BASE_ORIGIN` and `HOME_CONSUMERS_BASE64`'s `base` entry moved together |
| + (the runbook's steps 2 and 4). `register-consumer` only verifies that entry. |
| +- Every Base env change (the runbook's steps 4 and 5) is made **before** |
| + `configure`, which captures the immutable baseline. |
| +- Expected preflight: `base: ready`, with Base's door answering its |
| + agent-shaped 401. `operations-absent` or `operations-app-401` means the |
| + host is not serving Base's release. |
| +- `configure --app base --apply` writes `BASE_AGENT_ISSUER` and |
| + `BASE_AGENT_TEAM`, restarts only the canonical Base host, and records the |
| + held-door check. Base ignores both keys. |
| +- A plan naming all eight canonical apps exactly fills Home's eight-app plan |
| + cap. A continuation plan names only the missing apps (`base`). |
diff --git a/homecompat/adopt_flow_test.go b/homecompat/adopt_flow_test.go| index 336e5c8..1ff6ecb 100644 |
| --- a/homecompat/adopt_flow_test.go |
| +++ b/homecompat/adopt_flow_test.go |
| @@ -36,6 +36,8 @@ var served = map[string]struct{ body, header string }{ |
| "memoria": {"v0.1.0-47-g174fb45", "174fb45"}, |
| // Synthetic supported Equipo release; production contract is a separate branch. |
| "equipo": {"v1.0.0", "v1.0.0"}, |
| + // Base's live release on 2026-11-23 (carlos/base main). |
| + "base": {"3f8e6d1", "3f8e6d1"}, |
| } |
| // observer stands in for the CARLOS half's activation gate: what it |
diff --git a/homecompat/adopt_test.go b/homecompat/adopt_test.go| index fb265f1..469aa95 100644 |
| --- a/homecompat/adopt_test.go |
| +++ b/homecompat/adopt_test.go |
| @@ -152,7 +152,7 @@ func TestHomeAcceptsAdoptionContinuation(t *testing.T) { |
| v := r.home.confirm(t, role, "") |
| // sheets' register and everything after it are missing (Home lists |
| // a plan's apps sorted). |
| - if v.Kind != homeop.KindAddApps || v.ExistingTeam != team.TeamSQID || strings.Join(v.Apps, ",") != "calendar,calls,equipo,memoria,sheets,slides" || v.OwnerIndex != "" { |
| + if v.Kind != homeop.KindAddApps || v.ExistingTeam != team.TeamSQID || strings.Join(v.Apps, ",") != "base,calendar,calls,equipo,memoria,sheets,slides" || v.OwnerIndex != "" { |
| t.Fatalf("%s continuation view: kind %s apps %v", role, v.Kind, v.Apps) |
| } |
| } |
diff --git a/homecompat/canonical_test.go b/homecompat/canonical_test.go| new file mode 100644 |
| index 0000000..22bbf7e |
| --- /dev/null |
| +++ b/homecompat/canonical_test.go |
| @@ -0,0 +1,32 @@ |
| +package altacompat |
| + |
| +import ( |
| + "testing" |
| + |
| + "amadan.net/oficina/alta/homeop" |
| + "amadan.net/oficina/alta/provision" |
| + "amadan.net/oficina/home/internal/home/directorydata" |
| +) |
| + |
| +// homeop.CanonicalOrigin is Alta's copy of Home's closed registry of |
| +// canonical instances. It must agree with Home's at the pinned commit for |
| +// every app Alta knows and for names neither may admit: an app Alta adopts |
| +// that Home does not bind is a plan Home refuses, and the reverse is an |
| +// app Alta would never offer. |
| +func TestCanonicalOriginIsHomes(t *testing.T) { |
| + // ReservedLabels holds every app-like name (each app's, the suite's |
| + // and the platform's own), so a name added to either registry that |
| + // the other lacks fails here. |
| + names := append(provision.Slugs(), "", "Base", "base.oficina.works", "https://base.oficina.works") |
| + for label := range provision.ReservedLabels { |
| + names = append(names, label) |
| + } |
| + for _, app := range names { |
| + if got, want := homeop.CanonicalOrigin(app), directorydata.CanonicalOrigin(app); got != want { |
| + t.Errorf("CanonicalOrigin(%q): Alta %q, Home %q", app, got, want) |
| + } |
| + } |
| + if homeop.CanonicalOrigin("base") != "https://base.oficina.works" { |
| + t.Fatal("Base's canonical origin") |
| + } |
| +} |
diff --git a/homecompat/compat_test.go b/homecompat/compat_test.go| index 9421fb2..6494280 100644 |
| --- a/homecompat/compat_test.go |
| +++ b/homecompat/compat_test.go |
| @@ -49,7 +49,7 @@ const ( |
| ) |
| var apps = []string{"docs", "sheets", "slides", "calendar", "calls", "memoria"} |
| -var adoptionApps = append(append([]string(nil), apps...), "equipo") |
| +var adoptionApps = append(append([]string(nil), apps...), "equipo", "base") |
| type home struct { |
| now time.Time |
diff --git a/homecompat/go.mod b/homecompat/go.mod| index e3b9f24..0a1fcb0 100644 |
| --- a/homecompat/go.mod |
| +++ b/homecompat/go.mod |
| @@ -11,9 +11,9 @@ toolchain go1.26.5 |
| require ( |
| amadan.net/oficina/alta v0.0.0 |
| - amadan.net/oficina/home v0.1.1-0.20261120144520-0a91dbee81b4 |
| - amadan.net/oficina/home/handoff v0.0.0-20261120144520-0a91dbee81b4 |
| - amadan.net/oficina/home/roster v0.0.0-20261120144520-0a91dbee81b4 |
| + amadan.net/oficina/home v0.1.1-0.20261123215544-b4e00f18d5dd |
| + amadan.net/oficina/home/handoff v0.0.0-20261123215544-b4e00f18d5dd |
| + amadan.net/oficina/home/roster v0.0.0-20261123215544-b4e00f18d5dd |
| amadan.net/rastrillo/rastrillo v0.38.0 |
| ) |
diff --git a/homecompat/go.sum b/homecompat/go.sum| index f7dfeab..cea1746 100644 |
| --- a/homecompat/go.sum |
| +++ b/homecompat/go.sum |
| @@ -1,13 +1,13 @@ |
| amadan.net/carlos/platform.git/launchctx v0.0.0-20260911135504-fb577f96f7d1 h1:RxwIRojWcVtwSdNAjtdz7y1bxHLh3GUgqT1TrXVKpyM= |
| amadan.net/carlos/platform.git/launchctx v0.0.0-20260911135504-fb577f96f7d1/go.mod h1:6fBmMWgtESLFXZURzu/HyRXM0vyLuo4+XGGdKuZ+wao= |
| -amadan.net/oficina/home v0.1.1-0.20261120144520-0a91dbee81b4 h1:xpLleaJG/umCMsSpWyODojGPwYULiTsO/tuncxeRTZk= |
| -amadan.net/oficina/home v0.1.1-0.20261120144520-0a91dbee81b4/go.mod h1:BLttgK8HEPzRBX+to6ge6IN9k8RkLcTYofjFpuPzXnc= |
| -amadan.net/oficina/home/handoff v0.0.0-20261120144520-0a91dbee81b4 h1:vr1Z7uGKrKoU+WlSfQ7KrenUXiXPOCAXQ6OAZK0kWgI= |
| -amadan.net/oficina/home/handoff v0.0.0-20261120144520-0a91dbee81b4/go.mod h1:Mn5Rsm7Vcd6VZArBKMawza2yO+Fjo8KB1Ii6UcjcJHQ= |
| -amadan.net/oficina/home/roster v0.0.0-20261120144520-0a91dbee81b4 h1:89BUkdyiNA6jzDMpmrzuwD/6zo2qgLn8BKP6/w02Cjk= |
| -amadan.net/oficina/home/roster v0.0.0-20261120144520-0a91dbee81b4/go.mod h1:xmSzAVbHHfLcuQO7QnvwuXOQe4rCrA1xRyNIBiHTBqw= |
| -amadan.net/rastrillo/fiesta v1.5.0 h1:wKfTsL5zRMofJBAqOxNlCY7aCtgHCtfwvTPBMA+ZA20= |
| -amadan.net/rastrillo/fiesta v1.5.0/go.mod h1:LpO391W1dIRUxOIKklHm+bGyWXtlFyBRRPQCysb9LjY= |
| +amadan.net/oficina/home v0.1.1-0.20261123215544-b4e00f18d5dd h1:ccfcD2sfvxV3UNKsyHHS+FWR1bwF9bshpEc0kkvDcFw= |
| +amadan.net/oficina/home v0.1.1-0.20261123215544-b4e00f18d5dd/go.mod h1:cQRud+PB1eu8PjY4xV0XlyNph9TYh5lJV4YAEc+8qik= |
| +amadan.net/oficina/home/handoff v0.0.0-20261123215544-b4e00f18d5dd h1:YX2Hfrg2gcfQ0uFBmNuJVV3Pzt5dHWpCqGDYNXxoYVM= |
| +amadan.net/oficina/home/handoff v0.0.0-20261123215544-b4e00f18d5dd/go.mod h1:Mn5Rsm7Vcd6VZArBKMawza2yO+Fjo8KB1Ii6UcjcJHQ= |
| +amadan.net/oficina/home/roster v0.0.0-20261123215544-b4e00f18d5dd h1:ViPh8dyt+buT8by6Qt7xQbxWpm9Vkz9RP1/X5nxMRX8= |
| +amadan.net/oficina/home/roster v0.0.0-20261123215544-b4e00f18d5dd/go.mod h1:xmSzAVbHHfLcuQO7QnvwuXOQe4rCrA1xRyNIBiHTBqw= |
| +amadan.net/rastrillo/fiesta v1.6.0 h1:ntdiZ/rvKd8wVxnlwkbaB8n0Fop9tIFL7bgJ3MUN3E4= |
| +amadan.net/rastrillo/fiesta v1.6.0/go.mod h1:LpO391W1dIRUxOIKklHm+bGyWXtlFyBRRPQCysb9LjY= |
| amadan.net/rastrillo/rastrillo v0.38.0 h1:q8aPnVtKt4q+uNjfxBRCTizhVvj+HdjDJh1MhlkBPOc= |
| amadan.net/rastrillo/rastrillo v0.38.0/go.mod h1:0bufVMz8D4aWvxvJjehW70T8Jsvytrp1YEwoIzFTKm8= |
| amadan.net/rastrillo/rastrillo/money v0.1.0 h1:MxU4oqNrW8abxRTkgZBv24OYNpFnvonajNqeLIzmmaM= |
diff --git a/homeop/fakehome/fakehome.go b/homeop/fakehome/fakehome.go| index fb600c7..0f47a00 100644 |
| --- a/homeop/fakehome/fakehome.go |
| +++ b/homeop/fakehome/fakehome.go |
| @@ -38,7 +38,7 @@ import ( |
| // observedVersion is Home's app_version rule (0cee9ba). |
| var observedVersion = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$`) |
| -var registry = []string{"docs", "sheets", "slides", "calendar", "calls", "memoria", "equipo"} |
| +var registry = []string{"docs", "sheets", "slides", "calendar", "calls", "memoria", "equipo", "base"} |
| type plan struct { |
| id, kind, label, name, owner string |
diff --git a/homeop/protocol.go b/homeop/protocol.go| index 1636183..ad60ee3 100644 |
| --- a/homeop/protocol.go |
| +++ b/homeop/protocol.go |
| @@ -161,7 +161,7 @@ type Plan struct { |
| // needs it too. homecompat pins it against Home's own. |
| func CanonicalOrigin(app string) string { |
| switch app { |
| - case "docs", "sheets", "slides", "memoria", "calendar", "calls", "equipo": |
| + case "docs", "sheets", "slides", "memoria", "calendar", "calls", "equipo", "base": |
| return "https://" + app + ".oficina.works" |
| } |
| return "" |
diff --git a/provision/adopt_test.go b/provision/adopt_test.go| index 211f258..675fa4d 100644 |
| --- a/provision/adopt_test.go |
| +++ b/provision/adopt_test.go |
| @@ -954,7 +954,7 @@ func TestAdoptionContinuesAfterTheWindowCloses(t *testing.T) { |
| if r, _ := a.store.Run(a.ctx(), run); r.State != "superseded" { |
| t.Fatalf("stranded run %s", r.State) |
| } |
| - missing := "slides,calendar,calls,memoria,equipo" |
| + missing := "slides,calendar,calls,memoria,equipo,base" |
| if r, _ := a.store.Run(a.ctx(), next); !r.Adoption || r.Kind != homeop.KindCreateTeam || strings.Join(r.Apps, ",") != missing { |
| t.Fatalf("continuation run %+v", r) |
| } |
diff --git a/provision/apps.go b/provision/apps.go| index 3e6ae67..166bb39 100644 |
| --- a/provision/apps.go |
| +++ b/provision/apps.go |
| @@ -105,6 +105,7 @@ var Apps = []App{ |
| {Slug: "calls", Name: "Calls", Prefix: "CALLS", Roster: true, MailPrefixes: []string{"CALLS_SMTP", "CARLOS_SMTP"}, SubmitPrefix: "CARLOS_SMTP", Relay: true}, |
| {Slug: "memoria", Name: "Memoria", Prefix: "MEMORIA", Roster: true, MailPrefixes: []string{"CARLOS_SMTP"}, SubmitPrefix: "CARLOS_SMTP"}, |
| {Slug: "equipo", Name: "Equipo", Prefix: "EQUIPO", AdoptionOnly: true, MailPrefixes: []string{"CARLOS_SMTP"}, SubmitPrefix: "CARLOS_SMTP"}, |
| + {Slug: "base", Name: "Base", Prefix: "BASE", AdoptionOnly: true, MailPrefixes: []string{"CARLOS_SMTP"}, SubmitPrefix: "CARLOS_SMTP"}, |
| } |
| // ProvisioningApps are the apps with supported fresh-instance recipes. |
diff --git a/provision/base_test.go b/provision/base_test.go| new file mode 100644 |
| index 0000000..88dbde4 |
| --- /dev/null |
| +++ b/provision/base_test.go |
| @@ -0,0 +1,93 @@ |
| +package provision |
| + |
| +import ( |
| + "slices" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/alta/homeop" |
| +) |
| + |
| +// Base joins canonical adoption as Equipo did: adoption-only, env prefix |
| +// BASE (Base reads BASE_HOME_ISSUER and BASE_HOME_CONSUMER_ID), and the |
| +// label was already reserved. |
| +func TestBaseAdoptionRegistry(t *testing.T) { |
| + app, ok := AppBySlug("base") |
| + if !ok || app.Prefix != "BASE" || app.Name != "Base" || !app.AdoptionOnly || app.Roster { |
| + t.Fatalf("Base registry: %+v %v", app, ok) |
| + } |
| + for _, a := range ProvisioningApps() { |
| + if a.Slug == "base" { |
| + t.Fatal("Base advertised for fresh provisioning") |
| + } |
| + } |
| + if !ReservedLabels["base"] { |
| + t.Fatal("Base label is not reserved") |
| + } |
| + if homeop.CanonicalOrigin("base") != "https://base.oficina.works" || !slices.Equal(SortApps([]string{"base"}), []string{"base"}) { |
| + t.Fatal("Base adoption mapping missing") |
| + } |
| +} |
| + |
| +// A completed seven-app adoption is extended without reseeding the team or |
| +// touching existing registrations. Both Home confirmations remain required. |
| +func TestBaseJoinsExistingAdoption(t *testing.T) { |
| + saved := Apps |
| + t.Cleanup(func() { Apps = saved }) |
| + Apps = slices.DeleteFunc(slices.Clone(saved), func(a App) bool { return a.Slug == "base" }) |
| + a := newAdoption(t) |
| + e := a.adopter(nil, newObserver()) |
| + a.planA(e) |
| + oldTeam, _ := a.store.Team(a.ctx(), AdoptionLabel) |
| + Apps = saved |
| + a.home.AddEnvConsumer("base", "https://base.oficina.works") |
| + a.tick(homeop.WindowLifetime * time.Second) |
| + run, err := e.ContinueAdoption(a.ctx()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + r, _ := a.store.Run(a.ctx(), run) |
| + if !slices.Equal(r.Apps, []string{"base"}) { |
| + t.Fatalf("continuation: %v", r.Apps) |
| + } |
| + for role, p := range a.plans(run) { |
| + if p.Kind != homeop.KindAddApps || p.ExistingTeam != oldTeam.TeamSQID || !slices.Equal(p.Apps, []string{"base"}) { |
| + t.Fatalf("%s plan: %+v", role, p) |
| + } |
| + } |
| + a.confirm(homeop.KindAddApps) |
| + if r := a.drive(e, run, 10); r.State != "done" || r.Code != "awaiting-configuration" { |
| + t.Fatalf("registration: %s %s", r.State, r.Code) |
| + } |
| + team, _ := a.store.Team(a.ctx(), AdoptionLabel) |
| + if team.Apps["base"] != "active" { |
| + t.Fatal("Base missing from existing local team") |
| + } |
| + var environments int |
| + if err := a.store.DB().QueryRow("SELECT count(*) FROM environments").Scan(&environments); err != nil || environments != 0 { |
| + t.Fatalf("adoption reserved environments: %d %v", environments, err) |
| + } |
| + if a.home.InstanceState("base") != "pending" { |
| + t.Fatal("Base must stay pending before activation") |
| + } |
| + run = a.activate(e, "base") |
| + if r := a.drive(e, run, 10); r.State != "done" || a.home.InstanceState("base") != "live" { |
| + t.Fatalf("activation: %s %s", r.State, r.Code) |
| + } |
| + if a.home.TeamCount() != 1 || a.home.ConsumerCount() != 0 || a.home.Calls[homeop.DirectorySeedTeam] != 1 || a.home.Calls[homeop.CredentialOwnerSeed] != 1 || a.net.count() != 0 { |
| + t.Fatal("adoption changed existing team, registry, or instances") |
| + } |
| +} |
| + |
| +func TestBaseCannotProvisionFreshInstances(t *testing.T) { |
| + h := newHarness(t) |
| + h.initialized() |
| + e := h.engine(nil) |
| + _, err := e.CreateTeam(h.ctx(), NewTeam{Label: "new-team", Name: "New", Owner: ownerCanary, Apps: []string{"docs", "base"}}) |
| + failCode(t, err, "unknown-app") |
| + if err := h.store.CreateTeam(h.ctx(), "existing", "Existing", "existing", false, ownerCanary, []string{"docs"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + _, err = e.AddApps(h.ctx(), "existing", []string{"base"}, RunOptions{}) |
| + failCode(t, err, "unknown-app") |
| +} |