oficina / home Public

Team page: say Equipo and Base keep their own people, and who can see the team's data

On a team with a live Equipo or Base (oficina/alta design/team-bundle, spec
§5.1 rule 1), the Remove confirmation and the note under the list say a
change here does not reach them. Every Team page says who runs Oficina
and can see the team's data (Paul's ruling, 2026-11-30, Q11).

COPY APPROVED by Paul in the copy-review tool, 2026-11-30 13:19, all three
strings unedited (team.remove.confirm_seeded, team.note.changes_seeded,
team.operator).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 86e587f52d8a90f8768c4dfb465bff9ef5fd563b parent 88f610a
4 files changed, +75 −3
  • internal/home/directorydata/members.go +17 −0
  • internal/home/team_page.go +9 −2
  • internal/home/team_page_test.go +41 −0
  • internal/home/templates/team.html +8 −1

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.999s
?   	amadan.net/oficina/home/cmd/oficina	[no test files]
ok  	amadan.net/oficina/home/internal/guardstest	0.205s
ok  	amadan.net/oficina/home/internal/home	57.539s
ok  	amadan.net/oficina/home/internal/home/directorydata	1.377s
ok  	amadan.net/oficina/home/internal/home/logtest	0.007s
ok  	amadan.net/oficina/home/internal/home/seal	0.003s
ok  	amadan.net/oficina/home/internal/home/sealtest	0.003s
ok  	amadan.net/oficina/home/internal/home/wisp	0.041s
ok  	amadan.net/oficina/home/internal/operator	6.476s
ok  	amadan.net/oficina/home/internal/operatorlaunch	4.115s
ok  	amadan.net/oficina/home/internal/provisioner	49.308s
cd handoff && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/handoff	0.657s
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.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.403s
ok  	amadan.net/oficina/home/connect/linkstore	0.411s
cd teammode && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/teammode	0.102s
?   	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	339.518s
ok  	amadan.net/oficina/home/internal/operator	82.681s
ok  	amadan.net/oficina/home/internal/operatorlaunch	22.384s
ok  	amadan.net/oficina/home/internal/home/directorydata	23.545s
ok  	amadan.net/oficina/home/internal/provisioner	398.564s
cd handoff && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/handoff	12.879s
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	7.003s
cd dashboard && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/dashboard	1.066s
cd connect && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/connect	6.210s
ok  	amadan.net/oficina/home/connect/linkstore	6.258s
cd teammode && CGO_ENABLED=1 go test -race -count=1 ./...
ok  	amadan.net/oficina/home/teammode	1.944s
?   	amadan.net/oficina/home/teammode/teammodetest	[no test files]
diff --git a/internal/home/directorydata/members.go b/internal/home/directorydata/members.go
index cbca8b5..af9744e 100644
--- a/internal/home/directorydata/members.go
+++ b/internal/home/directorydata/members.go
@@ -613,3 +613,20 @@ func (s *Store) ConfirmAdd(ctx context.Context, id, actor string, now time.Time,
}
return in, nil
}
+
+// SeededApps are the apps that keep their own list of people, seeded from
+// their environment rather than Home's roster (oficina/alta
+// design/team-bundle, spec §5.1 rule 1): a removal on the Team page does
+// not reach them.
+var SeededApps = []string{"equipo", "base"}
+
+// HasLiveSeededApp reports whether team has a live instance of a seeded
+// app, so the Team page can say that changes there don't reach it.
+func (s *Store) HasLiveSeededApp(ctx context.Context, teamID int64) (bool, error) {
+ var n int
+ err := s.db.QueryRowContext(ctx, `SELECT count(*) FROM team_instances WHERE team_id=? AND state='live' AND app IN (?,?)`, teamID, SeededApps[0], SeededApps[1]).Scan(&n)
+ if err != nil {
+ return false, ErrUnavailable
+ }
+ return n > 0, nil
+}
diff --git a/internal/home/team_page.go b/internal/home/team_page.go
index aa403a5..7878c5a 100644
--- a/internal/home/team_page.go
+++ b/internal/home/team_page.go
@@ -104,8 +104,11 @@ type memberView struct {
}
type teamView struct {
- Name, SQID, Error string
- Owner, CanAdd bool
+ Name, SQID, Error string
+ Owner, CanAdd bool
+ // Seeded: the team has a live Equipo or Base, whose own lists of
+ // people a change here does not reach (team-bundle spec §5.1 rule 1).
+ Seeded bool
Members []memberView
AddName, AddRole, FieldError string
}
@@ -181,6 +184,10 @@ func (a *App) renderTeam(w http.ResponseWriter, r *http.Request, viewer, sqid st
return
}
v := a.teamView(viewer, t, members)
+ if v.Seeded, err = a.directory.store.HasLiveSeededApp(r.Context(), t.ID); err != nil {
+ a.errorPage(w, r, http.StatusServiceUnavailable)
+ return
+ }
v.Error, v.FieldError, v.AddName, v.AddRole = notice.Error, notice.FieldError, notice.AddName, notice.AddRole
if v.AddRole == "" {
v.AddRole = "member"
diff --git a/internal/home/team_page_test.go b/internal/home/team_page_test.go
index a33565a..183501a 100644
--- a/internal/home/team_page_test.go
+++ b/internal/home/team_page_test.go
@@ -520,3 +520,44 @@ func TestTeamWriteBudget(t *testing.T) {
t.Fatal(r.Code)
}
}
+
+// A team with a live Equipo or Base says, on the Team page, that a change
+// there does not reach those two (oficina/alta design/team-bundle, spec
+// §5.1 rule 1); every Team page names who can see the team's data.
+func TestTeamPageSaysSeededAppsKeepTheirOwnPeople(t *testing.T) {
+ f := newTeamFixture(t)
+ member := f.person(t, "member@example.invalid")
+ f.member(t, f.sqid, member, "member")
+ ownerCookie := f.session(t, f.owner, time.Now().Add(-time.Hour))
+ const (
+ removeSeeded = "except Equipo and Base, which keep their own list of people"
+ noteSeeded = "change who is on those in Equipo and Base themselves"
+ removePlain = "<p>They lose this team in every app within a minute.</p>"
+ notePlain = "Changes reach every app in this team within a minute.</p>"
+ operatorLine = "Paul Campbell runs this Oficina and can see everything this team keeps in it."
+ )
+ body := f.get(f.teamURL(), ownerCookie).Body.String()
+ if !strings.Contains(body, removePlain) || !strings.Contains(body, notePlain) || strings.Contains(body, removeSeeded) || strings.Contains(body, noteSeeded) || !strings.Contains(body, operatorLine) {
+ t.Fatal("team without Equipo or Base: wrong lines")
+ }
+ // A pending Equipo is not yet one: only a live instance counts.
+ exec := func(state string) {
+ t.Helper()
+ if _, err := f.directory.db.Writer().Exec("INSERT OR REPLACE INTO team_instances VALUES(?,?,?,?,?)", 1, "equipo", "https://canarylabel.equipo.oficina.works", "canarylabel-equipo", state); err != nil {
+ t.Fatal(err)
+ }
+ }
+ exec("pending")
+ if body = f.get(f.teamURL(), ownerCookie).Body.String(); strings.Contains(body, removeSeeded) {
+ t.Fatal("a pending Equipo changed the lines")
+ }
+ exec("live")
+ body = f.get(f.teamURL(), ownerCookie).Body.String()
+ if !strings.Contains(body, removeSeeded) || !strings.Contains(body, noteSeeded) || strings.Contains(body, removePlain) || strings.Contains(body, notePlain) || !strings.Contains(body, operatorLine) {
+ t.Fatal("team with a live Equipo: wrong lines")
+ }
+ mem := f.get(f.teamURL(), f.session(t, member, time.Now())).Body.String()
+ if !strings.Contains(mem, noteSeeded) || !strings.Contains(mem, operatorLine) || strings.Contains(mem, "@") && strings.Contains(mem, "member@example.invalid") {
+ t.Fatal("member view: wrong lines, or an address")
+ }
+}
diff --git a/internal/home/templates/team.html b/internal/home/templates/team.html
index 93ef508..aa82b9b 100644
--- a/internal/home/templates/team.html
+++ b/internal/home/templates/team.html
@@ -43,7 +43,11 @@
<summary rst-btn="ghost sm">Remove</summary>
<form method="post" action="/team/remove" rst-form>
<input type="hidden" name="team" value="{{$.Data.SQID}}"><input type="hidden" name="person" value="{{.Ref}}">
+ {{- if $.Data.Seeded}}
+ <p>They lose this team in every app within a minute, except Equipo and Base, which keep their own list of people. Remove them there too.</p>
+ {{- else}}
<p>They lose this team in every app within a minute.</p>
+ {{- end}}
<div rst-form-foot><button type="submit" rst-btn="danger sm">Remove from team</button></div>
</form>
</details>
@@ -53,7 +57,9 @@
</div>
{{- end}}
</div>
-<p home-dashboard-note>Changes reach every app in this team within a minute.</p>
+{{if .Seeded}}<p home-dashboard-note>Changes reach every app in this team within a minute, except Equipo and Base: change who is on those in Equipo and Base themselves.</p>
+{{else}}<p home-dashboard-note>Changes reach every app in this team within a minute.</p>
+{{end}}
{{if .Owner}}{{if .CanAdd}}
<section id="add" home-team-add aria-labelledby="add-heading">
<h2 id="add-heading">Add someone</h2>
@@ -76,4 +82,5 @@
{{end}}{{else}}
<p>Only owners can change who is on this team.</p>
{{end}}
+<p home-dashboard-note>Paul Campbell runs this Oficina and can see everything this team keeps in it.</p>
{{end}}{{end}}