Skip to content

GenClass reports by email: daily by default, hourly to monthly, P0 alerts, design ideas - #232

Merged
MeharPro merged 2 commits into
mainfrom
feat/daily-report
Nov 13, 2026
Merged

MeharPro merged 2 commits into
mainfrom
feat/daily-report

Conversation

@MeharPro

Copy link
Copy Markdown
Contributor

The owner asked for a GenClass report by email: daily by default, changeable from the email itself (every hour up to every month, or off), plus P0 alerts as soon as something critical shows up.

What a report holds

  • A headline, then the summary. The model writes the summary from the dashboard's numbers (appDigest) and the listed items. It never sees an email, account id, app key or secret.
  • What to fix first (P0 critical, P1 important). Each item has a button to a signed page that copies its fix prompt or opens it in Claude Code.
  • Setup problems with their setup prompts. The same step on several apps is one row.
  • Each app's numbers against the period before.
  • Pull requests the GitHub App reviewed.
  • Visitors (Pro).
  • Security and unusual activity, from patterns in the counts and the account's own sign-ins. No IP address is stored or shown.
  • The last genclass suggest ideas.
  • Upgrade your website design: measured contrast and layout checks, redesigns picked for the company (each with a prompt), and three showcase sites a day, one of them 3D.
  • Free apps get totals, setup help and alerts, plus Pro's trial box.

How it runs

  • Cron 7 * * * * runs the hourly sweep. Each report is claimed atomically, so two overlapping runs never send the same report twice.
  • A deploy, or a new account, only sets the next slot (13:00 UTC). Nothing is sent at once.
  • An alert goes out at most once a day per app and rule. Each account gets at most 30 emails a day.
  • Every email has one-click List-Unsubscribe.
  • Mail is sent through the [[send_email]] EMAIL binding, from report@genclass.dev only.
  • Migration 0020_reports.sql must be applied before the deploy.

Layout (second commit): each section is a card and each prompt is a button. Without a signed link, a short prompt is printed and a long one stays in the plain-text part. Rendered from the owner's real account (read-only), the email is 41 KB and about 3,600 px tall at 720 px wide, down from 7,000 px. Checked in light mode, dark mode and at 375 px with no sideways scroll.

Docs: PRIVACY.md gets a "Reports and alerts by email" section, AGENTS.md gets rule 13, and telemetry-worker/README.md lists the routes and the migration.

Checks: all 866 collector tests pass after the rebase onto #230. 24 of them are report tests, covering the schedule, priority rules, plan stripping, escaping, the model's input, sweep claims, alert dedupe, the cap, settings, tokens, unsubscribe, and the new layout. A worker typecheck in strict mode is clean. Also fixes a flaky token-tamper test: about one token in 64 already ends with the "x" the test wrote.

Not covered: the AI summary and signed links against production. They need the Worker's OPENAI_API_KEY and INTEGRATIONS_KEY, so they are first seen after deploy.

🤖 Generated with Claude Code

MeharPro and others added 2 commits November 13, 2026 07:58
…thly) and P0 alerts

A report about an account's apps goes to the account's email on the schedule it picks (hourly when something
happened, daily at 13:00 UTC by default, weekly, monthly, or off), and an alert as soon as the hourly run sees a
critical problem, at most once a day per app and rule. Sent through Cloudflare Email Sending (the EMAIL binding,
report@genclass.dev only; genclass.dev is onboarded).

What a report holds, all from what the dashboards already show under each app's plan: the model's summary (Pro
apps; the owner's OPENAI_API_KEY via suggest.ts modelText, given appDigest and the listed items, never an email,
account id, app key or the key), critical and important items with a prompt for a coding agent each, the apps'
numbers against the period before, pull requests the GitHub App reviewed, visitors (Pro), security and unusual
activity (new terminals, passkeys and password changes; request storms, odd behaviour, traffic that tripled; no IP
addresses), setup (no data, data stopped, the model failing to load, GitHub not connected), the last genclass
suggest answer, and "Upgrade your website design" (measured contrast and layout checks, suggest's designs with
their prompts, three sites to learn from a day, one 3D). A Free app gets totals, setup and its silent/spike alerts,
never its problems' kinds, pages or prompts, plus Pro's trial box. The recorded demo's estimate gives no item.

Priorities are rules in appItems (P0: failing endpoint x3, a race or failure on a payment page, a blank page, a page
that stopped taking clicks, an app silent for 6 hours after steady traffic, problems that jumped within the hour).
Links to change how often, one-click unsubscribe (List-Unsubscribe-Post) and a prompt page with Copy and Open in
Claude Code are HMAC-signed with a key derived from INTEGRATIONS_KEY. At most 30 emails an account a day.

Migration 0020 (accounts.report_*, report_alerts, report_sends), cron "7 * * * *", /account/report (settings, Send
me one now, Preview), Account settings > Notifications. PRIVACY.md "Reports and alerts by email", AGENTS.md rule 13,
README "Reports by email". Two config tests now expect the third cron and no EMAIL binding when self-hosted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r setup step on many apps)

The first test report was 7,000 px of prompt boxes. Now each section is a card, a
prompt is a button to its signed page (printed only without a link, and only when
short; the text part keeps them all), the same setup step on several apps is one
row with a link per app, and the apps table becomes a status list until something
is measured. A headline says what matters, and the footer picks how often.

Also fixes a test that changed a link token's last character to x, which one
token in 64 already ends with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MeharPro
MeharPro merged commit 31bdcb6 into main Nov 13, 2026
4 checks passed
MeharPro added a commit that referenced this pull request Nov 13, 2026
… applied to production)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant