oficina / alta Public

Memoria is a roster-mode app: its team recipe

Memoria's team mode (oficina/memoria #32, team-mode @ 88f6cec, through
Home's teammode.ConfigFromLookup("MEMORIA")): Roster true, the five
MEMORIA_TEAM_* keys from teamKeys (the roster token Home's bearer,
fetched by replaying step 5), and MEMORIA_OWNERS no longer written:
LoadConfig wants it only without team configuration. MEMORIA_DEK stays
GENERATED and MEMORIA_TEAM stays the label, which team mode now requires
to be the first label of MEMORIA_ORIGIN (team_siblings.go). AI stays
off: MEMORIA_AI, the TensorX key, siblings and logged mail are absent.
Step 11 verifies Memoria through /api/team (teammode.Probe).

TestRosterRecipes pins Memoria's exact names; TestMemoriaTeamLabelAndAIOff
checks MEMORIA_TEAM against MEMORIA_ORIGIN and that no AI, sibling,
logged-mail or owners key is ever set; the fake console serves /api/team
for Memoria; the end-to-end run, the crash suite and homecompat (Home's
real 0cee9ba engine) activate Memoria, with Calendar still pending. The
README names the four roster apps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev d9b8d614f9e53089b6ad6f9167c60a6cfc9c6d27 parent d59778f
6 files changed, +50 −17
  • README.md +7 −6
  • console/fakeconsole/fakeconsole.go +2 −2
  • homecompat/compat_test.go +3 −0
  • provision/apps.go +10 −3
  • provision/apps_test.go +27 −5
  • provision/review_test.go +1 −1

CI passed — run details

