mushi-mushi 0.6.5 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONTRIBUTING.md CHANGED
@@ -101,6 +101,17 @@ Releases are fully automated. Maintainers don't run `npm publish` by hand.
101
101
 
102
102
  If GitHub's anti-loop protection suppresses the auto re-fire (the squash merge can be attributed to `github-actions[bot]`), trigger the workflow manually: **Actions → release → Run workflow → master**.
103
103
 
104
+ ### Known CI/CD quirks and their automatic safeguards
105
+
106
+ A handful of GitHub-Actions × Changesets edge cases have caused release-pipeline stalls in the past. Each is now caught automatically — keep these in mind when you see the symptom:
107
+
108
+ | Symptom | Root cause | Automatic safeguard |
109
+ | --- | --- | --- |
110
+ | The `Build & Test` required check never registers on the `chore: version packages` PR — the PR stays "Required check missing" forever | `changeset-release/master` is pushed by `github-actions[bot]`. GitHub silently drops the downstream `pull_request` event to prevent bot loops (observed on PR #45, #102, #124). | `ci.yml` now also triggers on `push` to `changeset-release/master`, so `Build & Test` reports against the head commit directly. No empty-commit nudge needed. |
111
+ | Release workflow fails with `No commits between master and changeset-release/master` after merging a PR with a new changeset. | A `.changeset/*.md` file whose YAML frontmatter only targets packages listed in `.changeset/config.json#ignore` (e.g. `@mushi-mushi/server`, `@mushi-mushi/admin`). `changeset version` produces no bumps, the version PR is empty, the next push errors (PR #102 / #121, 2026-05-19). | `pnpm check:changeset-orphans` runs in both `ci.yml` and `release.yml`. PR CI fails with an actionable message naming the orphan file *before* it can reach master. If you legitimately need to record an internal-only change, omit the changeset entirely — the diff lives in git history. |
112
+ | Release workflow's `Audit signatures of installed dependencies` step fails with `npm ETARGET / No matching version found for @mushi-mushi/<pkg>@<ver>` seconds after the publish step succeeded. | npm's registry CDN can take up to ~30s to propagate a freshly-published manifest. The audit step shells out to `npm install` against the just-published version and races the CDN (observed 2026-05-20, run 26149167393). | The audit step retries with exponential backoff (1, 2, 4, 8, 16, 32s — 63s total) before failing. Sigstore signatures are written at publish time, so a one-off audit failure never indicates a corrupted package — `pnpm view <pkg> version` is the ground truth. |
113
+ | Push to `master` after merging a PR doesn't fire the `Release` workflow. | Same anti-loop protection: when a squash merge is attributed to `github-actions[bot]`, GitHub may suppress the downstream `push` trigger. Sporadic — observed twice in the last 60 days. | `release.yml` keeps `workflow_dispatch` as the manual fallback. Recovery: **Actions → Release → Run workflow → master**. The `Build & Verify` job re-runs identically to the auto-fired path. |
114
+
104
115
  ### Adding a brand-new publishable package
105
116
 
106
117
  Trusted Publisher bindings are configured **per package** on `npmjs.com` and require the package to already exist on the registry. New packages therefore need a one-time bootstrap before OIDC can take over.
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # mushi-mushi 🐛
4
4
 
5
- **Ship a shake-to-report button. Get AI-classified, deduped, ready-to-fix bug reports.**
5
+ **Software's missing Darwin moment — catch bugs, name them, teach every future developer to never make the same mistake.**
6
6
 
7
- One `npx` command. Works with React, Next.js, Vue, Nuxt, Svelte, SvelteKit, Angular, React Native, Expo, Capacitor, and vanilla JS.
7
+ `npx mushi-mushi` · React · Next.js · Vue · Nuxt · Svelte · Angular · React Native · Expo · Capacitor · Vanilla JS
8
8
 
9
9
  [![npm](https://img.shields.io/npm/v/mushi-mushi?color=cb3837&label=mushi-mushi)](https://www.npmjs.com/package/mushi-mushi)
10
10
  [![npm downloads](https://img.shields.io/npm/dm/mushi-mushi?color=cb3837&label=downloads)](https://www.npmjs.com/package/mushi-mushi)
@@ -17,188 +17,128 @@ One `npx` command. Works with React, Next.js, Vue, Nuxt, Svelte, SvelteKit, Angu
17
17
  <img src="https://raw.githubusercontent.com/kensaurus/mushi-mushi/master/docs/screenshots/report-detail-dark.png" alt="A real user-felt bug inside the Mushi admin — Plan / Do / Check / Act PDCA receipt across the top, the original user description, LLM classification (Confusing UX · Medium · 78% confidence · component = Dashboard/HeroCTA), environment + performance metrics, and a one-click Dispatch-fix CTA." width="860" />
18
18
  </a>
19
19
 
20
- <sub>↑ a real user report, fully classified and ready to dispatch as a GitHub PR · <a href="https://kensaur.us/mushi-mushi/">open the live demo</a></sub>
20
+ <sub>↑ a real user report, classified and encoded as institutional memory · <a href="https://kensaur.us/mushi-mushi/">open the live demo</a></sub>
21
21
 
22
22
  </div>
23
23
 
24
24
  ---
25
25
 
26
- ## What does it actually do? (60 seconds, no jargon)
26
+ ## Why evolution? (The 60-second idea behind this tool)
27
27
 
28
- Your users open your app, something feels broken — a button that doesn't react, a page that takes forever, a layout that folds in half on their phone — and they leave. Your error tracker stays silent because nothing technically _crashed_.
28
+ Every living thing on Earth shares one invisible superpower: **when it fails, the lesson gets inherited**. A bacterium that dies from an antibiotic passes that encoded resistance to its descendants. An aviation fleet that crashes encodes the root cause into a mandatory checklist every pilot learns on day one. The lesson doesn't evaporate — it becomes part of the substrate.
29
29
 
30
- Mushi adds a small **"shake your phone (or click the bug)"** button. The user taps it, scribbles a note, and Mushi captures everything around the moment: a screenshot, the page they were on, what they were trying to do, and the last few seconds of network and console activity. An AI then reads that report, tags it with severity and category in plain English, groups it with similar reports so you see one row per actual bug, and (optionally) hands it off to another AI that opens a draft pull request with a proposed fix. **A human always reviews and merges** — the loop never bypasses you.
30
+ Software development has never had this. A bug is reported, fixed, and forgotten. The developer who filed the ticket moves on. The lesson lives in a Jira comment that nobody reads. Six months later, a new teammate joins, hits the same class of mistake, and the cycle resets. Every team is, perpetually, generation zero.
31
31
 
32
- Founders, PMs, designers: see the [60-second tour in the GitHub README](https://github.com/kensaurus/mushi-mushi#read-this-first-if-youre-not-a-developer).
32
+ **Mushi is the missing layer.** It gives every reported bug a permanent home: captured → clustered with similar bugs by meaning → promoted to a named learning rule → injected into the next PR review and the next AI agent run — so neither you nor your AI can repeat the same class of mistake twice. The more bugs it absorbs, the richer the lesson library becomes. It gets better by failing. That's not a metaphor — it's the technical architecture.
33
33
 
34
- ---
35
-
36
- ## Install in one line
37
-
38
- ```bash
39
- npx mushi-mushi
40
- ```
34
+ > *"Cumulative selection is the key to all of evolution. Each improvement, however slight, is retained and passed on."*
35
+ > — Richard Dawkins, *Climbing Mount Improbable* (1996, p. 74)
41
36
 
42
- The wizard detects your framework, installs the right SDK, writes env vars to `.env.local` (with the right prefix — `NEXT_PUBLIC_`, `NUXT_PUBLIC_`, or `VITE_`), and prints the snippet to paste into your app. **Non-destructive**: never overwrites existing env vars, never edits your source.
37
+ > *"Every failure is data. Aviation's NTSB turns every crash into institutional memory — software has no equivalent layer."*
38
+ > — Matthew Syed, *Black Box Thinking* (2015, p. 9)
43
39
 
44
- ```tsx
45
- // After the wizard runs (React example):
46
- import { MushiProvider } from '@mushi-mushi/react';
47
-
48
- export function App({ children }) {
49
- return (
50
- <MushiProvider config={{ projectId: 'proj_xxx', apiKey: 'mushi_xxx' }}>
51
- {children}
52
- </MushiProvider>
53
- );
54
- }
55
- ```
56
-
57
- That's it. Your users now have a shake-to-report button (or a floating widget). Reports land in [your admin console](https://kensaur.us/mushi-mushi/), classified by an LLM within seconds.
40
+ > *"Innovations emerge as a consequence of trial-and-error and then become encoded in heuristics and practical knowhow."*
41
+ > — Nassim Nicholas Taleb, *Antifragile* (2012, p. 230)
58
42
 
59
43
  ---
60
44
 
61
- ## What you get
62
-
63
- - **Shake-to-report widget** — Shadow-DOM, zero CSS conflicts. Ships with screenshot, console ring, network ring, route + intent capture, and an offline queue.
64
- - **AI-classified reports** — 2-stage pipeline (Haiku fast-filter → Sonnet deep + vision + RAG) tags each report with category, severity, confidence, and the component path. Stage 2 streams partial results to the admin UI as tokens arrive.
65
- - **Dedup by meaning, not by string** — pgvector knowledge graph collapses duplicate reports across users, routes, and deploys so your queue isn't a noise storm.
66
- - **Bidirectional inventory (v2)** — opt in to `capture: { discoverInventory: true }` and the SDK quietly observes routes, `data-testid`s, and outbound API paths in production. Claude drafts an `inventory.yaml` of user stories + pages + actions for you to accept — most teams will never hand-author one.
67
- - **Five pre-release gates (v2)** — `mushi-mushi/no-dead-handler`, `mushi-mushi/no-mock-leak`, inventory drift, agentic-failure detection, synthetic walk health. One composite GitHub status check via the [Mushi Mushi CI Gate Action](https://github.com/kensaurus/mushi-mushi/tree/master/packages/mcp-ci).
68
- - **Spec-traced fixes (v2.10)** — every dispatched fix carries the inventory `Action` it's meant to repair, the `expected_outcome` contract is rendered into the LLM prompt, a deterministic `validateAgainstSpec` gate fires before the PR opens, and a targeted synthetic probe runs the moment the PR lands.
69
- - **One-click "Dispatch fix"** — agentic orchestrator opens a GitHub PR with a screenshot diff and a Playwright replay. Sandbox-pluggable (`e2b`, `modal`, `cloudflare`, or your own).
70
- - **Standards-first integrator** — W3C `traceparent` end-to-end, Standard Webhooks signing on every outbound delivery, RFC-draft `Idempotency-Key` middleware, OAuth 2.0 Dynamic Client Registration, OTLP/HTTP+JSON BYOK exporter. You bring your own observability stack — Mushi never marks up tokens.
71
- - **Agent-native via MCP + A2A** — MCP Streamable HTTP at `/functions/v1/mcp`, A2A v1.0.0 tasks at `/v1/a2a/tasks` (pull SSE _and_ push notifications), Agent Card discovery, OpenAPI 3.1 spec. Cursor, Claude Code, Copilot, OpenAI Agents SDK, LangGraph, CrewAI all see the same surface.
45
+ ## Before Mushi / After Mushi
72
46
 
73
- ---
74
-
75
- ## Who it's for
47
+ The same team, the same codebase — but with a fundamentally different relationship to failure.
76
48
 
77
- | You are… | …and this helps because |
78
- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
79
- | **A solo dev / small team** shipping a consumer app | You already have Sentry for crashes — but users drop off over _friction_, not exceptions. Mushi captures "this button doesn't do anything". |
80
- | **A PM or designer** living in the admin | Triage, severity, component ownership, and PR status — all in one dark-mode console. No reading stack traces. |
81
- | **An AI-native team** already using Cursor / Claude | MCP tools expose the whole loop to your agent. `get_recent_reports`, `classify`, `dispatch_fix` — the same primitives your teammates use. |
82
- | **An enterprise** needing SOC 2 + residency | Region-pinned data (US / EU / JP / SELF), SAML SSO, audit-log ingest, DSAR workflow, HMAC-signed plugin webhooks. |
49
+ | | ❌ Before Mushi | ✅ After Mushi |
50
+ |---|---|---|
51
+ | **User hits a broken button** | Leaves silently. You never know. | Shakes phone → note + screenshot → your queue in seconds. |
52
+ | **Your error tracker** | Silent (nothing crashed). Sentry stays green. | Classified report: "Confusing UX · Medium · Dashboard/HeroCTA". |
53
+ | **Same bug, 40 users** | 40 separate tickets. Triage nightmare. | 1 row. Deduplicated by meaning, not by string. |
54
+ | **Root cause** | Your team guesses from a stack trace. | AI reads the screenshot and user note, names the component, suggests the fix. |
55
+ | **Fix it** | Assign Jira ticket → sprint → PR → review → deploy. | Click "Dispatch fix" → draft PR opens in minutes → you review and merge. |
56
+ | **Lesson encoded?** | No. It lives in a git commit message. | Yes. Vector-clustered into a named learning rule in `.mushi/lessons.json`. |
57
+ | **Next developer** | Makes the same class of mistake. | PR review gets the rule injected: *"Rule L-0042: never call setState in useEffect for derived values — seen 17 times."* |
58
+ | **Next AI agent** | Guesses from the same blank slate. | Cursor / Claude Code reads the lesson library via MCP before proposing a diff. |
59
+ | **Release accountability** | Nobody knows which user found which bug. | Auto-drafted changelog: *"Fixed by Kenji: Settings back-button counted safe-area inset twice."* |
83
60
 
84
61
  ---
85
62
 
86
- ## Mushi vs your existing stack
63
+ ## Pros & Cons
87
64
 
88
- Mushi is a **companion** to Sentry/Datadog, not a replacement. It sees the bugs your crash tracker can't.
65
+ Be honest about what you're signing up for.
89
66
 
90
- | Scenario | Sentry / Datadog | **Mushi Mushi** |
91
- | --------------------------------------- | :--------------: | :-------------: |
92
- | Unhandled JS exception | ✅ | ✅ |
93
- | Button that _looks_ clickable but isn't | — | ✅ |
94
- | 12-second page load, no error thrown | — | ✅ |
95
- | User can't find the settings panel | — | ✅ |
96
- | Layout broken on iPad Safari only | — | ✅ |
97
- | Form submits but data doesn't save | ~ | ✅ |
98
- | Feature silently regressed last deploy | ~ | ✅ |
99
- | LLM-classified + deduped queue | — | ✅ |
100
- | One-click AI fix → draft GitHub PR | — | ✅ |
67
+ ### Pros
101
68
 
102
- > Already have Sentry? Mushi writes breadcrumbs into your existing Sentry session so you can jump from a crash to the user's own words in one click.
69
+ - **Zero-code capture.** `npx mushi-mushi` installs in one command — no Webpack config, no SDK wrapper, no manual `window.onerror` wiring. The widget is Shadow-DOM; it won't touch your CSS.
70
+ - **Catches the invisible.** Dead buttons, 12-second screens, one-device layout bugs — the category of failures that Sentry, Datadog, and Firebase are structurally blind to.
71
+ - **Reports don't pile up.** pgvector dedup collapses the same broken thing across 40 users to one row. Your queue reflects reality, not noise.
72
+ - **The loop closes itself.** Bug → cluster → lesson → PR-review injection → agent memory. The next bug of the same class is stopped before it ships.
73
+ - **Bring your own AI keys.** You pay Anthropic and OpenAI directly, at your rate, with your data agreements. Mushi never marks up tokens or holds your data hostage.
74
+ - **Agent-native from day one.** MCP Streamable HTTP, A2A v1.0.0 tasks, OpenAPI 3.1. Cursor, Claude Code, Copilot, LangGraph, CrewAI all see the same surface the human admin does.
75
+ - **Standards-first.** W3C `traceparent` end-to-end, Standard Webhooks signing, RFC-draft `Idempotency-Key`, OAuth 2.0 Dynamic Client Registration. You bring your existing observability stack — Mushi slots in.
76
+ - **Self-host or cloud.** One Docker Compose file. One Helm chart (138 SQL migrations bundled). No vendor lock-in at the infra level.
77
+ - **Open-source SDK.** Every client package is MIT. Fork it, audit it, sell it — the trademarks are separate from the code.
103
78
 
104
- ---
79
+ ### Cons / trade-offs
105
80
 
106
- ## Integrates with
107
-
108
- **12 outbound plugins** — Mushi sends signals to whatever your team already lives in:
109
-
110
- <table>
111
- <tr>
112
- <td align="center" width="110"><b>GitHub</b><br/><sub>Auto-draft PRs<br/>+ Checks API</sub></td>
113
- <td align="center" width="110"><b>Sentry</b><br/><sub>Breadcrumb bridge<br/>+ session link</sub></td>
114
- <td align="center" width="110"><b>Slack</b><br/><sub>Block Kit<br/>+ /mushi cmd</sub></td>
115
- <td align="center" width="110"><b>Jira</b><br/><sub>OAuth 3LO<br/>bidir sync</sub></td>
116
- <td align="center" width="110"><b>Linear</b><br/><sub>Issue create<br/>+ status sync</sub></td>
117
- <td align="center" width="110"><b>PagerDuty</b><br/><sub>Severity-scoped<br/>escalation</sub></td>
118
- </tr>
119
- <tr>
120
- <td align="center" width="110"><b>Discord</b><br/><sub>Embed messages<br/>per channel</sub></td>
121
- <td align="center" width="110"><b>MS Teams</b><br/><sub>Adaptive cards<br/>+ on-call</sub></td>
122
- <td align="center" width="110"><b>GitHub Issues</b><br/><sub>Labels<br/>+ assignees</sub></td>
123
- <td align="center" width="110"><b>Bugsnag</b><br/><sub>Mirror + close<br/>on fix merge</sub></td>
124
- <td align="center" width="110"><b>Rollbar</b><br/><sub>Mirror + resolve<br/>on fix merge</sub></td>
125
- <td align="center" width="110"><b>Crashlytics</b><br/><sub>Push reports<br/>+ close</sub></td>
126
- </tr>
127
- <tr>
128
- <td align="center" width="110"><b>Zapier</b><br/><sub>Generic<br/>webhook fan-out</sub></td>
129
- <td align="center" width="110"><b>Langfuse</b><br/><sub>LLM trace<br/>deeplinks</sub></td>
130
- <td align="center" width="110"><b>Cursor</b><br/><sub>via MCP<br/>server</sub></td>
131
- <td align="center" width="110"><b>Claude Code</b><br/><sub>via MCP<br/>server</sub></td>
132
- <td align="center" width="110"><b>OpenAI Agents</b><br/><sub>via A2A<br/>tasks</sub></td>
133
- <td align="center" width="110"><b>LangGraph</b><br/><sub>via A2A<br/>+ MCP</sub></td>
134
- </tr>
135
- </table>
136
-
137
- **11 inbound adapters** — Mushi receives alerts from your existing monitoring and turns them into the same triaged report rows as user-felt bugs:
138
-
139
- > Sentry · Datadog · Bugsnag · Rollbar · Firebase Crashlytics · New Relic · Honeycomb · Grafana Loki · AWS CloudWatch · Opsgenie · Firebase Analytics
140
-
141
- All of them ship in [`@mushi-mushi/adapters`](https://www.npmjs.com/package/@mushi-mushi/adapters) — drop them into any Node webhook server (Express / Fastify / Hono / serverless function).
81
+ - **Requires your own LLM API key.** Classification, clustering, fix-dispatch, and lessons all call Anthropic / OpenAI. Most teams run under $20/month, but the cost is yours. If you have no API budget, the widget still captures and you can triage manually — but the AI layers won't fire.
82
+ - **The lesson library needs volume.** Vector clustering requires ~30 reports before it promotes its first cluster to a lesson. Early-stage projects see a quiet lesson page for the first week or two.
83
+ - **AI-dispatched fixes are a draft, not a merge.** The agent opens a PR. A human always reviews. If you want fully automated merges, wire your own CI policy — Mushi doesn't force-merge.
84
+ - **Server packages are BSL 1.1** (converts to Apache 2.0 in 2029). SDK packages are MIT. If you want to run Mushi as a hosted service for third-party clients today, you need a commercial license.
85
+ - **OIDC SSO is audit-only today.** SAML SSO is self-service; OIDC stores the config and returns HTTP 202 for manual Supabase-support setup. Most teams use SAML or API-key auth without needing OIDC.
86
+ - **AI fix orchestrator needs a GitHub token.** Without one, the classification, dedup, and lesson loop all work — you just won't get auto-drafted PRs. Jira/Linear/Slack plugins still fire.
142
87
 
143
88
  ---
144
89
 
145
- ## Framework support
90
+ ## Install in one line
146
91
 
147
- | Framework | Install after wizard (automatic) |
148
- | ------------------------------- | ------------------------------------------------- |
149
- | React | `@mushi-mushi/react` |
150
- | Next.js | `@mushi-mushi/react` |
151
- | Vue 3 / Nuxt | `@mushi-mushi/vue` + `@mushi-mushi/web` |
152
- | Svelte / SvelteKit | `@mushi-mushi/svelte` + `@mushi-mushi/web` |
153
- | Angular 17+ | `@mushi-mushi/angular` + `@mushi-mushi/web` |
154
- | React Native / Expo | `@mushi-mushi/react-native` |
155
- | Capacitor / Ionic | `@mushi-mushi/capacitor` |
156
- | Flutter / Dart | `pub add mushi_mushi` |
157
- | iOS native (Swift) | Swift Package Manager — early dev |
158
- | Android native (Kotlin/Java) | Gradle `dev.mushimushi:mushi-android` — early dev |
159
- | Node (Express / Fastify / Hono) | `@mushi-mushi/node` (server-side error capture) |
160
- | Vanilla JS | `@mushi-mushi/web` |
161
-
162
- Prefer to skip the wizard? `npm i @mushi-mushi/react` (or your framework's package) and wire it up by hand.
92
+ ```bash
93
+ npx mushi-mushi
94
+ ```
163
95
 
164
- ---
96
+ The wizard auto-detects your framework, installs the right SDK, writes `MUSHI_PROJECT_ID` and `MUSHI_API_KEY` to `.env.local` (with the right prefix — `NEXT_PUBLIC_`, `NUXT_PUBLIC_`, or `VITE_`), and prints the snippet to paste. **Non-destructive**: never overwrites existing env vars, never edits your source files.
165
97
 
166
- ## How the pipeline works
98
+ ```tsx
99
+ // After the wizard — React / Next.js:
100
+ import { MushiProvider } from '@mushi-mushi/react';
167
101
 
168
- ```
169
- User hits widget ──▶ screenshot + console + network + intent
170
- │
171
- ▼
172
- Fast-filter (Haiku) ──▶ drops spam, keeps signal
173
- │
174
- ▼
175
- Deep classify (Sonnet + vision + RAG) ──▶ category, severity, component
176
- │
177
- ▼
178
- Dedup (pgvector) ──▶ groups repeat reports by meaning
179
- │
180
- ▼
181
- Judge (weekly) ──▶ scores classifier, retrains prompts
182
- │
183
- ▼
184
- "Dispatch fix" ──▶ agent opens a GitHub PR with Playwright replay + visual diff
102
+ export function App({ children }) {
103
+ return (
104
+ <MushiProvider config={{ projectId: 'proj_xxx', apiKey: 'mushi_xxx' }}>
105
+ {children}
106
+ </MushiProvider>
107
+ );
108
+ }
185
109
  ```
186
110
 
187
- See the full architecture in the [root README](https://github.com/kensaurus/mushi-mushi#architecture).
111
+ That's it. Your users have a shake-to-report button. Every report lands in [your admin console](https://kensaur.us/mushi-mushi/), classified within seconds.
188
112
 
189
- ---
190
-
191
- ## 30-second quick start
192
-
193
- ```bash
194
- # 1. Drop the wizard in (or one of the equivalents below)
195
- npx mushi-mushi
196
-
197
- # equivalents:
198
- npm create mushi-mushi
199
- npx @mushi-mushi/cli init
113
+ <details>
114
+ <summary><b>Other frameworks</b> — Vue, Svelte, Angular, React Native, Vanilla JS</summary>
115
+
116
+ ```ts
117
+ // Vue 3 / Nuxt
118
+ import { MushiPlugin } from '@mushi-mushi/vue';
119
+ app.use(MushiPlugin, { projectId: 'proj_xxx', apiKey: 'mushi_xxx' });
120
+
121
+ // Svelte / SvelteKit
122
+ import { initMushi } from '@mushi-mushi/svelte';
123
+ initMushi({ projectId: 'proj_xxx', apiKey: 'mushi_xxx' });
124
+
125
+ // Angular 17+
126
+ import { provideMushi } from '@mushi-mushi/angular';
127
+ bootstrapApplication(AppComponent, {
128
+ providers: [provideMushi({ projectId: 'proj_xxx', apiKey: 'mushi_xxx' })],
129
+ });
130
+
131
+ // React Native / Expo
132
+ import { MushiProvider } from '@mushi-mushi/react-native';
133
+ <MushiProvider projectId="proj_xxx" apiKey="mushi_xxx"><App /></MushiProvider>;
134
+
135
+ // Vanilla JS / any framework
136
+ import { Mushi } from '@mushi-mushi/web';
137
+ Mushi.init({ projectId: 'proj_xxx', apiKey: 'mushi_xxx' });
200
138
  ```
201
139
 
140
+ </details>
141
+
202
142
  <details>
203
143
  <summary><b>Flags for CI, monorepos, and self-hosted</b></summary>
204
144
 
@@ -206,71 +146,138 @@ npx @mushi-mushi/cli init
206
146
  npx mushi-mushi --framework next # skip framework detection
207
147
  npx mushi-mushi --project-id proj_xxx --api-key mushi_xxx
208
148
  npx mushi-mushi --skip-install # print the install command, don't run it
209
- npx mushi-mushi --skip-test-report # don't offer to send a test report
210
149
  npx mushi-mushi --cwd apps/web # run inside a monorepo sub-package
211
150
  npx mushi-mushi --endpoint https://mushi.your-company.com # self-hosted
212
- npx mushi-mushi -y # accept the detected framework
213
- npx mushi-mushi -v # print version
214
- npx mushi-mushi --help
151
+ npx mushi-mushi -y # accept the detected framework, no prompts
215
152
  ```
216
153
 
154
+ The wizard also auto-detects monorepo workspace type (npm / yarn / pnpm workspaces, Turborepo, Nx, Lerna) from your `package.json` and shows the correct workspace-scoped install command.
155
+
217
156
  </details>
218
157
 
219
- <details>
220
- <summary><b>Troubleshooting</b></summary>
158
+ ---
221
159
 
222
- - **Wrong framework detected?** Pass `--framework <id>`. Valid values: `next, react, vue, nuxt, svelte, sveltekit, angular, expo, react-native, capacitor, vanilla`.
223
- - **Monorepo?** `cd` into the package first, or pass `--cwd apps/web`.
224
- - **Stale `npx` cache?** `npm cache clean --force` or `npx mushi-mushi@latest`.
225
- - **Non-interactive terminal (CI)?** Pass `--yes --project-id proj_xxx --api-key mushi_xxx`. The wizard exits with a clear error instead of hanging.
226
- - **Node version too old?** Requires Node ≥ 18. Upgrade at [nodejs.org](https://nodejs.org/).
227
- - **Full stack traces on error?** `DEBUG=mushi npx mushi-mushi`.
160
+ ## How the loop actually runs
228
161
 
229
- </details>
162
+ ```
163
+ 1. User taps the widget ──▶ screenshot + route + note + last 5s of console + network
164
+ │
165
+ ▼
166
+ 2. Fast-filter (Haiku) ──▶ drops spam / test noise, passes real friction
167
+ │
168
+ ▼
169
+ 3. Deep classify (Sonnet + vision + RAG) ──▶ category, severity, component, root-cause hint
170
+ │
171
+ ▼
172
+ 4. Dedup (pgvector) ──▶ collapses duplicates across users — 40 reports become 1 row
173
+ │
174
+ ▼
175
+ 5. Cluster (BIRCH) ──▶ groups similar bugs by meaning; LLM judge scores coherence
176
+ │
177
+ ▼
178
+ 6. Promote to lesson ──▶ coherent clusters become named rules in .mushi/lessons.json
179
+ │
180
+ ▼
181
+ 7. Inject into PR review ──▶ `lessons.query` MCP tool sends relevant rules to your agent
182
+ │
183
+ ▼
184
+ 8. Optional: Dispatch fix ──▶ agent opens a draft GitHub PR · human reviews and merges
185
+ │
186
+ ▼
187
+ 9. Release credits ──▶ changelog names the user who found the bug · SDK shows toast
188
+ │
189
+ ▼
190
+ └────────────── Loop starts stronger than it began ──────────────┘
191
+ ```
230
192
 
231
- <details>
232
- <summary><b>Security notes</b></summary>
193
+ Every iteration of the loop is slightly better than the last. That's cumulative selection — not a metaphor.
233
194
 
234
- - Credentials passed via `--api-key` are visible to other users on the same machine via `ps -ef`. Use the interactive prompt on shared hosts.
235
- - `~/.mushirc` (the credentials cache) is written with mode `0o600` on Unix; the CLI also tightens the permissions of any existing file on first load.
236
- - The wizard rejects pasted secrets containing CR/LF/NUL to prevent `.env` injection.
237
- - All prompts validate format: `proj_[A-Za-z0-9_-]{10,}` and `mushi_[A-Za-z0-9_-]{10,}`.
238
- - This release ships with [npm provenance](https://docs.npmjs.com/generating-provenance-statements) — verify with `npm audit signatures`.
195
+ ---
239
196
 
240
- </details>
197
+ ## What you get on day one
198
+
199
+ - **Shake-to-report widget** — Shadow-DOM, zero CSS conflicts. Captures screenshot, console ring, network ring, route + intent, and queues offline automatically.
200
+ - **AI-classified reports** — 2-stage pipeline (Haiku fast-filter → Sonnet deep + vision) streams partial results to the admin UI as tokens arrive. Stage 2 includes RAG over your lesson library so reports of *known* bugs get flagged immediately.
201
+ - **Dedup by meaning, not string** — pgvector knowledge graph collapses duplicates across users, routes, and deploys.
202
+ - **Lesson library** — BIRCH-style clusterer + LLM coherence judge promotes clusters to named learning rules. `mushi sync-lessons` writes `.mushi/lessons.json` to your repo automatically.
203
+ - **Bidirectional inventory (v2)** — opt into `capture: { discoverInventory: true }` and the SDK quietly observes routes, `data-testid`s, and outbound API paths. Claude drafts an `inventory.yaml` of user stories → pages → actions for you to accept.
204
+ - **Five pre-release gates (v2)** — `no-dead-handler`, `no-mock-leak`, inventory drift, agentic-failure detection, synthetic walk health. One composite GitHub check.
205
+ - **Spec-traced fixes (v2.10)** — every dispatched fix carries the inventory `Action` it repairs; `validateAgainstSpec` fires before the PR opens; a targeted synthetic probe runs the moment the PR lands.
206
+ - **One-click "Dispatch fix"** — agentic orchestrator opens a GitHub PR with a Playwright replay and screenshot diff. Sandbox-pluggable (`e2b`, `modal`, `cloudflare`, or your own `SandboxProvider`).
207
+ - **A/B experiments** — `mushi.experiment('hero-copy-v3')` returns sticky variant assignments; CUPED + mSPRT analysis with automatic SRM detection.
208
+ - **Anomaly detection** — STL + Page-Hinkley + isolation-forest detectors on inbound adapter metrics; confirmed regressions auto-open reports and feed back into the lesson library.
209
+ - **Release attribution** — auto-drafted changelogs credit the exact user whose report triggered the fix; SDK shows a toast: *"v1.2.3 shipped — you helped fix the settings back-button."*
210
+ - **PDCA iterate loop** — producer/critic agent loop with selectable personas (Tufte data-density, NN/g heuristic, WCAG a11y, mobile-first). Live progress + draft-PR exit.
211
+ - **Agent-native via MCP + A2A** — MCP Streamable HTTP at `/functions/v1/mcp`, A2A v1.0.0 tasks at `/v1/a2a/tasks`. Cursor, Claude Code, Copilot, OpenAI Agents SDK, LangGraph, and CrewAI all see the same surface.
241
212
 
242
- <details>
243
- <summary><b>Supply-chain & verification (Socket, Bundlephobia, Snyk)</b></summary>
213
+ ---
244
214
 
245
- Mushi is a CLI launcher — it spawns one `npm install` and writes one `.env.local` line. Here's what each scanner shows and why:
215
+ ## Who it's for
246
216
 
247
- | Scanner | What it shows | What it actually means |
248
- | ------------------ | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
249
- | **npm provenance** | ✅ Signed by `kensaurus/mushi-mushi @ master` | Cryptographic Sigstore attestation — `npm audit signatures` will verify this build came from this exact commit on this exact CI workflow. |
250
- | **Socket.dev** | Score + a few low-signal alerts | Alerts are expected and benign: `child_process.spawn` (used to invoke `npm install`), `process.env` (read `DEBUG`, `npm_config_*`), URL strings (printed in help text). All visible in `src/index.ts` — ~150 LOC, easy to audit. |
251
- | **Bundlephobia** | ❌ EntryPointError | **Expected.** This is a CLI (`bin` only — no `main`/`module`/`exports`), so there is no importable bundle to measure. Bundlephobia only works for libraries you `import`. |
252
- | **Snyk Advisor** | Health score (lower right after publish) | Snyk's crawler often lags by 1–2 weeks for new public packages — score corrects itself once it picks up the actual `package.json` (`CONTRIBUTING.md`, `funding`, downloads, repo activity). |
217
+ | You are… | …this helps because |
218
+ |---|---|
219
+ | **Solo dev / small team** shipping a consumer app | You already have Sentry for crashes — but users drop off over *friction*, not exceptions. Mushi captures "this button doesn't do anything". |
220
+ | **PM or designer** living in the admin | Triage, severity, component ownership, and PR status — in one dark-mode console. No reading stack traces. |
221
+ | **AI-native team** already in Cursor / Claude | MCP tools expose the full loop to your agent: `get_recent_reports`, `classify`, `dispatch_fix`, `lessons.query`. |
222
+ | **Team that ships fast and breaks things** | The lesson library means each sprint starts smarter than the last. You're not just fixing bugs — you're encoding them. |
223
+ | **Enterprise** needing SOC 2 + residency | Region-pinned data (US / EU / JP / SELF), SAML SSO, audit-log ingest, DSAR workflow, HMAC-signed plugin webhooks. |
253
224
 
254
- If something looks off to you, [open an issue](https://github.com/kensaurus/mushi-mushi/issues) — the source is 100% public and the CI build is reproducible.
225
+ ---
255
226
 
256
- </details>
227
+ ## Mushi vs your existing stack
228
+
229
+ Mushi is a **companion** to Sentry/Datadog, not a replacement. It sees the signal they structurally can't.
230
+
231
+ | Signal type | Typical tool | What they miss |
232
+ |---|---|---|
233
+ | Code-thrown errors | Sentry, Crashlytics, Bugsnag, Rollbar | Bugs that don't throw — dead buttons, janky scroll, 12-second screens |
234
+ | System telemetry | Datadog, New Relic, Honeycomb | The user's perspective on what that latency spike *felt* like |
235
+ | Product analytics | Firebase, PostHog, Amplitude | *Why* a funnel step was abandoned, in the user's own words |
236
+ | **User-felt friction** | **nothing → Mushi** | — |
237
+
238
+ | | Sentry / Crashlytics | Datadog / New Relic | Firebase / Amplitude | **Mushi Mushi** |
239
+ |---|:---|:---|:---|:---|
240
+ | **Signal origin** | Code throws | Infrastructure metrics | User events | User-felt friction, in the moment |
241
+ | **Lesson encoded?** | No | No | No | Yes — named rule in `.mushi/lessons.json` |
242
+ | **Repeat signal** | Same error = separate issue | Spike repeats = new alert | Funnel drops again | Same broken button → 1 row, forever |
243
+ | **Closes the loop** | Assign a ticket | Write a runbook | A/B test conversion | Draft PR → lesson → future PRs get the rule |
244
+ | **From your IDE** | Paste issue ID into Cursor | — | — | Cursor reads the lesson library + proposes the diff |
245
+
246
+ > Already have Sentry? Mushi writes breadcrumbs into your existing Sentry session — jump from a crash to the user's own words in one click. 12 outbound plugins (Slack, Jira, Linear, PagerDuty, Discord, MS Teams, GitHub Issues, Bugsnag, Rollbar, Crashlytics, Zapier, Sentry) and 11 inbound adapters ship in [`@mushi-mushi/adapters`](https://www.npmjs.com/package/@mushi-mushi/adapters).
247
+
248
+ ---
249
+
250
+ ## Framework support
251
+
252
+ | Framework | Package installed by wizard |
253
+ |---|---|
254
+ | React / Next.js | `@mushi-mushi/react` |
255
+ | Vue 3 / Nuxt | `@mushi-mushi/vue` + `@mushi-mushi/web` |
256
+ | Svelte / SvelteKit | `@mushi-mushi/svelte` + `@mushi-mushi/web` |
257
+ | Angular 17+ | `@mushi-mushi/angular` + `@mushi-mushi/web` |
258
+ | React Native / Expo | `@mushi-mushi/react-native` (v0.11.0 — Hermes-compatible) |
259
+ | Capacitor / Ionic | `@mushi-mushi/capacitor` |
260
+ | Flutter / Dart | `pub add mushi_mushi` |
261
+ | iOS native (Swift) | Swift Package Manager |
262
+ | Android (Kotlin/Java) | `dev.mushimushi:mushi-android` |
263
+ | Vanilla JS / any | `@mushi-mushi/web` |
264
+ | Node.js (Express / Fastify / Hono) | `@mushi-mushi/node` |
257
265
 
258
266
  ---
259
267
 
260
268
  ## Power-user CLI
261
269
 
262
- `mushi-mushi` is just the setup wizard. For day-to-day triage install the full CLI:
270
+ `mushi-mushi` is the setup wizard. For daily triage install the full CLI:
263
271
 
264
272
  ```bash
265
273
  npm i -g @mushi-mushi/cli
266
274
  mushi reports list
267
- mushi reports show <id>
268
- mushi reports triage <id> --status acknowledged --severity high
275
+ mushi reports triage <id> --status triaged --severity high
269
276
  mushi deploy check # post-deploy smoke check
270
277
  mushi status # live pipeline health
271
278
  ```
272
279
 
273
- For the **v2 inventory + gates** loop the actionable surface is the GitHub Action — drop one job into your repo and it runs Claude's proposer / the gate suite / the discovery digest on every PR:
280
+ For the **AI agent loop**, add one GitHub Action:
274
281
 
275
282
  ```yaml
276
283
  # .github/workflows/mushi-gates.yml
@@ -278,26 +285,50 @@ For the **v2 inventory + gates** loop the actionable surface is the GitHub Actio
278
285
  with:
279
286
  api-key: ${{ secrets.MUSHI_API_KEY }}
280
287
  project-id: ${{ secrets.MUSHI_PROJECT_ID }}
281
- command: gates # also: propose · discover-api · discovery-status · auth-bootstrap
288
+ command: gates # also: propose · discover-api · discovery-status
282
289
  ```
283
290
 
284
- The same commands are exposed as MCP tools through [`@mushi-mushi/mcp`](https://www.npmjs.com/package/@mushi-mushi/mcp), so Cursor / Claude Code / Copilot can drive the v2 loop without you ever opening a terminal.
285
-
286
- Or skip the CLI entirely and drive it from your AI agent via [`@mushi-mushi/mcp`](https://www.npmjs.com/package/@mushi-mushi/mcp):
291
+ Or drive it entirely from your AI agent:
287
292
 
288
293
  ```json
289
294
  { "mcpServers": { "mushi": { "command": "npx", "args": ["-y", "@mushi-mushi/mcp"] } } }
290
295
  ```
291
296
 
297
+ <details>
298
+ <summary><b>Troubleshooting</b></summary>
299
+
300
+ - **Wrong framework detected?** Pass `--framework <id>`. Valid: `next, react, vue, nuxt, svelte, sveltekit, angular, expo, react-native, capacitor, vanilla`.
301
+ - **Monorepo?** `cd` into your app package first, or pass `--cwd apps/web`. The wizard reads your `package.json` to detect workspace type (npm / yarn / pnpm workspaces, Turborepo, Nx, Lerna) and shows the right install command.
302
+ - **Stale `npx` cache?** `npm cache clean --force` or `npx mushi-mushi@latest`.
303
+ - **Non-interactive terminal (CI)?** Pass `--yes --project-id proj_xxx --api-key mushi_xxx`.
304
+ - **Node version?** Requires Node ≥ 18. Check at [nodejs.org](https://nodejs.org/).
305
+ - **Debug mode:** `DEBUG=mushi npx mushi-mushi`.
306
+
307
+ </details>
308
+
309
+ <details>
310
+ <summary><b>Supply-chain verification (Socket, Provenance, Bundlephobia)</b></summary>
311
+
312
+ | Scanner | What it shows | What it means |
313
+ |---|---|---|
314
+ | **npm provenance** | ✅ Signed by `kensaurus/mushi-mushi @ master` | Cryptographic Sigstore attestation — `npm audit signatures` verifies this build came from this exact commit |
315
+ | **Socket.dev** | Score + a few low-signal alerts | Alerts are benign: `child_process.spawn` (invokes `npm install`), `process.env` (reads `DEBUG`, `npm_config_*`). All visible in `src/index.ts` — ~150 LOC, auditable in minutes |
316
+ | **Bundlephobia** | ❌ EntryPointError | **Expected.** This is a CLI (`bin` only — no `main`/`module`/`exports`). Bundlephobia only measures importable libraries |
317
+
318
+ </details>
319
+
292
320
  ---
293
321
 
294
322
  ## Links
295
323
 
296
- - 🌐 **[Live admin demo](https://kensaur.us/mushi-mushi/)** — click around a real dataset
297
- - 📦 **[GitHub](https://github.com/kensaurus/mushi-mushi)** — source, architecture, self-hosting
298
- - 📚 **[Docs](https://github.com/kensaurus/mushi-mushi#readme)** — quickstart, concepts, API reference
324
+ - 🌐 **[Live admin demo](https://kensaur.us/mushi-mushi/)** — click through a real dataset, no sign-up
325
+ - 📦 **[GitHub](https://github.com/kensaurus/mushi-mushi)** — source, full architecture, self-hosting guide
326
+ - 📚 **[Docs](https://kensaur.us/mushi-mushi/docs/)** — concepts, SDK reference, closed-loop essay
327
+ - 🧬 **[Why a closed loop](https://kensaur.us/mushi-mushi/docs/concepts/closed-loop)** — the full Dawkins / Taleb / Syed argument
299
328
  - 🐛 **[Report a bug](https://github.com/kensaurus/mushi-mushi/issues)** — eat your own dogfood
300
329
 
330
+ ---
331
+
301
332
  ## License
302
333
 
303
334
  MIT © [Kenji Sakuramoto](https://github.com/kensaurus). Backend packages (`@mushi-mushi/server`, `agents`, `verify`) are [BSL 1.1](https://github.com/kensaurus/mushi-mushi/blob/master/packages/server/LICENSE) — converts to Apache 2.0 on April 15, 2029.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // src/index.ts
4
4
  import { runInit } from "@mushi-mushi/cli/init";
5
5
  import { FRAMEWORK_IDS, isFrameworkId } from "@mushi-mushi/cli/detect";
6
- var VERSION = true ? "0.6.5" : "0.0.0-dev";
6
+ var VERSION = true ? "0.7.2" : "0.0.0-dev";
7
7
  var MIN_NODE_MAJOR = 18;
8
8
  var ISSUES_URL = "https://github.com/kensaurus/mushi-mushi/issues";
9
9
  var HELP = `mushi-mushi \u2014 bug-reporting SDK launcher
@@ -13,7 +13,7 @@ Usage:
13
13
  npx mushi-mushi init same, with optional flags
14
14
 
15
15
  Flags (forwarded to \`mushi init\`):
16
- --project-id <id> skip the project ID prompt
16
+ --project-id <uuid> skip the project ID prompt (UUID from the Projects page)
17
17
  --api-key <key> skip the API key prompt (CI only \u2014 leaks into \`ps\`)
18
18
  --framework <id> force a framework (${FRAMEWORK_IDS.join(", ")})
19
19
  --skip-install print the install command instead of running it
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "mushi-mushi",
3
- "version": "0.6.5",
3
+ "version": "0.7.2",
4
4
  "license": "MIT",
5
5
  "description": "Ship a shake-to-report button and get AI-classified, deduped, ready-to-fix bug reports — one `npx mushi-mushi` command for React, Next.js, Vue, Nuxt, Svelte, SvelteKit, Angular, React Native, Expo, Capacitor, and vanilla JS. Companion to Sentry: catches the user-felt bugs crash trackers can't see. Wires into GitHub, Slack, Jira, Linear, PagerDuty, Langfuse, and any MCP-compatible AI agent (Cursor, Claude Code, Copilot).",
6
6
  "bin": {
7
7
  "mushi-mushi": "./dist/index.js"
8
8
  },
9
9
  "dependencies": {
10
- "@mushi-mushi/cli": "^0.7.0"
10
+ "@mushi-mushi/cli": "^0.10.0"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "^22.19.17",