oficina / alta Public

homecompat, Makefile, CI and the repo's own documents

homecompat is a test-only module that runs Alta's engine against Home's
real internal/operator at 82d9388: the verifier and canonical-bytes
check, the plan store and its windows, the provenance fence, owner-seed,
seed-team, provision, register (the record verified under the pinned
provisioning key), verify, activate, disable, retire and both inspects,
behind a transport that mirrors operator_http.go. It takes a module path
under amadan.net/oficina/home because Go admits imports of Home's
internal packages only from there; it is never built into anything.

make ci is vet, gofmt, the tests and compat, the same steps .amadan/ci.d
reports one by one. AGENTS.md (CLAUDE.md points at it), PRODUCT.md and a
README with the configuration and the deploy checklist, none of which has
been done.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev b1c508bc0fc78b78fc23ff52485b1e36f831f29d parent 5587cdb
13 files changed, +904 −0
  • .amadan/ci +5 −0
  • .amadan/ci.d/10-vet +2 −0
  • .amadan/ci.d/20-fmt +2 −0
  • .amadan/ci.d/30-test +2 −0
  • .amadan/ci.d/40-compat +2 −0
  • AGENTS.md +90 −0
  • CLAUDE.md +5 −0
  • Makefile +62 −0
  • PRODUCT.md +44 −0
  • README.md +104 −0
  • homecompat/compat_test.go +456 −0
  • homecompat/go.mod +41 −0
  • homecompat/go.sum +89 −0
