memorydetective 1.5.0 → 1.6.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/CHANGELOG.md CHANGED
@@ -6,6 +6,40 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.6.0] — 2026-05-03
10
+
11
+ Catalog grows from 27 to **33 patterns** (Swift 6 / Observation / SwiftData / NavigationStack era), the server adopts MCP **Resources** + **Prompts** beyond raw Tools, every classification now carries a `staticAnalysisHint` bridging to SwiftLint, and the `--version` drift bug from earlier is fixed.
12
+
13
+ ### Added
14
+
15
+ - **6 new cycle patterns** in `classifyCycle`, sourced from Apple Developer Forums (#736110, #716804, #748042, #22795), Swift Forums (#64584, #77257), Donny Wals on the Swift 6.2 `Observations` API, and the Embrace WKWebView memory-leak writeup:
16
+ - `swiftui.observable-state-modal-leak` — `@Observable` model held as `@State` across modal presentation
17
+ - `swiftui.navigationpath-stored-in-viewmodel` — `NavigationPath` retains every element ever pushed (FB11643551, unfixed)
18
+ - `concurrency.async-sequence-on-self` — `for await ... in seq` pins self via the consuming Task; `[weak self]` does NOT help
19
+ - `concurrency.notificationcenter-async-observer-task` — special case of the above for `NotificationCenter.notifications(named:)`
20
+ - `swiftui.observations-closure-strong-self` — Swift 6.2 `Observations { }` closure retains self like `Combine.sink`
21
+ - `webkit.wkscriptmessagehandler-bridge` — handler ↔ webview ↔ contentController 3-link bridge cycle
22
+ - **MCP Resources surface** — all 33 catalog patterns are now browsable as MCP resources at `memorydetective://patterns/{patternId}`. Each resource is a markdown body. Implemented in `src/runtime/resources.ts`. `resources/list` returns all 33; `resources/read` resolves any pattern URI to its markdown body.
23
+ - **MCP Prompts surface** — 5 investigation playbooks exposed as MCP prompts (slash commands in clients that surface them, e.g. Claude Code): `/investigate-leak`, `/investigate-hangs`, `/investigate-jank`, `/investigate-launch`, `/verify-cycle-fix`. Each prompt fills the canonical playbook's argument templates with user-provided values and hands the agent a ready-to-execute brief. Implemented in `src/runtime/prompts.ts`.
24
+ - **`staticAnalysisHint` field** on every `PatternMatch` — bridges runtime evidence to static analysis. Per-pattern entries point at the SwiftLint rule that would catch this at parse time (`weak_self`, `weak_delegate`) OR explicitly note the gap (with a link to e.g. SwiftLint #776 for `@escaping` retain cycles, or Swift Forums #64584 for AsyncSequence). The `swiftui.tag-index-projection` original-investigation pattern explicitly notes "no rule exists; this is a SwiftUI-internal observation issue, not a closure-capture issue." Implemented in `src/runtime/staticAnalysisHints.ts` with a 1:1-coverage test guard against `PATTERNS`.
25
+
26
+ ### Fixed
27
+
28
+ - `memorydetective --version` now reports the actually-installed version. Previously the CLI string was hardcoded (last bumped to `"1.4.0"` in v1.4.0; never bumped for `1.5.0`). The MCP server's `SERVER_VERSION` was even staler — it had been `"0.1.0-dev"` since the v1.0.0 release. Both surfaces now read from `package.json` at runtime via `src/version.ts`, so they can never drift again. (Originally caught while dogfooding the new release script — bundled into 1.6.0 since 1.5.x didn't ship.)
29
+
30
+ ### Changed
31
+
32
+ - README: new "What's new in v1.6" callout. New "Resources (33)" and "Prompts (5)" subsections in the API section. The opening API line now reads "27 MCP tools + 33 Resources + 5 Prompts" instead of "27 MCP tools". Pattern-count and tool-description cells updated.
33
+ - USAGE.md section 2 gains a v1.6 sub-table with the 6 new patterns + a paragraph explaining the new `staticAnalysisHint` field. New section 7 ("MCP Resources + Prompts") documents the catalog-as-resources and slash-command surfaces; the old section 7 is renumbered to 8.
34
+ - Release process is now automated: `scripts/release.sh` orchestrates preflight → build/test → tag → npm publish → GitHub Release in one command. `.github/workflows/release.yml` re-validates on every `vX.Y.Z` tag push (build, tests, version match, CLI smoke). See the maintainer-facing checklist for the full process.
35
+ - Test count: 152 → 183 (31 new — 14 for resources + prompts, 10 for the 6 new patterns + edge cases, 7 for the static-analysis-hint coverage guard).
36
+
37
+ ### Notes
38
+
39
+ - No breaking changes — all additions are catalog entries or new optional fields. Old callers that ignore Resources/Prompts continue to work.
40
+ - The `webkit.wkscriptmessagehandler-bridge` pattern is intentionally additive: it fires *alongside* the broader v1.4 `webkit.scriptmessage-handler-strong` pattern when all three signals (WKWebView + WKUserContentController + handler/bridge class) coexist. Different fix templates apply to each — the new specific one tells you to wrap in a `WeakScriptMessageHandler` proxy; the old broad one just notes that `WKUserContentController.add(_:name:)` retains strongly.
41
+ - Catalog now covers 33 distinct cycle shapes across SwiftUI (incl. Swift 6 / `@Observable` / SwiftData / NavigationStack), Combine, Swift Concurrency (incl. AsyncSequence), UIKit (Timer / CADisplayLink / UIGestureRecognizer / KVO / URLSession / WebKit / DispatchSource), Core Animation, Core Data, the Coordinator pattern, RxSwift, and Realm.
42
+
9
43
  ## [1.5.0] — 2026-05-02
10
44
 
11
45
  Catalog completion + cost transparency. **24 → 27 patterns** (Core Animation animation/layer delegate quirks, Core Data `NSFetchedResultsController`), and the README now documents what `memorydetective` saves you in tokens and developer time, including the cases where the win is marginal.
package/README.md CHANGED
@@ -15,7 +15,9 @@
15
15
 
16
16
  - **CLI-driven leak hunting.** Read `.memgraph` files captured by Xcode (or by `memorydetective` itself on simulators), find ROOT CYCLEs, classify them against known SwiftUI/Combine patterns, and get a one-liner fix hint — all from a script or a chat.
17
17
  - **MCP-native.** Plugs into Claude Code, Claude Desktop, Cursor, Cline, and any other MCP client. The agent drives the full investigate → classify → suggest-fix loop without you opening Instruments.
18
- - **Honest about its limits.** No mocked outputs, no over-promises. Hangs analysis works clean from `xctrace`; sample-level Time Profile still needs Instruments today (planned for v0.2). Memory Graph capture works on Mac apps and iOS simulator; physical iOS devices still need Xcode.
18
+ - **Honest about its limits.** No mocked outputs, no over-promises. Hangs analysis works clean from `xctrace`; sample-level Time Profile is parsed when `xctrace` symbolicates the trace and returns a structured workaround notice when it can't (the underlying `xctrace` SIGSEGV on heavy unsymbolicated traces is an Apple-side limitation we surface explicitly). Memory Graph capture works on Mac apps and iOS simulator; physical iOS devices still need Xcode.
19
+
20
+ > **What's new in v1.6** (2026-05-03): catalog grew from 27 to **33 cycle patterns** (Swift 6 / `@Observable` / SwiftData / NavigationStack / async-sequence-on-self / WKScriptMessageHandler bridge), the server now exposes the catalog as **33 MCP Resources** + ships **5 investigation Prompts** (`/investigate-leak`, `/investigate-hangs`, `/investigate-jank`, `/investigate-launch`, `/verify-cycle-fix`), and every cycle classification now carries a `staticAnalysisHint` pointing at the SwiftLint rule (or explicit gap) that complements the runtime evidence. Full notes in [CHANGELOG](./CHANGELOG.md).
19
21
 
20
22
  ## Quickstart
21
23
 
@@ -70,7 +72,7 @@ memorydetective classify ~/Desktop/myapp.memgraph
70
72
  > **You:** Profile DemoApp on my iPhone for 90 seconds and tell me where the hangs are.
71
73
  >
72
74
  > **Claude:** *(calls `listTraceDevices` → `recordTimeProfile` → `analyzeHangs`)*
73
- > Recorded `~/Desktop/run.trace` (90s, attached to DemoApp on iPhone 17 Pro Max). Found **23 user-visible hangs** (>500 ms each), longest 1.16 s, average 769 ms — severe load. All on the main thread. Sample-level hotspots aren't symbolicated yet; open the trace in Instruments for that step (or wait for `analyzeTimeProfile` v0.2).
75
+ > Recorded `~/Desktop/run.trace` (90s, attached to DemoApp on iPhone 17 Pro Max). Found **23 user-visible hangs** (>500 ms each), longest 1.16 s, average 769 ms — severe load. All on the main thread. Sample-level hotspots aren't symbolicated yet; open the trace in Instruments for that step (`analyzeTimeProfile` returns a structured workaround notice when `xctrace` can't symbolicate — see CHANGELOG known limits).
74
76
 
