mushi-mushi 0.6.4 → 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/CONTRIBUTING.md +27 -0
- package/README.md +223 -161
- package/SECURITY.md +167 -4
- package/dist/index.js +2 -2
- package/package.json +6 -6
package/CONTRIBUTING.md
CHANGED
|
@@ -91,6 +91,33 @@ pnpm changeset
|
|
|
91
91
|
|
|
92
92
|
Select the affected packages, the semver bump type, and write a summary. The changeset file gets committed with your PR.
|
|
93
93
|
|
|
94
|
+
## Release flow
|
|
95
|
+
|
|
96
|
+
Releases are fully automated. Maintainers don't run `npm publish` by hand.
|
|
97
|
+
|
|
98
|
+
1. PRs land on `master` with one or more changeset files in `.changeset/`.
|
|
99
|
+
2. `release.yml` runs on every push to `master`. It opens (or updates) a `chore: version packages` PR that bumps every affected `package.json`, rolls up the changelogs, and deletes the consumed changesets.
|
|
100
|
+
3. Merging that "Version Packages" PR re-fires `release.yml`. The publish step authenticates to npm via **OpenID Connect (OIDC) Trusted Publishers** — no long-lived `NPM_TOKEN` is exchanged — and every tarball ships with a **Sigstore provenance attestation** uploaded to the public transparency log.
|
|
101
|
+
|
|
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
|
+
|
|
104
|
+
### Adding a brand-new publishable package
|
|
105
|
+
|
|
106
|
+
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.
|
|
107
|
+
|
|
108
|
+
1. Add the package under `packages/<name>/` with a real `version`, `files`, `publishConfig.access: "public"`, `LICENSE`, and the standard fields enforced by `pnpm check:publish-readiness`.
|
|
109
|
+
2. Build it locally: `pnpm install && pnpm -r build`.
|
|
110
|
+
3. Mint a short-lived granular access token at `https://www.npmjs.com/settings/<your-user>/tokens/granular-access-tokens/new` — **Bypass 2FA: ON**, **Read and write: All packages**, **Expiration: 7 days**.
|
|
111
|
+
4. Bootstrap-publish:
|
|
112
|
+
```bash
|
|
113
|
+
NPM_TOKEN=npm_xxx pnpm bootstrap:new-package
|
|
114
|
+
```
|
|
115
|
+
The script auto-detects which workspace packages are missing on npm and publishes them via `pnpm publish --no-provenance` (so `workspace:^` specifiers get rewritten to real semver in the tarball).
|
|
116
|
+
5. The script prints one URL per freshly-published package. Open each, click **GitHub Actions** under "Trusted Publisher", confirm the auto-filled fields (`<owner>` / `<repo>` / `release.yml`), and tap your security key.
|
|
117
|
+
6. Revoke the bootstrap token at `https://www.npmjs.com/settings/<your-user>/tokens`.
|
|
118
|
+
|
|
119
|
+
From the next changeset bump onward, that package publishes through the normal `release.yml` flow with full OIDC provenance — same as the rest.
|
|
120
|
+
|
|
94
121
|
## Code Style
|
|
95
122
|
|
|
96
123
|
- **TypeScript strict mode** — no `any` unless absolutely necessary
|
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,157 +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
|
-
|
|
29
|
-
npx mushi-mushi
|
|
30
|
-
```
|
|
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.
|
|
31
29
|
|
|
32
|
-
|
|
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.
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
// After the wizard runs (React example):
|
|
36
|
-
import { MushiProvider } from '@mushi-mushi/react'
|
|
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.
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<MushiProvider config={{ projectId: 'proj_xxx', apiKey: 'mushi_xxx' }}>
|
|
41
|
-
{children}
|
|
42
|
-
</MushiProvider>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
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.
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## What you get
|
|
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)
|
|
52
36
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- **🪞 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.
|
|
56
|
-
- **🌱 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.
|
|
57
|
-
- **🚦 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).
|
|
58
|
-
- **🤖 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).
|
|
59
|
-
- **📬 Wires into your existing stack** — Sentry breadcrumbs, Slack Block Kit, Jira OAuth sync, Linear issues, PagerDuty escalations, Langfuse traces, GitHub PRs.
|
|
60
|
-
- **🧑💻 Agent-native via MCP** — Cursor, Claude Code, Copilot, and any MCP client can read, triage, and dispatch fixes through the same JSON-RPC surface.
|
|
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)
|
|
61
39
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## Who it's for
|
|
65
|
-
|
|
66
|
-
| You are… | …and this helps because |
|
|
67
|
-
| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
-
| **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". |
|
|
69
|
-
| **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. |
|
|
70
|
-
| **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. |
|
|
71
|
-
| **An enterprise** needing SOC 2 + residency | Region-pinned data (US / EU / JP / SELF), SAML SSO, audit-log ingest, DSAR workflow, HMAC-signed plugin webhooks. |
|
|
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)
|
|
72
42
|
|
|
73
43
|
---
|
|
74
44
|
|
|
75
|
-
## Mushi
|
|
76
|
-
|
|
77
|
-
Mushi is a **companion** to Sentry/Datadog, not a replacement. It sees the bugs your crash tracker can't.
|
|
45
|
+
## Before Mushi / After Mushi
|
|
78
46
|
|
|
79
|
-
|
|
80
|
-
| ---------------------------------------- | :--------------: | :-------------: |
|
|
81
|
-
| Unhandled JS exception | ✅ | ✅ |
|
|
82
|
-
| Button that *looks* clickable but isn't | — | ✅ |
|
|
83
|
-
| 12-second page load, no error thrown | — | ✅ |
|
|
84
|
-
| User can't find the settings panel | — | ✅ |
|
|
85
|
-
| Layout broken on iPad Safari only | — | ✅ |
|
|
86
|
-
| Form submits but data doesn't save | ~ | ✅ |
|
|
87
|
-
| Feature silently regressed last deploy | ~ | ✅ |
|
|
88
|
-
| LLM-classified + deduped queue | — | ✅ |
|
|
89
|
-
| One-click AI fix → draft GitHub PR | — | ✅ |
|
|
47
|
+
The same team, the same codebase — but with a fundamentally different relationship to failure.
|
|
90
48
|
|
|
91
|
-
|
|
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."* |
|
|
92
60
|
|
|
93
61
|
---
|
|
94
62
|
|
|
95
|
-
##
|
|
96
|
-
|
|
97
|
-
<table>
|
|
98
|
-
<tr>
|
|
99
|
-
<td align="center" width="110"><b>GitHub</b><br/><sub>Auto-draft PRs<br/>+ Checks API</sub></td>
|
|
100
|
-
<td align="center" width="110"><b>Sentry</b><br/><sub>Breadcrumb bridge<br/>+ session link</sub></td>
|
|
101
|
-
<td align="center" width="110"><b>Slack</b><br/><sub>Block Kit<br/>+ /mushi cmd</sub></td>
|
|
102
|
-
<td align="center" width="110"><b>Jira</b><br/><sub>OAuth 3LO<br/>bidir sync</sub></td>
|
|
103
|
-
<td align="center" width="110"><b>Linear</b><br/><sub>Issue create<br/>+ status sync</sub></td>
|
|
104
|
-
</tr>
|
|
105
|
-
<tr>
|
|
106
|
-
<td align="center" width="110"><b>PagerDuty</b><br/><sub>Severity-scoped<br/>escalation</sub></td>
|
|
107
|
-
<td align="center" width="110"><b>Langfuse</b><br/><sub>LLM trace<br/>deeplinks</sub></td>
|
|
108
|
-
<td align="center" width="110"><b>Cursor</b><br/><sub>via MCP<br/>server</sub></td>
|
|
109
|
-
<td align="center" width="110"><b>Claude Code</b><br/><sub>via MCP<br/>server</sub></td>
|
|
110
|
-
<td align="center" width="110"><b>Zapier</b><br/><sub>Generic<br/>webhook fan-out</sub></td>
|
|
111
|
-
</tr>
|
|
112
|
-
</table>
|
|
113
|
-
|
|
114
|
-
Plus first-class adapters for Datadog, New Relic, Honeycomb, and Grafana alerts via [`@mushi-mushi/adapters`](https://www.npmjs.com/package/@mushi-mushi/adapters).
|
|
63
|
+
## Pros & Cons
|
|
115
64
|
|
|
116
|
-
|
|
65
|
+
Be honest about what you're signing up for.
|
|
117
66
|
|
|
118
|
-
|
|
67
|
+
### Pros
|
|
119
68
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
| Vanilla JS | `@mushi-mushi/web` |
|
|
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.
|
|
130
78
|
|
|
131
|
-
|
|
79
|
+
### Cons / trade-offs
|
|
80
|
+
|
|
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.
|
|
132
87
|
|
|
133
88
|
---
|
|
134
89
|
|
|
135
|
-
##
|
|
90
|
+
## Install in one line
|
|
136
91
|
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
│
|
|
140
|
-
▼
|
|
141
|
-
Fast-filter (Haiku) ──▶ drops spam, keeps signal
|
|
142
|
-
│
|
|
143
|
-
▼
|
|
144
|
-
Deep classify (Sonnet + vision + RAG) ──▶ category, severity, component
|
|
145
|
-
│
|
|
146
|
-
▼
|
|
147
|
-
Dedup (pgvector) ──▶ groups repeat reports by meaning
|
|
148
|
-
│
|
|
149
|
-
▼
|
|
150
|
-
Judge (weekly) ──▶ scores classifier, retrains prompts
|
|
151
|
-
│
|
|
152
|
-
▼
|
|
153
|
-
"Dispatch fix" ──▶ agent opens a GitHub PR with Playwright replay + visual diff
|
|
92
|
+
```bash
|
|
93
|
+
npx mushi-mushi
|
|
154
94
|
```
|
|
155
95
|
|
|
156
|
-
|
|
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.
|
|
157
97
|
|
|
158
|
-
|
|
98
|
+
```tsx
|
|
99
|
+
// After the wizard — React / Next.js:
|
|
100
|
+
import { MushiProvider } from '@mushi-mushi/react';
|
|
159
101
|
|
|
160
|
-
|
|
102
|
+
export function App({ children }) {
|
|
103
|
+
return (
|
|
104
|
+
<MushiProvider config={{ projectId: 'proj_xxx', apiKey: 'mushi_xxx' }}>
|
|
105
|
+
{children}
|
|
106
|
+
</MushiProvider>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
```
|
|
161
110
|
|
|
162
|
-
|
|
163
|
-
# 1. Drop the wizard in (or one of the equivalents below)
|
|
164
|
-
npx mushi-mushi
|
|
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.
|
|
165
112
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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' });
|
|
169
138
|
```
|
|
170
139
|
|
|
140
|
+
</details>
|
|
141
|
+
|
|
171
142
|
<details>
|
|
172
143
|
<summary><b>Flags for CI, monorepos, and self-hosted</b></summary>
|
|
173
144
|
|
|
@@ -175,71 +146,138 @@ npx @mushi-mushi/cli init
|
|
|
175
146
|
npx mushi-mushi --framework next # skip framework detection
|
|
176
147
|
npx mushi-mushi --project-id proj_xxx --api-key mushi_xxx
|
|
177
148
|
npx mushi-mushi --skip-install # print the install command, don't run it
|
|
178
|
-
npx mushi-mushi --skip-test-report # don't offer to send a test report
|
|
179
149
|
npx mushi-mushi --cwd apps/web # run inside a monorepo sub-package
|
|
180
150
|
npx mushi-mushi --endpoint https://mushi.your-company.com # self-hosted
|
|
181
|
-
npx mushi-mushi -y # accept the detected framework
|
|
182
|
-
npx mushi-mushi -v # print version
|
|
183
|
-
npx mushi-mushi --help
|
|
151
|
+
npx mushi-mushi -y # accept the detected framework, no prompts
|
|
184
152
|
```
|
|
185
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
|
+
|
|
186
156
|
</details>
|
|
187
157
|
|
|
188
|
-
|
|
189
|
-
<summary><b>Troubleshooting</b></summary>
|
|
158
|
+
---
|
|
190
159
|
|
|
191
|
-
|
|
192
|
-
- **Monorepo?** `cd` into the package first, or pass `--cwd apps/web`.
|
|
193
|
-
- **Stale `npx` cache?** `npm cache clean --force` or `npx mushi-mushi@latest`.
|
|
194
|
-
- **Non-interactive terminal (CI)?** Pass `--yes --project-id proj_xxx --api-key mushi_xxx`. The wizard exits with a clear error instead of hanging.
|
|
195
|
-
- **Node version too old?** Requires Node ≥ 18. Upgrade at [nodejs.org](https://nodejs.org/).
|
|
196
|
-
- **Full stack traces on error?** `DEBUG=mushi npx mushi-mushi`.
|
|
160
|
+
## How the loop actually runs
|
|
197
161
|
|
|
198
|
-
|
|
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
|
+
```
|
|
199
192
|
|
|
200
|
-
|
|
201
|
-
<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.
|
|
202
194
|
|
|
203
|
-
|
|
204
|
-
- `~/.mushirc` (the credentials cache) is written with mode `0o600` on Unix; the CLI also tightens the permissions of any existing file on first load.
|
|
205
|
-
- The wizard rejects pasted secrets containing CR/LF/NUL to prevent `.env` injection.
|
|
206
|
-
- All prompts validate format: `proj_[A-Za-z0-9_-]{10,}` and `mushi_[A-Za-z0-9_-]{10,}`.
|
|
207
|
-
- This release ships with [npm provenance](https://docs.npmjs.com/generating-provenance-statements) — verify with `npm audit signatures`.
|
|
195
|
+
---
|
|
208
196
|
|
|
209
|
-
|
|
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.
|
|
210
212
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Who it's for
|
|
213
216
|
|
|
214
|
-
|
|
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. |
|
|
215
224
|
|
|
216
|
-
|
|
217
|
-
| ---------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
218
|
-
| **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. |
|
|
219
|
-
| **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.|
|
|
220
|
-
| **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`. |
|
|
221
|
-
| **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). |
|
|
225
|
+
---
|
|
222
226
|
|
|
223
|
-
|
|
227
|
+
## Mushi vs your existing stack
|
|
224
228
|
|
|
225
|
-
|
|
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` |
|
|
226
265
|
|
|
227
266
|
---
|
|
228
267
|
|
|
229
268
|
## Power-user CLI
|
|
230
269
|
|
|
231
|
-
`mushi-mushi` is
|
|
270
|
+
`mushi-mushi` is the setup wizard. For daily triage install the full CLI:
|
|
232
271
|
|
|
233
272
|
```bash
|
|
234
273
|
npm i -g @mushi-mushi/cli
|
|
235
274
|
mushi reports list
|
|
236
|
-
mushi reports
|
|
237
|
-
mushi reports triage <id> --status acknowledged --severity high
|
|
275
|
+
mushi reports triage <id> --status triaged --severity high
|
|
238
276
|
mushi deploy check # post-deploy smoke check
|
|
239
277
|
mushi status # live pipeline health
|
|
240
278
|
```
|
|
241
279
|
|
|
242
|
-
For the **
|
|
280
|
+
For the **AI agent loop**, add one GitHub Action:
|
|
243
281
|
|
|
244
282
|
```yaml
|
|
245
283
|
# .github/workflows/mushi-gates.yml
|
|
@@ -247,26 +285,50 @@ For the **v2 inventory + gates** loop the actionable surface is the GitHub Actio
|
|
|
247
285
|
with:
|
|
248
286
|
api-key: ${{ secrets.MUSHI_API_KEY }}
|
|
249
287
|
project-id: ${{ secrets.MUSHI_PROJECT_ID }}
|
|
250
|
-
command: gates
|
|
288
|
+
command: gates # also: propose · discover-api · discovery-status
|
|
251
289
|
```
|
|
252
290
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
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:
|
|
256
292
|
|
|
257
293
|
```json
|
|
258
294
|
{ "mcpServers": { "mushi": { "command": "npx", "args": ["-y", "@mushi-mushi/mcp"] } } }
|
|
259
295
|
```
|
|
260
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
|
+
|
|
261
320
|
---
|
|
262
321
|
|
|
263
322
|
## Links
|
|
264
323
|
|
|
265
|
-
- 🌐 **[Live admin demo](https://kensaur.us/mushi-mushi/)** — click
|
|
266
|
-
- 📦 **[GitHub](https://github.com/kensaurus/mushi-mushi)** — source, architecture, self-hosting
|
|
267
|
-
- 📚 **[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
|
|
268
328
|
- 🐛 **[Report a bug](https://github.com/kensaurus/mushi-mushi/issues)** — eat your own dogfood
|
|
269
329
|
|
|
330
|
+
---
|
|
331
|
+
|
|
270
332
|
## License
|
|
271
333
|
|
|
272
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/SECURITY.md
CHANGED
|
@@ -19,15 +19,59 @@ If you discover a security vulnerability, please report it responsibly.
|
|
|
19
19
|
|
|
20
20
|
**Do NOT open a public GitHub issue.**
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Use either channel below:
|
|
23
|
+
|
|
24
|
+
1. **GitHub Private Vulnerability Reporting** — strongly preferred.
|
|
25
|
+
<https://github.com/kensaurus/mushi-mushi/security/advisories/new>
|
|
26
|
+
Routes the report into a private advisory with built-in CVE issuance,
|
|
27
|
+
patch coordination, and contributor-credit workflow.
|
|
28
|
+
2. **Email** — `kensaurus@gmail.com`, subject prefix `[mushi-security]`.
|
|
29
|
+
PGP welcome but not required.
|
|
23
30
|
|
|
24
31
|
Include:
|
|
25
32
|
- Description of the vulnerability
|
|
26
|
-
- Steps to reproduce
|
|
27
|
-
- Impact assessment
|
|
33
|
+
- Steps to reproduce (smallest reproducer wins)
|
|
34
|
+
- Impact assessment (what an attacker gains)
|
|
28
35
|
- Suggested fix (if any)
|
|
36
|
+
- Whether you want public credit (and how to spell your name)
|
|
37
|
+
|
|
38
|
+
### Coordinated-disclosure timeline
|
|
39
|
+
|
|
40
|
+
| Day | Action |
|
|
41
|
+
|-----|--------|
|
|
42
|
+
| 0 | Report received |
|
|
43
|
+
| ≤ 2 | Acknowledgment + assigned a tracking ID |
|
|
44
|
+
| ≤ 7 | Triage complete: severity assigned (CVSS 3.1) and target patch date communicated |
|
|
45
|
+
| ≤ 30 | Patch released for critical / high (CVSS ≥ 7.0); ≤ 60 days for medium; best-effort for low |
|
|
46
|
+
| Patch + 7 | Public advisory + CVE published; reporter credited unless they declined |
|
|
47
|
+
| Patch + 90 | Embargo expires regardless; if upstream is unresponsive, the reporter is free to publish |
|
|
48
|
+
|
|
49
|
+
### Safe harbor
|
|
50
|
+
|
|
51
|
+
Good-faith security research on Mushi Mushi is welcome. If you stay
|
|
52
|
+
within the rules below, we will not pursue legal action, will not ask
|
|
53
|
+
your hosting provider to take you offline, and will publicly credit your
|
|
54
|
+
work:
|
|
55
|
+
|
|
56
|
+
- Test only against your own self-hosted instance, the public demo at
|
|
57
|
+
<https://kensaur.us/mushi-mushi/admin/>, or accounts you own.
|
|
58
|
+
- Do not access, exfiltrate, or modify data belonging to other users.
|
|
59
|
+
- Do not run automated scanning that affects availability for others
|
|
60
|
+
(rate-limit your tooling, exclude `/health`).
|
|
61
|
+
- Disclose privately first (channels above); do not publish before the
|
|
62
|
+
embargo above expires.
|
|
63
|
+
- Do not intentionally exploit a finding to escalate beyond proving it
|
|
64
|
+
exists.
|
|
65
|
+
|
|
66
|
+
If a finding requires touching production data to confirm, **stop and
|
|
67
|
+
ask first** — describe what you'd need to do and we'll spin up a sandbox.
|
|
68
|
+
|
|
69
|
+
### Hall of fame
|
|
29
70
|
|
|
30
|
-
|
|
71
|
+
Researchers who report a confirmed vulnerability are credited in the
|
|
72
|
+
release notes for the patched version and added to
|
|
73
|
+
[`docs/SECURITY_HALL_OF_FAME.md`](./docs/SECURITY_HALL_OF_FAME.md) (with
|
|
74
|
+
permission).
|
|
31
75
|
|
|
32
76
|
## Scope
|
|
33
77
|
|
|
@@ -48,6 +92,125 @@ We will acknowledge receipt within 48 hours and aim to release a patch within 7
|
|
|
48
92
|
- **Rotate API keys** regularly via the admin console
|
|
49
93
|
- **Enable SSO** for team projects (Enterprise tier)
|
|
50
94
|
- **Review audit logs** periodically for suspicious activity
|
|
95
|
+
- **Verify SDK integrity** with `npm audit signatures` after install
|
|
96
|
+
- **Set `Content-Security-Policy`** on any page embedding the Mushi widget;
|
|
97
|
+
the widget itself ships with `script-src 'self'` and does not load
|
|
98
|
+
remote scripts.
|
|
99
|
+
|
|
100
|
+
## Threat model
|
|
101
|
+
|
|
102
|
+
What we treat as in-scope attacker capabilities, and what we don't.
|
|
103
|
+
|
|
104
|
+
| Capability | In scope | Notes |
|
|
105
|
+
|-----------|----------|-------|
|
|
106
|
+
| Unauthenticated network attacker hitting public endpoints | ✅ | Rate-limit + HMAC + replay protection on every webhook endpoint (`packages/server/supabase/functions/_shared/webhook-middleware.ts`). |
|
|
107
|
+
| Authenticated user trying to read another tenant's data | ✅ | Postgres RLS on every `public.*` table; advisor lints reviewed monthly. |
|
|
108
|
+
| Authenticated user trying to escalate to super-admin | ✅ | Role lives in `auth.users.raw_app_meta_data.role`; cannot be self-edited via PostgREST. |
|
|
109
|
+
| Compromised dependency (npm supply-chain attack) | ✅ | 7-day cooldown + provenance + Harden-Runner + pinned SHAs (see "Supply-chain hardening" below). |
|
|
110
|
+
| Stolen API key | ✅ | Per-key scopes (`api_key_has_scope`), revocation via admin console, audit log of every use. |
|
|
111
|
+
| User pasting a Stripe / OpenAI / GitHub PAT into a bug report | ✅ | PII scrubber redacts ~15 vendor token formats client-side before the report leaves the device. Mirrors `packages/core/src/pii-scrubber.ts` across iOS, Android, Flutter, React Native. |
|
|
112
|
+
| Stolen end-user device with the SDK installed | ⚠️ partial | Offline queue is AsyncStorage / Keychain / SharedPreferences — no app-level encryption beyond the OS default. Reports waiting to flush are vulnerable to a forensic attacker. |
|
|
113
|
+
| Compromised Supabase service-role key | ❌ | Treated as a tier-0 incident; would require key rotation and audit-log forensics. Not defendable in software. |
|
|
114
|
+
| Compromise of `kensaurus@gmail.com` | ❌ | Treated as a project-fork event; downstream consumers should pin to the last known-good version and follow the new release channel. |
|
|
115
|
+
| Physical / OS-level attacker on an end-user device | ❌ | Out of scope. |
|
|
116
|
+
| Malicious fork using the Mushi name to ship malware | ❌ (technical) ✅ (legal) | The MIT/BSL grant lets the fork exist; the trademark policy (`TRADEMARK.md`) makes shipping it under the Mushi name an infringement we will pursue. |
|
|
117
|
+
|
|
118
|
+
## Data handling and PII
|
|
119
|
+
|
|
120
|
+
### What the SDK collects by default
|
|
121
|
+
|
|
122
|
+
| Field | Scope | PII risk |
|
|
123
|
+
|-------|-------|----------|
|
|
124
|
+
| URL / route the user was on | Always | Low — strip query strings if your routes encode user IDs. |
|
|
125
|
+
| Browser / OS / device | Always | None |
|
|
126
|
+
| Console errors (last 50) | Opt-in via `captureConsole: true` | Medium — can include user data your code logs. |
|
|
127
|
+
| Network failures (URL + status) | Opt-in via `captureNetwork: true` | Medium — query params logged as-is unless you redact in-app. |
|
|
128
|
+
| User id / email / role | Only if you call `setUser()` | High — only set what you need; we do not auto-discover. |
|
|
129
|
+
| Session replay frames | Off by default | High — handled by the masking layer; passwords / cards / opted-out elements never leave the page. |
|
|
130
|
+
| Free-text bug description | Always | Medium — passed through the PII scrubber (see below). |
|
|
131
|
+
|
|
132
|
+
### What the PII scrubber redacts before send
|
|
133
|
+
|
|
134
|
+
Implemented identically across `@mushi-mushi/core`, the iOS, Android,
|
|
135
|
+
Flutter, and React Native SDKs. Defaults are below — every category can
|
|
136
|
+
be toggled off, but `secretTokens` is on by default and we recommend
|
|
137
|
+
keeping it that way.
|
|
138
|
+
|
|
139
|
+
| Category | Default | Patterns |
|
|
140
|
+
|----------|---------|----------|
|
|
141
|
+
| `ssns` | on | `123-45-6789` |
|
|
142
|
+
| `creditCards` | on | 12–19 digit Luhn-shaped sequences with optional separators |
|
|
143
|
+
| `secretTokens` | on | AWS access key (`AKIA…` / `ASIA…`), AWS secret (`aws_secret_access_key=…`), Stripe (`sk_live_…`, `sk_test_…`, `rk_…`, `pk_…`), Slack (`xox[abpor]-…`), GitHub PAT (`ghp_…`, `github_pat_…`), OpenAI (`sk-…`, `sk-proj-…`), Anthropic (`sk-ant-…`), Google API (`AIza…`), JWT (`eyJ…` 3-segment) |
|
|
144
|
+
| `emails` | on | RFC-5322 lite |
|
|
145
|
+
| `phones` | on | E.164 with optional country code |
|
|
146
|
+
| `ipAddresses` | off | IPv4 (off because internal IPs are usually not PII and noise hurts triage) |
|
|
147
|
+
| `ipv6` | off | Same |
|
|
148
|
+
|
|
149
|
+
The fields scrubbed are:
|
|
150
|
+
|
|
151
|
+
- `description` — primary free-text field of every bug report
|
|
152
|
+
- `summary` — short summary, in the same composer
|
|
153
|
+
- `breadcrumbs[].message` — auto-captured user-action trail (clicks, route changes, console messages)
|
|
154
|
+
|
|
155
|
+
Structured fields you set explicitly (`metadata.userEmail`,
|
|
156
|
+
`metadata.userId`, etc.) are intentionally **not** scrubbed — those are
|
|
157
|
+
opt-in attribution data, and silently rewriting them would break
|
|
158
|
+
support workflows.
|
|
159
|
+
|
|
160
|
+
### Where data lives
|
|
161
|
+
|
|
162
|
+
- **Reports & telemetry** — Supabase Postgres in the `us-west-1` region.
|
|
163
|
+
- **Session replays** — Supabase Storage, same region. Lifecycle policy
|
|
164
|
+
trims replays older than 30 days unless explicitly retained from the
|
|
165
|
+
admin console.
|
|
166
|
+
- **Inbound webhook bodies** — only a SHA-256 hash + `delivery_id` of
|
|
167
|
+
the body is persisted (`webhook_audit_log`). The full body is
|
|
168
|
+
processed in memory and discarded.
|
|
169
|
+
- **Outbound integrations** (Slack, Jira, …) — Mushi is a sender only;
|
|
170
|
+
the receiving system's retention applies.
|
|
171
|
+
|
|
172
|
+
### Encryption
|
|
173
|
+
|
|
174
|
+
| Surface | At rest | In transit |
|
|
175
|
+
|---------|---------|------------|
|
|
176
|
+
| Postgres (Supabase) | AES-256 (Supabase default) | TLS 1.2+ |
|
|
177
|
+
| Supabase Storage (replays) | AES-256 | TLS 1.2+ |
|
|
178
|
+
| Edge Function ↔ Postgres | — | TLS via the Supavisor pooler |
|
|
179
|
+
| SDK ↔ ingest endpoint | — | TLS 1.2+ enforced; HSTS preload on `kensaur.us` |
|
|
180
|
+
| Inbound webhooks | — | TLS terminated at CloudFront / Supabase edge |
|
|
181
|
+
| Audit log integrity | append-only by RLS; no in-row signing | — |
|
|
182
|
+
|
|
183
|
+
### Cryptographic primitives
|
|
184
|
+
|
|
185
|
+
| Use | Algorithm | Implementation |
|
|
186
|
+
|-----|-----------|---------------|
|
|
187
|
+
| Webhook HMAC verification (Sentry, GitHub, Datadog, Honeycomb, Grafana, Bugsnag, Rollbar, Crashlytics) | HMAC-SHA256, constant-time compare | Web Crypto in Deno; `crypto.subtle.timingSafeEqual` analogue |
|
|
188
|
+
| AWS SNS subscription confirmation | RSA-SHA1 / RSA-SHA256 | Deno `crypto.subtle.verify` with the cert from `SigningCertURL` (URL allow-listed to `*.sns.*.amazonaws.com`) |
|
|
189
|
+
| Opsgenie JWT shared-token | HS256 with `aud` claim verification | `jose` (Deno-compatible) |
|
|
190
|
+
| API-key hashing (database) | SHA-256 prefix + bcrypt secret half | `pgcrypto` |
|
|
191
|
+
| Provenance attestations (npm) | Sigstore (Fulcio + Rekor) | `npm publish --provenance` |
|
|
192
|
+
|
|
193
|
+
We deliberately do not roll our own crypto. If you find an algorithm or
|
|
194
|
+
library above that has been deprecated, please file a security advisory.
|
|
195
|
+
|
|
196
|
+
### Operator security checklist
|
|
197
|
+
|
|
198
|
+
When you provision a new self-hosted Mushi instance:
|
|
199
|
+
|
|
200
|
+
- [ ] Set `auth_leaked_password_protection = true` in Supabase Auth
|
|
201
|
+
(HaveIBeenPwned blocklist; flagged as `auth_leaked_password_protection`
|
|
202
|
+
in the security advisor).
|
|
203
|
+
- [ ] Enable at least two MFA factors in Supabase Auth (`auth_insufficient_mfa_options`).
|
|
204
|
+
- [ ] Rotate the service-role key on day 1, then quarterly.
|
|
205
|
+
- [ ] Restrict Postgres direct connections to your CI / migration runners
|
|
206
|
+
via Supabase network restrictions.
|
|
207
|
+
- [ ] Run `pnpm dlx supabase advisors --project-ref <ref>` after every
|
|
208
|
+
migration; aim for zero ERROR-level findings.
|
|
209
|
+
- [ ] Configure a Supabase log drain to your SIEM if you are subject to
|
|
210
|
+
SOC 2 / ISO 27001.
|
|
211
|
+
- [ ] Set CSP `frame-ancestors` on the host page if you embed the Mushi
|
|
212
|
+
widget (the widget is iframe-friendly but does not enforce
|
|
213
|
+
framing constraints itself).
|
|
51
214
|
|
|
52
215
|
## Supply-chain hardening (how this package is protected)
|
|
53
216
|
|
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,20 +1,20 @@
|
|
|
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
|
-
"@types/node": "^22.
|
|
14
|
-
"eslint": "^10.
|
|
13
|
+
"@types/node": "^22.19.17",
|
|
14
|
+
"eslint": "^10.3.0",
|
|
15
15
|
"tsup": "^8.5.1",
|
|
16
|
-
"typescript": "^6.0.
|
|
17
|
-
"vitest": "^4.1.
|
|
16
|
+
"typescript": "^6.0.3",
|
|
17
|
+
"vitest": "^4.1.5",
|
|
18
18
|
"@mushi-mushi/eslint-config": "0.0.0"
|
|
19
19
|
},
|
|
20
20
|
"author": "Kenji Sakuramoto",
|