Architecture
Mushi Mushi is intentionally boring at the seams: a Hono gateway in front of
Supabase, more than 70 edge functions behind it (pnpm docs-stats prints the
current count), and three
data substrates (relational + vector + graph) that mirror each other for
their respective query shapes. Everything an SDK does is one POST to the
gateway; everything a contributor adds is either a route or a function.
Wire-level flow
The four columns below correspond to the four “layers” of the stack — left-to-right is the path a single bug report takes from a user’s device to a merged PR.
| ⓵ SDKs (client) | ⓶ Edge gateway | ⓷ Data | ⓸ External |
|---|---|---|---|
mushi-mushi + framework subpaths | api (Hono router) | Postgres + RLS | Sentry (User-Feedback webhook) |
@mushi-mushi/react-native | fast-filter (spam triage) | pgvector embeddings | Slack |
| Native iOS / Android / Flutter | classify-report (2-stage LLM) | Apache AGE graph | GitHub (scoped App) |
@mushi-mushi/capacitor | judge-batch (nightly cron) | blast_radius_cache MV | Langfuse (traces) |
@mushi-mushi/mcp (stdio + Streamable HTTP) | fix-worker (sandbox PR + LLM agent) | Supabase Vault (BYOK + plugin secrets) | Marketplace plugins (PagerDuty, Linear, …) |
@mushi-mushi/cli (init / connect / upgrade) | sdk-upgrade-worker (semver bump PR) | sdk_upgrade_jobs | GitHub (upgrade PRs) |
Admin Connect & Update (/connect) | sdk-versions-cron (daily npm sync) | sdk_versions | npm registry |
skill-sync (skills.sh ingest) | agent_skills + pipeline runs | kenji skills / skills.sh | |
intelligence-report (weekly digest) | contract_snapshots (drift baseline) | Firecrawl (research + crawl) | |
drift-walker (live crawl diff) | pdca_runs + fix_attempts | Browserbase (QA story execution) | |
contract-graph-builder (snapshot builder) | qa_stories + qa_story_runs | ||
pdca-runner (Plan→Do→Check→Act) | integration_health_history | ||
qa-story-runner (scheduled user-story tests) | |||
soc2-evidence (control snapshot) |
Edges that matter (everything else flows top-to-bottom inside a column):
- Every SDK posts to
api— there is no client-direct DB write. api → fast-filter → classify-reportis the canonical ingest path.classify-report → pgvector + Apache AGE + pluginshappens in parallel.judge-batchreads from and writes back intoclassify-report’s prompts.fix-worker → GitHubdispatches automatically when autofix is enabled and the estimated cost is under the project’s budget; it pauses for a console approval only when that cost exceedsautofix_approval_cost_threshold_usd.pdca-runnerorchestratesfix-workerautonomously — one PDCA run may spawn multiple fix-worker calls.drift-walker → contract-graph-buildercompares a fresh crawl against the storedcontract_snapshotsbaseline.api → Supabase Vaultresolves BYOK secrets per-request, never cached.- All LLM-touching functions stream traces to Langfuse.
Component summary
- Edge gateway (
api, Hono on Supabase Edge Functions) authenticates with API keys (public SDK reports) or JWT (admin console), enforces rate limits, and routes to specialised functions. All admin routes live under/v1/admin/*. fast-filtertriages high-volume garbage (form spam, duplicate one-liners) with the cheapest model the project’s BYOK plan permits.classify-reportis stage 2 of the classifier. Stage 1 (fast-filter) reads the scrubbed report and extracts structured symptoms; stage 2 sees only that structured output (an air gap against prompt injection) and writes the root cause, repro steps and fix direction. When a screenshot is present, a separate image-only vision call runs afterwards and can annotate the report but not change its diagnosis.judge-batchis a nightly cron that scores classifier accuracy with a separate judge call, feeding the prompt-A/B framework that promotes a candidate prompt after 30 evaluations when its mean score is more than 5% higher.fix-workerdispatches approved triage decisions to a sandboxed LLM agent (Anthropic / OpenAI BYOK) that generates code patches, validates them against a Zod schema, and opens a draft PR via the GitHub App, or dispatches a Cursor or GitHub cloud agent that opens the PR itself. Validation failures include Zod issue detail infix_attempts.errorfor debugging.agent-pr-reviewreviews each fix PR with Claude Opus on the project’s own Anthropic key and stores a merge / fix_first / hold verdict. A merge verdict on the PR’s current commit marks the draft ready so your CI runs; with no review possible, a fix-worker draft falls back to its own self-check.review-followupsends a “fix first” verdict’s findings back to a new cloud agent on the same PR (off by default), and asks it to repair CI when an approved PR fails on its own code.fix-verifierchecks the merge gates for a PR’s head (review, CI, the Mushi Mushi verify check, no weakened tests, diff size, a second-model review) and, only when the project turns on verified auto-merge, merges it.merge-queuemerges PRs a person queued with “Merge when ready”, one per repo at a time, or batches approved PRs into a release-train PR.- Local workers (
mushi work --daemon) let your own machine claim reports, follow-ups, merge conflicts or audits under a lease, so the cloud and your machine never work on the same report at once. pdca-runnerorchestrates autonomous Plan → Do → Check → Act cycles: crawls a target URL, identifies issues, callsfix-workerfor each, verifies the result, and writes per-run + per-iteration records topdca_runs.drift-walkerfetches the live app (usingcontract-graph-builder) and diffs the result against the storedcontract_snapshotsbaseline, writingdrift_findings. Errors (builder failed or unreachable, snapshot not found) come back with a plain message and show in the Drift scanner UI.contract-graph-builderbuilds a contract snapshot from three sources: the project’s OpenAPI spec URL, the inventory’s API dependencies, and the latest Supabase schema snapshot frombackend-drift-scanner. It stores the result incontract_snapshotsand is called bydrift-walkerbefore every walk.qa-story-runnerexecutesqa_storiesrecords on schedule (pg_cron, every minute) using Firecrawl, Browserbase, or local Playwright. Writes results toqa_story_runsandqa_story_evidencewith screenshots.intelligence-reportgenerates weekly bug-intelligence digests with optional cross-customer benchmarking (k-anonymity enforced via materialized view). Runs withverify_jwt = false; authenticated via service-role header internally.soc2-evidencesnapshots five controls nightly as evidence toward SOC 2 (not a certification).sdk-upgrade-workerreads a linked GitHub repo’spackage.json(s), computes a semver-only bump plan (computeBumpPlan), opens a draft PR via sharedcreatePrFromFiles, and writes status tosdk_upgrade_jobs. Triggered from Connect & Update → Create Upgrade PR orPOST /v1/admin/projects/:pid/sdk-upgrade.sdk-versions-cronupserts latest stable@mushi-mushi/*versions from npm (daily pg_cron + post-publish sync) intosdk_versionsso freshness chips stay accurate between releases.skill-syncingests allowlistedSKILL.mdfiles (default:kensaurus/skills), embeds descriptions, and powers Skill Pipelines (/skills) — attach a skill chain to a report and stream step status over Realtime.
MCP surface (2026)
The same tool catalog ships on two transports:
| Transport | Entry | Notes |
|---|---|---|
| stdio | npx @mushi-mushi/mcp | Local editor subprocess; env from .env.local or mcp.json |
| Streamable HTTP | /functions/v1/mcp | Remote orchestrators; ?features=triage,fixes,inventory,setup,docs for lean default |
Catalog source of truth: packages/mcp/src/catalog.ts, mirrored in
apps/admin/src/lib/mcpCatalog.ts, guarded by pnpm check:catalog-sync.
Destructive tools carry MCP annotations; scope enforcement is mcp:read vs mcp:write.
Connect & Update (console)
/connect consolidates onboarding paths that previously lived across Settings,
Onboarding, and MCP:
- GitHub — prerequisite for upgrade PRs and autofix.
- SDK install — live snippet + trigger-mode preview (
SdkInstallCard). - MCP — Add to Cursor deeplink + hosted/stdio snippets (
ClientConnectButton). - CLI —
npm i -g @mushi-mushi/cli@latest. - Update center — per-package freshness + Create Upgrade PR (
SdkUpgradeCTA).
CLI mirror: mushi connect --wait writes the same artifacts locally (Cursor MCP is wired by default; pass --no-ide to skip).
Knowledge graph
Reports embed into pgvector for semantic dedup. The same edges are mirrored asynchronously into Apache AGE so customers who care about graph queries (e.g. “find all reports touching the same component within a release window”) get true Cypher.
A2A Agent Card
Public discovery endpoints at /.well-known/agent-card and /v1/agent-card
expose the agent’s identity, skills, supported A2A version, MCP transport,
and auth requirements. Other agents can negotiate with Mushi Mushi without
out-of-band config.
Data residency
Each project pins to a region (us / eu / jp). The gateway has
307 Temporary Redirect middleware (regionRouter) for requests that reach the
wrong cluster, and the Core SDK can resolve and cache a project’s endpoint in
localStorage.
Today there is one production project, in Tokyo (ap-northeast-1). No other
regional endpoint is configured, so the middleware never redirects and every
region is served there. See Data residency.
Storage
Per-project storage settings (BYO Storage) let you keep screenshots and intelligence-report PDFs in your own S3 / R2 / GCS / MinIO bucket. Supabase Storage is the default.