Activation takes the observed version token Home now admits
Home 0cee9ba (Fable APPROVED, #96) lets directory.activate-consumer take
an observed printable token, ^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$, so
commit40 goes and app_version is /api/version as read. Step 10 mirrors
Home's rule for every app: a body Home would refuse (an error page, a
proxy's text) parks version-unacceptable there instead of failing
activate-refused; "dev" still parks version-unstamped.
TestVersionHomeWouldRefuseParksAtServing covers it and a git-describe
string activating; removing the park fails it with activate-refused.
homecompat pins Home 0cee9ba and activates Docs on v0.1.7-3-gabc1234
through Home's real engine; its directory database gains the Team page's
migration set (directorydata.TeamSchema, part of the serving schema
since 7bdddfa), whose memberships.added_at seed-team now writes. fakehome
uses Home's new rule. The README says Docs' /api/team (e58a22f) lands
with the next Docs deploy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 files changed,
+69
−34
AGENTS.md+1 −1README.md+12 −5homecompat/compat_test.go+7 −2homecompat/go.mod+1 −1homecompat/go.sum+2 −2homeop/fakehome/fakehome.go+5 −1internal/web/words.go+2 −2provision/review_test.go+29 −0provision/steps.go+10 −20
CI passed — run details
diff --git a/AGENTS.md b/AGENTS.md| index 62be9c1..8c3278c 100644 |
| --- a/AGENTS.md |
| +++ b/AGENTS.md |
| @@ -9,7 +9,7 @@ Home. |
| The design is Home's `implementation/team-provisioning-app.md` (APPROVED, |
| discussion 92), with `team-provisioning-amendment.md` (the Home endpoint, |
| -implemented at Home `82d9388`) and carlos/platform |
| +implemented at Home `82d9388`; `homecompat` pins `0cee9ba`) and carlos/platform |
| `implementation/team-scoped-credentials.md` (merged `9bcbab0f5`, not |
| released). Read all three before changing behaviour here; a change that |
| departs from them needs the same review they had. |
diff --git a/README.md b/README.md| index 0306f22..1ff91e6 100644 |
| --- a/README.md |
| +++ b/README.md |
| @@ -7,7 +7,8 @@ registered with Home as a consumer, plus a Home team with its first owner. |
| Design: Home `implementation/team-provisioning-app.md` (APPROVED, round 3, |
| discussion 92). Home side: `team-provisioning-amendment.md`, implemented at |
| -Home `82d9388`. CARLOS side: `team-scoped-credentials.md`, merged at |
| +Home `82d9388` (activation's version rule relaxed at `0cee9ba`, which |
| +`homecompat` pins). CARLOS side: `team-scoped-credentials.md`, merged at |
| platform `9bcbab0f5`, **not released**. Alta replaces |
| `oficina/teams/provision-team.py`. **Not deployed.** |
| @@ -120,10 +121,16 @@ recorded here instead (Fable's rulings on oficina/alta #1): |
| at step 0, and every environment when the walk delivers (step 7, and |
| the audit), refusing a prefix the app does not read. Deploying step 5 is |
| the human check. |
| -- **§7, `app_version`**: Home at `82d9388` admits only a 40-hex commit. |
| - Home is changing that to an opaque printable token; until it lands, Alta |
| - keeps the check (`provision/steps.go`, `activationVersion = commit40`), |
| - and dropping it is that one line. |
| +- **§7, `app_version`**: Home now admits an observed printable token |
| + (`^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$`, Home `0cee9ba`), so a |
| + git-describe stamp activates. Alta mirrors that rule at step 10 |
| + (`activationVersion` in `provision/steps.go`): a version Home would |
| + refuse parks there as `version-unacceptable` instead of failing |
| + activation. |
| +- **§6 step 11, `/api/team`**: Docs serves the readiness probe on main |
| + (`e58a22f`); until the next Docs deploy, Docs parks at |
| + `no-readiness-probe` (its directory row stays pending, and the owner's |
| + address is deleted all the same). |
| - **§11, Help**: the account menu has no Help items yet (no Colophon page). |
| ## Developing |
diff --git a/homecompat/compat_test.go b/homecompat/compat_test.go| index a332d77..03b1533 100644 |
| --- a/homecompat/compat_test.go |
| +++ b/homecompat/compat_test.go |
| @@ -96,7 +96,10 @@ func newHome(t *testing.T, alta *family.Keypair, prefilter string, installation, |
| h.provPub = base64.RawURLEncoding.EncodeToString(prov.SignPub()) |
| // The directory role. |
| - h.dirDB = open(t, migrate.Merge(directorydata.Schema, directorydata.RosterSchema, directorydata.OperatorSchema, operator.DirectorySchema, operator.DirectoryHTTPSchema)) |
| + // The directory's serving schema at the pinned commit |
| + // (internal/home runtime.go ServingSchema): since 7bdddfa it includes |
| + // the Team page's set, whose memberships.added_at seed-team writes. |
| + h.dirDB = open(t, migrate.Merge(directorydata.Schema, directorydata.RosterSchema, directorydata.OperatorSchema, operator.DirectorySchema, operator.DirectoryHTTPSchema, directorydata.TeamSchema)) |
| h.dirV, err = operator.NewVerifier(operator.Pins{Role: "directory", Origin: dirOrigin, Installation: installation, Registry: registry, Device: device, PublicKey: altaPub, |
| Actions: []string{"directory.inspect", "directory.initialize", "directory.seed-team", "directory.provision-consumer", "directory.verify-consumer", "directory.activate-consumer", "directory.disable-consumer"}}) |
| if err != nil { |
| @@ -287,7 +290,9 @@ func newRig(t *testing.T) *rig { |
| tokens := map[string]string{} |
| for _, a := range provision.Apps { |
| tokens[a.Slug] = con.Mint(a.Slug) |
| - con.Versions[a.Slug] = "0123456789abcdef0123456789abcdef01234567" |
| + // A git-describe stamp, as the apps' Makefiles write: Home |
| + // (0cee9ba) activates on an observed token, not only a commit. |
| + con.Versions[a.Slug] = "v0.1.7-3-gabc1234" |
| con.MailPrefix[a.Slug] = a.MailPrefixes[0] |
| } |
| con.Relay["calls"] = true |
diff --git a/homecompat/go.mod b/homecompat/go.mod| index cc0bd8a..ebea1d4 100644 |
| --- a/homecompat/go.mod |
| +++ b/homecompat/go.mod |
| @@ -11,7 +11,7 @@ toolchain go1.26.5 |
| require ( |
| amadan.net/oficina/alta v0.0.0 |
| - amadan.net/oficina/home v0.1.1-0.20261028092646-82d938882ed3 |
| + amadan.net/oficina/home v0.1.1-0.20261028105932-0cee9bad1c40 |
| amadan.net/oficina/home/handoff v0.0.0-20261028092646-82d938882ed3 |
| amadan.net/oficina/home/roster v0.0.0-20261028092646-82d938882ed3 |
| amadan.net/rastrillo/rastrillo v0.29.1-0.20261028004840-5bb38c0ab31b |
diff --git a/homecompat/go.sum b/homecompat/go.sum| index 4d17bbc..d447c2e 100644 |
| --- a/homecompat/go.sum |
| +++ b/homecompat/go.sum |
| @@ -1,7 +1,7 @@ |
| 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.20261028092646-82d938882ed3 h1:V8PwS2i9IRja+WSEjmzwR7h1raIRcar+MmI4q3bvhY4= |
| -amadan.net/oficina/home v0.1.1-0.20261028092646-82d938882ed3/go.mod h1:mt2ZytPZvpN0yYfrQLsoZ3y5ij+CkjOwb74M4M6JI3w= |
| +amadan.net/oficina/home v0.1.1-0.20261028105932-0cee9bad1c40 h1:2knYtzHnkG/gojSJAN4Z5JlfLht0MZ3taVeIQ3b5wVA= |
| +amadan.net/oficina/home v0.1.1-0.20261028105932-0cee9bad1c40/go.mod h1:mt2ZytPZvpN0yYfrQLsoZ3y5ij+CkjOwb74M4M6JI3w= |
| amadan.net/oficina/home/handoff v0.0.0-20261028092646-82d938882ed3 h1:KQ3zM7eJp/JRQuPI2090jVcV5fJSVmOvonVAfSWzwUY= |
| amadan.net/oficina/home/handoff v0.0.0-20261028092646-82d938882ed3/go.mod h1:YISpzFJ+iMgrM0rUL032OSzsAQbP4/nozvXLCCOcn1k= |
| amadan.net/oficina/home/roster v0.0.0-20261028092646-82d938882ed3 h1:AjimnZNNK8kIlaba371a4TgO7Z04DgLLBhjv25k2fPo= |
diff --git a/homeop/fakehome/fakehome.go b/homeop/fakehome/fakehome.go| index 622a808..6fa014f 100644 |
| --- a/homeop/fakehome/fakehome.go |
| +++ b/homeop/fakehome/fakehome.go |
| @@ -23,6 +23,7 @@ import ( |
| "io" |
| "net/http" |
| "net/url" |
| + "regexp" |
| "slices" |
| "strings" |
| "sync" |
| @@ -34,6 +35,9 @@ import ( |
| "github.com/go-json-experiment/json/jsontext" |
| ) |
| +// 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"} |
| type plan struct { |
| @@ -682,7 +686,7 @@ func (h *Home) mutate(x *role, w *plan, a homeop.Authorization, input []byte, he |
| } |
| p := in.Evidence |
| u, err := url.Parse(p.Audience) |
| - if err != nil || !slices.Contains(w.apps, p.App) || p.Policy != homeop.ActivationPolicy || len(p.AppVersion) != 40 || !homeop.CanonicalToken(p.ArtifactDigest) || !homeop.CanonicalToken(p.EnvironmentBinding) || !homeop.CanonicalToken(p.ManifestDigest) || p.AliasHost != u.Host || p.Completed > now || now-p.Completed >= 300 { |
| + if err != nil || !slices.Contains(w.apps, p.App) || p.Policy != homeop.ActivationPolicy || !observedVersion.MatchString(p.AppVersion) || !homeop.CanonicalToken(p.ArtifactDigest) || !homeop.CanonicalToken(p.EnvironmentBinding) || !homeop.CanonicalToken(p.ManifestDigest) || p.AliasHost != u.Host || p.Completed > now || now-p.Completed >= 300 { |
| return res, false |
| } |
| if _, ok := h.fence(p.TeamSQID, w.label); !ok { |
diff --git a/internal/web/words.go b/internal/web/words.go| index 6984aef..b963b43 100644 |
| --- a/internal/web/words.go |
| +++ b/internal/web/words.go |
| @@ -46,8 +46,8 @@ var words = map[string]string{ |
| "version-unstamped": "The build reports no version", |
| "awaiting-box-report": "Waiting for the box to report what it serves", |
| "serving-disagrees": "The box and /api/version disagree", |
| - "version-not-commit": "The app's version is not a commit, so it cannot be activated", |
| - "no-readiness-probe": "The app has no /api/team yet", |
| + "version-unacceptable": "/api/version answers something Home would not take as a version", |
| + "no-readiness-probe": "The app has no /api/team yet (Docs: it lands with the next Docs deploy)", |
| "not-team-mode": "The app is not in team mode", |
| "awaiting-roster": "Waiting for the app's roster", |
| "attempt-expired": "The verification attempt lapsed; verifying again", |
diff --git a/provision/review_test.go b/provision/review_test.go| index c30f4d6..696397f 100644 |
| --- a/provision/review_test.go |
| +++ b/provision/review_test.go |
| @@ -201,3 +201,32 @@ func TestServingParksAsleepAndUnstamped(t *testing.T) { |
| t.Fatalf("dev: serving %s %s", st.State, st.Code) |
| } |
| } |
| + |
| +// Home (0cee9ba) admits an observed printable version token; step 10 |
| +// mirrors its rule, so a build Home would refuse parks there rather than |
| +// failing activation. A git-describe string activates. |
| +func TestVersionHomeWouldRefuseParksAtServing(t *testing.T) { |
| + h := newHarness(t) |
| + h.initialized() |
| + h.con.VersionAnswer["docs"] = "<html>Bad gateway</html>" |
| + e := h.engine(nil) |
| + run, err := e.CreateTeam(h.ctx(), NewTeam{Label: "lagged", Name: "Lagged", Owner: ownerCanary, Apps: []string{"docs"}}) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + h.confirm(homeop.KindCreateTeam) |
| + r := h.drive(e, run, 15) |
| + if st, _, _ := h.store.Step(h.ctx(), "lagged", "docs", StepServing); r.State != "parked" || st.Code != "version-unacceptable" { |
| + t.Fatalf("run %s %s, serving %s %s", r.State, r.Code, st.State, st.Code) |
| + } |
| + if h.home.Calls[homeop.DirectoryActivate] != 0 { |
| + t.Fatal("activation attempted with a version Home refuses") |
| + } |
| + h.con.VersionAnswer["docs"] = "v0.1.7-3-gabc1234" |
| + if r := h.drive(e, run, 20); r.State != "done" { |
| + t.Fatalf("%s %s", r.State, r.Code) |
| + } |
| + if h.home.InstanceState(ConsumerID("lagged", "docs")) != "live" { |
| + t.Fatal("a git-describe version did not activate") |
| + } |
| +} |
diff --git a/provision/steps.go b/provision/steps.go| index 78240b7..128a713 100644 |
| --- a/provision/steps.go |
| +++ b/provision/steps.go |
| @@ -8,6 +8,7 @@ import ( |
| "errors" |
| "io" |
| "net/http" |
| + "regexp" |
| "strings" |
| "time" |
| @@ -654,6 +655,11 @@ func (e *Engine) stepServing(ctx context.Context, p *pass, app App) error { |
| if version == "" || version == "dev" { |
| return park("version-unstamped") |
| } |
| + // Checked for every app, not only those that activate: anything else |
| + // in the body (an error page, a proxy's text) is not a version. |
| + if !activationVersion.MatchString(version) { |
| + return park("version-unacceptable") |
| + } |
| // The two names need not agree: the box's is the release version |
| // `carlos ship` recorded, /api/version is the binary's stamp (git |
| // describe). Both are recorded — app_version for the evidence, |
| @@ -731,23 +737,10 @@ func artifactDigest(serving string) string { |
| } |
| // activationVersion is the app_version Home's directory.activate-consumer |
| -// admits. Home at 82d9388 takes only a 40-hex commit |
| -// (verification.go version()); once Home accepts an opaque observed |
| -// token, this line becomes `var activationVersion = func(s string) bool |
| -// { return s != "" }` and nothing else changes. |
| -var activationVersion = commit40 |
| - |
| -func commit40(s string) bool { |
| - if len(s) != 40 { |
| - return false |
| - } |
| - for _, c := range s { |
| - if !(c >= '0' && c <= '9' || c >= 'a' && c <= 'f') { |
| - return false |
| - } |
| - } |
| - return true |
| -} |
| +// admits: an observed, opaque, printable token (Home 0cee9ba, |
| +// internal/operator/verification.go observedVersion), mirrored here so a |
| +// build Home would refuse parks at step 10 instead of failing activation. |
| +var activationVersion = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$`) |
| func (e *Engine) stepActivate(ctx context.Context, p *pass, app App) error { |
| st := e.cfg.Store |
| @@ -772,9 +765,6 @@ func (e *Engine) stepActivate(ctx context.Context, p *pass, app App) error { |
| return park("attempt-expired") |
| } |
| version := str(sv, "app_version") |
| - if !activationVersion(version) { |
| - return park("version-not-commit") |
| - } |
| ev := homeop.ActivationEvidence{Version: 1, Policy: homeop.ActivationPolicy, Attempt: str(v, "attempt"), Consumer: ConsumerID(label, app.Slug), TeamSQID: p.team.TeamSQID, App: app.Slug, |
| Audience: PublicOrigin(label, app.Slug), Generation: str(cd, "generation"), RecordSequence: 1, RecordDigest: str(cd, "record_digest"), Epoch: num(cd, "epoch"), Owner: p.team.OwnerRef, |
| AppVersion: version, ArtifactDigest: artifactDigest(str(sv, "serving")), EnvironmentBinding: str(envd, "binding"), ManifestDigest: str(reg, "manifest_digest"), |