oficina / home Public

List live Base instances in the native directory

Human

Prompt

Paul has decided that Base production goes at https://base.oficina.works, so Base's native app can find it in team `oficina`'s Oficina directory. Add Base to the native directory exactly as Equipo was added in 0a91dbe (merged as fd6edc2): nativeTeamApps gets "base"; directoryApps gets {slug: "base", name: "Base", integrated: true}; directorydata.CanonicalOrigin("base") is "https://base.oficina.works"; the tests and implementation notes that change with it. Check whether anything else keys off that list (app chooser, Alta's adoption verbs, team-provisioning records, consumers) and include what's needed for Base to be adoptable.

From this commit's own message. The prompt ledger has no entries for it — which is what a squashed, rebased or amended commit looks like, and what every commit looks like in a repo without a ledger.

Summary

Base joins Home's native directory and canonical adoption, as Equipo did (0a91dbe, 3d1bc36): nativeTeamApps and directoryApps gain base, and CanonicalOrigin("base") is https://base.oficina.works. That also mounts the /apps/base web chooser and lets an existing-team adoption plan name base for team oficina (operator plan validity and routeScope key off CanonicalOrigin). Tests first: routes, live membership, chooser, registry count, assertion origins, and an adoption plan for base alone and with all eight apps; Base's CARLOS host is never a canonical route. Spec §9 and existing-team-adoption.md counts move to seven native / eight canonical; implementation/base-native-validation.md records it.
Agent notes
Nothing else keys off the list for Base: the static catalog tiles (directory_catalog.go) and HOME_APP_PREVIEW_ORIGINS have no Equipo either; the operator plan cap is len(Apps) <= 8, now exactly full with all canonical apps. Adoption cannot register Base's consumer: credential register-consumer under adoption requires base: https://base.oficina.works already in HOME_CONSUMERS (existing-team-adoption.md 'Credential register-consumer'). make test green with go1.26.5.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 9dd7fc0d3479709c67f28bf37a07d8482a37dc5f parent 4dba68e
10 files changed, +225 −10
  • docs/superpowers/specs/2026-11-14-oficina-id-native.md +1 −1
  • implementation/base-native-validation.md +29 −0
  • implementation/existing-team-adoption.md +8 −4
  • internal/home/app_chooser_test.go +1 −1
  • internal/home/base_native_test.go +145 −0
  • internal/home/directory_native.go +2 −2
  • internal/home/directory_runtime.go +1 −0
  • internal/home/directory_runtime_test.go +1 −1
  • internal/home/directorydata/canonical.go +1 −1
  • internal/operator/base_adoption_test.go +36 −0

CI passed — run details

