mushi-mushi 0.6.5 β 0.7.0
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/README.md +222 -191
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# mushi-mushi π
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**Software's missing Darwin moment β catch bugs, name them, teach every future developer to never make the same mistake.**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
`npx mushi-mushi` Β· React Β· Next.js Β· Vue Β· Nuxt Β· Svelte Β· Angular Β· React Native Β· Expo Β· Capacitor Β· Vanilla JS
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/mushi-mushi)
|
|
10
10
|
[](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,
|
|
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
|
-
##
|
|
26
|
+
## Why evolution? (The 60-second idea behind this tool)
|
|
27
27
|
|
|
28
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
45
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
|
78
|
-
|
|
79
|
-
| **
|
|
80
|
-
| **
|
|
81
|
-
| **
|
|
82
|
-
| **
|
|
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
|
-
##
|
|
63
|
+
## Pros & Cons
|
|
87
64
|
|
|
88
|
-
|
|
65
|
+
Be honest about what you're signing up for.
|
|
89
66
|
|
|
90
|
-
|
|
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
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
##
|
|
90
|
+
## Install in one line
|
|
146
91
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
-
|
|
98
|
+
```tsx
|
|
99
|
+
// After the wizard β React / Next.js:
|
|
100
|
+
import { MushiProvider } from '@mushi-mushi/react';
|
|
167
101
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
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
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
|
|
220
|
-
<summary><b>Troubleshooting</b></summary>
|
|
158
|
+
---
|
|
221
159
|
|
|
222
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
243
|
-
<summary><b>Supply-chain & verification (Socket, Bundlephobia, Snyk)</b></summary>
|
|
213
|
+
---
|
|
244
214
|
|
|
245
|
-
|
|
215
|
+
## Who it's for
|
|
246
216
|
|
|
247
|
-
|
|
|
248
|
-
|
|
249
|
-
| **
|
|
250
|
-
| **
|
|
251
|
-
| **
|
|
252
|
-
| **
|
|
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
|
-
|
|
225
|
+
---
|
|
255
226
|
|
|
256
|
-
|
|
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
|
|
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
|
|
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 **
|
|
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
|
|
288
|
+
command: gates # also: propose Β· discover-api Β· discovery-status
|
|
282
289
|
```
|
|
283
290
|
|
|
284
|
-
|
|
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
|
|
297
|
-
- π¦ **[GitHub](https://github.com/kensaurus/mushi-mushi)** β source, architecture, self-hosting
|
|
298
|
-
- π **[Docs](https://
|
|
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
|
+
var VERSION = true ? "0.7.0" : "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 <
|
|
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.
|
|
3
|
+
"version": "0.7.0",
|
|
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.
|
|
10
|
+
"@mushi-mushi/cli": "^0.8.0"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/node": "^22.19.17",
|