oficina / home Public

Merge branch 'base-in-directory' into main

Merge branch 'base-in-directory' into main

Base joins the native Oficina directory as Equipo did: nativeTeamApps,
directoryApps, CanonicalOrigin("base") = https://base.oficina.works; the
held-door delivery rule documented (Paul approved 2026-11-23); Paul's
11-17 waiver stays at six apps. Reviewed by Claude Fable 5.2 (#157,
approved). CI passed (one race-step timing flake, re-run green).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev b4e00f18d5dd4853cd11ec460909740aed0e09a0 parent 4dba68eparent 36bbe67
10 files changed, +233 −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 +16 −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.909s
?   	amadan.net/oficina/home/cmd/oficina	[no test files]
ok  	amadan.net/oficina/home/internal/guardstest	0.290s
ok  	amadan.net/oficina/home/internal/home	57.621s
ok  	amadan.net/oficina/home/internal/home/directorydata	1.396s
ok  	amadan.net/oficina/home/internal/home/logtest	0.003s
ok  	amadan.net/oficina/home/internal/home/seal	0.008s
ok  	amadan.net/oficina/home/internal/home/sealtest	0.009s
ok  	amadan.net/oficina/home/internal/home/wisp	0.048s
ok  	amadan.net/oficina/home/internal/operator	6.498s
ok  	amadan.net/oficina/home/internal/operatorlaunch	4.128s
ok  	amadan.net/oficina/home/internal/provisioner	48.800s
cd handoff && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/handoff	0.664s
ok  	amadan.net/oficina/home/handoff/seal	0.002s
cd roster && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/roster	5.119s
cd dashboard && CGO_ENABLED=0 go test ./...
ok  	amadan.net/oficina/home/dashboard	(cached)
cd connect && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/connect	1.408s
ok  	amadan.net/oficina/home/connect/linkstore	0.465s
cd teammode && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/teammode	0.100s
?   	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	340.002s
ok  	amadan.net/oficina/home/internal/operator	82.861s
ok  	amadan.net/oficina/home/internal/operatorlaunch	22.403s
ok  	amadan.net/oficina/home/internal/home/directorydata	23.685s
ok  	amadan.net/oficina/home/internal/provisioner	399.429s
cd handoff && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/handoff	12.913s
ok  	amadan.net/oficina/home/handoff/seal	1.014s
cd roster && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/roster	6.962s
cd dashboard && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/dashboard	1.065s
cd connect && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/connect	6.254s
ok  	amadan.net/oficina/home/connect/linkstore	6.332s
cd teammode && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/teammode	1.945s
?   	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..b4edac9 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
@@ -207,6 +211,12 @@ if:
`Cache-Control: no-store` and a body whose `error.code` is
`unauthenticated`).
+For Base only (Paul, 2026-11-23, oficina/alta discussion 5), the third
+bullet is held rather than moved: `GET /api/v1/operations` must answer the
+same agent-shaped 401 before and after configure's restart, because it is
+Base's own door for Equipo's Assistant and Base reads no agent settings;
+every other delivery check is kept (Alta's `docs/base-adoption.md`).
+
The runner records the check bound to the identity, delivered version and
configuration it observed; it is void if any of them changes. The check is
part of the signed observation: environment_binding carries it in the
@@ -281,7 +291,9 @@ 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
only on Plan B having activated calendar successfully, and stays refused
-if calendar has since been rolled back or disabled. Synthetic proof of
+if calendar has since been rolled back or disabled. Base, added on
+2026-11-23, is not covered by this waiver: a plan naming `base` runs the
+negative live checks above normally. Synthetic proof of
refusal and revocation stays in integration tests. Until the reviewed
snapshot/observation runner exists, production activation is blocked even
if Home capability is deployed. This document does not authorize
@@ -301,7 +313,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")
+ }
+}