CI log
amadan: .amadan/timeout: this job's budget is 20m0s (this runner allows up to 30m0s)
=== vet ===
CGO_ENABLED=0 go vet ./...
CGO_ENABLED=0 go vet -tags browser ./internal/home/
cd handoff && CGO_ENABLED=0 go vet ./...
cd roster && CGO_ENABLED=0 go vet ./...
cd dashboard && CGO_ENABLED=0 go vet ./...
cd connect && CGO_ENABLED=0 go vet ./...
cd teammode && CGO_ENABLED=0 go vet ./...
=== fmt ===
=== build ===
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ./cmd/home ./cmd/oficina ./internal/operatorlaunch
cd handoff && CGO_ENABLED=0 go build ./...
cd roster && CGO_ENABLED=0 go build ./...
cd dashboard && CGO_ENABLED=0 go build ./...
cd connect && CGO_ENABLED=0 go build ./...
cd teammode && CGO_ENABLED=0 go build ./...
=== go-test ===
CGO_ENABLED=0 go test -count=1 ./...
?   	amadan.net/oficina/home/cmd/home	[no test files]
ok  	amadan.net/oficina/home/cmd/home-placeholder	0.973s
?   	amadan.net/oficina/home/cmd/oficina	[no test files]
ok  	amadan.net/oficina/home/internal/guardstest	0.303s
ok  	amadan.net/oficina/home/internal/home	63.145s
ok  	amadan.net/oficina/home/internal/home/directorydata	1.412s
ok  	amadan.net/oficina/home/internal/home/logtest	0.007s
ok  	amadan.net/oficina/home/internal/home/seal	0.002s
ok  	amadan.net/oficina/home/internal/home/sealtest	0.003s
ok  	amadan.net/oficina/home/internal/home/wisp	0.047s
ok  	amadan.net/oficina/home/internal/operator	6.787s
ok  	amadan.net/oficina/home/internal/operatorlaunch	4.113s
ok  	amadan.net/oficina/home/internal/provisioner	51.982s
cd handoff && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/handoff	0.698s
ok  	amadan.net/oficina/home/handoff/seal	0.003s
cd roster && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/roster	5.124s
cd dashboard && CGO_ENABLED=0 go test ./...
ok  	amadan.net/oficina/home/dashboard	0.010s
cd connect && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/connect	1.459s
ok  	amadan.net/oficina/home/connect/linkstore	0.542s
cd teammode && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/teammode	0.128s
?   	amadan.net/oficina/home/teammode/teammodetest	[no test files]
=== race ===
go test -race -count=1 ./internal/home/ ./internal/operator/ ./internal/operatorlaunch/ ./internal/home/directorydata/
ok  	amadan.net/oficina/home/internal/home	361.801s
ok  	amadan.net/oficina/home/internal/operator	84.322s
ok  	amadan.net/oficina/home/internal/operatorlaunch	22.402s
ok  	amadan.net/oficina/home/internal/home/directorydata	23.959s
ok  	amadan.net/oficina/home/internal/provisioner	408.224s
cd handoff && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/handoff	13.072s
ok  	amadan.net/oficina/home/handoff/seal	1.015s
cd roster && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/roster	7.005s
cd dashboard && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/dashboard	1.064s
cd connect && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/connect	6.425s
ok  	amadan.net/oficina/home/connect/linkstore	6.508s
cd teammode && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/teammode	2.030s
?   	amadan.net/oficina/home/teammode/teammodetest	[no test files]
diff --git a/docs/superpowers/specs/2026-11-14-oficina-id-native.md b/docs/superpowers/specs/2026-11-14-oficina-id-native.md
index 6519ad4..8e0924c 100644
--- a/docs/superpowers/specs/2026-11-14-oficina-id-native.md
+++ b/docs/superpowers/specs/2026-11-14-oficina-id-native.md
@@ -157,7 +157,7 @@ The browser `Finish` keeps today's shape (`handoff/http.go` `Finish`: `Store.Fin
## 9. Teams, store, onboarding
-**Teams.** The directory is a consumer. The app gets a directory session through `NativeExchange`, then calls `GET https://oficina.works/api/native/teams` → `[{sqid, label, name, role, apps:[{app, origin, consumer_id}]}]`. The list comes from `Store.AgentChoices`, filtered to live instances of the six native apps (Equipo added by Paul’s approved 2026-11-20 Equipo native Oficina ID spec, part 3 / E4), and is `no-store`. Apps use the returned origin as given. They never use portero. The app refreshes at launch, on opening the menu (at most every 5 minutes), and on any 403. The team colour is derived on the device from `sqid`. **Zero teams (Paul's ruling H):** once Alta runs, the empty state offers "Create a team" through Alta. While Alta is blocked, slice A shows help text only. Slice A needs Paul's teams to exist first, through Alta or the operator path.
+**Teams.** The directory is a consumer. The app gets a directory session through `NativeExchange`, then calls `GET https://oficina.works/api/native/teams` → `[{sqid, label, name, role, apps:[{app, origin, consumer_id}]}]`. The list comes from `Store.AgentChoices`, filtered to live instances of the seven native apps (Equipo added by Paul’s approved 2026-11-20 Equipo native Oficina ID spec, part 3 / E4; Base by Paul’s 2026-11-23 ruling that Base production is https://base.oficina.works), and is `no-store`. Apps use the returned origin as given. They never use portero. The app refreshes at launch, on opening the menu (at most every 5 minutes), and on any 403. The team colour is derived on the device from `sqid`. **Zero teams (Paul's ruling H):** once Alta runs, the empty state offers "Create a team" through Alta. While Alta is blocked, slice A shows help text only. Slice A needs Paul's teams to exist first, through Alta or the operator path.
**Store (RastrilloApple).** Every record carries `v`. An older app reads what it understands, never rewrites a newer record, and asks for an update. **Shared keychain group:** each identity's record, key, token and **team cache**. Team names stay out of the Mac App Group because an unsandboxed app's group container is readable by any process running as the same user. **App Group** (`9U4A84C4WK.works.oficina` on Mac, `group.works.oficina` on iOS): identity order and the last-used (identity, team) only. **Each app's private keychain:** its sessions, keyed `(grant_id, origin)`.
diff --git a/implementation/base-native-validation.md b/implementation/base-native-validation.md
new file mode 100644
index 0000000..3a11730
--- /dev/null
+++ b/implementation/base-native-validation.md
@@ -0,0 +1,29 @@
+# Base in the native directory — validation, 2026-11-23
+
+Implementer: Claude Opus 5.5. Authority: Paul's 2026-11-23 ruling that
+Base production is https://base.oficina.works, so Base's native app finds it
+in team `oficina`'s directory. Follows Equipo's change (0a91dbe, 3d1bc36,
+merged fd6edc2) line for line.
+
+Tests were written first. Before implementation, `TestBaseDirectoryRoutes`
+failed on the missing integrated registry, both routes and the canonical
+origin; `TestNativeDirectoryBaseLiveMembership` returned an empty list;
+`TestNativeAppChoicesKeepTeamAndAppBoundaries/base` and the registry count
+failed; `TestBaseIsAdoptableIntoTeamOficina` refused an adoption plan naming
+`base`. As for Equipo, `TestNativeAssertBaseRegisteredOrigins` already
+passed: the exact-origin consumer policy needs no production change.
+
+The new tests cover canonical and team-host Base routes, exact app, origin
+and consumer output, pending/disabled/foreign-team exclusion, membership
+removal, the web chooser at /apps/base, assertion for registered origins
+only, and an adoption plan for `base` alone and with all eight canonical
+apps (the plan's eight-app cap is now exactly full). Base's CARLOS host,
+https://base.bds.oncarlos.com, is never a canonical route or adoption target.
+
+No schema, key, native assertion policy or credential registration changed.
+Adoption still cannot register a consumer: credential register-consumer
+under an adoption window requires `base: https://base.oficina.works` to be
+in HOME_CONSUMERS already. Base's own domain move, its env, and the
+credential manifest are operator work, in Base's runbook
+(carlos/base .superpowers/sdd/2026-11-23-base-native/), not this branch.
+This branch is not a deployment approval.
diff --git a/implementation/existing-team-adoption.md b/implementation/existing-team-adoption.md
index b1053a2..ceb1638 100644
--- a/implementation/existing-team-adoption.md
+++ b/implementation/existing-team-adoption.md
@@ -10,8 +10,12 @@ the negative live checks are dropped for this adoption. Implements
agent-access task 5 and Home discussion 103. Amended 2026-11-20 by Paul’s
approved Equipo native Oficina ID spec, part 3 / E4: Equipo joins canonical
adoption as the seventh app; its app-side contract must be deployed first.
+Amended 2026-11-23 (Paul: Base production is https://base.oficina.works):
+Base joins as the eighth. Its instance must already serve that host, and
+its `base` consumer must be in the credential env manifest with that origin,
+before an adoption plan names it.
-The seven existing canonical instances need directory membership and routing
+The eight existing canonical instances need directory membership and routing
without creating replacement instances, changing their keys, or converting
their existing item permissions to TeamMode. Agent adapters already support
this combination: Home controls delegated team admission; each app resolves
@@ -22,7 +26,7 @@ directory membership never grants access to existing content by itself.
Extend the signed operator plan with optional `existing_team` (the actual
team SQID, not the dashboard label). It is valid only for create-team or
-add-apps plans and only for the seven compiled canonical apps. Both roles show
+add-apps plans and only for the eight compiled canonical apps. Both roles show
an explicit existing-app adoption description. The directory requires label
`oficina`, shows the exact canonical hosts, and binds seeding and every
subsequent operation to the plan's SQID. The credential plan binds owner-seed
@@ -279,7 +283,7 @@ revocation is covered by Home's and oficina-connect's own tests. As with
the Plan 2 waiver, this is not a precedent for any other adoption.
What stays: Plan A's two fresh confirmations, and the Calendar canary.
-Plan B activates calendar alone. Plan C, the other six apps, is gated
+Plan B activates calendar alone. Plan C, the other seven apps, is gated
only on Plan B having activated calendar successfully, and stays refused
if calendar has since been rolled back or disabled. Synthetic proof of
refusal and revocation stays in integration tests. Until the reviewed
@@ -301,7 +305,7 @@ introduced for the adoption tool.
This supersedes team-provisioning-amendment.md §4's label.app-only rendering
for adoption plans, §2.6/§5's new-instance activation policy, and §8's claim
that a confirmed provisioner cannot affect existing canonical hosts. An
-adoption window explicitly allows binding those seven pre-existing hosts to
+adoption window explicitly allows binding those eight pre-existing hosts to
one confirmed team, changing directory discovery and delegated admission.
It grants no local content permission and cannot change credential env
registrations, existing storage or keys. The operator signer can falsely
diff --git a/internal/home/app_chooser_test.go b/internal/home/app_chooser_test.go
index fc50f6a..0a3b9b0 100644
--- a/internal/home/app_chooser_test.go
+++ b/internal/home/app_chooser_test.go
@@ -8,7 +8,7 @@ import (
)
func TestNativeAppChoicesKeepTeamAndAppBoundaries(t *testing.T) {
- for _, app := range []string{"docs", "sheets", "slides", "calendar", "calls", "memoria", "equipo"} {
+ for _, app := range []string{"docs", "sheets", "slides", "calendar", "calls", "memoria", "equipo", "base"} {
t.Run(app, func(t *testing.T) {
f := newMountedChooser(t)
cookie := f.session(t, chooserPerson)
diff --git a/internal/home/base_native_test.go b/internal/home/base_native_test.go
new file mode 100644
index 0000000..2c2df7c
--- /dev/null
+++ b/internal/home/base_native_test.go
@@ -0,0 +1,145 @@
+package home
+
+import (
+ "context"
+ "encoding/json"
+ "net/http"
+ "net/http/httptest"
+ "testing"
+ "time"
+
+ "amadan.net/oficina/home/internal/home/directorydata"
+ "amadan.net/rastrillo/rastrillo/migrate"
+ "amadan.net/rastrillo/rastrillo/sessions"
+)
+
+func TestBaseDirectoryRoutes(t *testing.T) {
+ found := false
+ for _, app := range directoryApps() {
+ if app.slug == "base" {
+ found = app.name == "Base" && app.integrated && !app.provisionable && app.foreignOrigin == ""
+ }
+ }
+ if !found {
+ t.Error("Base missing from integrated registry")
+ }
+ for _, label := range []string{"oficina", "blue"} {
+ origin, consumer := "https://blue.base.oficina.works", "blue-base"
+ if label == "oficina" {
+ origin, consumer = "https://base.oficina.works", "base"
+ }
+ route := directorydata.Route{Label: label, App: "base", Origin: origin, ConsumerID: consumer}
+ if !directoryRouteAllowed(route) {
+ t.Errorf("Base route refused: %+v", route)
+ }
+ for _, bad := range []string{origin + "/", origin + ":443", origin + ".evil.invalid", "https://other.base.oficina.works"} {
+ route.Origin = bad
+ if directoryRouteAllowed(route) {
+ t.Errorf("unsafe Base route admitted: %+v", route)
+ }
+ }
+ }
+ if directorydata.CanonicalOrigin("base") != "https://base.oficina.works" {
+ t.Error("Base canonical origin missing")
+ }
+ // Base's CARLOS host before the move is never team oficina's Base.
+ if directoryRouteAllowed(directorydata.Route{Label: "oficina", App: "base", ConsumerID: "base", Origin: "https://base.bds.oncarlos.com"}) {
+ t.Error("Base's old host admitted as canonical")
+ }
+ for _, r := range []directorydata.Route{
+ {Label: "other", App: "base", ConsumerID: "base", Origin: "https://base.oficina.works"},
+ {Label: "oficina", App: "base", ConsumerID: "other", Origin: "https://base.oficina.works"},
+ {Label: "oficina", App: "unknown", ConsumerID: "unknown", Origin: "https://unknown.oficina.works"},
+ } {
+ if directoryRouteAllowed(r) {
+ t.Errorf("canonical binding widened: %+v", r)
+ }
+ }
+}
+
+func TestNativeDirectoryBaseLiveMembership(t *testing.T) {
+ f := newMountedChooser(t)
+ rec := httptest.NewRecorder()
+ req := httptest.NewRequest("GET", directoryOrigin+"/", nil)
+ if err := f.p.directory.sessions.SignIn(rec, req, sessions.Session{Subject: chooserPerson, Method: nativeSessionMethod, AuthTime: time.Now()}); err != nil {
+ t.Fatal(err)
+ }
+ cookie := sessionCookie(rec)
+ exec := func(q string, args ...any) {
+ t.Helper()
+ if _, err := f.p.directory.db.Writer().Exec(q, args...); err != nil {
+ t.Fatal(err)
+ }
+ }
+ canonical := f.team(t, "AAA111", "oficina", "Oficina", chooserPerson)
+ team := f.team(t, "BBB222", "blue", "Blue", chooserPerson)
+ foreign := f.team(t, "CCC333", "other", "Other", chooserOther)
+ // Keep a live, non-native Slides instance to pin the native-only filter.
+ exec("UPDATE team_instances SET state='disabled'")
+ exec("INSERT INTO team_instances VALUES(?,?,?,?,?)", canonical, "slides", "https://slides.oficina.works", "slides", "live")
+ exec("INSERT INTO team_instances VALUES(?,?,?,?,?)", canonical, "base", "https://base.oficina.works", "base", "pending")
+ exec("INSERT INTO team_instances VALUES(?,?,?,?,?)", team, "base", "https://blue.base.oficina.works", "blue-base", "live")
+ exec("INSERT INTO team_instances VALUES(?,?,?,?,?)", foreign, "base", "https://other.base.oficina.works", "other-base", "live")
+ read := func() []nativeTeam {
+ t.Helper()
+ w := directoryCall(t, f, http.MethodGet, nativeTeamsPath, "", cookie, nil)
+ var got []nativeTeam
+ if w.Code != 200 || json.Unmarshal(w.Body.Bytes(), &got) != nil {
+ t.Fatalf("teams: %d %s", w.Code, w.Body.String())
+ }
+ return got
+ }
+ check := func(got []nativeTeam, sqid, label, name, origin, consumer string) {
+ t.Helper()
+ if len(got) != 1 || got[0].SQID != sqid || got[0].Label != label || got[0].Name != name || got[0].Role != "member" || len(got[0].Apps) != 1 || got[0].Apps[0] != (nativeTeamApp{"base", origin, consumer}) {
+ t.Fatalf("Base teams: %+v", got)
+ }
+ }
+ check(read(), "BBB222", "blue", "Blue", "https://blue.base.oficina.works", "blue-base")
+ exec("UPDATE team_instances SET state='disabled' WHERE team_id=? AND app='base'", team)
+ if got := read(); len(got) != 0 {
+ t.Fatalf("pending or disabled Base visible: %+v", got)
+ }
+ exec("UPDATE team_instances SET state='live' WHERE team_id=? AND app='base'", canonical)
+ check(read(), "AAA111", "oficina", "Oficina", "https://base.oficina.works", "base")
+ exec("DELETE FROM memberships WHERE person_ref=?", chooserPerson)
+ if got := read(); len(got) != 0 {
+ t.Fatalf("removed member still sees Base: %+v", got)
+ }
+}
+
+func TestNativeAssertBaseRegisteredOrigins(t *testing.T) {
+ app := newNativeApp(t)
+ if _, err := migrate.Apply(context.Background(), app.db, (Runtime{role: "credential"}).ServingSchema()); err != nil {
+ t.Fatal(err)
+ }
+ app.runtime.consumers["base"] = "https://base.oficina.works"
+ app.runtime.registry = newConsumerRegistry(app.runtime.consumers)
+ for _, row := range [][3]string{{"blue-base", "https://blue.base.oficina.works", "active"}, {"gone-base", "https://gone.base.oficina.works", "retired"}} {
+ if _, err := app.db.Writer().Exec("INSERT INTO consumers VALUES(?,?,'base',?,'2026-11-20',?)", row[0], row[1], row[2], fixtureToken(1)); err != nil {
+ t.Fatal(err)
+ }
+ }
+ if err := app.runtime.registry.load(context.Background(), app.db.Writer(), Origin, app.runtime.keys); err != nil {
+ t.Fatal(err)
+ }
+ d := newDevice(t)
+ grant, _ := d.signInByCode(t, app, "base@example.invalid")
+ _, challenge := verifierFor(91)
+ for _, origin := range []string{"https://base.oficina.works", "https://blue.base.oficina.works"} {
+ w := d.assert(t, app, grant, origin, challenge)
+ if w.Code != 200 {
+ t.Fatalf("registered Base: %d %s", w.Code, w.Body.String())
+ }
+ claims := verifyAssertion(t, app, decodeReply(t, w)["assertion"].(string), origin)
+ if claims.Audience != origin || claims.Nonce != mustNativeNonce(t, challenge) || claims.ExpiresAt-claims.IssuedAt != 120 {
+ t.Fatalf("Base claims: %+v", claims)
+ }
+ }
+ for _, origin := range []string{"https://base.oficina.works/", "https://BASE.oficina.works", "https://base.oficina.works:443", "https://base.oficina.works.evil.invalid", "https://green.base.oficina.works", "https://gone.base.oficina.works"} {
+ w := d.assert(t, app, grant, origin, challenge)
+ if w.Code != 400 || decodeReply(t, w)["error"] != "audience" {
+ t.Fatalf("unregistered Base admitted: %s %d", origin, w.Code)
+ }
+ }
+}
diff --git a/internal/home/directory_native.go b/internal/home/directory_native.go
index 6cfa3a1..41ace1f 100644
--- a/internal/home/directory_native.go
+++ b/internal/home/directory_native.go
@@ -32,7 +32,7 @@ const (
)
// nativeTeamApps are the native apps; the list is filtered to them (§9).
-var nativeTeamApps = map[string]bool{"calls": true, "docs": true, "sheets": true, "calendar": true, "memoria": true, "equipo": true}
+var nativeTeamApps = map[string]bool{"calls": true, "docs": true, "sheets": true, "calendar": true, "memoria": true, "equipo": true, "base": true}
// directoryNativeExchange is POST /native/oficina-id {assertion, verifier,
// target?, choice?}. It verifies the assertion against the pinned keys with
@@ -157,7 +157,7 @@ type nativeTeam struct {
}
// directoryNativeTeams is GET /api/native/teams: the person's teams with
-// live instances of the six native apps, from Store.AgentChoices. Zero
+// live instances of the seven native apps, from Store.AgentChoices. Zero
// teams is an empty list, never an error; the app then shows its help and
// may link noTeamsHelpPath.
func (a *App) directoryNativeTeams(w http.ResponseWriter, r *http.Request) {
diff --git a/internal/home/directory_runtime.go b/internal/home/directory_runtime.go
index 8d54e4a..beff75c 100644
--- a/internal/home/directory_runtime.go
+++ b/internal/home/directory_runtime.go
@@ -22,6 +22,7 @@ func directoryApps() []directoryApp {
{slug: "calls", name: "Calls", integrated: true},
{slug: "memoria", name: "Memoria", integrated: true},
{slug: "equipo", name: "Equipo", integrated: true},
+ {slug: "base", name: "Base", integrated: true},
}
}
diff --git a/internal/home/directory_runtime_test.go b/internal/home/directory_runtime_test.go
index 193bd61..fc6fa95 100644
--- a/internal/home/directory_runtime_test.go
+++ b/internal/home/directory_runtime_test.go
@@ -122,7 +122,7 @@ func TestDirectoryRuntimeAnonymousReturnAndRoleSchemaSeparation(t *testing.T) {
}
}
apps := directoryApps()
- if len(apps) != 7 || apps[0].slug != "docs" || !apps[0].integrated || apps[0].provisionable || apps[0].foreignOrigin != "" {
+ if len(apps) != 8 || apps[0].slug != "docs" || !apps[0].integrated || apps[0].provisionable || apps[0].foreignOrigin != "" {
t.Fatal("registry advertised unsupported provisioning")
}
for _, app := range apps {
diff --git a/internal/home/directorydata/canonical.go b/internal/home/directorydata/canonical.go
index 9e84bdf..9a2e982 100644
--- a/internal/home/directorydata/canonical.go
+++ b/internal/home/directorydata/canonical.go
@@ -4,7 +4,7 @@ package directorydata
// does not authorize a write: only a confirmed operator adoption may bind one.
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/internal/operator/base_adoption_test.go b/internal/operator/base_adoption_test.go
new file mode 100644
index 0000000..6b39770
--- /dev/null
+++ b/internal/operator/base_adoption_test.go
@@ -0,0 +1,36 @@
+package operator
+
+import "testing"
+
+// Base joins canonical adoption (Paul, 2026-11-23: Base production at
+// https://base.oficina.works). A plan may adopt it into team oficina, alone
+// or with all seven other canonical apps, and the adoption binds only the
+// canonical host: never Base's old CARLOS host.
+func TestBaseIsAdoptableIntoTeamOficina(t *testing.T) {
+ f := newHTTPDirectory(t)
+ all := []string{"docs", "sheets", "slides", "calendar", "calls", "memoria", "equipo", "base"}
+ for _, apps := range [][]string{{"base"}, all} {
+ p := Plan{Version: 1, Purpose: "operator-plan", Role: "directory", Origin: f.engine.verifier.pins.Origin,
+ Installation: token(1), Registry: token(2), Device: token(3), PlanID: token(4), Kind: "add-apps", Apps: apps,
+ Label: "oficina", ExistingTeam: "Uk", Issued: f.now.Unix(), Expires: f.now.Unix() + PlanLifetime}
+ set := map[string]bool{}
+ for _, app := range all {
+ set[app] = true
+ }
+ if !p.valid(set) {
+ t.Fatalf("adoption of %v refused", apps)
+ }
+ }
+ if !routeScope("Uk", "oficina", "Uk", "base", "base", "https://base.oficina.works") {
+ t.Fatal("Base's canonical host refused")
+ }
+ for _, origin := range []string{"https://base.bds.oncarlos.com", "https://base.oficina.works/", "https://blue.base.oficina.works"} {
+ if routeScope("Uk", "oficina", "Uk", "base", "base", origin) {
+ t.Fatalf("adoption bound %s", origin)
+ }
+ }
+ // Ordinary provisioning still never takes the canonical host.
+ if routeScope("", "blue", "Bb", "base", "blue-base", "https://base.oficina.works") {
+ t.Fatal("a new team took Base's canonical host")
+ }
+}