Commit Graph
4 Commits
Author SHA1 Message Date
LouisandClaude 3a7eaba620 Coucou Cloud: every ready-made Mochi but the Memory Gardener (#1248)
The Cloud ran only PR Reviewer. It now runs what each Mochi needs:
- GitHub events: new PR (PR Reviewer), new issue (Issue Triage), an issue
  labelled for an unscheduled Night Shift, a failed run on the default
  branch (CI Fixer, its failed logs in the prompt);
- schedules in the user's time zone, once per slot (Night Shift takes the
  oldest labelled issue it hasn't worked on, Deps & Security, Ship Log from
  the week's commits);
- a click on the Mac (POST /v1/mochis/:id/run: Release Prep, or any of them now);
- Prod Watch every 15 minutes, no AI, a run only when an address changes.

A Mochi that changes files is asked, once its report is written, to run a
pack script mounted in the sandbox: the changed files go to the session's
outputs and the Worker keeps them until the click, which makes the draft PR
with GitHub's API (blobs, tree, commit, a mochi/ branch, the PR). Nothing is
pushed from the sandbox, which keeps read-only tokens; each GitHub token asks
only what its step needs. Issue Triage's reply is posted on the issue.

Mac: brain 0.9.1 sends kind, tools, schedule, label, addresses, runs a day
and the time zone; a Cloud Mochi no longer runs on the Mac's schedule, Run
now goes to the Cloud, turning one on or off reaches the Cloud, and Cloud
runs keep their link and what started them. The Cloud page lists Prod Watch
and says why a Mochi stays on the Mac.


Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-01 15:22:48 +00:00
Claude 5293c0ded0 Coucou Cloud: Stripe and the offers
The Cloud is now sold: Free (everything on the Mac, unchanged) and
« Cloud · your key » at 9 €/month (the AI on the user's own Anthropic key).
Solo, Pro and Max are listed as coming, until the credit offers open.

Worker (billing.ts): the offers in one place (GET /v1/plans, public, so a
price changes without an app update); Stripe Checkout and the customer
portal, opened in the browser (the card never touches Coucou); the signed
Stripe webhook keeps the subscription's state; a user's Mochis run in the
Cloud only with an active subscription (past_due included while Stripe
retries) or a login in COMP_LOGINS (Louis-CFM). Without STRIPE_SECRET_KEY,
billing is off. Under the VAT franchise: no VAT, the invoice footer says
« TVA non applicable, article 293 B du CGI »; STRIPE_TAX turns Stripe Tax on.
The new user columns are added by the Worker itself.
scripts/stripe-setup.mjs makes the price, the portal and the webhook, and
pipes the webhook's secret straight into wrangler.

brain: `cloud subscribe`, `cloud billing` (--json gives the URL to the app);
`cloud status` carries the offer and the offers.

App: the offers view (CloudPlans.swift, for the onboarding too), a
« Choose your offer » step in the Cloud setup, the offer on the account
card (renews / ends / payment failed, Manage, See the offers); the switch
to move a Mochi needs the offer. 28 strings in the 16 languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-11-30 16:47:31 +00:00
Claude 31da031dbd Mochis: the Autonomous level; Cloud page: Mochis as tiles
A repo Mochi can now be Autonomous (editor › What it may do): it does what
is safe and can be undone on its own — opens the draft PR, posts the review
as a comment, replies on the issue — and tells you after. It never merges,
pushes to main, approves or sends a mail; a mail Mochi only drafts and only
a repo Mochi can be autonomous.

- brain: level "autonome"; runMochi posts with the user's git and gh right
  away and records it on the run (auto: applied + url, or failed + error).
  A post GitHub refuses waits for the click instead. A Cloud Mochi's level
  goes to the Cloud when it is saved.
- Worker: mochis.autonomous and runs.auto; when a run is collected, an
  autonomous Mochi's review is posted at once. The columns are added to the
  existing database by the Worker itself, no command to run.
- Notch: "PR Reviewer posted its review on PR #12" with Open, nothing to
  click. Results: "Posted its review on PR #12 on its own" with Open.
- Cloud page: the Mochis as small tiles (a switch each, Soon for the others,
  the level shown); the refresh button is gone, the page refreshes itself
  every minute while open; a run posted on its own says so, with Open.

12 new strings in the 16 languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-11-30 14:21:16 +00:00
Claude 5a3dce5121 cloud: the Coucou Cloud engine, V0 (your own Anthropic key)
A Cloudflare Worker (cloud/) that runs the PR Reviewer while the Mac is
off: a GitHub App webhook for pull_request starts a Claude Managed Agents
session on the subscriber's own Anthropic key, on the PR's head commit,
with the diff in the prompt and a spend ceiling; a cron collects the
finished sessions every minute; the review waits until the click posts
it as a comment. D1 keeps the GitHub id and login, the hash of the Mac's
token, the Anthropic key sealed with AES-GCM, the Cloud Mochis and each
run's result. Never the code.

The prompt and the Managed Agents requests move to two modules with no
Node API, shared by the brain and the Worker: brain/src/prompt-core.ts
(buildRepoPrompt, languageRule, repoSystem) and brain/src/cloud-core.ts
(the client, the diff, agent/environment/session params, summarize,
looksLikeReport, withoutNotes). brain cloud try now uses them too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-11-30 01:47:49 +00:00