75
77
  ### End-to-end: leak → file → fix suggestion
76
78
 
@@ -256,11 +258,11 @@ Copilot's MCP integration moves fast — if this snippet is stale, see the [VS C
256
258
 
257
259
  ## API
258
260
 
259
- 27 MCP tools, grouped by purpose. Tool descriptions are tagged with a category prefix (`[mg.memory]`, `[mg.trace]`, `[mg.code]`, `[mg.log]`, `[mg.render]`, `[mg.ci]`, `[mg.discover]`, `[meta]`) so related tools are visible at a glance.
261
+ **27 MCP tools + 33 Resources + 5 Prompts**, grouped by purpose. Tool descriptions are tagged with a category prefix (`[mg.memory]`, `[mg.trace]`, `[mg.code]`, `[mg.log]`, `[mg.render]`, `[mg.ci]`, `[mg.discover]`, `[meta]`) so related tools are visible at a glance.
260
262
 
261
- Many tools include a `suggestedNextCalls` field in their response — a typed list of `{ tool, args, why }` entries pre-populated from the current result, so the orchestrating LLM can chain calls without re-reasoning. Start with `getInvestigationPlaybook(kind)` for the canonical sequence.
263
+ Many tools include a `suggestedNextCalls` field in their response — a typed list of `{ tool, args, why }` entries pre-populated from the current result, so the orchestrating LLM can chain calls without re-reasoning. Start with `getInvestigationPlaybook(kind)` for the canonical sequence — or just type `/investigate-leak` (one of the [Prompts](#prompts-5)) in any client that exposes MCP slash commands.
262
264
 
263
- The cycle classifier ships **27 named antipatterns** spanning SwiftUI, Combine, Swift Concurrency, UIKit (Timer/CADisplayLink/UIGestureRecognizer/KVO/URLSession/WebKit/DispatchSource), Core Animation (CAAnimation/custom CALayer delegate quirks), Core Data (`NSFetchedResultsController`), Coordinator pattern, and the popular third-party libs RxSwift + Realm. Each pattern has a one-line fix hint and a confidence tier.
265
+ The cycle classifier ships **33 named antipatterns** spanning SwiftUI (including the Swift 6 / `@Observable` / SwiftData / NavigationStack era), Combine, Swift Concurrency (incl. AsyncSequence-on-self and the new `Observations` API), UIKit (Timer/CADisplayLink/UIGestureRecognizer/KVO/URLSession/WebKit/DispatchSource), Core Animation, Core Data, Coordinator pattern, and the popular third-party libs RxSwift + Realm. Each pattern carries a one-line fix hint, a confidence tier, AND a `staticAnalysisHint` field pointing at the SwiftLint rule (`weak_self`, `weak_delegate`) that would have caught it at parse time — or an explicit gap notice when no static rule exists. Reinforces the differentiator: memorydetective sees the runtime evidence linters miss.
264
266
 
265
267
  ### Read & analyze (13)
266
268
 
@@ -273,7 +275,7 @@ The cycle classifier ships **27 named antipatterns** spanning SwiftUI, Combine,
273
275
  | `reachableFromCycle` | Cycle-scoped reachability. "How many `<X>` instances are reachable from the cycle rooted at `<Y>`?" — distinguishes the actual culprit from its retained dependencies. |
274
276
  | `diffMemgraphs` | Compare two `.memgraph` snapshots: total deltas + class-count changes + cycles new/gone/persisted. |
275
277
  | `verifyFix` | Cycle-semantic diff: per-pattern PASS/PARTIAL/FAIL verdict + bytes freed. CI-gateable. |
276
- | `classifyCycle` | Match each ROOT CYCLE against a built-in catalog of **27 named antipatterns** (SwiftUI / Combine / Concurrency / UIKit / Core Animation / Core Data / Coordinator / RxSwift / Realm) with confidence + fix hint. |
278
+ | `classifyCycle` | Match each ROOT CYCLE against a built-in catalog of **33 named antipatterns** (SwiftUI / Combine / Concurrency / UIKit / Core Animation / Core Data / Coordinator / RxSwift / Realm) with confidence + fix hint + `staticAnalysisHint` (which SwiftLint rule complements this, or explicit gap). |
277
279
  | `analyzeHangs` | Parse `xctrace` `potential-hangs` schema; return Hang vs Microhang counts + top N longest. |
278
280
  | `analyzeAnimationHitches` | Parse `xctrace` `animation-hitches` schema; report by-type counts and how many hitches crossed Apple's user-perceptible 100ms threshold. |
279
281
  | `analyzeTimeProfile` | Parse `xctrace` `time-profile` schema; return top symbols by sample count. Reports SIGSEGV with workarounds when xctrace can't symbolicate. |
@@ -324,6 +326,33 @@ These tools require macOS + Xcode (full Xcode, not just Command Line Tools — `
324
326
 
325
327
  > **Why `captureMemgraph` doesn't work on physical iOS devices**: `leaks(1)` only attaches to processes running on the local Mac (which includes iOS simulators). Memory Graph capture from a real device goes through Xcode's debugger over USB/lockdownd — different mechanism, no public CLI equivalent.
326
328
 
329
+ ### Resources (33)
330
+
331
+ The cycle-pattern catalog is also surfaced as MCP resources, browsable at `memorydetective://patterns/{patternId}`. Each resource is a markdown body with the pattern name, a longer description, and the fix hint. Use this to let an agent (or a human in a UI-aware MCP client) browse the catalog without burning a `classifyCycle` call.
332
+
333
+ ```
334
+ memorydetective://patterns/swiftui.tag-index-projection
335
+ memorydetective://patterns/concurrency.async-sequence-on-self
336
+ memorydetective://patterns/webkit.wkscriptmessagehandler-bridge
337
+
338
+ ```
339
+
340
+ `resources/list` returns all 33 entries. `resources/read` resolves any `memorydetective://patterns/{id}` URI to its markdown body.
341
+
342
+ ### Prompts (5)
343
+
344
+ Investigation playbooks are exposed as MCP prompts (slash commands in clients that surface them, e.g. Claude Code).
345
+
346
+ | Slash command | What it does | Args |
347
+ |---|---|---|
348
+ | `/investigate-leak` | Runs the canonical 6-step memgraph-leak investigation: `analyzeMemgraph` → `classifyCycle` → `reachableFromCycle` → `swiftSearchPattern` → `swiftGetSymbolDefinition` → `swiftFindSymbolReferences`. | `memgraphPath` |
349
+ | `/investigate-hangs` | Diagnose user-visible main-thread hangs from a `.trace`. | `tracePath` |
350
+ | `/investigate-jank` | Diagnose dropped frames / animation hitches from a `.trace`. | `tracePath` |
351
+ | `/investigate-launch` | Diagnose cold/warm launch slowness from a `.trace`. | `tracePath` |
352
+ | `/verify-cycle-fix` | Diff a before/after pair of `.memgraph` snapshots to confirm a fix landed. | `before`, `after` |
353
+
354
+ Each prompt fills the canonical playbook's argument templates with the user-provided values, then hands the agent a ready-to-execute brief. Calls the same tools listed in [Read & analyze](#read--analyze-13) — prompts are an orchestration shortcut, not a separate engine.
355
+
327
356
  ### CLI mode
328
357
 
329
358
  The same binary is also a thin CLI for scripting and CI:
@@ -361,15 +390,16 @@ npm run dev # tsx, stdio mode (dev mode)
361
390
  Contributions are welcome — bug reports, feature requests, new cycle patterns, all of it.
362
391
 
363
392
  - **Bugs / feature requests**: [open an issue](https://github.com/carloshpdoc/memorydetective/issues).
364
- - **PRs**: fork → branch → `npm install` → make changes → `npm test` (152 tests must stay green) → open a PR with a concise description of what changed and why.
393
+ - **PRs**: fork → branch → `npm install` → make changes → `npm test` (183 tests must stay green) → open a PR with a concise description of what changed and why.
365
394
 
366
395
  ### Adding a cycle pattern to `classifyCycle`
367
396
 
368
- `classifyCycle` ships with 27 built-in patterns covering SwiftUI, Combine, Swift Concurrency, UIKit (Timer / CADisplayLink / UIGestureRecognizer / KVO / URLSession / WebKit / DispatchSource), Core Animation, Core Data, the Coordinator pattern, RxSwift, and Realm. To add one:
397
+ `classifyCycle` ships with 33 built-in patterns covering SwiftUI (incl. Swift 6 / `@Observable` / SwiftData / NavigationStack), Combine, Swift Concurrency (incl. AsyncSequence-on-self and `Observations`), UIKit (Timer / CADisplayLink / UIGestureRecognizer / KVO / URLSession / WebKit / DispatchSource), Core Animation, Core Data, the Coordinator pattern, RxSwift, and Realm. To add one:
369
398
 
370
399
  1. Edit `src/tools/classifyCycle.ts` — add an entry to `PATTERNS` with `id`, `name`, `fixHint`, and a `match` function.
371
400
  2. Add a test in `src/tools/readTools.test.ts` that asserts the new pattern fires against a representative memgraph fixture.
372
- 3. Open a PR.
401
+ 3. Add a `staticAnalysisHint` entry in `src/runtime/staticAnalysisHints.ts` (the test in that file enforces 1:1 coverage with `PATTERNS`).
402
+ 4. Open a PR.
373
403
 
374
404
  ## Support this project
375
405
 
package/USAGE.md CHANGED
@@ -94,9 +94,9 @@ Claude orchestrates the full flow (see [section 3](#3-how-fixes-actually-flow-fr
94
94
 
95
95
  ---
96
96
 
97
- ## 2. The 27 cycle patterns and their fix hints
97
+ ## 2. The 33 cycle patterns and their fix hints
98
98
 
99
- `classifyCycle` ships with a built-in catalog of 27 common iOS retain-cycle patterns. Each pattern returns a `fixHint` — a plain-English string describing the fix direction. Patterns are grouped below by the framework / source they target.
99
+ `classifyCycle` ships with a built-in catalog of 33 common iOS retain-cycle patterns. Each pattern returns a `fixHint` — a plain-English string describing the fix direction — plus an optional `staticAnalysisHint` field pointing at the SwiftLint rule (or explicit gap) that complements the runtime evidence. Patterns are grouped below by the framework / source they target.
100
100
 
101
101
  ### v1.0 core (8) — SwiftUI + Combine + Concurrency + Notifications
102
102
 
@@ -140,8 +140,31 @@ Claude orchestrates the full flow (see [section 3](#3-how-fixes-actually-flow-fr
140
140
  | `coreanimation.layer-delegate-cycle` | Custom `CALayer` subclass (`CAShapeLayer` / `CAGradientLayer` / `CAEmitterLayer` / `CAMetalLayer` / etc.) in chain without `UIView` auto-pairing | Custom layer wired to non-UIView delegate leaks. Wrap in `WeakLayerDelegate` or clear `layer.delegate = nil` in `deinit`. |
141
141
  | `coredata.fetchedresultscontroller-delegate` | `NSFetchedResultsController` / `_PFFetchedResultsController` in chain | Apple's historical strong-delegate quirk via the change-tracker. `frc.delegate = nil` in `viewWillDisappear` / `deinit`. |
142
142
 
143
+ ### v1.6 catalog expansion (6) — Swift 6 / Observation / SwiftData / NavigationStack era
144
+
145
+ Sourced from Apple Developer Forums (#736110, #716804, #748042), Swift Forums (#64584, #77257), Donny Wals on the Swift 6.2 `Observations` API, and the Embrace WKWebView memory-leak writeup.
146
+
147
+ | Pattern ID | When it matches | Fix hint (summary) |
148
+ |---|---|---|
149
+ | `swiftui.observable-state-modal-leak` | `_$ObservationRegistrar` + sheet/presentation host in chain | `@Observable` model passed as `@State` to a modal leaks. Move the model to `@StateObject` on the parent and pass via `@Bindable`, or use `.sheet(item:)` with a value type. |
150
+ | `swiftui.navigationpath-stored-in-viewmodel` | `NavigationPath` / `NavigationStackStore` / `AnyHashableStorageBase` in chain | NavigationPath retains every element ever pushed (FB11643551, unfixed). Keep it `@State` local to the view, or reset with `path = NavigationPath()` after `popToRoot`. |
151
+ | `concurrency.async-sequence-on-self` | `AsyncSequence` / `AsyncIteratorProtocol` + `Task<...>` in chain | `for await ... in seq { use(self) }` pins self via the iteration context — `[weak self]` does NOT help. Capture only the values needed before the loop, or `task.cancel()` in `deinit`. |
152
+ | `concurrency.notificationcenter-async-observer-task` | `NotificationCenter.Notifications` (the `AsyncSequence` form) + `Task<...>` | Special case of the above — `for await _ in NotificationCenter.default.notifications(named:)` never terminates. Same fix discipline. |
153
+ | `swiftui.observations-closure-strong-self` | `Observations` (the Swift 6.2 API, NOT `ObservationRegistrar`) + `Closure context` | The new non-SwiftUI `Observations { }` closure retains self like `Combine.sink`. Use `[weak self]` inside the closure. |
154
+ | `webkit.wkscriptmessagehandler-bridge` | `WKWebView` + `WKUserContentController` + `WKScriptMessageHandler` (or `*Bridge`/`*Handler` class) all in chain | The 3-link bridge cycle: bridge → webView → contentController → bridge. Wrap the handler in `WeakScriptMessageHandler` proxy, or `removeScriptMessageHandler(forName:)` for every name added. Fires alongside the broader v1.4 `webkit.scriptmessage-handler-strong` pattern when the full bridge shape is present. |
155
+
143
156
  **Confidence tiers**: each pattern returns `high`, `medium`, or `low` based on how many specific signals match. If multiple patterns fire on the same cycle, all matches are returned — the highest-confidence one is `primaryMatch`, the rest are in `allMatches`.
144
157
 
158
+ **Static analysis bridge (v1.6+)**: every classified cycle now carries a `staticAnalysisHint` field with three sub-fields:
159
+ - `rule` — the SwiftLint rule that would have caught this at parse time (`weak_self`, `weak_delegate`, etc.), or `null` when no rule exists
160
+ - `url` — link to the rule docs OR to the open issue tracking the gap (e.g. SwiftLint #776 for `@escaping` retain cycles)
161
+ - `explanation` — plain-English description of the static-vs-runtime relationship
162
+
163
+ Reinforces the differentiator: **memorydetective sees the runtime evidence linters miss**. Examples:
164
+ - `combine.sink-store-self-capture` → `weak_self` (SwiftLint catches the closure form)
165
+ - `concurrency.async-sequence-on-self` → `null` rule, with note that `[weak self]` does NOT help here
166
+ - `delegate.strong-reference` → `weak_delegate` (SwiftLint catches it directly)
167
+
145
168
  **The hints are deliberately textual, not code patches.** That's by design — see the next section.
146
169
 
147
170
  ---
@@ -390,7 +413,54 @@ Every tool description starts with a category tag so related tools are visible a
390
413
 
391
414
  The tag is leading text in the MCP description, so it shows up in any tools/list output and inside Claude Code's "deferred tools" list.
392
415
 
393
- ## 7. Where to go from here
416
+ ## 7. MCP Resources + Prompts (catalog browsing + slash commands)
417
+
418
+ Since v1.6, memorydetective surfaces two MCP-spec features beyond raw Tools.
419
+
420
+ ### Resources — browsable cycle-pattern catalog
421
+
422
+ Each of the 33 catalog patterns is exposed as a read-only MCP resource at `memorydetective://patterns/{patternId}`. The body is markdown — the pattern name, the fix hint, and a footer pointing at how it composes with `classifyCycle`'s `primaryMatch`.
423
+
424
+ ```jsonc
425
+ // resources/list response (excerpt)
426
+ {
427
+ "resources": [
428
+ {
429
+ "uri": "memorydetective://patterns/swiftui.tag-index-projection",
430
+ "name": "SwiftUI .tag(...) closure-over-self cycle",
431
+ "description": "SwiftUI .tag(...) closure-over-self cycle",
432
+ "mimeType": "text/markdown"
433
+ },
434
+ {
435
+ "uri": "memorydetective://patterns/concurrency.async-sequence-on-self",
436
+ "name": "`for await` over an infinite AsyncSequence pins self via the consuming Task",
437
+ "description": "`for await` over an infinite AsyncSequence pins self via the consuming Task",
438
+ "mimeType": "text/markdown"
439
+ },
440
+
441
+ ]
442
+ }
443
+ ```
444
+
445
+ **Why this matters:** an agent that needs to ask "do you cover X?" can browse the resource list cheaply (no tool call). A UI-aware client can render the catalog as a sidebar or completion source.
446
+
447
+ ### Prompts — investigation playbooks as slash commands
448
+
449
+ Five prompts ship, one per investigation kind:
450
+
451
+ | Prompt name | Surfaces in Claude Code as | Args | Equivalent tool sequence |
452
+ |---|---|---|---|
453
+ | `investigate-leak` | `/investigate-leak` | `memgraphPath` | `analyzeMemgraph` → `classifyCycle` → `reachableFromCycle` → `swiftSearchPattern` → `swiftGetSymbolDefinition` → `swiftFindSymbolReferences` |
454
+ | `investigate-hangs` | `/investigate-hangs` | `tracePath` | `listTraceDevices` → `recordTimeProfile` (if needed) → `analyzeHangs` → `swiftSearchPattern` |
455
+ | `investigate-jank` | `/investigate-jank` | `tracePath` | `recordTimeProfile` (Animation Hitches template) → `analyzeAnimationHitches` → `swiftFindSymbolReferences` |
456
+ | `investigate-launch` | `/investigate-launch` | `tracePath` | `recordTimeProfile` (App Launch template) → `analyzeAppLaunch` → `swiftSearchPattern` |
457
+ | `verify-cycle-fix` | `/verify-cycle-fix` | `before`, `after` | `diffMemgraphs` → `classifyCycle` |
458
+
459
+ When the user invokes a prompt, the server fills the canonical playbook's argument templates with the user-provided values and returns a ready-to-execute brief. The agent then executes the steps — same tool calls as if the user had typed them out, just orchestrated.
460
+
461
+ > **Both surfaces (Tools + Resources + Prompts) are independent — clients that only support Tools still get the full catalog via `classifyCycle`.** Resources and Prompts are pure-add UX improvements for clients that surface them.
462
+
463
+ ## 8. Where to go from here
394
464
 
395
465
  - **Add a new cycle pattern**: see the *Adding a cycle pattern to `classifyCycle`* section in [`README.md`](./README.md#contributing).
396
466
  - **Run a custom analysis from scratch**: every tool's input schema is documented via the MCP `tools/list` request. Hit the server with `{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}` over stdio.
package/dist/cli.js CHANGED
@@ -15,6 +15,7 @@ import { homedir } from "node:os";
15
15
  import { resolve as resolvePath, join as joinPath } from "node:path";
16
16
  import { analyzeMemgraph } from "./tools/analyzeMemgraph.js";
17
17
  import { classifyCycle } from "./tools/classifyCycle.js";
18
+ import { VERSION } from "./version.js";
18
19
  const C = {
19
20
  reset: "\x1b[0m",
20
21
  dim: "\x1b[2m",
@@ -25,7 +26,6 @@ const C = {
25
26
  cyan: "\x1b[36m",
26
27
  gray: "\x1b[90m",
27
28
  };
28
- const VERSION = "1.4.0";
29
29
  const HELP = `${C.bold}memorydetective${C.reset} — iOS leak hunting from the CLI
30
30
 
31
31
  ${C.dim}Usage:${C.reset}
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,GAAG;IACR,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,SAAS;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AAC;gBACrF,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,KAAK,qBAAqB,GAAG,GAAG,IAAI,IAAI,CAAC,CAAC;gBAC3E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC3B,OAAO,CAAC,CAAC;YACX,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC,CAAC;QACtD,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
package/dist/index.js CHANGED
@@ -23,8 +23,11 @@ import { reachableFromCycle, reachableFromCycleSchema, } from "./tools/reachable
23
23
  import { getInvestigationPlaybook, getInvestigationPlaybookSchema, } from "./tools/getInvestigationPlaybook.js";
24
24
  import { verifyFix, verifyFixSchema } from "./tools/verifyFix.js";
25
25
  import { swiftGetSymbolDefinition, swiftGetSymbolDefinitionSchema, swiftFindSymbolReferences, swiftFindSymbolReferencesSchema, swiftGetSymbolsOverview, swiftGetSymbolsOverviewSchema, swiftGetHoverInfo, swiftGetHoverInfoSchema, swiftSearchPattern, swiftSearchPatternSchema, } from "./tools/swift/index.js";
26
+ import { VERSION as SERVER_VERSION } from "./version.js";
27
+ import { listPatternResources, readPatternResource, } from "./runtime/resources.js";
28
+ import { PROMPTS } from "./runtime/prompts.js";
29
+ import { z } from "zod";
26
30
  const SERVER_NAME = "memorydetective";
27
- const SERVER_VERSION = "0.1.0-dev";
28
31
  const server = new McpServer({
29
32
  name: SERVER_NAME,
30
33
  version: SERVER_VERSION,
@@ -281,6 +284,60 @@ server.registerTool("verifyFix", {
281
284
  const result = await verifyFix(input);
282
285
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
283
286
  });
287
+ // ─────────────────────────────────────────────────────────────────────────────
288
+ // MCP Resources — the cycle-pattern catalog as browsable URIs
289
+ // ─────────────────────────────────────────────────────────────────────────────
290
+ for (const res of listPatternResources()) {
291
+ server.registerResource(res.name, res.uri, {
292
+ title: res.name,
293
+ description: res.description,
294
+ mimeType: res.mimeType,
295
+ }, async (uri) => {
296
+ const body = readPatternResource(uri.href);
297
+ if (!body) {
298
+ throw new Error(`Unknown resource URI: ${uri.href}`);
299
+ }
300
+ return {
301
+ contents: [
302
+ {
303
+ uri: body.uri,
304
+ mimeType: body.mimeType,
305
+ text: body.text,
306
+ },
307
+ ],
308
+ };
309
+ });
310
+ }
311
+ // ─────────────────────────────────────────────────────────────────────────────
312
+ // MCP Prompts — investigation playbooks as named slash commands
313
+ // ─────────────────────────────────────────────────────────────────────────────
314
+ for (const prompt of PROMPTS) {
315
+ const argsSchema = {};
316
+ for (const arg of prompt.arguments) {
317
+ let schema = z.string().describe(arg.description);
318
+ if (!arg.required) {
319
+ // Optional args still represented as strings; leave required-ness to
320
+ // the prompt definition. (MCP SDK v1.x supports optional via .optional()
321
+ // but our prompts are all-required for now.)
322
+ }
323
+ argsSchema[arg.name] = schema;
324
+ }
325
+ server.registerPrompt(prompt.name, {
326
+ title: prompt.title,
327
+ description: prompt.description,
328
+ argsSchema,
329
+ }, (args) => ({
330
+ messages: [
331
+ {
332
+ role: "user",
333
+ content: {
334
+ type: "text",
335
+ text: prompt.render(args),
336
+ },
337
+ },
338
+ ],
339
+ }));
340
+ }
284
341
  async function main() {
285
342
  // CLI mode: when called with arguments, run the synchronous CLI wrapper.
286
343
  // No arguments → start the MCP server over stdio (the default and the
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,O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/C,CAAC;QACD,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;IAChC,CAAC;IACD,MAAM,CAAC,cAAc,CACnB,MAAM,CAAC,IAAI,EACX;QACE,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,UAAU;KACX,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACT,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,IAA8B,CAAC;iBACpD;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,yEAAyE;IACzE,sEAAsE;IACtE,sBAAsB;IACtB,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IACD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * MCP Prompts surface — exposes the canonical investigation playbooks as
3
+ * named prompts (slash commands in clients that support them).
4
+ *
5
+ * Each prompt corresponds to a `Playbook` from `getInvestigationPlaybook`,
6
+ * but takes user-provided args (e.g. memgraph path, before/after pair) and
7
+ * fills the placeholders so the agent receives a ready-to-execute brief.
8
+ *
9
+ * Prompt names follow `investigate-*` / `verify-*` convention; surfaces in
10
+ * Claude Code as `/investigate-leak`, `/investigate-hangs`, etc.
11
+ */
12
+ export interface PromptArg {
13
+ name: string;
14
+ description: string;
15
+ required: boolean;
16
+ }
17
+ export interface PromptDefinition {
18
+ name: string;
19
+ title: string;
20
+ description: string;
21
+ arguments: PromptArg[];
22
+ /** Substitutes args into the playbook to produce the user message text. */
23
+ render: (args: Record<string, string>) => string;
24
+ }
25
+ export declare const PROMPTS: PromptDefinition[];
26
+ export declare function findPrompt(name: string): PromptDefinition | undefined;
@@ -0,0 +1,143 @@
1
+ /**
2
+ * MCP Prompts surface — exposes the canonical investigation playbooks as
3
+ * named prompts (slash commands in clients that support them).
4
+ *
5
+ * Each prompt corresponds to a `Playbook` from `getInvestigationPlaybook`,
6
+ * but takes user-provided args (e.g. memgraph path, before/after pair) and
7
+ * fills the placeholders so the agent receives a ready-to-execute brief.
8
+ *
9
+ * Prompt names follow `investigate-*` / `verify-*` convention; surfaces in
10
+ * Claude Code as `/investigate-leak`, `/investigate-hangs`, etc.
11
+ */
12
+ import { PLAYBOOKS } from "../tools/getInvestigationPlaybook.js";
13
+ export const PROMPTS = [
14
+ {
15
+ name: "investigate-leak",
16
+ title: "Investigate a memgraph leak",
17
+ description: "Run the canonical 6-step memgraph-leak investigation: analyzeMemgraph → classifyCycle → reachableFromCycle → swiftSearchPattern → swiftGetSymbolDefinition → swiftFindSymbolReferences.",
18
+ arguments: [
19
+ {
20
+ name: "memgraphPath",
21
+ description: "Absolute path to the .memgraph file",
22
+ required: true,
23
+ },
24
+ ],
25
+ render: ({ memgraphPath }) => renderPlaybookPrompt(PLAYBOOKS["memgraph-leak"], {
26
+ path: memgraphPath,
27
+ }),
28
+ },
29
+ {
30
+ name: "investigate-hangs",
31
+ title: "Investigate user-visible hangs",
32
+ description: "Diagnose main-thread hangs from a `.trace` recorded with the Time Profiler or Hangs template.",
33
+ arguments: [
34
+ {
35
+ name: "tracePath",
36
+ description: "Absolute path to the .trace bundle",
37
+ required: true,
38
+ },
39
+ ],
40
+ render: ({ tracePath }) => renderPlaybookPrompt(PLAYBOOKS["perf-hangs"], { tracePath }),
41
+ },
42
+ {
43
+ name: "investigate-jank",
44
+ title: "Investigate UI jank / animation hitches",
45
+ description: "Diagnose dropped frames from a `.trace` recorded with the Animation Hitches template.",
46
+ arguments: [
47
+ {
48
+ name: "tracePath",
49
+ description: "Absolute path to the .trace bundle",
50
+ required: true,
51
+ },
52
+ ],
53
+ render: ({ tracePath }) => renderPlaybookPrompt(PLAYBOOKS["ui-jank"], { tracePath }),
54
+ },
55
+ {
56
+ name: "investigate-launch",
57
+ title: "Investigate slow app launch",
58
+ description: "Diagnose cold/warm launch slowness from a `.trace` recorded with the App Launch template.",
59
+ arguments: [
60
+ {
61
+ name: "tracePath",
62
+ description: "Absolute path to the .trace bundle",
63
+ required: true,
64
+ },
65
+ ],
66
+ render: ({ tracePath }) => renderPlaybookPrompt(PLAYBOOKS["app-launch-slow"], { tracePath }),
67
+ },
68
+ {
69
+ name: "verify-cycle-fix",
70
+ title: "Verify a fix closed a known cycle",
71
+ description: "Diff a before/after pair of `.memgraph` snapshots to confirm a fix actually closed the originally-classified cycle.",
72
+ arguments: [
73
+ {
74
+ name: "before",
75
+ description: "Path to the before-fix .memgraph",
76
+ required: true,
77
+ },
78
+ {
79
+ name: "after",
80
+ description: "Path to the after-fix .memgraph",
81
+ required: true,
82
+ },
83
+ ],
84
+ render: ({ before, after }) => renderPlaybookPrompt(PLAYBOOKS["verify-fix"], { before, after }),
85
+ },
86
+ ];
87
+ export function findPrompt(name) {
88
+ return PROMPTS.find((p) => p.name === name);
89
+ }
90
+ /**
91
+ * Substitutes user-provided values into a playbook's argsTemplate slots and
92
+ * renders a markdown brief the agent can act on directly.
93
+ */
94
+ function renderPlaybookPrompt(playbook, values) {
95
+ const lines = [];
96
+ lines.push(`Run the **${playbook.kind}** investigation playbook.`);
97
+ lines.push("");
98
+ lines.push(playbook.summary);
99
+ lines.push("");
100
+ lines.push("## User-provided values");
101
+ for (const [key, value] of Object.entries(values)) {
102
+ lines.push(`- \`${key}\`: \`${value}\``);
103
+ }
104
+ lines.push("");
105
+ lines.push("## Steps");
106
+ lines.push("");
107
+ for (const step of playbook.steps) {
108
+ const argsRendered = renderArgsTemplate(step.argsTemplate, values);
109
+ lines.push(`### ${step.step}. \`${step.tool}\``);
110
+ lines.push("");
111
+ lines.push(step.purpose);
112
+ lines.push("");
113
+ lines.push("```json");
114
+ lines.push(argsRendered);
115
+ lines.push("```");
116
+ if (step.resultGuidance) {
117
+ lines.push("");
118
+ lines.push(`> ${step.resultGuidance}`);
119
+ }
120
+ lines.push("");
121
+ }
122
+ lines.push("Execute the steps in order. After each tool call, follow any");
123
+ lines.push("`suggestedNextCalls` returned by the tool — they're the canonical");
124
+ lines.push("chain. Do not propose architectural changes before evidence.");
125
+ return lines.join("\n");
126
+ }
127
+ function renderArgsTemplate(template, values) {
128
+ // Substitute values where keys match — e.g. {path: "<absolute path...>"}
129
+ // becomes {path: "<actual user value>"} when values has matching key.
130
+ // For slots we don't have, leave the template placeholder so the agent
131
+ // can fill it from result chaining (e.g. step 2's class name).
132
+ const filled = {};
133
+ for (const [key, slot] of Object.entries(template)) {
134
+ if (typeof slot === "string" && values[key]) {
135
+ filled[key] = values[key];
136
+ }
137
+ else {
138
+ filled[key] = slot;
139
+ }
140
+ }
141
+ return JSON.stringify(filled, null, 2);
142
+ }
143
+ //# sourceMappingURL=prompts.js.map