diff --git a/.amadan/ci b/.amadan/ci
new file mode 100755
index 0000000..e6f2f3b
--- /dev/null
+++ b/.amadan/ci
@@ -0,0 +1,5 @@
+#!/bin/sh
+# amadan CI entry (single-script fallback). The steps in ci.d/ are the
+# same targets, reported one by one. Must stay executable.
+set -e
+exec make ci
diff --git a/.amadan/ci.d/10-vet b/.amadan/ci.d/10-vet
new file mode 100755
index 0000000..139a2a2
--- /dev/null
+++ b/.amadan/ci.d/10-vet
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec make vet
diff --git a/.amadan/ci.d/20-fmt b/.amadan/ci.d/20-fmt
new file mode 100755
index 0000000..5884a7b
--- /dev/null
+++ b/.amadan/ci.d/20-fmt
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec make fmt-check
diff --git a/.amadan/ci.d/30-test b/.amadan/ci.d/30-test
new file mode 100755
index 0000000..758ffe2
--- /dev/null
+++ b/.amadan/ci.d/30-test
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec make test
diff --git a/.amadan/ci.d/40-compat b/.amadan/ci.d/40-compat
new file mode 100755
index 0000000..62d29b2
--- /dev/null
+++ b/.amadan/ci.d/40-compat
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec make compat
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 0000000..62be9c1
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,90 @@
+# alta
+
+Alta (*dar de alta*, to enrol) is Paul's team-provisioning app: it creates
+a **team** — one CARLOS instance per Oficina app, each bound to its own
+standalone environment owned by scope `alta`, attached at
+`<label>.<app>.oficina.works`, registered with Home — through Home's signed
+operator endpoint and the CARLOS `team` credential. Paul-only, separate from
+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
+`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.
+
+A [rastrillo](https://amadan.net/rastrillo/rastrillo) app, on the current
+`amadan.net/rastrillo/rastrillo` import path (never the frozen
+`github.com/carlosframework/rastrillo` one), styled with estilo.
+
+## Layout
+
+- `homeop/` — Alta's half of Home's operator endpoint: the signed
+ operation, plan and inspect challenge, every verb's input and Home's
+ result, **field for field and tag for tag as Home's
+ `internal/operator` declares them** (Home re-encodes what it decodes and
+ compares bytes; a moved field is a refused request). `homeop/fakehome` is
+ an in-memory Home for the engine's tests.
+- `console/` — the CARLOS console client: one `team` credential per app,
+ the account by **sqid** (`bds`), client-side envelope sealing, and the §8
+ guards every request passes before it is sent. `console/fakeconsole` is
+ the console as a team credential meets it, with the platform walks.
+- `provision/` — Alta's sealed SQLite state (`store.go`,
+ `migrations/`), the per-app recipes (`apps.go`, §5's GENERATED / SET /
+ PLATFORM), and the §6 state machine (`engine.go`, `steps.go`).
+- `internal/web/` — the pages (§11), Home sign-in, the operator-only gate.
+- `cmd/alta/` — serving, and `alta keygen`.
+- `homecompat/` — a separate, test-only module that runs Alta's engine
+ against **Home's real operator code** at the pinned commit. It takes a
+ module path under `amadan.net/oficina/home/` because Go admits imports of
+ Home's `internal/` only from there; it is never built into anything.
+ Bump its `go.mod` pin when Home's operator code changes, and re-read the
+ diff of `internal/operator` against `homeop/protocol.go`.
+
+## Rules Alta holds hard
+
+- **Alta never holds a platform credential.** No SMTP password, no
+ `CARLOS_RELAY`, no TURN secret, no operate or instance token. PLATFORM
+ keys are waited for, never written; the guard refuses every prefix's SMTP
+ five, the relay, the mail-events key, scan callback secrets and store
+ coordinates, whatever the recipe says.
+- **Generated keys are never regenerated.** Existence is checked by name;
+ a DEK that changes under a database makes it unreadable.
+- **Nothing is inferred from a timeout.** A request is stored, sealed,
+ before it is sent; a lost answer is recovered by exact replay. A refused
+ request never consumed a sequence.
+- **Nothing is deleted to clean up**, and labels and retired hostnames are
+ never reused. The only DELETEs are §9's, inside a retire-apps run.
+- **No address at rest after step 13.** The owner's address lives sealed in
+ `owner_inputs`, the credential plan and the owner-seed request until
+ every allowlist is written, then all three are deleted (`secure_delete`).
+- **Logs carry step keys and fixed codes only**: never a label, an address,
+ a key or a platform value.
+- Screens work without JavaScript; the only script is estilo's `busy.js`.
+ Destructive actions have their own confirm page with a typed label.
+- The gate is `make ci` (vet, gofmt, tests, homecompat), the same
+ definition CI runs. `CGO_ENABLED=0` throughout. Use `make`, not bare
+ `go test`: the Makefile pins the toolchain.
+
+## Serving
+
+`rastrillo.Resolve` + `Serve` speak the CARLOS activation contract;
+`./alta -addr :8080` serves anywhere. `GET /healthz` and `GET
+/api/version` are the framework's. Alta hibernates: a run waiting on a
+domain or a walk advances when Paul next opens a page or presses Resume,
+and every 20 s while the process is awake.
+
+## Deploying
+
+Not before the CARLOS team credential and its floor release exist (Paul's
+condition on ruling 8). The checklist is the README's "Deploying". No live
+CARLOS writes, no AWS and no deploys from an agent session.
+
+## Work in a worktree, and catch main up first
+
+ git -C <repo> fetch origin
+ git -C <repo> worktree add ../<repo>-<task> -b <branch> origin/main
+
+Several sessions share this machine; a checkout has one HEAD between all of
+them. Remove the worktree when the work has landed.
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 0000000..971dce4
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,5 @@
+@AGENTS.md
+
+This project keeps its instructions in AGENTS.md so they apply to every
+agent, not just Claude Code. Nothing is duplicated here on purpose: two
+copies drift, and the drift is silent.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0c30350
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,62 @@
+export GOTOOLCHAIN := go1.26.5
+export GOPRIVATE := $(GOPRIVATE),amadan.net/oficina/estilo.git
+
+APP := alta
+
+# What `carlos ship -target` defaults to, and so what a release must be
+# built for. Override for a one-off: make release RELEASE_GOARCH=amd64
+RELEASE_GOOS ?= linux
+RELEASE_GOARCH ?= arm64
+RELEASE_BIN := releases/$(APP)-$(RELEASE_GOOS)-$(RELEASE_GOARCH)
+
+# What GET /api/version answers. An unstamped binary answers "dev"
+# forever, and the deploy check can then never fail.
+VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null)
+
+.PHONY: build release version-check deps test vet fmt-check compat ci
+
+build:
+ CGO_ENABLED=0 go build ./...
+
+release: version-check
+ @mkdir -p releases
+ CGO_ENABLED=0 GOOS=$(RELEASE_GOOS) GOARCH=$(RELEASE_GOARCH) go build -trimpath \
+ -ldflags "-s -w -X amadan.net/rastrillo/rastrillo.BuildVersion=$(VERSION)" \
+ -o $(RELEASE_BIN) ./cmd/$(APP)
+ @echo "built $(RELEASE_BIN) reporting version $(VERSION)"
+
+version-check:
+ @test -n "$(VERSION)" || { echo "make release: no version to stamp; commit, or name it: make release VERSION=v0.1.0"; exit 1; }
+ @case "$(VERSION)" in *-dirty) echo "make release: the tree is dirty, so $(VERSION) does not name what you would ship"; exit 1;; esac
+
+# deps repairs a module cache whose extracted copy lost files (go mod
+# verify names it), the CI runner's known failure (memoria's Makefile).
+deps:
+ @go mod download
+ @out=$$(go mod verify 2>&1) || { \
+ echo "$$out"; \
+ echo "$$out" | sed -n 's/.*: dir has been modified (\(.*\))$$/\1/p' | while read -r dir; do \
+ echo "deps: re-extracting $$dir"; chmod -R u+w "$$dir" && rm -rf "$$dir"; \
+ done; \
+ go mod download && go mod verify; \
+ }
+
+test:
+ CGO_ENABLED=0 go test ./...
+
+vet: deps
+ go vet ./...
+
+fmt-check:
+ @out=$$(gofmt -l .); if [ -n "$$out" ]; then echo "gofmt needed:"; echo "$$out"; exit 1; fi
+
+# compat runs Alta's engine against Home's real operator code at the
+# pinned commit (homecompat/go.mod). Its own module, so Alta's build
+# never depends on Home's internals.
+compat:
+ cd homecompat && go vet ./... && CGO_ENABLED=0 go test ./...
+
+# ci is the one gate: what the runner executes and what you run before
+# pushing. No migration-check: Alta has no GORM models, only SQL
+# migrations under provision/migrations.
+ci: vet fmt-check test compat
diff --git a/PRODUCT.md b/PRODUCT.md
new file mode 100644
index 0000000..8c7f3e8
--- /dev/null
+++ b/PRODUCT.md
@@ -0,0 +1,44 @@
+# Product
+
+## Platform
+
+A server-rendered web app on CARLOS, one Go binary, cgo-free, hibernating
+between visits. Estilo's chrome and Calma; scriptless but for estilo's
+`busy.js`.
+
+## Users
+
+One: Paul, the operator of the Oficina suite. Nobody else ever sees a
+page, and nobody else needs to: a team's owner meets the result — their
+team's apps in Home's chooser — never Alta.
+
+## Product purpose
+
+Paul's ruling, 2026-10-27: a new person gets a team of their own, never a
+seat on the existing instances. Alta makes that a form and two confirms
+instead of a script: it creates the team's instances, configuration,
+hostnames and Home registrations, and can retire them.
+
+## Positioning
+
+Not Home. Home holds no CARLOS credential, by design (spec §7); Alta holds
+CARLOS credentials that reach only the environments it owns, and only
+Alta's public key is pinned on Home. Every run is confirmed on Home's own
+pages, against Home's own copy of the plan, after a fresh sign-in.
+
+## Capabilities and constraints
+
+- Creates a team for an owner who has already signed in at Home.
+- Labels and retired hostnames are never reused.
+- Memoria AI is off; Slides ships without uploads; team dashboards are
+ blank; Calls' quality reports are off.
+- Alta never holds or writes Paul's SMTP or relay secrets: CARLOS mints
+ them per team environment.
+- No live updates: refresh to see progress.
+
+## Product principles
+
+- Probe, act, verify, record. A crash resumes by probing.
+- What Alta shows is what Alta observed; what Paul confirms is what Home
+ shows him.
+- Nothing is deleted to tidy up.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..fb9484a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,104 @@
+# Alta
+
+Paul's team-provisioning app for the Oficina suite. A **team** is one
+CARLOS instance per app, each bound to its own standalone environment owned
+by CARLOS scope `alta`, attached at `<label>.<app>.oficina.works`,
+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
+platform `9bcbab0f5`, **not released**. Alta replaces
+`oficina/teams/provision-team.py`. **Not deployed.**
+
+## How a run goes
+
+1. **Preflight** (Alta): the label is new and well-formed, both Home roles
+ answer a signed inspect, the directory is initialized, each app has its
+ team credential, nothing already holds the environment or the host.
+2. **Plan**: Alta signs one plan per Home role with one shared plan id and
+ posts it. The run page shows the two Home confirm links and the plan
+ id's first 8 hex.
+3. **Paul confirms on Home** — `https://oficina.works/operator/confirm`,
+ then `https://id.oficina.works/operator/confirm` (retyping the owner's
+ address), each behind a fresh Home sign-in. Home shows its own copy of
+ the plan. Each confirm opens a 15-minute window.
+4. **Alta runs** the steps: owner-seed and seed-team at Home; per app,
+ provision and register the consumer, write the environment, create the
+ instance, attach the hostname, wait for it to serve, and — for apps with
+ roster mode — verify and activate; then the exact-keys audit, after
+ which Alta deletes every row holding the owner's address.
+5. A run that outlives its window parks; **Continue under a new plan**
+ submits an `add-apps` plan for the same apps, confirmed again on Home.
+
+Retiring apps (`retire-apps`) disables the directory consumer, retires the
+credential consumer, detaches the hostname and deletes the instance. The
+parked database replica, the owned environment, and the team's label stay;
+labels and retired hostnames are never reused.
+
+## Configuration
+
+| Variable | Kind | What |
+|---|---|---|
+| `ALTA_ORIGIN` | env | Alta's own origin. The host is not ruled; the default is the unlisted platform address `https://alta.bds.oncarlos.com`. Change it here and in Home's `HOME_CONSUMERS` together. |
+| `ALTA_DEK` | secret | 32 bytes, standard base64: seals Alta's database columns. |
+| `ALTA_OPERATOR_SUBJECT` | env | Paul's Home person ref: the only identity that sees a page. |
+| `ALTA_HOME_ISSUER` | env | `https://id.oficina.works` |
+| `ALTA_HOME_CONSUMER_ID` | env | `alta` |
+| `ALTA_HOME_KEYS_BASE64` | env | Home's assertion public keys (the manifest every app has). Also written into each team app's `<P>_HOME_KEYS_BASE64`. |
+| `ALTA_HOME_DEK_BASE64` | secret | 32 bytes for the sign-in hand-off. |
+| `HOME_DIRECTORY_ORIGIN` | env | `https://oficina.works` |
+| `ALTA_OPERATOR_KEY` | secret | Alta's P-256 operator key (`alta keygen`). |
+| `ALTA_OPERATOR_PREFILTER` | secret | 32 bytes, base64url: Home's prefilter bearer. |
+| `ALTA_OPERATOR_INSTALLATION`, `_REGISTRY`, `_DEVICE` | env | Random once (`alta keygen`), pinned on Home. |
+| `ALTA_DIRECTORY_PROVISIONING_PUBLIC_KEY` | env | The directory's provisioning public key (base64url): Alta verifies every record with it and writes it into Docs' `DOCS_TEAM_OPERATOR_KEYS_BASE64`. |
+| `ALTA_CARLOS_DOCS`, `_SHEETS`, `_SLIDES`, `_CALENDAR`, `_CALLS`, `_MEMORIA` | secret | One CARLOS `team` credential per app, scope `alta`. Never an operate or instance token. |
+| `ALTA_CARLOS_ACCOUNT` | env | The account's **sqid**, default `bds` (the team doors 404 the account's name). |
+| `ALTA_CARLOS_CONSOLE` | env | Default `https://console.carloku.com`. |
+| `ALTA_CALLS_ZONE` | env | `CALLS_ZONE` for team Calls instances; default `UTC`. |
+
+`alta keygen` prints fresh operator material, the pins, and both roles'
+`HOME_OPERATOR_HTTP` with every verb Alta uses.
+
+## Deploying (checklist; nothing here has been done)
+
+1. **Hub repo**: create `oficina/alta` on amadan.net, then push `main`.
+2. **Production gate**: CARLOS `team-scoped-credentials` released, and every
+ box at its floor (`release.TeamEnvironmentFloor`, v0.30.0).
+3. **Team credentials** (Paul, person-only), one per app:
+
+ carlos services create --account oficina --role team --app docs --scope alta alta-docs
+ … sheets, slides, calendar, calls, memoria
+
+ then `carlos secrets set --app alta ALTA_CARLOS_<APP>=…`.
+4. **The CARLOS app** `alta` in account `oficina` (`bds`), served at its
+ platform address; `carlos apps build-probe --app alta --account oficina
+ /api/version`; Alta's own config from the table above.
+5. **Mail and relay**: each app's mail declared under the prefix its binary
+ reads — `DOCS_SMTP` for Docs — and the relay enabled for Calls, so the
+ CARLOS walks mint per-environment credentials. Alta is given no SMTP or
+ relay value.
+6. **DNS and certificates**: `*.<app>.oficina.works` → the deployment, per
+ app zone; Alta attaches explicit hosts.
+7. **Home**: add `"alta": "<ALTA_ORIGIN>"` as the 8th `HOME_CONSUMERS`
+ entry (credential role); set `HOME_OPERATOR_HTTP` on both roles (from
+ `alta keygen`, with `operator_subject` and, on the credential role,
+ `directory_provisioning_public_key` filled in) beside each role's
+ `HOME_OPERATOR_MATERIAL`; enable the directory's roster endpoint.
+8. **The owner** (Till) signs in once at `https://oficina.works`.
+9. **Amendment §12 pre-flight**: Paul confirms the production directory has
+ never issued a roster generation or consumer record, by typing it on
+ Alta's Initialize page. Alta's first production run is `initialize`.
+10. **`lagged`**: per app, `carlos env fork --from lagged --to lagged-team
+ --scope alta`, then rebind each instance with `--scope alta`; create the
+ team in Alta with "Moving a stopgap" ticked.
+
+## Developing
+
+ make ci # vet, gofmt, tests, and the Home compatibility module
+ make release # linux/arm64, stamped with git describe
+
+Tests run the state machine against `homeop/fakehome` and
+`console/fakeconsole` (including a crash after every act, a lost answer
+after every Home commit, and §8's guards), and against Home's real
+operator engine in `homecompat/`.
diff --git a/homecompat/compat_test.go b/homecompat/compat_test.go
new file mode 100644
index 0000000..a332d77
--- /dev/null
+++ b/homecompat/compat_test.go
@@ -0,0 +1,456 @@
+package altacompat
+
+// Alta's engine against Home's real operator engine (internal/operator at
+// the pinned commit): the verifier, the canonical-bytes check, the stream,
+// the plan store and its windows, the provenance fence, owner-seed,
+// seed-team, provision, register (with the record verified under the
+// pinned provisioning key), verify, activate, disable and retire, and
+// both inspects. The HTTP transport below mirrors internal/home
+// operator_http.go's routing and fixed outcomes; Home's own tests cover
+// that transport, which needs the whole Home app to construct.
+
+import (
+ "bytes"
+ "context"
+ "crypto/hmac"
+ "crypto/sha256"
+ "database/sql"
+ "encoding/base64"
+ "encoding/hex"
+ "errors"
+ "io"
+ "log/slog"
+ "net/http"
+ "net/http/httptest"
+ "path/filepath"
+ "strings"
+ "testing"
+ "time"
+
+ "amadan.net/oficina/alta/console"
+ "amadan.net/oficina/alta/console/fakeconsole"
+ "amadan.net/oficina/alta/homeop"
+ "amadan.net/oficina/alta/provision"
+ sharedseal "amadan.net/oficina/home/handoff/seal"
+ "amadan.net/oficina/home/internal/home/directorydata"
+ "amadan.net/oficina/home/internal/operator"
+ "amadan.net/oficina/home/roster"
+ "amadan.net/rastrillo/rastrillo/assertion"
+ family "amadan.net/rastrillo/rastrillo/crypto"
+ rdb "amadan.net/rastrillo/rastrillo/db"
+ "amadan.net/rastrillo/rastrillo/migrate"
+)
+
+const (
+ credOrigin = "https://id.oficina.works"
+ dirOrigin = "https://oficina.works"
+ owner = "till-canary@lagged.test"
+ account = "bds"
+)
+
+var apps = []string{"docs", "sheets", "slides", "calendar", "calls", "memoria"}
+
+type home struct {
+ now time.Time
+ pepper []byte
+ prefilter [32]byte
+ dirPlans *operator.PlanStore
+ credPlans *operator.PlanStore
+ directory *operator.Directory
+ credential *operator.CredentialHTTP
+ dirV *operator.Verifier
+ credV *operator.Verifier
+ provPub string
+ dirDB *sql.DB
+ credDB *sql.DB
+}
+
+func open(t *testing.T, set *migrate.Set) *sql.DB {
+ t.Helper()
+ h, err := rdb.Open(filepath.Join(t.TempDir(), "role.db"), nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { h.Close() })
+ if _, err := migrate.Apply(context.Background(), h, set); err != nil {
+ t.Fatal(err)
+ }
+ return h.Writer()
+}
+
+func newHome(t *testing.T, alta *family.Keypair, prefilter string, installation, registry, device string) *home {
+ t.Helper()
+ h := &home{now: time.Unix(2_000_000_000, 0), pepper: bytes.Repeat([]byte{9}, 32)}
+ raw, _ := base64.RawURLEncoding.DecodeString(prefilter)
+ h.prefilter = sha256.Sum256(raw)
+ clock := func() time.Time { return h.now }
+ sealer, err := sharedseal.New(bytes.Repeat([]byte{6}, 32), "oficina/operator")
+ if err != nil {
+ t.Fatal(err)
+ }
+ altaPub := base64.RawURLEncoding.EncodeToString(alta.SignPub())
+ ownerKey, _ := family.Generate()
+ prov, _ := family.Generate()
+ page, _ := family.Generate()
+ browser, _ := family.Generate()
+ 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))
+ 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 {
+ t.Fatal(err)
+ }
+ de, err := operator.NewEngine(h.dirDB, h.dirV, sealer, bytes.Repeat([]byte{7}, 32), clock)
+ if err != nil {
+ t.Fatal(err)
+ }
+ ov, err := operator.NewOwnerVerifier(base64.RawURLEncoding.EncodeToString(ownerKey.SignPub()), credOrigin, dirOrigin)
+ if err != nil {
+ t.Fatal(err)
+ }
+ route := func(r directorydata.Route) bool { return r.Origin == "https://"+r.Label+"."+r.App+".oficina.works" }
+ h.directory, err = operator.NewDirectory(de, ov, prov, []roster.Key{{ID: "page1", Public: base64.RawURLEncoding.EncodeToString(page.SignPub())}}, directorydata.Config{Apps: apps, ValidateRoute: route})
+ if err != nil {
+ t.Fatal(err)
+ }
+ if h.dirPlans, err = operator.NewPlanStore(h.dirDB, "directory", sealer); err != nil {
+ t.Fatal(err)
+ }
+
+ // The credential role.
+ h.credDB = open(t, migrate.Merge(operator.CredentialSchema, operator.CredentialHTTPSchema))
+ if _, err := h.credDB.Exec("CREATE TABLE people(person_ref TEXT PRIMARY KEY, blind_index TEXT UNIQUE)"); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := h.credDB.Exec("INSERT INTO people VALUES('pr_aaaaaaaaaaaaaaaaaaaaaaaaaa',?)", h.index(owner)); err != nil {
+ t.Fatal(err)
+ }
+ h.credV, err = operator.NewVerifier(operator.Pins{Role: "credential", Origin: credOrigin, Installation: installation, Registry: registry, Device: device, PublicKey: altaPub,
+ Actions: []string{"credential.inspect", "credential.owner-seed", "credential.register-consumer", "credential.retire-consumer"}})
+ if err != nil {
+ t.Fatal(err)
+ }
+ ce, err := operator.NewEngine(h.credDB, h.credV, sealer, bytes.Repeat([]byte{8}, 32), clock)
+ if err != nil {
+ t.Fatal(err)
+ }
+ resolve := func(ctx context.Context, c *sql.Conn, address string, existing bool, _ time.Time) (string, bool, error) {
+ var ref string
+ err := c.QueryRowContext(ctx, "SELECT person_ref FROM people WHERE blind_index=?", h.index(address)).Scan(&ref)
+ if errors.Is(err, sql.ErrNoRows) {
+ return "", false, nil
+ }
+ return ref, err == nil, err
+ }
+ cred, err := operator.NewCredential(ce, dirOrigin, ownerKey, [][]byte{browser.SignPub()}, resolve)
+ if err != nil {
+ t.Fatal(err)
+ }
+ keys := map[string][]byte{"k1": browser.SignPub()}
+ admit := func(id, origin string) bool {
+ _, err := assertion.NewVerifier(credOrigin, origin, keys)
+ return err == nil && id != ""
+ }
+ env := map[string]string{"directory": dirOrigin, "alta": "https://alta-x.bds.oncarlos.com"}
+ if h.credential, err = operator.NewCredentialHTTP(cred, h.provPub, env, apps, h.index, admit); err != nil {
+ t.Fatal(err)
+ }
+ if h.credPlans, err = operator.NewPlanStore(h.credDB, "credential", sealer); err != nil {
+ t.Fatal(err)
+ }
+ return h
+}
+
+func (h *home) index(address string) string {
+ m := hmac.New(sha256.New, h.pepper)
+ m.Write([]byte(strings.ToLower(address)))
+ return hex.EncodeToString(m.Sum(nil))
+}
+
+// handler mirrors internal/home operator_http.go's handleOperator.
+func (h *home) handler(role string) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ answer := func(status int, code string) {
+ w.Header().Set("Content-Type", "application/json")
+ w.WriteHeader(status)
+ _, _ = io.WriteString(w, `{"outcome":"`+code+`"}`)
+ }
+ if r.Method != http.MethodPost || (r.URL.Path != "/operator/v1" && r.URL.Path != "/operator/v1/plan") {
+ answer(404, "not_found")
+ return
+ }
+ if len(r.Header.Values("Cookie")) > 0 || len(r.Header.Values("Origin")) > 0 || r.Header.Get("Content-Type") != "application/json" {
+ answer(403, "browser")
+ return
+ }
+ tok, err := base64.RawURLEncoding.Strict().DecodeString(strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer "))
+ if err != nil || sha256.Sum256(tok) != h.prefilter {
+ answer(401, "prefilter")
+ return
+ }
+ body, _ := io.ReadAll(io.LimitReader(r.Body, operator.BodyLimit+1))
+ v, plans := h.dirV, h.dirPlans
+ if role == "credential" {
+ v, plans = h.credV, h.credPlans
+ }
+ result := func(out []byte, err error) {
+ switch {
+ case err == nil:
+ w.Header().Set("Content-Type", "application/json")
+ _, _ = w.Write(out)
+ case errors.Is(err, operator.ErrRefused):
+ answer(403, "refused")
+ default:
+ answer(503, "unavailable")
+ }
+ }
+ if r.URL.Path == "/operator/v1/plan" {
+ p, err := v.VerifyPlan(body, apps, h.now)
+ if err != nil {
+ answer(403, "refused")
+ return
+ }
+ index := ""
+ if role == "credential" && p.Owner != "" {
+ index = h.index(p.Owner)
+ var one int
+ if h.credDB.QueryRow("SELECT 1 FROM people WHERE blind_index=?", index).Scan(&one) != nil {
+ answer(403, "refused")
+ return
+ }
+ }
+ err = plans.Submit(context.Background(), p, index, h.now)
+ if errors.Is(err, operator.ErrBusy) {
+ answer(409, "busy")
+ return
+ }
+ result([]byte(`{"outcome":"pending"}`), err)
+ return
+ }
+ if _, err := v.Verify(body); err == nil {
+ if role == "directory" {
+ result(h.directory.ExecuteHTTP(r.Context(), body))
+ } else {
+ result(h.credential.ExecuteHTTP(r.Context(), body))
+ }
+ return
+ }
+ if role == "directory" {
+ result(h.directory.InspectHTTP(r.Context(), body))
+ } else {
+ result(h.credential.InspectHTTP(r.Context(), body))
+ }
+ })
+}
+
+// confirm is Paul on Home's confirm pages: Home's own copy of the pending
+// plan, the credential role comparing the typed owner's blind index.
+func (h *home) confirm(t *testing.T, role, typed string) operator.PlanView {
+ t.Helper()
+ plans := h.dirPlans
+ if role == "credential" {
+ plans = h.credPlans
+ }
+ p, err := plans.Pending(context.Background(), h.now)
+ if err != nil {
+ t.Fatalf("%s: no pending plan: %v", role, err)
+ }
+ v, err := plans.Open(context.Background(), p.ID, h.now, func(v operator.PlanView) bool {
+ return role == "directory" || v.OwnerIndex == "" || hmac.Equal([]byte(v.OwnerIndex), []byte(h.index(typed)))
+ })
+ if err != nil {
+ t.Fatalf("%s: confirm: %v", role, err)
+ }
+ return v
+}
+
+type rig struct {
+ home *home
+ con *fakeconsole.Console
+ engine *provision.Engine
+ store *provision.Store
+}
+
+func newRig(t *testing.T) *rig {
+ t.Helper()
+ alta, _ := family.Generate()
+ pre, inst, reg, dev := homeop.Token(), homeop.Token(), homeop.Token(), homeop.Token()
+ h := newHome(t, alta, pre, inst, reg, dev)
+ dir := httptest.NewServer(h.handler("directory"))
+ cred := httptest.NewServer(h.handler("credential"))
+ t.Cleanup(dir.Close)
+ t.Cleanup(cred.Close)
+ con := fakeconsole.New(account, "alta")
+ t.Cleanup(con.Close)
+ tokens := map[string]string{}
+ for _, a := range provision.Apps {
+ tokens[a.Slug] = con.Mint(a.Slug)
+ con.Versions[a.Slug] = "0123456789abcdef0123456789abcdef01234567"
+ con.MailPrefix[a.Slug] = a.MailPrefixes[0]
+ }
+ con.Relay["calls"] = true
+ db, err := provision.OpenDB(filepath.Join(t.TempDir(), "alta.db"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { db.Close() })
+ clock := func() time.Time { return h.now }
+ store, err := provision.NewStore(context.Background(), db, bytes.Repeat([]byte{4}, 32), clock)
+ if err != nil {
+ t.Fatal(err)
+ }
+ roles := map[string]homeop.Role{
+ "credential": {Name: "credential", Origin: credOrigin, URL: cred.URL, Installation: inst, Registry: reg, Device: dev},
+ "directory": {Name: "directory", Origin: dirOrigin, URL: dir.URL, Installation: inst, Registry: reg, Device: dev},
+ }
+ e := provision.New(provision.Config{Store: store, Home: &homeop.Client{Key: alta, Prefilter: pre, Roles: roles, Now: clock},
+ Console: &console.Client{Base: con.URL(), Account: account, Tokens: tokens, Guard: provision.Guard{Store: store, Account: account}},
+ Public: &http.Client{Transport: con.Transport()},
+ HomeCfg: provision.HomeConfig{Issuer: credOrigin, Directory: dirOrigin, KeysBase64: "eyJrMSI6IkJBPT0ifQ==", Provisioner: h.provPub},
+ Account: account, Now: clock, Logger: slog.New(slog.NewTextHandler(io.Discard, nil)),
+ Debug: func(err error) { t.Logf("transient: %v", err) }})
+ return &rig{home: h, con: con, engine: e, store: store}
+}
+
+func (r *rig) drive(t *testing.T, run int64) provision.Run {
+ t.Helper()
+ var out provision.Run
+ for i := 0; i < 40; i++ {
+ _ = r.engine.Advance(context.Background(), run)
+ out, _ = r.store.Run(context.Background(), run)
+ if out.State == "done" || out.State == "failed" {
+ return out
+ }
+ r.con.Walk()
+ r.home.now = r.home.now.Add(3 * time.Second)
+ }
+ return out
+}
+
+// TestAltaAgainstHomesRealOperator runs Alta's first production run and a
+// whole team through Home's real code: initialize; create-team for all
+// six apps (Docs through verify and activate); add-apps after the window
+// closes; then retire.
+func TestAltaAgainstHomesRealOperator(t *testing.T) {
+ r := newRig(t)
+ ctx := context.Background()
+
+ run, err := r.engine.StartInitialize(ctx, provision.InitializeAttestation)
+ if err != nil {
+ t.Fatal(err)
+ }
+ r.home.confirm(t, "directory", "")
+ if got := r.drive(t, run); got.State != "done" {
+ t.Fatalf("initialize: %s %s", got.State, got.Code)
+ }
+ // Home keeps the initialize window open until it expires; a second
+ // confirm before then is 409.
+ r.home.now = r.home.now.Add(homeop.WindowLifetime * time.Second)
+
+ run, err = r.engine.CreateTeam(ctx, provision.NewTeam{Label: "lagged", Name: "Lagged", Owner: owner, Apps: apps})
+ if err != nil {
+ t.Fatal(err)
+ }
+ r1, _ := r.store.Run(ctx, run)
+ dv := r.home.confirm(t, "directory", "")
+ cv := r.home.confirm(t, "credential", owner)
+ // Home's own copy, as Paul reads it on both pages.
+ if dv.Prefix() != homeop.PlanPrefix(r1.PlanID) || cv.Prefix() != dv.Prefix() || dv.Label != "lagged" || dv.DisplayName != "Lagged" || len(dv.Apps) != 6 || cv.OwnerIndex != r.home.index(owner) {
+ t.Fatalf("Home's copy: %+v / %+v", dv, cv)
+ }
+ if got := r.drive(t, run); got.State != "done" {
+ steps, _ := r.store.Steps(ctx, "lagged")
+ t.Fatalf("create-team: %s %s %+v", got.State, got.Code, steps)
+ }
+ var state string
+ if err := r.home.dirDB.QueryRow("SELECT state FROM team_instances WHERE consumer_id='lagged-docs'").Scan(&state); err != nil || state != "live" {
+ t.Fatalf("docs at the directory: %q %v", state, err)
+ }
+ if err := r.home.dirDB.QueryRow("SELECT state FROM team_instances WHERE consumer_id='lagged-sheets'").Scan(&state); err != nil || state != "pending" {
+ t.Fatalf("sheets at the directory: %q %v", state, err)
+ }
+ var n int
+ _ = r.home.credDB.QueryRow("SELECT count(*) FROM consumers WHERE state='active'").Scan(&n)
+ if n != 6 {
+ t.Fatalf("credential consumers %d", n)
+ }
+ // Alta's manifest digest is Home's.
+ table, _ := operator.ActiveConsumers(ctx, r.home.credDB)
+ union := map[string]string{"directory": dirOrigin, "alta": "https://alta-x.bds.oncarlos.com"}
+ for id, o := range table {
+ union[id] = o
+ }
+ want, _ := operator.ManifestDigest(union)
+ if got := homeop.ManifestDigest(union); got != want {
+ t.Fatalf("manifest digest %s, Home's %s", got, want)
+ }
+ // Docs' environment carries a record Docs itself would accept: the
+ // one Home signed, under the key Alta pinned.
+ vars, _, _ := r.con.Env("docs", "lagged")
+ rec, _ := base64.StdEncoding.DecodeString(vars["DOCS_TEAM_PROVISIONING_BASE64"].Value)
+ keys, _ := base64.StdEncoding.DecodeString(vars["DOCS_TEAM_OPERATOR_KEYS_BASE64"].Value)
+ if _, err := roster.VerifyProvisioning(rec, provision.ProvisionerKeys(r.home.provPub), roster.Bindings{Issuer: credOrigin, Directory: dirOrigin, Consumer: "lagged-docs", App: "docs", Team: vars["DOCS_TEAM_ID"].Value, Audience: "https://lagged.docs.oficina.works"}); err != nil || !strings.Contains(string(keys), r.home.provPub) {
+ t.Fatalf("docs record: %v", err)
+ }
+ // Alta's stream is Home's.
+ for _, role := range []string{"directory", "credential"} {
+ seq, head, _, _ := r.store.Stream(ctx, role)
+ db := r.home.dirDB
+ if role == "credential" {
+ db = r.home.credDB
+ }
+ var hs int64
+ var hh string
+ _ = db.QueryRow("SELECT sequence,head FROM "+role+"_operator_state WHERE singleton=1").Scan(&hs, &hh)
+ if seq != hs || head != hh {
+ t.Fatalf("%s stream: Alta %d/%s, Home %d/%s", role, seq, head, hs, hh)
+ }
+ }
+
+ // Retire Calls: disable at the directory, retire at the credential
+ // origin, detach, delete.
+ r.home.now = r.home.now.Add(homeop.WindowLifetime * time.Second)
+ run, err = r.engine.RetireApps(ctx, "lagged", []string{"calls"}, "lagged")
+ if err != nil {
+ t.Fatal(err)
+ }
+ r.home.confirm(t, "directory", "")
+ r.home.confirm(t, "credential", "")
+ if got := r.drive(t, run); got.State != "done" {
+ t.Fatalf("retire: %s %s", got.State, got.Code)
+ }
+ if err := r.home.dirDB.QueryRow("SELECT state FROM team_instances WHERE consumer_id='lagged-calls'").Scan(&state); err != nil || state != "disabled" {
+ t.Fatalf("calls at the directory: %q", state)
+ }
+ if err := r.home.credDB.QueryRow("SELECT state FROM consumers WHERE consumer_id='lagged-calls'").Scan(&state); err != nil || state != "retired" {
+ t.Fatalf("calls at the credential origin: %q", state)
+ }
+}
+
+// TestHomeRefusesWhatAltaMustNotDo checks the fences hold on Home's side
+// for requests Alta signs correctly: no window, a label outside the
+// window, an unknown owner.
+func TestHomeRefusesWhatAltaMustNotDo(t *testing.T) {
+ r := newRig(t)
+ ctx := context.Background()
+ run, _ := r.engine.StartInitialize(ctx, provision.InitializeAttestation)
+ // Not confirmed: no window, nothing happens at Home.
+ if got := r.drive(t, run); got.State == "done" {
+ t.Fatal("initialized without a window")
+ }
+ var n int
+ _ = r.home.dirDB.QueryRow("SELECT count(*) FROM roster_generation").Scan(&n)
+ if n != 0 {
+ t.Fatal("generation written without a window")
+ }
+ r.home.confirm(t, "directory", "")
+ if got := r.drive(t, run); got.State != "done" {
+ t.Fatalf("initialize: %s %s", got.State, got.Code)
+ }
+ r.home.now = r.home.now.Add(homeop.WindowLifetime * time.Second)
+ if _, err := r.engine.CreateTeam(ctx, provision.NewTeam{Label: "alpha", Name: "Alpha", Owner: "nobody@nowhere.test", Apps: []string{"docs"}}); err == nil {
+ t.Fatal("Home accepted a plan for an owner who never signed in")
+ }
+}
diff --git a/homecompat/go.mod b/homecompat/go.mod
new file mode 100644
index 0000000..cc0bd8a
--- /dev/null
+++ b/homecompat/go.mod
@@ -0,0 +1,41 @@
+// homecompat checks Alta against Home's real operator code. Home keeps it
+// in internal/operator, which Go lets only import paths under
+// amadan.net/oficina/home import; so this test-only module takes a path
+// under Home's (it is never published, built or deployed), and pins the
+// exact Home commit Alta was written against.
+module amadan.net/oficina/home/altacompat
+
+go 1.26
+
+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/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
+)
+
+require (
+ amadan.net/carlos/platform.git/launchctx v0.0.0-20260911135504-fb577f96f7d1 // indirect
+ github.com/dustin/go-humanize v1.0.1 // indirect
+ github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2 // indirect
+ github.com/google/uuid v1.6.0 // indirect
+ github.com/jinzhu/inflection v1.0.0 // indirect
+ github.com/jinzhu/now v1.1.5 // indirect
+ github.com/mattn/go-isatty v0.0.20 // indirect
+ github.com/ncruces/go-strftime v1.0.0 // indirect
+ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
+ github.com/sqids/sqids-go v0.4.1 // indirect
+ golang.org/x/sys v0.47.0 // indirect
+ golang.org/x/text v0.41.0 // indirect
+ gorm.io/gorm v1.31.2 // indirect
+ gorm.io/plugin/dbresolver v1.6.2 // indirect
+ modernc.org/libc v1.74.1 // indirect
+ modernc.org/mathutil v1.7.1 // indirect
+ modernc.org/memory v1.11.0 // indirect
+ modernc.org/sqlite v1.55.0 // indirect
+)
+
+replace amadan.net/oficina/alta => ../
diff --git a/homecompat/go.sum b/homecompat/go.sum
new file mode 100644
index 0000000..4d17bbc
--- /dev/null
+++ b/homecompat/go.sum
@@ -0,0 +1,89 @@
+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/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=
+amadan.net/oficina/home/roster v0.0.0-20261028092646-82d938882ed3/go.mod h1:gqshuXyDtFZUCYbhuZyV3Epc51pUcsLbpqAqiA5UiXg=
+amadan.net/rastrillo/rastrillo v0.29.1-0.20261028004840-5bb38c0ab31b h1:7rApPVcEQ4MReZ6Q1h6fydrxtQwjd6kk6MyzQfpHYjo=
+amadan.net/rastrillo/rastrillo v0.29.1-0.20261028004840-5bb38c0ab31b/go.mod h1:jSSeydqEvlm/fU3hhWoXFnyEaDgroR8LPRZSo9ZhhIM=
+amadan.net/rastrillo/rastrillo/money v0.1.0 h1:MxU4oqNrW8abxRTkgZBv24OYNpFnvonajNqeLIzmmaM=
+amadan.net/rastrillo/rastrillo/money v0.1.0/go.mod h1:cmgkjBEIQh1pFSYvQk0UU6oPYS8kSDypdT9+t4Flx0U=
+github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
+github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
+github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2 h1:iizUGZ9pEquQS5jTGkh4AqeeHCMbfbjeb0zMt0aEFzs=
+github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2/go.mod h1:TiCD2a1pcmjd7YnhGH0f/zKNcCD06B029pHhzV23c2M=
+github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
+github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
+github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs=
+github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
+github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
+github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
+github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
+github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
+github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
+github.com/keymaildev/signin v0.1.1 h1:gO+1IAM99sqUkBtCezkgGxab+/DOrqwDxd5H32N1s9Q=
+github.com/keymaildev/signin v0.1.1/go.mod h1:Eb/sCmEel1jlcdkgPOrNeMn5jvxzoFvJrdjDUxOBHls=
+github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
+github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
+github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
+github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
+github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
+github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
+github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
+github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
+github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
+github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
+github.com/sqids/sqids-go v0.4.1 h1:eQKYzmAZbLlRwHeHYPF35QhgxwZHLnlmVj9AkIj/rrw=
+github.com/sqids/sqids-go v0.4.1/go.mod h1:EMwHuPQgSNFS0A49jESTfIQS+066XQTVhukrzEPScl8=
+golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk=
+golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40=
+golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
+golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
+golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
+golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
+golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=
+golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE=
+golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk=
+gorm.io/driver/mysql v1.5.7 h1:MndhOPYOfEp2rHKgkZIhJ16eVUIRf2HmzgoPmh7FCWo=
+gorm.io/driver/mysql v1.5.7/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM=
+gorm.io/driver/sqlite v1.6.0 h1:WHRRrIiulaPiPFmDcod6prc4l2VGVWHz80KspNsxSfQ=
+gorm.io/driver/sqlite v1.6.0/go.mod h1:AO9V1qIQddBESngQUKWL9yoH93HIeA1X6V633rBwyT8=
+gorm.io/gorm v1.31.2 h1:3o8FXNo9v9S858gil+3LlZA1LkCOzgb4g5BL64FgaCo=
+gorm.io/gorm v1.31.2/go.mod h1:XyQVbO2k6YkOis7C2437jSit3SsDK72s7n7rsSHd+Gs=
+gorm.io/plugin/dbresolver v1.6.2 h1:F4b85TenghUeITqe3+epPSUtHH7RIk3fXr5l83DF8Pc=
+gorm.io/plugin/dbresolver v1.6.2/go.mod h1:tctw63jdrOezFR9HmrKnPkmig3m5Edem9fdxk9bQSzM=
+modernc.org/cc/v4 v4.29.0 h1:CXgwL8cvxmyzBQZzbSl/6xFtMCryb6u8IOqDci39cgc=
+modernc.org/cc/v4 v4.29.0/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI=
+modernc.org/ccgo/v4 v4.34.6 h1:sBgfIwyN0TQ9C5hwIeuqyeAKyMWnbvj2fvpF4L11uzU=
+modernc.org/ccgo/v4 v4.34.6/go.mod h1:SZ8YcN9NG7XVsQYdm6jYBvi8PQP1qi+kqB6OhjqI3Fk=
+modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM=
+modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU=
+modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
+modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=
+modernc.org/gc/v3 v3.1.4 h1:2g65LGVSmFQrXeITAw97x7hCRvZFcyE1uDP+7Vng7JI=
+modernc.org/gc/v3 v3.1.4/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
+modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
+modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
+modernc.org/libc v1.74.1 h1:bdR4VTKFMC4966QSNZ05XLGI/VwzVa2kTUX51Dm0riQ=
+modernc.org/libc v1.74.1/go.mod h1:uH4t5bOx3G3g9Xcmj10YKlTcVISlRDwv8VoQJG9n8Os=
+modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
+modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
+modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
+modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
+modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg=
+modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
+modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
+modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
+modernc.org/sqlite v1.55.0 h1:hIFh0MCH0rGinQ/4KYb5/UbCkRkb+UP+OkLCVWa5MTM=
+modernc.org/sqlite v1.55.0/go.mod h1:4ntCLuNmnH8+GNqjka1wNg7KJd5/Hi5FYp8K+XQ7GZw=
+modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
+modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
+modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
+modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=