diff --git a/README.md b/README.md
index 558add6..6be404f 100644
--- a/README.md
+++ b/README.md
@@ -127,13 +127,14 @@ recorded here instead (Fable's rulings on oficina/alta #1):
(`activationVersion` in `provision/steps.go`): a version Home would
refuse parks there as `version-unacceptable` instead of failing
activation.
-- **§6 step 11, `/api/team`**: the roster-mode apps are Docs, Sheets and
- Slides (team mode on each app's main or team-mode branch: Docs
- `e58a22f`, Sheets #52, Slides #33). Each serves the readiness probe
- once that build is deployed; until then it parks at
+- **§6 step 11, `/api/team`**: the roster-mode apps are Docs, Sheets,
+ Slides and Memoria (team mode on each app's main or team-mode branch:
+ Docs `e58a22f`, Sheets #52, Slides #33, Memoria #32). Each serves the
+ readiness probe once that build is deployed; until then it parks at
`no-readiness-probe` (its directory row stays pending, and the owner's
- address is deleted all the same). Calendar, Calls and Memoria have no
- roster mode yet and keep the owner allowlist.
+ address is deleted all the same). Calendar and Calls have no roster
+ mode yet and keep the owner allowlist. Memoria's AI stays off in team
+ mode: no `MEMORIA_AI`, TensorX key, siblings or logged mail.
- **§11, Help**: the account menu has no Help items yet (no Colophon page).
## Developing
diff --git a/console/fakeconsole/fakeconsole.go b/console/fakeconsole/fakeconsole.go
index b11a3c9..bdfcf50 100644
--- a/console/fakeconsole/fakeconsole.go
+++ b/console/fakeconsole/fakeconsole.go
@@ -576,8 +576,8 @@ func (c *Console) Transport() http.RoundTripper {
} else {
rec.WriteString(i.serving)
}
- case r.URL.Path == "/api/team" && (i.app == "docs" || i.app == "sheets" || i.app == "slides") && !c.NoTeamProbe:
- // The roster-mode apps: Docs, Sheets and Slides.
+ case r.URL.Path == "/api/team" && (i.app == "docs" || i.app == "sheets" || i.app == "slides" || i.app == "memoria") && !c.NoTeamProbe:
+ // The roster-mode apps: Docs, Sheets, Slides and Memoria.
p := strings.ToUpper(i.app)
b := c.envs[i.app][i.env]
_, token := b.vars[p+"_TEAM_ROSTER_TOKEN"]
diff --git a/homecompat/compat_test.go b/homecompat/compat_test.go
index e43f5da..2431d7e 100644
--- a/homecompat/compat_test.go
+++ b/homecompat/compat_test.go
@@ -379,6 +379,9 @@ func TestAltaAgainstHomesRealOperator(t *testing.T) {
if err := r.home.dirDB.QueryRow("SELECT state FROM team_instances WHERE consumer_id='lagged-slides'").Scan(&state); err != nil || state != "live" {
t.Fatalf("slides at the directory: %q %v", state, err)
}
+ if err := r.home.dirDB.QueryRow("SELECT state FROM team_instances WHERE consumer_id='lagged-memoria'").Scan(&state); err != nil || state != "live" {
+ t.Fatalf("memoria at the directory: %q %v", state, err)
+ }
if err := r.home.dirDB.QueryRow("SELECT state FROM team_instances WHERE consumer_id='lagged-calendar'").Scan(&state); err != nil || state != "pending" {
t.Fatalf("calendar at the directory: %q %v", state, err)
}
diff --git a/provision/apps.go b/provision/apps.go
index b23b89d..e51a475 100644
--- a/provision/apps.go
+++ b/provision/apps.go
@@ -48,7 +48,7 @@ var Apps = []App{
{Slug: "slides", Name: "Slides", Prefix: "SLIDES", Roster: true, MailPrefixes: []string{"SLIDES_SMTP", "CARLOS_SMTP"}},
{Slug: "calendar", Name: "Calendar", Prefix: "CALENDAR", MailPrefixes: []string{"CALENDAR_SMTP", "CARLOS_SMTP"}},
{Slug: "calls", Name: "Calls", Prefix: "CALLS", MailPrefixes: []string{"CALLS_SMTP", "CARLOS_SMTP"}, Relay: true},
- {Slug: "memoria", Name: "Memoria", Prefix: "MEMORIA", MailPrefixes: []string{"CARLOS_SMTP"}},
+ {Slug: "memoria", Name: "Memoria", Prefix: "MEMORIA", Roster: true, MailPrefixes: []string{"CARLOS_SMTP"}},
}
// AppBySlug finds a registry app.
@@ -179,12 +179,19 @@ func Recipe(app App, in Inputs) []Key {
)
case "memoria":
// AI off: MEMORIA_AI, _TENSORX_KEY, _SIBLINGS, _SIBLING_TOKEN_*
- // and _ALLOW_LOGGED_MAIL are simply absent.
+ // and _ALLOW_LOGGED_MAIL are simply absent (Paul: AI is off, and
+ // his key is never used).
+ // Team mode (oficina/memoria #32, team-mode @ 88f6cec, through
+ // Home's teammode): MEMORIA_OWNERS is optional beside
+ // MEMORIA_TEAM_*, so the owner is not written. MEMORIA_TEAM is the
+ // sibling transport's host label, which in team mode must be the
+ // first label of MEMORIA_ORIGIN (team_siblings.go): both are the
+ // team's label.
keys = append(keys,
Key{Name: "MEMORIA_DEK", Class: Generated, Secret: true},
- owner("MEMORIA_OWNERS"),
Key{Name: "MEMORIA_TEAM", Class: Set, Value: in.Label},
)
+ keys = append(keys, teamKeys(p, in)...)
}
return keys
}
diff --git a/provision/apps_test.go b/provision/apps_test.go
index e0b8953..c8e1f96 100644
--- a/provision/apps_test.go
+++ b/provision/apps_test.go
@@ -5,7 +5,9 @@ import (
"testing"
)
-// The recipes against each app's own config readers. Slides follows
+// The recipes against each app's own config readers. Memoria follows
+// oficina/memoria team-mode @ 88f6cec (teammode; MEMORIA_OWNERS optional
+// beside it; MEMORIA_TEAM the first label of MEMORIA_ORIGIN). Slides follows
// oficina/slides team-mode @ 80fd3c9 (Home's teammode.EnvNames("SLIDES");
// SLIDES_ALLOWED_ADDRESSES optional beside them). Sheets follows
// oficina/sheets team-mode @ b0264ff (internal/sheets/team_config.go,
@@ -14,9 +16,10 @@ import (
func TestRosterRecipes(t *testing.T) {
in := Inputs{Label: "lagged", Owner: "o@x.test", TeamSQID: "Uk", Record: []byte("{}"), Home: HomeConfig{Issuer: "https://id.oficina.works", Directory: "https://oficina.works", Provisioner: "AQ"}}
want := map[string][]string{
- "docs": {"DOCS_ALLOWED_ADDRESSES", "DOCS_CONTENT_KEY", "DOCS_HOME_CONSUMER_ID", "DOCS_HOME_DEK_BASE64", "DOCS_HOME_ISSUER", "DOCS_HOME_KEYS_BASE64", "DOCS_INSTANCE_KEY", "DOCS_ORIGIN", "DOCS_TEAM_DIRECTORY_ORIGIN", "DOCS_TEAM_ID", "DOCS_TEAM_OPERATOR_KEYS_BASE64", "DOCS_TEAM_PROVISIONING_BASE64", "DOCS_TEAM_ROSTER_TOKEN", "HOME_DIRECTORY_ORIGIN"},
- "slides": {"HOME_DIRECTORY_ORIGIN", "SLIDES_HOME_CONSUMER_ID", "SLIDES_HOME_DEK_BASE64", "SLIDES_HOME_ISSUER", "SLIDES_HOME_KEYS_BASE64", "SLIDES_INSTANCE_KEY", "SLIDES_ORIGIN", "SLIDES_TEAM_DIRECTORY_ORIGIN", "SLIDES_TEAM_ID", "SLIDES_TEAM_OPERATOR_KEYS_BASE64", "SLIDES_TEAM_PROVISIONING_BASE64", "SLIDES_TEAM_ROSTER_TOKEN"},
- "sheets": {"HOME_DIRECTORY_ORIGIN", "SHEETS_DEK", "SHEETS_HOME_CONSUMER_ID", "SHEETS_HOME_DEK_BASE64", "SHEETS_HOME_ISSUER", "SHEETS_HOME_KEYS_BASE64", "SHEETS_INSTANCE_KEY", "SHEETS_ORIGIN", "SHEETS_TEAM_DIRECTORY_ORIGIN", "SHEETS_TEAM_ID", "SHEETS_TEAM_OPERATOR_KEYS_BASE64", "SHEETS_TEAM_PROVISIONING_BASE64", "SHEETS_TEAM_ROSTER_TOKEN"},
+ "docs": {"DOCS_ALLOWED_ADDRESSES", "DOCS_CONTENT_KEY", "DOCS_HOME_CONSUMER_ID", "DOCS_HOME_DEK_BASE64", "DOCS_HOME_ISSUER", "DOCS_HOME_KEYS_BASE64", "DOCS_INSTANCE_KEY", "DOCS_ORIGIN", "DOCS_TEAM_DIRECTORY_ORIGIN", "DOCS_TEAM_ID", "DOCS_TEAM_OPERATOR_KEYS_BASE64", "DOCS_TEAM_PROVISIONING_BASE64", "DOCS_TEAM_ROSTER_TOKEN", "HOME_DIRECTORY_ORIGIN"},
+ "slides": {"HOME_DIRECTORY_ORIGIN", "SLIDES_HOME_CONSUMER_ID", "SLIDES_HOME_DEK_BASE64", "SLIDES_HOME_ISSUER", "SLIDES_HOME_KEYS_BASE64", "SLIDES_INSTANCE_KEY", "SLIDES_ORIGIN", "SLIDES_TEAM_DIRECTORY_ORIGIN", "SLIDES_TEAM_ID", "SLIDES_TEAM_OPERATOR_KEYS_BASE64", "SLIDES_TEAM_PROVISIONING_BASE64", "SLIDES_TEAM_ROSTER_TOKEN"},
+ "memoria": {"HOME_DIRECTORY_ORIGIN", "MEMORIA_DEK", "MEMORIA_HOME_CONSUMER_ID", "MEMORIA_HOME_DEK_BASE64", "MEMORIA_HOME_ISSUER", "MEMORIA_HOME_KEYS_BASE64", "MEMORIA_INSTANCE_KEY", "MEMORIA_ORIGIN", "MEMORIA_TEAM", "MEMORIA_TEAM_DIRECTORY_ORIGIN", "MEMORIA_TEAM_ID", "MEMORIA_TEAM_OPERATOR_KEYS_BASE64", "MEMORIA_TEAM_PROVISIONING_BASE64", "MEMORIA_TEAM_ROSTER_TOKEN"},
+ "sheets": {"HOME_DIRECTORY_ORIGIN", "SHEETS_DEK", "SHEETS_HOME_CONSUMER_ID", "SHEETS_HOME_DEK_BASE64", "SHEETS_HOME_ISSUER", "SHEETS_HOME_KEYS_BASE64", "SHEETS_INSTANCE_KEY", "SHEETS_ORIGIN", "SHEETS_TEAM_DIRECTORY_ORIGIN", "SHEETS_TEAM_ID", "SHEETS_TEAM_OPERATOR_KEYS_BASE64", "SHEETS_TEAM_PROVISIONING_BASE64", "SHEETS_TEAM_ROSTER_TOKEN"},
}
for slug, names := range want {
app, _ := AppBySlug(slug)
@@ -42,8 +45,27 @@ func TestRosterRecipes(t *testing.T) {
}
}
for _, a := range Apps {
- if a.Roster != (a.Slug == "docs" || a.Slug == "sheets" || a.Slug == "slides") {
+ if a.Roster != (a.Slug == "docs" || a.Slug == "sheets" || a.Slug == "slides" || a.Slug == "memoria") {
t.Fatalf("%s roster mode %v", a.Slug, a.Roster)
}
}
}
+
+// Memoria in team mode: MEMORIA_TEAM must be the first label of
+// MEMORIA_ORIGIN (team_siblings.go refuses boot otherwise), and AI stays
+// off: no MEMORIA_AI, TensorX key, siblings or logged mail, ever.
+func TestMemoriaTeamLabelAndAIOff(t *testing.T) {
+ app, _ := AppBySlug("memoria")
+ vals := map[string]string{}
+ for _, k := range Recipe(app, Inputs{Label: "lagged", Home: HomeConfig{Directory: "https://oficina.works"}}) {
+ vals[k.Name] = k.Value
+ for _, banned := range []string{"MEMORIA_AI", "MEMORIA_TENSORX_KEY", "MEMORIA_SIBLINGS", "MEMORIA_SIBLING_TOKEN_", "MEMORIA_ALLOW_LOGGED_MAIL", "MEMORIA_OWNERS"} {
+ if k.Name == banned || (banned == "MEMORIA_SIBLING_TOKEN_" && len(k.Name) > len(banned) && k.Name[:len(banned)] == banned) {
+ t.Fatalf("memoria recipe sets %s", k.Name)
+ }
+ }
+ }
+ if vals["MEMORIA_ORIGIN"] != "https://"+vals["MEMORIA_TEAM"]+".memoria.oficina.works" {
+ t.Fatalf("MEMORIA_TEAM %q is not the first label of MEMORIA_ORIGIN %q", vals["MEMORIA_TEAM"], vals["MEMORIA_ORIGIN"])
+ }
+}
diff --git a/provision/review_test.go b/provision/review_test.go
index f1876b3..ea32fbb 100644
--- a/provision/review_test.go
+++ b/provision/review_test.go
@@ -25,7 +25,7 @@ func TestOwnerForgottenWhileAnAppIsParked(t *testing.T) {
if r.State != "parked" {
t.Fatalf("run %s %s", r.State, r.Code)
}
- for _, app := range []string{"docs", "sheets", "slides"} {
+ for _, app := range []string{"docs", "sheets", "slides", "memoria"} {
if st, _, _ := h.store.Step(h.ctx(), "lagged", app, StepVerify); st.Code != "no-readiness-probe" {
t.Fatalf("%s verify %s %s", app, st.State, st.Code)
}