From e47764a78ec71cb0b86f095acc32602ad99927c8 Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 25 Nov 2026 13:07:21 -0700 Subject: [PATCH] =?UTF-8?q?TEST.md:=20three=20passes=20(local,=20server=20?= =?UTF-8?q?with=20the=20Core,=20multi-tenant),=20and=20checks=20for=20Phas?= =?UTF-8?q?es=2011=E2=80=9313?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- TEST.md | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 108 insertions(+), 4 deletions(-) diff --git a/TEST.md b/TEST.md index abee221..d1c4063 100644 --- a/TEST.md +++ b/TEST.md @@ -12,6 +12,19 @@ and emails, pushes and pull requests on your Gitea, restores. Leave them for last, or skip them. Before a session, make a backup: `supermarket backup "before testing"`. +**Three passes, one per edition.** Sections 1–13 are the app itself, and +are run first on the local edition, on this computer. Then: + +| Pass | Run it with | Sections | +|---|---|---| +| **Local** | `install.sh` / `./update.sh`, at | 1–13, 14 (local part), 15 | +| **Server, with the Core** | `./install-server.sh` on a server (or a test machine, with Caddy's own CA), its Core's domain entered under Settings → Core & Hermes | 14, 15 (agents on a server), 16, and a quick run through 2–10 as a member with only some modules | +| **Multi-tenant** | `compose.multi.yaml` with a Postgres and a Garage bucket (`multi.env`), `SUPERMARKET_PLATFORM_ADMINS` set | 17, and 16 for a team's Core sign-in | + +On the server and multi-tenant passes, sign in as different people (an +owner, an admin, a member with one module) in separate browser profiles or +private windows, so their sessions don't mix. + Throughout, also notice: - [x] Every page loads without an error, in both light and dark mode @@ -771,7 +784,10 @@ Throughout, also notice: ## 11. Agents (MCP) -- [x] `supermarket token` prints a token. +The detailed checks for agents (Phase 11) are in section 15. + +- [x] `supermarket token` prints a token. (Since Phase 11 it's the key of + the built-in *Hermes* agent, under Settings → Agents.) - [ ] Claude Code (`claude mcp list`) shows Supermarket connected, and can read the company profile, the Market and the CRM queue through it (`profile_get`, `inventory_list`, `crm_pending_actions`). @@ -797,9 +813,9 @@ Throughout, also notice: 64-digit key each time. - [ ] Started with `SUPERMARKET_MODE=server` and nothing else, Supermarket doesn't start: its log names each missing setting (database, secret - key, mail, an https:// address). With them all set, the server edition - starts (Phase 10); multi-tenant says it isn't built yet. `supermarket config` never shows a - password or the key. + key, mail, an https:// address). With them all set, it starts. The + multi-tenant edition also needs an S3 bucket. `supermarket config` + never shows a password or the key. - [ ] `supermarket config` also checks the file storage ("writable"), and on the other editions that Postgres can be reached. With a wrong S3 key or Postgres password, it says which and why. @@ -849,3 +865,91 @@ On a server (`./install-server.sh`; with Caddy's own CA on a test machine): - [ ] Settings → Activity shows each step above, with who and from where. - [ ] Settings → Backups lists the nightly dump the morning after. +## 15. Agents, approvals and the API (Phase 11) + +On the local edition (and again on a server, with an agent made there): +- [ ] Settings → Agents lists *Hermes*, built in, with the CRM (read and + act) and the Market (read); its key is `mcp-token`. Hermes' CRM job + and Claude Code still work as before. +- [ ] *New agent*: a name, what it's for, Content *read and act* and SEO + *read*. Its key (`sm_…`) is shown once; the agent's page shows only + its first characters afterwards. +- [ ] Claude Code with that key (`claude mcp add --transport http …`, as the + key's page shows): it's offered the Content and SEO reading tools and + the Content tools that change things, and no SEO tool that changes + anything, nor the CRM's. +- [ ] Ask it to read the morning check and What to write next, write a + draft, and schedule it (`content_publish` with a time). The draft is in + Posts *by* the agent; the schedule waits on **Approvals**, with a count + in the sidebar. +- [ ] On Approvals, edit the text, then *Approve*, ticking *let it do this + on its own, up to 1 a day*. It's scheduled. The agent's next post to + that account goes on its own; the one after waits again. +- [ ] *Refuse* one: nothing goes out; `approvals_status` tells the agent. +- [ ] The agent's page: its recent calls (tool, result, time), what it's + waiting on, its limits. Set *calls a minute* to 2: its third call in a + minute is refused. *Pause*: every call is refused at once; *Resume*. +- [ ] *Rotate the key* (old key works a day); *Rotate* with *it leaked*: + the old key stops at once, and what it was allowed on its own is + withdrawn. *Revoke* stops a key at once. +- [ ] `/api/v1/docs` lists every tool. With the key: + `curl -H "Authorization: Bearer sm_…" http://localhost:8470/api/v1/tools` + lists the agent's, and `curl -X POST … /api/v1/content_drafts -d '{}'` + answers with the drafts as JSON. +- [ ] Settings → Activity shows the agent's actions, marked as an agent. + +## 16. Signing in with the Core (Phase 12) + +On the server pass, with the Core's domain entered under Settings → Core & +Hermes: +- [ ] Settings → Sign-in shows the issuer (`https://authelia.`) and the redirect address. *Make the client's secret* shows + the entry for `idproviders.yml`, with a `$pbkdf2-sha512$310000$…` hash + like the other clients'. +- [ ] **(real)** The Core's admin adds it to `idproviders.yml` and restarts + Authelia; *Test* says Authelia answers. +- [ ] Turn it on: the sign-in page offers *Sign in with *. +- [ ] Invite someone by their Core address; they open the invitation and + choose *Sign in with *: Authelia (with its own two-factor, if + set), then they're in, and Users shows them active. +- [ ] They sign in with the Core again later: straight in. Someone with a + Core account who wasn't invited is refused. +- [ ] *Anyone at may join* with one module: a new Core user + signs in and joins as a member with just that module. +- [ ] *Only with the Core*: a member's password is refused, with a pointer + to the Core; the owner's still works. +- [ ] Signing out of Supermarket also signs out of the Core, if Authelia + offers it (*Test* says so). +- [ ] Activity shows the sign-ins *with the Core*, and the refusals. + +## 17. Multi-tenant (Phase 13) + +- [ ] `supermarket config` (in a copy) finds Postgres and the bucket; the + app starts as the multi-tenant edition, with several copies behind + Caddy. +- [ ] `/signup`: two teams, each with its own company and website (e.g. + `acme.example`, `bolt.example`). Each lands on its company profile. + The same address can't sign up twice. +- [ ] The profile refuses a website on another domain, saying to set up + another team for it. +- [ ] Before the domain is proved, an audit or a Search Console sync leads + to Settings → Domain. Prove it with the TXT record (or the file, or + Search Console). A second team can't prove a domain the first holds. +- [ ] Team A's owner invites team B's owner: they're added to A with the + account they have, and the team menu at the top of the sidebar + switches between A and B, each showing only its own data. +- [ ] Nothing of one team shows in the other: the Market, Posts, Search, + Activity, Settings, a photo's address, and an agent's tools. +- [ ] Settings → Core & Hermes takes a team's own Core; Hermes connects + with an agent's key (section 15). +- [ ] Settings → Your data (owner): *Export* (keys only with the password), + download it. *Delete the team*: it closes, everyone in it gets an + email, *Undo* brings it back. +- [ ] As a platform admin (`SUPERMARKET_PLATFORM_ADMINS`): `/platform` + asks for two-factor first, then lists the teams with their size, + people and failures. *Suspend* one: its people see it's suspended; + *Restore*. *View as* with a reason: read-only, a banner, it ends by + itself, and the team's Activity records it. +- [ ] Restart one copy: people stay signed in, and the others carry on + the background work. +