Commit Graph
31 Commits
Author SHA1 Message Date
davidandClaude Opus 5.5 47a504b7b2 Phase 10, part 4: inviting users, and what admins can change
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>
2026-11-25 09:07:32 -07:00
davidandClaude Opus 5.5 8040512a18 Phase 10, part 3: signing in and out, resets, locks and two-factor
The server edition now starts. Sign-in by email and password, limited per
address and per IP; ten failures in a row lock the account and email its
owner, and a reset by email (or an admin) unlocks it. Settings → Your
account has the profile, the password, where you're signed in, and
two-factor sign-in with an authenticator app (TOTP, from a QR code) and
ten recovery codes. The app's own mail goes through SUPERMARKET_MAIL_URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:01:29 -07:00
davidandClaude Opus 5.5 72455438c9 Phase 10, part 2: the first owner, from a one-time setup link
A new server prints a link to create its owner (supermarket setup-link
makes another); until it's used, every page says the setup isn't
finished. One-time links (schema 33) are kept as hashes and used up in
one statement; resets and invitations will use them too. The server
edition opens Postgres.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 08:53:14 -07:00
davidandClaude Opus 5.5 96404a3580 Phase 10, part 1: users, sessions and form tokens
Schema 32 adds users, memberships and sessions, on both databases.
internal/users keeps accounts (Argon2id passwords), roles and modules,
and sessions whose rows hold only a hash of the cookie's value; they end
after a week unused or 30 days. On the server edition, every page but the
public ones needs a session and sends others to /signin. Every edition's
forms now carry a CSRF token (a cookie repeated in each form, added as
pages render; htmx sends it as a header), besides the same-origin check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 08:49:45 -07:00
davidandClaude Opus 5.5 7a857c7346 Phase 9, part 1: editions and their settings
SUPERMARKET_MODE picks local (the default), server or multi. internal/config
reads and checks every setting the editions need (database, secret key,
storage, the app's own mail, an https address), reporting all problems at
once. supermarket config prints them without passwords; supermarket
secret-key makes a key. Settings -> About shows the edition. Server and
multi-tenant are checked but refuse to start until they're built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:55:30 -07:00
davidandClaude Opus 5.5 5705a9b58b Phase 7 part 4: SEO → What to write next
One list per website of everything worth writing: new wording for pages
(Push pages and the audit's title and description issues), landing
pages for signals that get replies, pages for apps people name in their
replies (their own words, without quoted mail or signatures), and
keywords or briefs that stalled. Ranked by the sign-ups each is expected
to bring, at most 10 shown, each with its reason in numbers and the
button that starts its flow; Not now hides one for 90 days. The SEO
module still opens on the Morning check; the Monday report links here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:17:42 -07:00
davidandClaude Opus 5.5 aeba28b658 SEO: daily clicks chart, top searches, percentages, daily email
- The morning check draws clicks by day, this week over the week before.
- The morning check and the Monday report list the searches that gained
  and lost most clicks (any size; real moves stay on their own list).
- The week's clicks and impressions show their change in percent.
- Settings → Search engines can email the morning check, at most once a
  day, when something really moved. Both emails carry the new lists.
- With a domain property, a line says how many clicks went to its other
  hosts (a shop, a Gitea…) and for which search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:55:54 -07:00
davidandClaude Opus 5.5 c36f786ae9 Fixes from the first round of TEST.md
SEO: a domain property (sc-domain:) covers every subdomain, so the shop,
Gitea and forum were counted as the website. What ranks, the morning
check, the Monday report, keywords, change candidates and the audit's
traffic now read only the website's own host (with or without www).
The report keeps pages worth a proposal apart from "Waiting for your
yes", explains only moves past the thresholds, and says "places up/down".

Also:
- Feed summaries drop the posts' scripts and styles.
- Spend you log can't be negative.
- Test and check buttons can't be clicked twice while they run.
- Previews show the site's web fonts and icon sprites.
- Backups are read without leaving -wal/-shm files; deleting one removes
  them, and leftovers are swept at start.
- The Overview's setup flags a CRM that Hermes can't reach.
- Import now says what came in; adding a prospect that exists says so;
  prospects can be deleted.
- Signal tags and brief addresses keep accented letters (Ü → u).
- Page errors start with a capital; clearer messages for bad uploads,
  CRM retry and cancel, keywords, and the finished audit.
- The module you're in stays unfolded in the sidebar.
- A picked keyword can be unpicked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:31:42 -07:00
davidandClaude Opus 5.5 2a605ac265 Sidebar: fold each module's pages
A chevron beside each module folds or unfolds its pages. The current
module is always open; the others keep the state you left them in; a
folded module shows its pages' counts added up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:27:22 -07:00
davidandClaude Opus 5.5 9ca09c1ffa Phase 6 part 5, step 2: start a new site
Sites → New site fills an empty Gitea repository with the theme, a
hugo.toml in the site's brand and a starter home page: checked that the
repository is empty and builds with Hugo, then the first commit is pushed
to its default branch. The site joins the profile, and a First pages card
builds its Home, About, Contact and product pages with the page builder;
About and Contact join the top menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:27:22 -07:00
davidandClaude Opus 5.5 062fcf2e59 Phase 5 part 4: landing pages per buying signal
Each signal's page lists its landing pages with their Gitea status, live
address and 30-day visitors from Plausible, and builds a new one. Pages
can be duplicated as variants (B, C…, with their own utm_content), taken
off the site through a pull request that deletes the file, or have their
pull request closed. The scorecard counts live pages. Schema 23.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:19:55 -07:00
davidandClaude Opus 5.5 5e799c7541 Phase 4 part 2: MRR, its movements, NRR and cohorts
Each customer's MRR at each month's end, from the recurring lines of paid
and open invoices: the amount after discounts over the billing interval,
prorations over their part-period. Moves are new, expansion, contraction,
churn and reactivation (sub-dollar noise ignored); NRR monthly and over
12 months; cohorts by first paid month. A start month, suggested when
most of the business appears at once (billing moved to Stripe), makes
those customers the base. Metrics page with a chart, the month table,
cohorts, and each month's customer moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:17:53 -07:00
davidandClaude Opus 5.5 68c224f51b Phase 3 part 6: briefs and pages
A brief for a search (a new page) or a page (a rewrite) starts from what
Search Console shows the page for, reads the live top 5 with Claude's web
search (unread results marked, never guessed), and gives the title,
description, H1, angle, sections, questions, internal links to pages we
have, and the questions only the owner can answer. The page is drafted
around those answers, with no invented tests, prices or customers; every
sentence claiming an experience must be confirmed before a pull request
adds or rewrites the page, checked with a Hugo build. Merged pages are
followed to the live site. Schema 17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:18:49 -07:00
davidandClaude Opus 5.5 43a7b42126 Phase 3 part 3: the audit, ranked by traffic, with AI visibility
A polite crawl of each website (Search Console's busiest pages, the
sitemap, then links; up to 300 pages; robots.txt honoured) checks titles
and descriptions (characters and pixels), headings, canonical, noindex,
status and redirects, broken links (outside ones twice), alt text, Open
Graph, JSON-LD, text without JavaScript, and whether the title says what
the page's main search asks. Issues are ranked by severity, then the
page's clicks and impressions. AI visibility: AI crawlers in robots.txt,
llms.txt, structured data, Organization data. Optional PageSpeed checks.
Weekly in the background, or Audit now. Schema 14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:53:10 -07:00
davidandClaude Opus 5.5 c2772a7927 Phase 2 part 6: outreach by email and LinkedIn
Drafts are written by the AI from the person's buying signal (hypothesis
and angle), their company and their history, then reviewed and edited.
Queued emails go out through the Core's mail server one at a time, within
the sending hours, the daily limit and a gap, never to a suppressed or
bouncing address or someone emailed in the last 14 days; with a signature,
an opt-out line, UTM-tagged links and a copy in Sent. The inbox is read
read-only every 10 minutes: replies (by Message-ID or sender) count as
Replied, bounces mark the address, and "stop" replies are suppressed.
LinkedIn messages are copied, sent by hand and marked sent. New pages:
Prospects → Outreach and Settings → Email (with an SMTP, IMAP, SPF, DKIM
and DMARC check). Schema 10; emersion/go-imap for IMAP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:09:47 -07:00
davidandClaude Opus 5.5 82d569da9c Phase 2 part 5: find people and verify emails with Hunter.io
Review gets Find people (Domain Search by the departments, seniority and
count set in Settings → Lead sources), Find their email (Email Finder for
a named person at a company), and Verify (one, or every unchecked address
in New). Every call is kept in enrich_runs (schema 9) with its result and
credits, and shown on the card. Nothing runs on a schedule. Sources are
shown by name (Hunter.io, origami.chat, explee.com).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 05:53:52 -07:00
davidandClaude Opus 5.5 157902f7e2 Phase 2 part 4: discovery per signal (Claude web search, explee.com)
Each signal's page can search for organizations that show it, by hand or
every 7, 14 or 30 days. Claude with the web_search_20260209 server tool
(pause_turn resumed) works from the signal's "How to spot it" lines and
the profile's targets; a company is kept only if its evidence URL was
among the pages searched. explee.com's company search runs the signal's
description in the target sizes, scored against the hypothesis, keeping
strong matches. Our sites, the inventory, existing prospects, CRM
Accounts and suppressed domains are left out. New companies go to Review
tagged with the signal. Schema 8 adds discovery_runs (counts, searches,
why companies were left out) and the signal's schedule and explee.com
description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 18:27:35 -07:00
davidandClaude Opus 5.5 b025a97e4a Phase 2 part 3: buying signals, the funnel and the scorecard
Schema 7 adds signals (hypothesis, how to spot it, angle, status, utm
slug), funnel_events (stage, channel, subject, campaign, source, deduped
by external ID) and outside_campaigns. Prospects -> Signals is the
scorecard: each signal's funnel from found to paid, people once per
stage, with revenue and outside spend, by period and channel. Each
signal's page shows its funnel by channel, its campaigns and its latest
steps. Prospects carry a signal (filter, change, "found" recorded) and
outcomes can be recorded by hand.

Settings -> Lead sources holds origami.chat and explee.com API keys. Every
6 hours (or Import now) Supermarket reads their campaigns, numbers and
spend, contacted people, replies and hot leads, read-only: interested
people and repliers become prospects, unsubscribes are suppressed, and
each campaign is assigned to a signal. The explee.com client follows its
OpenAPI schema; origami.chat's responses are undocumented, so its client
reads fields loosely and its Test shows the real response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 18:06:58 -07:00
davidandClaude Opus 5.5 7633697567 Phase 2 part 2: prospects, the review screen and the suppression list
Schema 6 adds prospect_companies, prospect_contacts (merged by domain and
email, each with its source, detail and date) and suppressions. Prospects
-> Review lists New, Accepted and Set aside: accepting a company queues an
EspoCRM Account, a person a Lead at their company, with provenance and
why they fit in the description; the page warns about records already in
the CRM as of the last sync, and shows each accepted prospect's CRM
progress. Prospects can be added by hand. The suppression list (emails
and domains) is checked on add and again before queueing, and suppressing
sets matching new prospects aside. Search finds prospects too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 16:51:05 -07:00
davidandClaude Opus 5.5 7733672706 Logo: the transparent Neon S, whole
The icons are now made from neon-S-transparent.png, keeping the whole S
and its glow (the earlier square crop cut off its top and bottom) and
centring it in a square. With no background, the logo drops the tile's
rounded corners and shadow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 12:10:23 -07:00
davidandClaude Opus 5.5 567abcffef New logo: the Neon S (white)
The sidebar logo, the tab icons (favicon.ico at 16-64 px and a PNG) and a
new 180 px home-screen icon are made from neon-S-white.png, cropped a
little so the S fills them. The logo is a rounded tile with a soft shadow
so it stands out on the light sidebar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 12:01:50 -07:00
davidandClaude Opus 5.5 013e30bf40 Post Reddit drafts by hand: Open in Reddit, Copy text, Mark as posted
Reddit now approves API apps before they get keys, so Supermarket may not
be able to post there for a while. Each Reddit draft in the Inbox can be
posted by hand instead:

- Open in Reddit saves the edits and opens old.reddit.com's submit page
  for the subreddit in a new tab, with the title and text filled in, the
  source link added and own-site links UTM-tagged as publishing would.
  Links-only subreddits get a link post. Over ~7500 characters the text
  is left out of the address.
- Copy text copies the draft's current text.
- Mark as posted (with the post's link, optional) moves it to Published
  and into the Reddit history used for warnings.

Copy buttons now copy a field's current value, not its first text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 11:51:16 -07:00
davidandClaude Opus 5.5 9c62680927 Remind before LinkedIn's sign-in expires, and stop posting once it has
LinkedIn tokens last 60 days and can't be renewed without signing in
again. The expiry LinkedIn reports is now recorded (60 days from sign-in
for older connections). The LinkedIn card says until when; from two
weeks before, the Overview, the Inbox and the card remind you, with a
Reconnect button. Once expired, LinkedIn counts as not connected, due
posts come back to the Inbox saying why, and a 401 from LinkedIn reads
"reconnect LinkedIn" instead of the raw error.

Also fixes a leftover "Settings → Credentials" in a publish error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 11:43:59 -07:00
davidandClaude Opus 5.5 1f181ed554 Social accounts: X's 127.0.0.1 callback, "Get it" links, save in place; cart logo
- X refuses "localhost" in callback URLs, so its sign-in now uses
  http://127.0.0.1:8470/auth/x/callback (shown on the page and sent to X);
  LinkedIn and Reddit keep localhost.
- Every key, on Social accounts and the AI tab, has a "Get it" link to the
  service's page for it (opens a new tab) and says where on that page to
  find it. Addresses checked on 2026-11-21.
- Each network's card saves its own keys in place (htmx swaps the card),
  saying "Saved." and enabling Connect when ready; no reload. Without
  JavaScript it still saves and reloads.
- The shopping-cart image is the logo in the sidebar, the tab icon (PNG,
  and a multi-size favicon.ico at /favicon.ico) and the touch icon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 11:01:01 -07:00
davidandClaude Opus 5.5 d9b1467365 Suggest subreddits when filling in an inventory entry, checked with Reddit
If the Subreddits box is empty, the AI suggests up to eight, by the
relationship, each with who is there. Each is looked up on Reddit (with
the app's client ID and secret) and left out if it doesn't exist, is
private, 18+, restricted or archived; the first five kept fill the box.
The form lists every suggestion with members, post types and why any was
left out. Lookups are cached for drafting. Without Reddit keys the
suggestions are kept and the form says they weren't checked.

The Reddit client now returns ErrNotFound and ErrForbidden, and treats an
empty about listing as not found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 10:31:04 -07:00
davidandClaude Opus 5.5 a89121f1ec Redesign the UI on brain's look: sidebar with search, Overview, modules, grouped Settings
- Left sidebar as in brain: search at the top (press /), Overview,
  Inventory, the modules (Content with Inbox, Sources, Scheduled and
  Published; later phases greyed out), Settings at the bottom; a top bar
  with breadcrumbs, and a menu that slides in on narrow screens.
- brain's colour tokens, type, radius and shadows, with a dark theme that
  follows the system setting.
- Settings as grouped tabs: Profile; Social accounts (was Credentials, now
  keys and sign-in together per network); Core & Hermes; AI, which now
  holds the API keys too. Old addresses redirect.
- /search matches every word across posts, fetched items, the inventory,
  products and settings pages.
- Overview: a card per module, then the setup checklist, folded once done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 07:50:24 -07:00
davidandClaude Opus 5.5 cd24f2a06d Phase 1, part 4: promote the company's own products
- Content lists the company first, at /content/own: its products from
  the profile (always there to pick from), its own feeds (a new profile
  field for the blog, news and releases), and new or updated pages from
  its websites' sitemaps, with each page's title and description.
- Drafts from it are kind "product" (utm_campaign=product), filed under
  the company's name, and prompted to promote the company's own work
  without unsupported claims; on Reddit, in the makers' voice, with a
  warning that self-promotion is often restricted.

This completes Phase 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 14:42:37 -07:00
davidandClaude Opus 5.5 0e34f574b7 Phase 1, part 3: Reddit
- Sign in with a Reddit web app; access tokens refresh automatically,
  and an app-only token reads rules before sign-in.
- Reddit drafts: a title and text for one subreddit, chosen when
  writing. The subreddit's guidelines and rules go into the prompt, which
  asks for a community member's post that discloses the affiliation and
  avoids marketing language.
- The Inbox shows the subreddit's rules (cached for a day, with Refresh)
  and warns, without blocking, about promotion rules, restricted
  subreddits, link-only subreddits, posting in the same subreddit within
  a week, more than 1 in 10 recent posts linking to the company's sites,
  and new accounts.
- Publishing makes a text post with the source link at the end, or a
  link post where the subreddit takes only links.
- Migration 4 adds the draft's title and subreddit, and the rules cache.
  Publishers now take a Post, which carries the title and subreddit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:51:16 -07:00
davidandClaude Opus 5.5 f275f039f9 Phase 1, part 2: Inbox, scheduled publishing and UTM tags
- Inbox: a top-level page, with a count in the menu, for everything
  waiting for approval; Content's drafts are reviewed there. /drafts
  redirects to it.
- Scheduling: publish a draft now or at a time (migration 3 adds
  publish_at). A scheduler in the app publishes due drafts every 30
  seconds. Posts more than 12 hours overdue, or refused before posting,
  go back to the Inbox with the reason. Content gets Scheduled and
  Published tabs.
- UTM tags on links to the company's own websites and product pages,
  added when publishing; drafts stay untagged.
- The container runs in the computer's time zone, so times are shown
  and read correctly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:17:38 -07:00
davidandClaude Opus 5.5 13bf18facc Phase 1, part 1: fetch, write and publish posts from the web app
Brings back posting, which Phase 0 removed with the terminal interface.

- Content page: per inventory entry, fetch its X account, X hashtag
  search, YouTube channel and RSS/Atom feeds (new), then select, dismiss
  or restore the fetched items, which are kept in the database.
- Writing: one AI call returns a draft per channel (X and LinkedIn),
  prompted from the company profile, the entry's relationship, talking
  points and mention policy, and each channel's rules. Fetched text is
  quoted as untrusted. An over-long X draft gets one request to shorten.
- Drafts page: edit with a live length counter that counts like X, then
  publish each draft on its own. A draft is claimed before posting so it
  can't go out twice; failures are kept on the draft for a retry; X
  tokens are refreshed and saved.
- Migration 2 adds content_items and drafts, and turns queued posts into
  drafts for the platforms they hadn't reached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 12:58:24 -07:00
davidandClaude Opus 5.5 d039484a4a Phase 0: turn Supermarket into a Dockerized local web app
Replace the old Go TUI with a web app (port 8470) that runs in a
container as a CoreDesktop sibling:

- cmd/supermarket server with htmx web UI: dashboard, company profile,
  inventory (partners/competitors), AI and credential settings, and a
  Core & Hermes page
- SQLite storage and a secrets store under ~/.local/share/supermarket
- AI providers (Anthropic, OpenAI-compatible) behind one interface
- MCP server and a Hermes bridge to the Federated Core MCP hub
- Import of the old Coremarketing TUI's state
- install.sh / update.sh / lib.sh, Dockerfile, compose.yaml, the
  bin/supermarket launcher and hermes/setup.sh

Posting is not wired back up yet; that comes in Phase 1. See PLAN.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 08:38:09 -07:00