Where things stand records how the import fills entries in and what it
skips; TEST.md gets checks for the "-url:" list and a run stopped by a
restart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A hand-typed list with no space after its dashes was an error about a
key defined twice. It's now read as meant; a list that still can't be
read says what an entry looks like.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A list of just websites and relationships (url:, website:, or a bare
address) can be imported with "Fill in the empty boxes from each
website": each entry is filled in as on New entry, in the background a
few at a time, and saved straight into the Market. Entries already there,
by name or website, are skipped before their site is read; the plan's
limit is kept. The import page shows the progress and each entry's result.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Total spend from charges, MRR and cohorts on paid invoices, renewals as
existing customers, cohorts in full with dollars, and the start month's
cohort labelled. TEST.md gets checks for each.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a "Count from" month set, that month's cohort is everyone already
paying then, not only those new that month. Both cohort tables now say
"existing customers" under it, the help text explains, and both cohort
CSVs add an existing_customers column.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both cohort tables (MRR retention on Metrics, revenue per customer on
CLV) and their CSVs now show every cohort, each followed to the latest
month, instead of the last 12 or 18 for 12 or 24 months.
Each MRR cohort is now two rows, the share of starting MRR and the
dollars under it, so the numbers line up across months; the month,
customers and starting MRR span both rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each cohort cell now gives what the same customers pay that month, in
dollars, under the share of their starting MRR. The cohorts CSV adds
month_N_mrr columns after the month_N_pct ones.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the earliest recurring invoice Stripe has for a customer is a renewal
(billing_reason subscription_cycle), they were a customer already, their
first year free or billed elsewhere. That first payment now counts as
reactivation (movement "existing"), not new: it stays out of New, the
cohorts and CAC, and the month's movements still add up. The customers
export gives the month first seen paying as first_paid. A $0 trial signup
before the first payment still makes a customer new.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open (unpaid) invoices no longer count toward MRR, so they don't put a
customer in a cohort either; an invoice counts once it's paid. This
matches the customer count, which takes only those who have spent more
than $0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Customers who paid without an invoice (one-off Checkout payments) were
missed, and the Stripe card counted every customer record, deleted ones
too. The sync now reads charges (and follows their events); a customer's
total spend is their successful charges, captured less refunded. A
database synced before reads everything once (sync state version 2).
Until charges are in, paid invoices less refunds stand in.
The Stripe card's Customers now counts those who spent more than $0, "of
N in Stripe", and a Payments count is added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A customer counts when their paid invoices' amount_paid, less refunds,
is above zero. Trials ($0 invoices), fully discounted invoices, only-open
invoices and payments refunded in full no longer put someone on the list.
Also ticks the Market Fetch check in TEST.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reddit's API isn't open to apps like this one, so Supermarket no longer
signs in to Reddit, publishes or schedules there, or reads subreddits and
the account's posts. The internal/api/reddit client, Reddit's OAuth, its
keys and its Social accounts card are gone.
Supermarket still writes the post. Each Reddit draft in Posts has a box
for its subreddit's rules, with a link to them on Reddit: pasted once,
they're kept (subreddits.data, as pasted_rules) and given to the model
for later drafts. Open in Reddit saves the edits and opens the submit
page filled in; Copy title and Copy text (with the tagged source link)
cover a box that comes up empty; Mark as posted records it. Warnings come
from the pasted rules and the posts marked as posted. Fill's subreddit
suggestions are kept unchecked, and say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It sat under the Save button, while the keys' help pointed below to it.
Now it comes first, with a Copy button, ahead of the keys that need it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three choices: as the device is (the default), light, or dark, kept in
a "theme" cookie per browser. The dark colours move to dark.css, linked
with a media attribute from the cookie, so the server renders the page
in the chosen colours with no flash (the CSP allows no inline script).
app.js sets the cookie and switches the media at once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings → Sign-in: roles follow the Core's groups, with a prefix.
<prefix>-admins makes an admin, <prefix>-<module> edits a module,
<prefix>-<module>-view reads it. Set at each sign-in with the Core; someone
in a group joins; the owner never changes; someone in none of them keeps
the access set here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seats: inviting past the seats paid for offers the owner to add one
(Stripe prorates it); admins are told to ask the owner; Free has two.
Moving down: past the plan's seats, the owner and one other (the owner's
pick, or the first to join) edit and the rest read; storage is measured
hourly, and past the plan's, photo uploads and the SEO crawl stop.
Nothing is deleted. TEST.md section 18.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An hourly platform job: a trial over without a subscription goes to Free;
past due, the owner is told and every page has a banner; at 14 days
read-only; at 53 days everyone is warned; at 60 days the team is deleted
with 30 days to undo. Each email once. Undoing a deletion for not paying
gives a week more.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/billing/stripe takes Stripe's webhooks, signatures checked, each event
handled once, and keeps each team's subscription up to date: checkout, its
status, seats and period, failed and paid invoices, cancellation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings → Billing shows the team's plan, trial, people, agents, storage
and next invoice. The owner subscribes through Stripe Checkout (monthly, or
yearly when there's a price) and pays or reads invoices in Stripe's
Customer Portal; admins see the plan only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The multi-tenant edition's plans (Free and Paid as decided, or a plans
file) and each team's billing account, with a 14-day trial of Paid. A
team's plan caps what its people and agents may change: modules outside it
stay readable, a lapsed team changes nothing, and agents, Market entries,
crawls and background jobs keep to it. Without a Stripe key, no billing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Admins make the client's secret under Settings → Sign-in, which shows the
entry for the Core's idproviders.yml (the secret's PBKDF2-SHA512 hash, the
redirect address, PKCE). People sign in with their Core account: invited
ones are matched by verified email, then by subject; optionally anyone at
the Core's domain joins. Passwords can be turned off but for the owner's,
and signing out ends the Core's session where it can. On multi-tenant, the
team is found by its proved domain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The multi-tenant edition starts. compose.multi.yaml runs several copies
behind Caddy, with the managed Postgres and Garage outside. A test walks
every page and fragment, with ids filled in, and every MCP tool, as one
team, and none shows another team's data or changes it; another has three
copies share six teams' work, each team's turn once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owner exports everything from Settings → Your data (the keys only with
their password), and can delete the team: it closes at once, everyone in it
is told, it can be undone for 30 days, and then its schema, files, agents
and memberships go for good.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The people running the multi-tenant service (SUPERMARKET_PLATFORM_ADMINS,
with two-factor sign-in) see every team at /platform with its size, people
and what failed lately, and can suspend or restore a team, resend its
invitations and release its domain. They don't see a team's data unless
they view as it: with a reason, for at most an hour, read-only, recorded in
the team's own audit log.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the server and multi-tenant editions a team's admin enters its Core's
domain and account under Settings → Core & Hermes, instead of core.conf;
Hermes connects from the team's side with an agent's key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Background jobs run for each active team on its own Server and under its
own locks, a few teams at a time and from a different team each round, so
the work is shared between copies of the app and no team holds up another.
Each team's files are under its own prefix, and an OAuth sign-in comes
back only to the team that started it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before Supermarket crawls a team's website, reads its Search Console data
or publishes to it, the team proves the domain is theirs: a DNS TXT
record, a file on the site, or owning its Search Console property. One
team holds a domain at a time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the multi-tenant edition anyone can set up a team: their account, the
company and its website, whose registered domain the team works on (the
profile keeps to it). A person can belong to several teams and switch
between them from the sidebar, or set up another. Inviting someone who has
an account adds them to the team.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A team's connections take a Postgres role that owns its schema and may
use the shared tables, nothing else: even SQL naming another team's
schema is refused. The second guard behind the search_path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the multi-tenant edition each team's data is in its own schema; the
tables every team shares (people, sessions, memberships, keys, locks, and
a new teams table) stay in the main one. A team's connection pool searches
its own schema first, so the app's SQL runs unchanged and can't reach
another team's tables. Each request is served by a copy of the Server for
the viewer's team, with that team's database, secrets and caches; agents
work on their own team's. The local and server editions are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/api/v1 offers the MCP tools as plain HTTP for scripts: GET /api/v1/tools
lists what a key may call, POST /api/v1/<tool> calls one with JSON. Each
call goes through /mcp internally, so keys, scopes, limits, logging and
approvals are the same. /api/v1/docs documents every tool.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each agent has calls a minute and things it may ask to send out a day,
checked on every tool call and every request to send; every call is
recorded (tool, outcome, time) and the agent's page lists the last 50 and
what it's waiting on. Pause refuses all its calls at once. Also fixes each
agent's MCP server being shared with others that had the same scopes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents can now ask to publish or schedule a post, send an email, add
someone to a mailing list, or apply an SEO change. Each waits on the
Approvals page (with a count in the sidebar) for an admin or a member with
edit on its module, who can edit it first, approve or refuse it, and let
the agent take that class of action on its own with a cap per day. A
rotation after a leak revokes the old keys and withdraws everything
allowed. All of it is in the audit log.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents get each module's tools by their scopes: reading tools with read,
the others with read and act. Content (drafts and items; writing, editing
and discarding drafts), Prospects (signals, review, outreach, suppression;
outreach drafts and edits), SEO (the morning check, What to write next,
links, changes; editing a proposal), Sites and Metrics (reading) and the
Market (list, get, save). They call what the pages call, and what an agent
changes is in the audit log as the agent. Nothing that leaves Supermarket
is offered yet: that waits for approvals.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents are users of kind agent, each given modules to read, or to read
and act on, and the CRM scope. Admins make them under Settings → Agents,
on every edition; keys (sm_…) are shown once and kept as hashes, can
expire, be rotated (the old one works a day) or revoked, and record their
last use. /mcp takes agent keys and offers each agent only the tools its
scopes allow. On the local edition, mcp-token is the key of a built-in
Hermes agent with the CRM and the Market.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
compose.server.yaml runs Supermarket behind Caddy (HTTPS from Let's
Encrypt, Caddy's own CA or the team's), with Postgres on an internal
network and a nightly pg_dump kept two weeks. install-server.sh asks for
the domain, certificate and mail server, makes the secret key and database
password, starts it all and prints the setup link. Settings → Backups lists
the dumps on a server, and how the operator restores one. Checked end to
end in Docker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign-ins and failed ones, everything admins do to users, connections,
posting accounts, each post published and email sent, pull requests and
deletions go in an audit log (schema 36), kept two years; admins read it
under Settings → Activity. Drafts, published posts and outreach emails
show who made them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Social accounts become posting accounts: several per network, the
company's and each person's own, with their tokens kept per account. The
old sign-ins are adopted as the company's. Admins say who may post to which
(Settings → Posting accounts); a draft can go out from one account or a
copy to several, each recording who posted it and as what. Signing an
account out, or removing its owner, holds the posts scheduled to it and
tells whoever scheduled them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Admins see every service Supermarket uses, whether it's connected,
failing or not set up, when it was last tested (every Test button now
records its result), and who connected or removed it and when. Keys and
sign-ins saved from the settings pages record the person; refreshed
tokens don't.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One table maps every address to an area (a module, Settings, anything
signed in, or public); each route is checked against it, and the app won't
start with a route missing from it. Changing needs edit on the module. For
members who may only view, forms that would change something are shown
disabled and htmx buttons hidden. The menu, the Overview, Search and the
SEO emails follow each person's modules; Settings is for admins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings → Users lists everyone with their access and status. Admins
invite people by email (a link for 7 days), as admins or as members with
modules each to view or edit; the invitation's page sets the password,
profile and emails wanted. Admins can resend or withdraw invitations,
change access, turn accounts off and on, unlock, reset two-factor, sign
someone out, and remove them; never the owner, nor themselves. Your
account gets the emails wanted and a photo.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>