memorydetective 1.8.0 → 1.9.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.
Files changed (89) hide show
  1. package/CHANGELOG.md +64 -1
  2. package/README.md +75 -9
  3. package/USAGE.md +27 -4
  4. package/dist/cli.js +106 -3
  5. package/dist/cli.js.map +1 -1
  6. package/dist/index.js +42 -22
  7. package/dist/index.js.map +1 -1
  8. package/dist/parsers/referenceTree.d.ts +73 -0
  9. package/dist/parsers/referenceTree.js +145 -0
  10. package/dist/parsers/referenceTree.js.map +1 -0
  11. package/dist/runtime/axe.js +6 -1
  12. package/dist/runtime/axe.js.map +1 -1
  13. package/dist/runtime/exec.d.ts +30 -0
  14. package/dist/runtime/exec.js +30 -3
  15. package/dist/runtime/exec.js.map +1 -1
  16. package/dist/runtime/fixTemplates.js +67 -0
  17. package/dist/runtime/fixTemplates.js.map +1 -1
  18. package/dist/runtime/leakReport.d.ts +62 -0
  19. package/dist/runtime/leakReport.js +138 -0
  20. package/dist/runtime/leakReport.js.map +1 -0
  21. package/dist/runtime/platformCheck.d.ts +54 -0
  22. package/dist/runtime/platformCheck.js +94 -0
  23. package/dist/runtime/platformCheck.js.map +1 -0
  24. package/dist/runtime/redact.d.ts +66 -0
  25. package/dist/runtime/redact.js +146 -0
  26. package/dist/runtime/redact.js.map +1 -0
  27. package/dist/runtime/responseFormatter.d.ts +55 -0
  28. package/dist/runtime/responseFormatter.js +200 -0
  29. package/dist/runtime/responseFormatter.js.map +1 -0
  30. package/dist/runtime/securityFlags.d.ts +74 -0
  31. package/dist/runtime/securityFlags.js +90 -0
  32. package/dist/runtime/securityFlags.js.map +1 -0
  33. package/dist/runtime/staticAnalysisHints.js +14 -1
  34. package/dist/runtime/staticAnalysisHints.js.map +1 -1
  35. package/dist/templates/leak-report.html +39 -0
  36. package/dist/templates/templates/leak-report.html +39 -0
  37. package/dist/tools/analyzeAbandonedMemory.d.ts +140 -0
  38. package/dist/tools/analyzeAbandonedMemory.js +287 -0
  39. package/dist/tools/analyzeAbandonedMemory.js.map +1 -0
  40. package/dist/tools/analyzeAllocations.d.ts +11 -2
  41. package/dist/tools/analyzeAllocations.js +4 -0
  42. package/dist/tools/analyzeAllocations.js.map +1 -1
  43. package/dist/tools/analyzeAnimationHitches.d.ts +32 -2
  44. package/dist/tools/analyzeAnimationHitches.js +25 -4
  45. package/dist/tools/analyzeAnimationHitches.js.map +1 -1
  46. package/dist/tools/analyzeAppLaunch.d.ts +3 -0
  47. package/dist/tools/analyzeAppLaunch.js +2 -0
  48. package/dist/tools/analyzeAppLaunch.js.map +1 -1
  49. package/dist/tools/analyzeHangs.d.ts +78 -2
  50. package/dist/tools/analyzeHangs.js +117 -4
  51. package/dist/tools/analyzeHangs.js.map +1 -1
  52. package/dist/tools/analyzeMemgraph.d.ts +21 -1
  53. package/dist/tools/analyzeMemgraph.js +52 -2
  54. package/dist/tools/analyzeMemgraph.js.map +1 -1
  55. package/dist/tools/analyzeTimeProfile.d.ts +11 -1
  56. package/dist/tools/analyzeTimeProfile.js +5 -0
  57. package/dist/tools/analyzeTimeProfile.js.map +1 -1
  58. package/dist/tools/bootAndLaunchForLeakInvestigation.d.ts +18 -9
  59. package/dist/tools/bootAndLaunchForLeakInvestigation.js +27 -0
  60. package/dist/tools/bootAndLaunchForLeakInvestigation.js.map +1 -1
  61. package/dist/tools/captureMemgraph.d.ts +22 -4
  62. package/dist/tools/captureMemgraph.js +42 -9
  63. package/dist/tools/captureMemgraph.js.map +1 -1
  64. package/dist/tools/captureScenarioState.d.ts +12 -4
  65. package/dist/tools/captureScenarioState.js +4 -0
  66. package/dist/tools/captureScenarioState.js.map +1 -1
  67. package/dist/tools/classifyCycle.js +77 -0
  68. package/dist/tools/classifyCycle.js.map +1 -1
  69. package/dist/tools/cleanupTraces.d.ts +87 -0
  70. package/dist/tools/cleanupTraces.js +232 -0
  71. package/dist/tools/cleanupTraces.js.map +1 -0
  72. package/dist/tools/compareTracesByPattern.d.ts +2 -2
  73. package/dist/tools/detectLeaksInXCTest.d.ts +116 -0
  74. package/dist/tools/detectLeaksInXCTest.js +311 -0
  75. package/dist/tools/detectLeaksInXCTest.js.map +1 -0
  76. package/dist/tools/detectLeaksInXCUITest.d.ts +8 -3
  77. package/dist/tools/detectLeaksInXCUITest.js +30 -4
  78. package/dist/tools/detectLeaksInXCUITest.js.map +1 -1
  79. package/dist/tools/diffMemgraphs.d.ts +5 -2
  80. package/dist/tools/diffMemgraphs.js +2 -0
  81. package/dist/tools/diffMemgraphs.js.map +1 -1
  82. package/dist/tools/findCycles.d.ts +1 -1
  83. package/dist/tools/recordTimeProfile.d.ts +29 -9
  84. package/dist/tools/recordTimeProfile.js +70 -7
  85. package/dist/tools/recordTimeProfile.js.map +1 -1
  86. package/dist/tools/renderCycleGraph.d.ts +1 -1
  87. package/dist/tools/verifyFix.d.ts +2 -2
  88. package/dist/types.d.ts +24 -1
  89. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -6,6 +6,68 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.9.0] - 2026-05-14
10
+
11
+ ### Added
12
+
13
+ - **Security env flags: `MEMORYDETECTIVE_ALLOW_LAUNCH`, `MEMORYDETECTIVE_MAX_RECORDING_SECONDS`, `MEMORYDETECTIVE_TRACE_ROOT`.** `ALLOW_LAUNCH` gates `bootAndLaunchForLeakInvestigation`. The tool executes `xcodebuild` + `xcrun simctl launch` against caller-supplied paths and bundle ids; without the env var set to literally `"1"`, the tool returns `ok: false` with `state: "launchNotAllowed"` and a clear explanation rather than running. `MAX_RECORDING_SECONDS` caps `recordTimeProfile.durationSec` at the default 300s (configurable, bounded to 3600s hard ceiling) so an unattended agent cannot pile up multi-GB traces; over-cap requests throw with an actionable message. `TRACE_ROOT` becomes the default directory for `.trace` bundles when `recordTimeProfile.output` is a relative path (absolute paths bypass it, preserving v1.8 behavior); the directory is auto-created on first write. The same root will be the default scan path for the upcoming `cleanup_traces` tool. The `launchNotAllowed` state is a new value on the `LaunchState` union: agents that branch on `state` should add a case. 13 new unit tests in `src/runtime/securityFlags.test.ts` cover env-var parsing (defaults, strict literal-`1` for ALLOW_LAUNCH, bounds clamping for MAX_RECORDING_SECONDS, fallback on empty/invalid values for all three) plus the error-message helpers.
14
+
15
+ - **`MEMORYDETECTIVE_REDACTION` env var: `balanced` / `strict` / `off`.** Output-scrubbing layer applied to every tool response at the formatter boundary. `balanced` (default) collapses home-directory absolute paths to `~/...` and masks token-shaped secrets (AWS access keys, GitHub classic + fine-grained PATs, Stripe live/test secrets, Slack tokens, Bearer auth headers). `strict` additionally masks hostnames, IPv4 addresses, and bundle identifiers (`com.example.app`). `off` disables redaction for local-only debugging. The active mode is logged once on server startup to stderr so an operator running `off` knows responses are unfiltered. Redaction is structural: object keys and non-string scalars (numbers, booleans, null) pass through; only string VALUES and string array items are rewritten, so the response schema is preserved. The host/IP regexes deliberately skip filename-with-extension patterns (`leak.memgraph`, `run.trace`) to avoid false positives on paths. 28 new unit tests cover the mode parsing, the three modes, recursion through objects/arrays, key preservation, scalar pass-through, and the once-per-instance log advisory.
16
+
17
+ - **`outputFormat: "markdown" | "json" | "both"` on every analyzer.** Optional input field (omitted/`json` preserves v1.8 behavior). When `markdown`, the response is a human-readable view of the same data (H1 title, H2 per top-level field, markdown tables for arrays of uniform objects, bullet lists for scalars, inline JSON for deeply nested values). When `both`, the response carries TWO content items: markdown first (so a UI that picks `content[0]` gets the readable view), then JSON (so an agent looking for the structured data finds it). Useful when the agent wants to display markdown to the user AND parse JSON for the next call without a second round-trip. Applied to: analyzeMemgraph, analyzeTimeProfile, analyzeAllocations, analyzeAnimationHitches, analyzeHangs, analyzeAppLaunch, diffMemgraphs, analyzeAbandonedMemory. Shared formatter at `src/runtime/responseFormatter.ts` (generic JSON-to-markdown renderer with table detection, cell truncation, deep-nesting collapse) keeps the wiring DRY. 14 new unit tests cover all three modes + edge cases (empty arrays, null, deeply nested, long strings, table detection).
18
+
19
+ - **`timeRangeMs: { startMs, endMs }` scoping on `analyzeHangs` and `analyzeAnimationHitches`.** Optional time-window filter that drops samples whose `startNs` falls outside the window. Lets the agent answer "what hangs happened during this 5-second user-visible jank?" without re-recording. Filter is applied post-parse, reusing the existing parsers. When the window matches zero rows, the response carries `status: "available"` and empty arrays (different from `not_present`, which means the table itself was missing from the trace). 2 new unit tests cover the windowed filter narrowing the baseline result set and the empty-window-still-available case. `analyzeTimeProfile` and `analyzeAllocations` deferred to a follow-up because the existing parsers don't expose per-row timestamps; the window would need a parser extension.
20
+
21
+ - **`status` field (DataStatus taxonomy) on trace analyzers.** `analyzeTimeProfile`, `analyzeAllocations`, `analyzeAnimationHitches`, and `analyzeHangs` now return a `status` field disambiguating empty arrays into four cases: `available` (data was exported and parsed; empty arrays mean the trace genuinely had no rows for the section), `partial` (export started but did not finish), `not_exportable` (a GUI track exists in Instruments.app but `xcrun xctrace export` has no exportable schema for it; Apple-side limitation), and `not_present` (the requested table schema is not in the trace bundle at all). Agents should branch on this rather than collapsing all empty arrays into a generic "no data" signal. analyzeTimeProfile's existing SIGSEGV-on-xctrace-export path is now tagged `not_exportable`. Shared `DataStatus` type added to `src/types.ts`. Backwards-compatible: existing callers see a new required field on the response, TypeScript consumers that destructure or check the field continue to work; ad-hoc consumers that ignored the response shape are unaffected. 2 new unit tests cover the available + not_present cases.
22
+
23
+ - **`analyzeAbandonedMemory(beforePath, afterPath)` tool.** New top-level MCP tool that diffs two `.memgraph` snapshots on heap reference-tree class counts (NOT cycle list) and classifies each grown class against a catalog of abandoned-memory shapes: `kvo-observer-orphaned`, `notificationcenter-observer-leaked`, `cache-too-aggressive`, `singleton-retains-payload`, `unknown-growth`. Each entry carries a `confidence` tier (`high` / `medium` / `low`) and a contextual `hint` pointing at the fix. The classifier escalates large co-occurrence growth: when `NSKeyValueObservance` grew, other classes with delta >= 5 are reclassified as `kvo-observer-orphaned` (medium for delta < 50, high for delta >= 50). The natural pair for the v1.8 verify-fix loop: `captureScenarioState({label:'before'})` -> ship fix -> `captureScenarioState({label:'after'})` -> `analyzeAbandonedMemory(before, after)`. Validated end-to-end on the notelet investigation 2026-05-12 where AVPlayerItem went 342 to 0 across a fix invisible in standard `leaks` output (`leakCount: 0` on both sides). 17 new unit tests cover the classifier catalog, co-occurrence escalation, topN slicing, classFilter substring, totals computation, and the empty/identity edge cases. Registered as the 32nd MCP tool (`[mg.memory]`).
24
+
25
+ - **`analyzeMemgraph` surfaces abandoned-memory top classes when `leakCount` is 0.** Previously a clean leaks count gave `cycles: [], "No leaks detected."` and no further signal, even when the heap was retaining hundreds of orphaned objects via KVO observers, NotificationCenter handlers, or runaway caches. Now `analyzeMemgraph` invokes a second `leaks <path> --referenceTree --groupByType --noContent` pass on the leakCount-0 path and populates a new `abandonedMemoryTop[]` field with the top N classes by live instance count. New optional input parameter `referenceTreeTopN` (default 20, set 0 to skip the second leaks invocation). Reference-tree parser at `src/parsers/referenceTree.ts` aggregates instance counts across the entire tree by class name, drops c-runtime allocator entries (malloc/calloc/realloc), and resolves `--> ClassName` arrows to the value type. 14 new unit tests cover size parsing, class-name extraction, aggregation, sort stability, topN slicing, malloc filtering, and empty-input cases. Surfaced from the notelet investigation 2026-05-12 where the pre-fix memgraph had `leakCount: 0` but 342 alive AVPlayerItem instances visible in the reference tree. Backwards-compatible: existing callers without `referenceTreeTopN` get the default and a new optional field; consumers that ignore the field continue to work unchanged.
26
+
27
+ - **Catalog: `uikit.viewcontroller-retained-after-pop` pattern.** New cycle-catalog entry covering the case where a UIViewController subclass is alive in the heap but no `_parentViewController` / `_presentingViewController` edge appears in the cycle. The VC was popped from its navigation stack but a closure, Combine sink, NotificationCenter block, or KVO observation is still retaining it. DebugSwift surfaces the same shape via `dealloc` swizzle on-device; the catalog-side equivalent matches the heap residue. Confidence tiers: `high` when the root is a `*ViewController` AND a `Closure context` co-occurs (the classic shape), `medium` when only one of the two signals is present, `low` otherwise. Suppressed when explicit `_parentViewController` / `_presentingViewController` edges appear in the chain (the VC is still owned, the leak is elsewhere). 4 unit tests cover the HIGH match with closure, the MEDIUM match without closure, the parent-edge suppression, and the negative case (non-VC root). Fix-hint chains audit closures captured in `viewDidLoad`, `Task { }` blocks that outlive the screen, KVO observations that never `invalidate()`, and delegate properties declared without `weak`.
28
+
29
+ - **Catalog: `swiftui.observable-write-on-every-render` pattern.** New cycle-catalog entry for the SwiftUI antipattern of mutating an `@Observable` (or `ObservableObject`) inside `body`, which triggers infinite re-render. Beyond the perf cost, the closure that mutates the observable usually captures the view's `self` (or an enclosing model), pinning a render-graph closure in the heap. DebugSwift detects the perf side via render-frequency analysis; the cycle catalog catches the heap shape it leaves behind. Match signals: `ObservationRegistrar` / `Observation._` / `ObservableObject` co-occurs with a SwiftUI view-graph class (`SwiftUI.ViewGraph`, `SwiftUI._GraphValue`, `SwiftUI._ViewList`, `ViewBodyAccessor`, `DynamicViewProperty`) AND a `Closure context`. Confidence tiers: `high` when all three coexist, `medium` for Observable + ViewGraph, `low` for Observable + Closure without an explicit view-graph signal. 4 unit tests cover each tier and the negative case (Observable alone). Fix-hint chains the canonical "compute in computed property, not in body" or "move side effects to .onChange/.task/.onAppear" guidance.
30
+
31
+ - **`analyzeHangs`: optional `mainThreadViolations` enrichment.** Each top hang now carries an optional `mainThreadViolations: Array<{ kind: "sync-io" | "db-lock" | "network" | "lock-contention"; topFrame: string; samples: number }>` field populated when the caller supplies a supplemental `topFramesByHangStartNs: Record<string, string>` map. Stringified `startNs` values are the keys so the map survives JSON round-trips. The pure classifier `classifyHangFrame(topFrame)` is exported for programmatic use and matches a four-category catalog inspired by DebugSwift's Thread Checker: `sync-io` (read/write/fsync, NSData blocking initializers, FileManager mutators), `db-lock` (SQLite mutex acquisition, NSPersistentStoreCoordinator lock, NSManagedObjectContext save), `network` (NSURLConnection sendSynchronousRequest, CFReadStreamRead, nw_connection_start/wait), and `lock-contention` (pthread / os_unfair_lock / dispatch_semaphore_wait / dispatch_sync / NSLock). When the frame is supplied but matches no signature, `mainThreadViolations` is set to `[]` (deliberate, "we looked and found nothing actionable"); when no frame is supplied for a given hang, the field stays `undefined`. The typical pipeline: call `analyzeTimeProfile` on the same trace, correlate samples to hang windows by timestamp, then re-call `analyzeHangs` with the resulting map. 11 new unit tests cover the four categories, the no-match null path, the samples threading, the map-key convention, and the three enrichment branches (matched, unmatched-frame, missing-frame).
32
+
33
+ - **`detectLeaksInXCTest` tool: per-test leak gate for XCTest unit-test schemes.** Sibling to `detectLeaksInXCUITest`. Builds for testing, launches the test bundle with an optional `-only-testing:<TestTarget>/<TestClass>[/<testMethod>]` filter, polls for the runner process (`xctest` by default, overridable via `processName` for app-hosted unit bundles), captures `.memgraph` baseline + after, diffs. Returns `passed: false` when new ROOT CYCLEs appear that are not in the `allowlistPatterns` list. Per-test granularity is achieved by calling the tool once per test method with different `testCaseFilter` values; aggregation stays on the caller side, keeping every response tied to a single well-defined before/after pair. When the runner exits before the after-capture window (common for fast unit tests with no host), the response carries an explicit `failureReason` pointing at the `tearDown` workaround. Registered as the 34th MCP tool (`[mg.ci]`). 15 unit tests cover schema validation (mutually-exclusive workspace/project, default `processName`, custom processName), the allowlist substring check, the descendant counter, and the new-cycles diff (no-change, new-leak, allowlist-matched, mixed, anonymous-root by address, chainLength inclusion).
34
+
35
+ - **HTML report output for both `detectLeaks*` tools.** Added optional `outputHtmlPath` parameter. When set, the tool writes a self-contained HTML report (inline CSS, no external assets) with verdict pills (PASS/FAIL), baseline/after/delta stat blocks, a new-cycles table tagging each entry as allowlisted or failing, the run-log inside a collapsed `<details>` block, and full HTML-entity escaping so leaked class names cannot inject markup. The response gains an `htmlReportPath` field pointing at the same file. Template lives at `src/templates/leak-report.html` and is copied to `dist/templates/` by the build script. Designed for CI artifact upload + PR-comment bots that link directly to the artifact. 12 unit tests cover the renderer (PASS/FAIL pills, failureReason rendering, allowlist badges, HTML escaping against script/img injection, memgraph path embedding, steps block, multi-section ordering, subtitle, version/timestamp substitution, signed delta formatting) plus the file-write helper.
36
+
37
+ - **CI recipe: "Add memorydetective to your CI in 5 minutes".** New README subsection under "CI / test integration" with a working `.github/workflows/leaks.yml` template that runs `detectLeaksInXCTest` and uploads the HTML report as an artifact. The same workflow is also available verbatim at `examples/ci/github-actions-leaks.yml`. Walkthrough covers Xcode pinning, simulator boot, allowlist pattern guidance (incl. `_TtC` Swift mangled prefixes), the iOS 18 runtime choice for the macOS 26.x regression, and `actions/cache` + `--skipBuild` for build reuse across chained invocations.
38
+
39
+ - **`cleanupTraces` tool: preview and delete `.trace` bundles under `MEMORYDETECTIVE_TRACE_ROOT`.** New top-level MCP tool that walks the trace root, finds `.trace` directories produced by `recordTimeProfile`, and returns a sorted (oldest-first) list of candidates with `path`, `sizeMB`, and `ageDays`. `dryRun: true` by default so an accidental call previews instead of destroying. Pass `dryRun: false` to actually delete. Optional `olderThanDays: N` filters to bundles older than the threshold (useful for "delete anything older than a week" workflows); omitted, all bundles are considered regardless of age. **Scope is restricted to `MEMORYDETECTIVE_TRACE_ROOT` by default.** To clean up an arbitrary directory, pass `root: <path>` AND set `MEMORYDETECTIVE_ALLOW_EXTERNAL_CLEANUP=1` in the env; without it, the tool returns `ok: false` with the failure reason and deletes nothing (default-deny on destructive disk operations outside the configured boundary). The walker stops at the `.trace` directory boundary (does NOT descend INTO bundles) so xctrace's `Run1`, `Form1.template`, etc. inside a bundle are not misread as nested bundles. Solves the "trace root fills up after a few profiling sessions" problem that v1.8 left to manual `rm -rf`. 15 new unit tests cover the boundary check (sibling-prefix string false positives), age filter, dryRun preserve-on-disk, dryRun=false deletes, external-root guard, missing-root tolerance, and file/non-`.trace`-directory skipping. Registered as the 33rd MCP tool (`[ops]`).
40
+
41
+ - **`recordTimeProfile` external timeout wrapper for the macOS 26.x `xctrace --time-limit` regression.** On some macOS 26.x simulator builds, `xctrace record` ignores `--time-limit` and runs indefinitely past its declared deadline. `recordTimeProfile` now wraps the invocation with a soft timeout at `durationSec + 30s` that sends `SIGINT` (so xctrace flushes the trace cleanly), waits up to 10s for graceful exit, then escalates to `SIGKILL` only if necessary. When the wrapper fires, the response gains `recordingTimedOut: true` and a structured `workaroundNotice` with `issue: "xctrace-time-limit-ignored"` listing concrete mitigations (iOS 18 sim runtime, shorter durations, simulator restart for partial-trace recovery). Previously the only outcomes were "xctrace exits cleanly" or "user kills the agent loop manually". Critically, `SIGTERM` (the previous default in `runCommand`) corrupts xctrace traces; this path explicitly uses `SIGINT` so the partial output remains parseable. `runCommand` in `src/runtime/exec.ts` gains two new options to support this: `timeoutSignal: NodeJS.Signals` (default `SIGTERM`, opt in to `SIGINT`) and `gracefulKillAfterMs: number` (default `0`, opt in to "resolve with `timedOut: true` instead of reject"). Default behavior preserved for all existing callers. 6 new unit tests in `src/runtime/exec.test.ts` cover the new paths.
42
+
43
+ ### Changed
44
+
45
+ - **Docs: macOS 26.x regression and the iOS 18 escape hatch documented prominently.** README gains a "Heads up for macOS 26.x users" callout in the Highlights section, naming the regression and the iOS 18 sim runtime workaround. USAGE.md Troubleshooting section now distinguishes `minimal-corpse` (relaunch with MallocStackLogging fixes) from `macos-26-task-for-pid-broken` (iOS 18 sim is the only reliable path), each with their own recovery checklist. Plus a note on the scheme-level Malloc Stack Logging toggle needed for Xcode's "View Memory Graph Hierarchy" on macOS 26.x.
46
+
47
+ ### Added
48
+
49
+ - **New `macos-26-task-for-pid-broken` workaround issue.** When `captureMemgraph` detects a `minimal-corpse` failure pattern AND the host is macOS 26.x (Darwin kernel 25.x), the workaround notice now upgrades the `issue` field from `minimal-corpse` to `macos-26-task-for-pid-broken`, swaps in a platform-aware message that names the Apple-side kernel regression as the root cause, and reorders the `fallbacks[]` to put the iOS 18 simulator runtime first. Adjusts `suggestedNextCalls` to chain into `recordTimeProfile` + `analyzeAllocations` on the new issue id the same way it does for `minimal-corpse`. Agents that branch on the issue id should add a case for the new value; the existing `minimal-corpse` branch continues to fire on non-macOS-26 hosts (older macOS, future macOS releases pending verification). 2 new unit tests cover the upgrade path and confirm `permission-denied` / `transient` are unaffected by the platform context. `classifyLeaksFailure` gains an optional `isMacOS26: boolean` parameter (defaults to `false`, so existing callers compile unchanged).
50
+
51
+ - **Proactive macOS 26.x platform advisory.** `captureMemgraph`, `captureScenarioState`, and `bootAndLaunchForLeakInvestigation` now emit a one-time stderr banner and a structured `platformAdvisory` field on their response when running on macOS 26.x (Darwin kernel 25.x). The advisory documents Apple's `task_for_pid` kernel regression that blocks `leaks --outputGraph`, `heap`, and `xctrace --template Allocations` against simulator processes regardless of `MallocStackLogging=1`, and recommends an iOS 18 simulator runtime as the most reliable workaround. Set `MEMORYDETECTIVE_SUPPRESS_PLATFORM_ADVISORY=1` to silence. New `src/runtime/platformCheck.ts` with 10 unit tests covering the helper. Reduces wasted time for users hitting the regression for the first time. Surfaced during the notelet investigation 2026-05-12 where three independent CLI memory-introspection paths failed before iOS 18 was identified as the working escape hatch.
52
+
53
+ ### Fixed
54
+
55
+ - **`replayScenario` and `captureScenarioState`: tap targets by `elementId` now resolve SwiftUI's `accessibilityIdentifier(_:)`.** The internal `normalizeAxeNode` in `src/runtime/axe.ts` previously only read the `AXIdentifier` key when populating `UIElement.identifier`, but `axe describe-ui` (and Apple's accessibility tree) emit the SwiftUI `accessibilityIdentifier` value under `AXUniqueId`. Result: every `tap` targeted by `elementId` failed with "Could not locate element matching ..." even when the element was present in the tree. Now reads both keys in order (`AXIdentifier` first, then `AXUniqueId`). Surfaced from the notelet investigation 2026-05-12 where 20 replay iterations all failed to find a SwiftUI Button identified by `.accessibilityIdentifier("present-button")`. 2 new unit tests cover the AXUniqueId path and the precedence case.
56
+
57
+ ## [1.8.1] - 2026-05-13
58
+
59
+ Metadata-only release to enable submission to the official MCP Registry (`registry.modelcontextprotocol.io`). Adds the `mcpName` property to `package.json` so the registry can verify that the published npm package matches the registry submission metadata.
60
+
61
+ ### Added
62
+
63
+ - **`mcpName: "io.github.carloshpdoc/memorydetective"`** in `package.json`. Required by the MCP Registry to verify package ownership. Follows the `io.github.<owner>/<repo>` convention mandated for GitHub-based authentication with `mcp-publisher`.
64
+
65
+ ### Notes
66
+
67
+ - No code changes, no API changes, no functional changes for existing consumers.
68
+ - Existing v1.8.0 installs keep working unchanged.
69
+ - The plugin's `^1.7` SPM-style range picks this up automatically; no plugin sync needed for this patch.
70
+
9
71
  ## [1.8.0] - 2026-05-06
10
72
 
11
73
  `leaks --outputGraph` regressed on macOS 26.x and aborts with `Failed to get DYLD info for task` when the target was not launched with malloc-stack-logging. This release fixes that end to end. `captureMemgraph` detects the regression and emits a structured `workaroundNotice`, the new `bootAndLaunchForLeakInvestigation` tool absorbs build + boot + install + launch with `MallocStackLogging=1` so capture works on the first try, and `replayScenario` + `captureScenarioState` close the verify-fix loop with deterministic before/after snapshots. 28 -> 31 MCP tools, 213 -> 287 tests.
@@ -323,7 +385,8 @@ When called with no arguments it starts the MCP server over stdio.
323
385
  - **`captureMemgraph`** does not work on physical iOS devices — `leaks(1)` only attaches to processes on the local Mac (which includes iOS simulators). Memory Graph capture from a physical device still requires Xcode.
324
386
  - **`detectLeaksInXCUITest`** is flagged experimental: orchestration logic is implemented but not yet validated against a wide set of production XCUITest runs.
325
387
 
326
- [Unreleased]: https://github.com/carloshpdoc/memorydetective/compare/v1.4.0...HEAD
388
+ [Unreleased]: https://github.com/carloshpdoc/memorydetective/compare/v1.9.0...HEAD
389
+ [1.9.0]: https://github.com/carloshpdoc/memorydetective/compare/v1.8.1...v1.9.0
327
390
  [1.4.0]: https://github.com/carloshpdoc/memorydetective/compare/v1.3.1...v1.4.0
328
391
  [1.3.1]: https://github.com/carloshpdoc/memorydetective/compare/v1.3.0...v1.3.1
329
392
  [1.3.0]: https://github.com/carloshpdoc/memorydetective/compare/v1.2.1...v1.3.0
package/README.md CHANGED
@@ -17,9 +17,11 @@
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
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
19
 
20
- > **What's new in v1.8** (2026-05-06): `leaks --outputGraph` regressed on macOS 26.x and aborts unless the target was launched with `MallocStackLogging=1`. This release fixes that end to end. `captureMemgraph` now emits a structured `workaroundNotice` when the regression hits, the new **`bootAndLaunchForLeakInvestigation`** tool absorbs build + boot + install + launch with the right env vars so capture works on the first try, and **`replayScenario`** + **`captureScenarioState`** close the verify-fix loop with deterministic before/after snapshots (memgraph + screenshot + UI tree, all labeled). 2831 MCP tools, 213 → 287 tests.
20
+ > **What's new in v1.9** (2026-05-14): Abandoned-memory detection for the family of bugs that `leaks(1)` reports as `leakCount: 0`. New `analyzeAbandonedMemory` tool diffs two memgraph snapshots on reference-tree class counts and classifies each grown class as `kvo-observer-orphaned`, `notificationcenter-observer-leaked`, `cache-too-aggressive`, `singleton-retains-payload`, or `unknown-growth`. New `detectLeaksInXCTest` per-test CI gate (sibling to `detectLeaksInXCUITest`), both with `outputHtmlPath` for self-contained reports. New `cleanupTraces` to keep `MEMORYDETECTIVE_TRACE_ROOT` from filling up. `analyzeHangs` gains `mainThreadViolations[]` classification (sync-io / db-lock / network / lock-contention). Security env flags `ALLOW_LAUNCH` / `MAX_RECORDING_SECONDS` / `TRACE_ROOT` / `ALLOW_EXTERNAL_CLEANUP` + a balanced/strict redaction layer. `outputFormat: "markdown" | "json" | "both"` on every analyzer. 3134 MCP tools, 3436 cycle patterns, 287 → 457 tests.
21
21
  >
22
- > **Also recent**: v1.7 (2026-05-03) added the 34th cycle pattern + `fixTemplate` snippets + `compareTracesByPattern` for trace-side CI gating. v1.6 (same day) added MCP Resources + Prompts. Full notes in [CHANGELOG](./CHANGELOG.md).
22
+ > **Also recent**: v1.8 (2026-05-06) shipped the macOS 26.x `task_for_pid` workaround chain + verify-fix loop. v1.7 (2026-05-03) added `fixTemplate` snippets and `compareTracesByPattern`. Full notes in [CHANGELOG](./CHANGELOG.md).
23
+
24
+ > **Heads up for macOS 26.x users:** Apple shipped a `task_for_pid` kernel regression on macOS 26.x that blocks `leaks --outputGraph`, `heap`, AND `xctrace --template Allocations` against iOS simulator processes regardless of `MallocStackLogging`. Even Xcode's "View Memory Graph Hierarchy" hits it unless `Malloc Stack Logging` is enabled in the scheme's Diagnostics tab. memorydetective surfaces this as a proactive `platformAdvisory` on the first capture-class tool call, plus a `workaroundNotice` with `issue: "macos-26-task-for-pid-broken"` if `leaks` is invoked. **The most reliable workaround today is to target an iOS 18 simulator runtime** (install via Xcode > Settings > Platforms > +iOS 18.x). Empirically validated in the [notelet investigation](https://github.com/carloshpdoc/memorydetective/blob/main/CHANGELOG.md#unreleased) 2026-05-12 where three independent CLI memory-introspection paths all failed before iOS 18 was identified as the working escape hatch. Set `MEMORYDETECTIVE_SUPPRESS_PLATFORM_ADVISORY=1` to silence the notice once you have settled on a workaround.
23
25
 
24
26
  ## Quickstart
25
27
 
@@ -278,22 +280,33 @@ Copilot's MCP integration moves fast. If this snippet is stale, see the [VS Code
278
280
 
279
281
  </details>
280
282
 
283
+ ### Environment variables
284
+
285
+ | Variable | Default | Effect |
286
+ |---|---|---|
287
+ | `MEMORYDETECTIVE_REDACTION` | `balanced` | Output scrubbing applied to every tool response. `balanced` collapses home-directory paths to `~/...` and masks token-shaped secrets (AWS keys, GitHub PATs, Stripe, Slack, Bearer auth). `strict` adds hostname, IPv4, and bundle-identifier masking. `off` disables redaction (useful for local-only debugging). Mode is logged once at server startup. |
288
+ | `MEMORYDETECTIVE_ALLOW_LAUNCH` | unset | Set to `1` to allow `bootAndLaunchForLeakInvestigation`. The tool executes `xcodebuild` and `xcrun simctl launch` against caller-supplied paths and bundle ids, so opt-in is required. Without the var set, the tool returns `ok: false` with `state: launchNotAllowed` and a clear explanation. Set this only when you trust the inputs the agent is producing. |
289
+ | `MEMORYDETECTIVE_MAX_RECORDING_SECONDS` | `300` | Cap on `recordTimeProfile.durationSec`. Requests above the cap are rejected with a clear error. Bounded internally to a 3600s (1h) hard ceiling so a misconfigured env var cannot disable the gate. |
290
+ | `MEMORYDETECTIVE_TRACE_ROOT` | `~/Library/Application Support/memorydetective/traces` | Directory used when `recordTimeProfile.output` is a relative path. Absolute paths bypass this default for v1.8 backwards-compat. Also the default scan path for `cleanupTraces`. The directory is auto-created on first write. |
291
+ | `MEMORYDETECTIVE_ALLOW_EXTERNAL_CLEANUP` | unset | Set to `1` to allow `cleanupTraces` to scan and delete `.trace` bundles OUTSIDE `MEMORYDETECTIVE_TRACE_ROOT`. Without it, requests that resolve outside the configured root return `ok: false` with the failure reason and delete nothing. Default-deny on destructive disk operations outside the configured boundary. |
292
+ | `MEMORYDETECTIVE_SUPPRESS_PLATFORM_ADVISORY` | unset | Set to `1` to silence the macOS 26.x platform advisory that captureMemgraph, captureScenarioState, and bootAndLaunchForLeakInvestigation emit on first use. Useful once you have an iOS 18 sim runtime installed and do not need the reminder. |
293
+
281
294
  ---
282
295
 
283
296
  ## API
284
297
 
285
- **31 MCP tools + 34 Resources + 5 Prompts**, grouped by purpose. Tool descriptions are tagged with a category prefix (`[mg.memory]`, `[mg.trace]`, `[mg.build]`, `[mg.scenario]`, `[mg.code]`, `[mg.log]`, `[mg.render]`, `[mg.ci]`, `[mg.discover]`, `[meta]`) so related tools are visible at a glance.
298
+ **34 MCP tools + 34 Resources + 5 Prompts**, grouped by purpose. Tool descriptions are tagged with a category prefix (`[mg.memory]`, `[mg.trace]`, `[mg.build]`, `[mg.scenario]`, `[mg.code]`, `[mg.log]`, `[mg.render]`, `[mg.ci]`, `[mg.discover]`, `[ops]`, `[meta]`) so related tools are visible at a glance.
286
299
 
287
300
  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.
288
301
 
289
- The cycle classifier ships **34 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:
302
+ The cycle classifier ships **36 named antipatterns** spanning SwiftUI (including the Swift 6 / `@Observable` / SwiftData / NavigationStack era, plus the v1.9 `swiftui.observable-write-on-every-render` shape), Combine, Swift Concurrency (incl. AsyncSequence-on-self and the new `Observations` API), UIKit (Timer/CADisplayLink/UIGestureRecognizer/KVO/URLSession/WebKit/DispatchSource, plus the v1.9 `uikit.viewcontroller-retained-after-pop` shape), Core Animation, Core Data, Coordinator pattern, and the popular third-party libs RxSwift + Realm. Each pattern carries:
290
303
 
291
304
  - a textual one-line `fixHint`
292
305
  - a confidence tier (`high` / `medium` / `low`)
293
306
  - a `staticAnalysisHint` pointing at the SwiftLint rule that complements the runtime evidence (or an explicit gap notice when no rule exists. Reinforces the differentiator: memorydetective sees what linters miss at parse time)
294
307
  - a `fixTemplate` with concrete Swift before/after snippets (new in v1.7) the agent can adapt directly to the user's code via the SourceKit-LSP source-bridging tools
295
308
 
296
- ### Read & analyze (13)
309
+ ### Read & analyze (14)
297
310
 
298
311
  | Tool | What |
299
312
  |---|---|
@@ -303,9 +316,10 @@ The cycle classifier ships **34 named antipatterns** spanning SwiftUI (including
303
316
  | `countAlive` | Count instances by class. Provide `className` for one number, or omit for top-N most-leaked classes. |
304
317
  | `reachableFromCycle` | Cycle-scoped reachability. "How many `<X>` instances are reachable from the cycle rooted at `<Y>`?". Distinguishes the actual culprit from its retained dependencies. |
305
318
  | `diffMemgraphs` | Compare two `.memgraph` snapshots: total deltas + class-count changes + cycles new/gone/persisted. |
319
+ | `analyzeAbandonedMemory` | Diff two `.memgraph` snapshots on heap reference-tree class counts (not cycle list) and classify each grown class as `kvo-observer-orphaned`, `notificationcenter-observer-leaked`, `cache-too-aggressive`, `singleton-retains-payload`, or `unknown-growth`. Surfaces the family of bugs `leaks(1)` reports as `leakCount: 0` because no strict cycle exists. |
306
320
  | `verifyFix` | Cycle-semantic diff: per-pattern PASS/PARTIAL/FAIL verdict + bytes freed. CI-gateable. |
307
- | `classifyCycle` | Match each ROOT CYCLE against a built-in catalog of **34 named antipatterns** (SwiftUI / Combine / Concurrency / UIKit / Core Animation / Core Data / Coordinator / RxSwift / Realm) with confidence + textual `fixHint` + `staticAnalysisHint` (which SwiftLint rule complements this, or explicit gap) + `fixTemplate` (Swift before/after snippet). |
308
- | `analyzeHangs` | Parse `xctrace` `potential-hangs` schema; return Hang vs Microhang counts + top N longest. |
321
+ | `classifyCycle` | Match each ROOT CYCLE against a built-in catalog of **36 named antipatterns** (SwiftUI / Combine / Concurrency / UIKit / Core Animation / Core Data / Coordinator / RxSwift / Realm) with confidence + textual `fixHint` + `staticAnalysisHint` (which SwiftLint rule complements this, or explicit gap) + `fixTemplate` (Swift before/after snippet). |
322
+ | `analyzeHangs` | Parse `xctrace` `potential-hangs` schema; return Hang vs Microhang counts + top N longest. Pass `topFramesByHangStartNs` (typically from a chained `analyzeTimeProfile` correlation) to enrich each top hang with `mainThreadViolations[]` classifying the blocker as `sync-io`, `db-lock`, `network`, or `lock-contention`. |
309
323
  | `analyzeAnimationHitches` | Parse `xctrace` `animation-hitches` schema; report by-type counts and how many hitches crossed Apple's user-perceptible 100ms threshold. |
310
324
  | `analyzeTimeProfile` | Parse `xctrace` `time-profile` schema; return top symbols by sample count. Reports SIGSEGV with workarounds when xctrace can't symbolicate. |
311
325
  | `analyzeAllocations` | Parse `xctrace` `allocations` schema; return per-category aggregates (cumulative bytes, allocation count, lifecycle = transient/persistent/mixed) and top allocators. |
@@ -343,13 +357,65 @@ These three tools combine into a single deterministic verify-fix loop: launch th
343
357
  |---|---|
344
358
  | `renderCycleGraph` | Read a `.memgraph`, pick a ROOT CYCLE, and emit a Mermaid graph (markdown-embeddable) or Graphviz DOT. App-level classes highlighted in red; CYCLE BACK terminators amber. |
345
359
 
346
- ### CI / test integration (2)
360
+ ### Ops (1)
361
+
362
+ | Tool | What |
363
+ |---|---|
364
+ | `cleanupTraces` | Preview and delete `.trace` bundles under `MEMORYDETECTIVE_TRACE_ROOT`. `dryRun: true` by default (the agent has to opt into deletion). Stops at the `.trace` boundary (does NOT descend INTO bundles). External roots require `MEMORYDETECTIVE_ALLOW_EXTERNAL_CLEANUP=1` (default-deny). Useful as a periodic call once a few `recordTimeProfile` sessions have accumulated tens to hundreds of MB of traces. |
365
+
366
+ ### CI / test integration (3)
347
367
 
348
368
  | Tool | What |
349
369
  |---|---|
350
- | `detectLeaksInXCUITest` | **Experimental.** Build the workspace for testing, run the named XCUITest, capture `.memgraph` baseline + after, diff. Returns `passed: false` when new ROOT CYCLEs appear that aren't in the user's allowlist. CI-runnable. |
370
+ | `detectLeaksInXCTest` | Build the unit-test scheme, run with an optional `-only-testing:` filter, capture `.memgraph` baseline + after against the `xctest` runner (or a custom `processName` for app-hosted bundles), diff. Returns `passed: false` when new ROOT CYCLEs appear that aren't in the user's allowlist. Set `outputHtmlPath` to also write a self-contained HTML report. CI-runnable. |
371
+ | `detectLeaksInXCUITest` | XCUITest sibling: build the workspace, run the named XCUITest, capture `.memgraph` baseline + after against the host app, diff. Returns `passed: false` when new ROOT CYCLEs appear that aren't in the user's allowlist. Set `outputHtmlPath` to also write a self-contained HTML report. CI-runnable. |
351
372
  | `compareTracesByPattern` | Trace-side counterpart to `verifyFix`. Compares two `.trace` bundles for a perf category (`hangs`, `animation-hitches`, or `app-launch`) and returns PASS/PARTIAL/FAIL with before/after stats and deltas. Apply thresholds: hangs PASS when longest is below `hangsMaxLongestMs`; hitches PASS when longest is below `hitchesMaxLongestMs` (default 100ms. Apple's user-perceptible threshold); app-launch PASS when total is below `appLaunchMaxTotalMs` (default 1000ms). |
352
373
 
374
+ #### Add memorydetective to your CI in 5 minutes
375
+
376
+ `detectLeaksInXCTest` + `outputHtmlPath` are the building blocks for a per-PR leak gate. The job below runs the named unit-test scheme on every push and PR, uploads the HTML report as a workflow artifact, and fails when new ROOT CYCLEs appear outside the allowlist. Copy the file into `.github/workflows/leaks.yml` and adjust the workspace + scheme + test identifier:
377
+
378
+ ```yaml
379
+ name: leaks
380
+ on: [push, pull_request]
381
+ jobs:
382
+ detect-leaks:
383
+ runs-on: macos-14
384
+ timeout-minutes: 30
385
+ steps:
386
+ - uses: actions/checkout@v4
387
+ - run: sudo xcode-select -s /Applications/Xcode_15.4.app
388
+ - run: npm install -g memorydetective
389
+ - run: |
390
+ xcrun simctl boot "iPhone 15" || true
391
+ xcrun simctl bootstatus "iPhone 15" -b
392
+ - run: |
393
+ cat > leaks.json <<EOF
394
+ {
395
+ "workspace": "DemoApp.xcworkspace",
396
+ "scheme": "DemoAppTests",
397
+ "destination": "platform=iOS Simulator,name=iPhone 15,OS=18.0",
398
+ "testCaseFilter": "DemoTests/LeakSensitiveCase",
399
+ "outputHtmlPath": "${GITHUB_WORKSPACE}/leak-report.html",
400
+ "allowlistPatterns": ["SwiftUI", "_TtC"]
401
+ }
402
+ EOF
403
+ memorydetective tool detectLeaksInXCTest --input leaks.json
404
+ - if: always()
405
+ uses: actions/upload-artifact@v4
406
+ with:
407
+ name: leak-report
408
+ path: leak-report.html
409
+ retention-days: 14
410
+ ```
411
+
412
+ The same file is in [`examples/ci/github-actions-leaks.yml`](examples/ci/github-actions-leaks.yml) if you want to copy it verbatim. Notes:
413
+
414
+ - **Simulator runtime:** pin to iOS 18 on `macos-14` runners. The macOS 26.x kernel regression (`task_for_pid`) breaks `leaks` against iOS 26 sims; iOS 18 is the canonical escape hatch (see the Highlights callout above).
415
+ - **Allowlist patterns:** substrings matched against the leaking ROOT CYCLE's root class. Use them to mask known pre-existing leaks while you work the backlog. `_TtC` covers Swift mangled class prefixes that occasionally show up in SwiftUI internals.
416
+ - **HTML artifact:** the report is self-contained (inline CSS, no external assets), so PR-comment bots and reviewers can preview it directly from the artifact URL.
417
+ - **Build cache:** add `actions/cache@v4` keyed on `Package.resolved` + `*.xcconfig` to skip `build-for-testing` rebuilds across runs. Then pass `--skipBuild` to the second invocation when chaining multiple `detectLeaksInXCTest` calls on the same job.
418
+
353
419
  ### Swift source bridging (5)
354
420
 
355
421
  Pair the memory-graph diagnosis with source-code lookups via SourceKit-LSP. Closes the loop "found this leak in the cycle → find the file/line in your project".
package/USAGE.md CHANGED
@@ -165,6 +165,13 @@ Sourced from Apple Developer Forums (#736110, #716804, #748042), Swift Forums (#
165
165
  |---|---|---|
166
166
  | `swiftdata.modelcontext-actor-cycle` | `ModelContext` + `DefaultSerialModelExecutor` (or `ModelExecutor`) + `Actor` in chain | Apple-documented quirk on iOS 17 (FB13844786, fixed in iOS 18 beta 1). Prefer the `@ModelActor` macro over hand-rolled executors; or hold `ModelContext` weakly inside a custom executor and re-resolve per operation. |
167
167
 
168
+ ### v1.9 catalog (2). DebugSwift borrow
169
+
170
+ | Pattern ID | When it matches | Fix hint (summary) |
171
+ |---|---|---|
172
+ | `uikit.viewcontroller-retained-after-pop` | A `*ViewController` subclass is in the heap with no `_parentViewController` / `_presentingViewController` edge in the chain | VC was popped but a closure, Combine sink, NotificationCenter block, or KVO observation is still retaining it. Audit closures captured in `viewDidLoad`, `Task { }` blocks that outlive the screen, KVO observations that never `invalidate()`, and delegate properties declared without `weak`. |
173
+ | `swiftui.observable-write-on-every-render` | `ObservationRegistrar` / `ObservableObject` + SwiftUI view-graph class (`ViewGraph`, `_GraphValue`, `_ViewList`, `ViewBodyAccessor`, `DynamicViewProperty`) + `Closure context` all in chain | An `@Observable` is mutated while `body` is evaluating, scheduling another render. Move the side effect out of `body`. Use a computed property for derived values, or attach to `.onChange(of:)` / `.task(id:)` / `.onAppear`. |
174
+
168
175
  **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`.
169
176
 
170
177
  **Static analysis bridge (v1.6+)**: every classified cycle now carries a `staticAnalysisHint` field with three sub-fields:
@@ -343,9 +350,15 @@ Known limit. `xcrun xctrace export` of the `time-profile` schema crashes on heav
343
350
 
344
351
  By design. `leaks(1)` only attaches to processes on the local Mac (which includes iOS simulators). Memory Graph capture from a physical device goes through Xcode's debugger over USB. Different mechanism, no public CLI equivalent. Use Xcode's Memory Graph button + File → Export Memory Graph for physical devices.
345
352
 
346
- ### `captureMemgraph` returns `workaroundNotice: { issue: "minimal-corpse" }` (macOS 26.x)
353
+ ### `captureMemgraph` returns `workaroundNotice: { issue: "macos-26-task-for-pid-broken" }` or `"minimal-corpse"`
354
+
355
+ There are two related-but-distinct failure modes here. v1.9 routes them apart so the agent (and you) can pick the right recovery without trial and error.
356
+
357
+ **`minimal-corpse`** fires when the target process was not launched with `MallocStackLogging=1`. Relaunching with the env var typically resolves it (see `bootAndLaunchForLeakInvestigation`).
347
358
 
348
- `leaks --outputGraph` regressed on macOS 26.x and aborts with `Failed to get DYLD info for task` when the target process was not launched with `MallocStackLogging=1` in its environment. This is the new structured failure shape v1.8 surfaces:
359
+ **`macos-26-task-for-pid-broken`** fires on macOS 26.x (Darwin kernel 25.x) when `leaks` fails with the same DYLD-info signature, but where the root cause is Apple's `task_for_pid` kernel regression. `MallocStackLogging` does not resolve it because the regression sits below the libmalloc layer. Other CLI memory-introspection tools (`heap`, `xctrace --template Allocations`) hit the same wall on the same host. The reliable workaround is **target an iOS 18 simulator runtime instead** (install via Xcode > Settings > Platforms > +iOS 18.x). This was empirically validated during the notelet investigation 2026-05-12 where every CLI path failed on iPhone 17 / iOS 26.4 sim but worked first-try on iPhone 16 / iOS 18 sim with the same demo app and capture flow.
360
+
361
+ memorydetective surfaces both issue ids in the structured shape:
349
362
 
350
363
  ```jsonc
351
364
  {
@@ -367,13 +380,23 @@ By design. `leaks(1)` only attaches to processes on the local Mac (which include
367
380
  }
368
381
  ```
369
382
 
370
- Recovery options in order of preference:
383
+ Recovery options:
384
+
385
+ **For `minimal-corpse` on non-macOS-26.x hosts:**
371
386
 
372
387
  1. **Use `bootAndLaunchForLeakInvestigation`**. Single call that builds, boots, installs, and launches with the right env vars in one shot. Returns the host PID ready for `captureMemgraph`. This is the canonical fix.
373
388
  2. **Xcode manual export.** With the app attached to Xcode debugger: Debug > View Memory Graph Hierarchy, then File > Export Memory Graph. Pass the resulting `.memgraph` to `analyzeMemgraph`.
374
389
  3. **Allocations fallback.** Follow `suggestedNextCalls` to record an `Allocations` trace and inspect with `analyzeAllocations`. Not full cycle detection but reveals top live classes.
375
390
 
376
- The `getInvestigationPlaybook({ kind: "memgraph-leak" })` response now carries a `troubleshooting` field with these recovery paths inline so an LLM agent can branch deterministically.
391
+ **For `macos-26-task-for-pid-broken` on macOS 26.x:**
392
+
393
+ 1. **iOS 18 simulator runtime (canonical).** Install via Xcode > Settings > Platforms > +iOS 18.x. Build + launch your app on the iOS 18 sim instead of the macOS 26.x sim. `leaks`, `captureMemgraph`, `captureScenarioState`, and all downstream tools work normally there. This is the only fully-automatable path today.
394
+ 2. **Xcode manual export with the scheme toggle.** Edit your Run scheme: Diagnostics tab > check Malloc Stack Logging. Then `Cmd+R`, drive the scenario, pause the debugger, Debug > View Memory Graph Hierarchy, File > Export Memory Graph. Without the scheme toggle, View Memory Graph fails with `VMUTaskMemoryScanner` errors on macOS 26.x.
395
+ 3. **`recordTimeProfile` Allocations trace.** Run the Allocations template against the live process, then `analyzeAllocations` for class counts. Avoid `--time-limit` past 30s on macOS 26.x sims due to a separate xctrace bug (see `recordTimeProfile` notes).
396
+
397
+ Set `MEMORYDETECTIVE_SUPPRESS_PLATFORM_ADVISORY=1` to silence the proactive stderr banner once you have settled on a workaround.
398
+
399
+ The `getInvestigationPlaybook({ kind: "memgraph-leak" })` response carries a `troubleshooting` field with these recovery paths inline so an LLM agent can branch deterministically.
377
400
 
378
401
  ### `replayScenario` returns `workaroundNotice: { issue: "axe-not-found" }`
379
402
 
package/dist/cli.js CHANGED
@@ -10,11 +10,13 @@
10
10
  * memorydetective --help
11
11
  * memorydetective --version
12
12
  */
13
- import { existsSync, mkdirSync, writeFileSync } from "node:fs";
13
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
14
14
  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 { detectLeaksInXCTest, detectLeaksInXCTestSchema, } from "./tools/detectLeaksInXCTest.js";
19
+ import { detectLeaksInXCUITest, detectLeaksInXCUITestSchema, } from "./tools/detectLeaksInXCUITest.js";
18
20
  import { VERSION } from "./version.js";
19
21
  const C = {
20
22
  reset: "\x1b[0m",
@@ -26,11 +28,12 @@ const C = {
26
28
  cyan: "\x1b[36m",
27
29
  gray: "\x1b[90m",
28
30
  };
29
- const HELP = `${C.bold}memorydetective${C.reset} iOS leak hunting from the CLI
31
+ const HELP = `${C.bold}memorydetective${C.reset}: iOS leak hunting from the CLI
30
32
 
31
33
  ${C.dim}Usage:${C.reset}
32
34
  memorydetective analyze <path-to-.memgraph> [--json]
33
35
  memorydetective classify <path-to-.memgraph> [--json]
36
+ memorydetective tool <toolName> --input <json-path>
34
37
  memorydetective --help Show this message
35
38
  memorydetective --version Print version
36
39
 
@@ -38,6 +41,21 @@ ${C.dim}Flags:${C.reset}
38
41
  --json Emit machine-readable JSON instead of formatted output.
39
42
  Useful for CI scripts and piping into jq.
40
43
 
44
+ ${C.dim}Tool subcommand:${C.reset}
45
+ Dispatches to any MCP tool by name, reading its input from a JSON
46
+ file. Exit code is 0 when the tool returns ok && passed !== false,
47
+ 1 otherwise. Designed for CI gating.
48
+
49
+ Supported tool names:
50
+ detectLeaksInXCTest
51
+ detectLeaksInXCUITest
52
+
53
+ Example:
54
+ cat > input.json <<EOF
55
+ { "workspace": "App.xcworkspace", "scheme": "AppTests", "destination": "platform=iOS Simulator,name=iPhone 15" }
56
+ EOF
57
+ memorydetective tool detectLeaksInXCTest --input input.json
58
+
41
59
  ${C.dim}When called with no arguments, memorydetective starts as an MCP server${C.reset}
42
60
  ${C.dim}over stdio. See https://github.com/carloshpdoc/memorydetective#configure${C.reset}
43
61
  ${C.dim}for full Claude Code / Desktop / Cursor / Cline / Kiro configuration.${C.reset}
@@ -72,7 +90,88 @@ function maybeShowFirstRunBanner() {
72
90
  }
73
91
  }
74
92
  const DIAGNOSIS_FOOTER = `${C.dim}# Found this useful? ⭐ https://github.com/carloshpdoc/memorydetective${C.reset}`;
75
- const KNOWN_COMMANDS = ["analyze", "classify", "--help", "-h", "help", "--version", "-v"];
93
+ const KNOWN_COMMANDS = ["analyze", "classify", "tool", "--help", "-h", "help", "--version", "-v"];
94
+ /**
95
+ * Generic-tool dispatch table. Keyed by tool name, returning a parse
96
+ * function (so the CLI surfaces schema errors directly) and an async tool
97
+ * function. Adding more tools later is one line.
98
+ */
99
+ const TOOL_HANDLERS = {
100
+ detectLeaksInXCTest: {
101
+ parse: (raw) => detectLeaksInXCTestSchema.parse(raw),
102
+ run: (input) => detectLeaksInXCTest(input),
103
+ },
104
+ detectLeaksInXCUITest: {
105
+ parse: (raw) => detectLeaksInXCUITestSchema.parse(raw),
106
+ run: (input) => detectLeaksInXCUITest(input),
107
+ },
108
+ };
109
+ function parseToolArgs(rest) {
110
+ const out = { unknownFlags: [] };
111
+ let i = 0;
112
+ while (i < rest.length) {
113
+ const arg = rest[i];
114
+ if (arg === "--input") {
115
+ out.inputPath = rest[i + 1];
116
+ i += 2;
117
+ continue;
118
+ }
119
+ if (arg.startsWith("--")) {
120
+ out.unknownFlags.push(arg);
121
+ i += 1;
122
+ continue;
123
+ }
124
+ if (!out.toolName) {
125
+ out.toolName = arg;
126
+ }
127
+ else {
128
+ out.unknownFlags.push(arg);
129
+ }
130
+ i += 1;
131
+ }
132
+ return out;
133
+ }
134
+ async function runTool(rest) {
135
+ const parsed = parseToolArgs(rest);
136
+ if (parsed.unknownFlags.length > 0) {
137
+ console.error(`${C.red}error:${C.reset} unknown flag(s): ${parsed.unknownFlags.join(", ")}`);
138
+ return 2;
139
+ }
140
+ if (!parsed.toolName) {
141
+ console.error(`${C.red}error:${C.reset} \`tool\` requires a tool name (e.g. \`detectLeaksInXCTest\`)`);
142
+ return 2;
143
+ }
144
+ if (!parsed.inputPath) {
145
+ console.error(`${C.red}error:${C.reset} \`tool\` requires \`--input <path>\` pointing at a JSON file with the tool inputs`);
146
+ return 2;
147
+ }
148
+ const handler = TOOL_HANDLERS[parsed.toolName];
149
+ if (!handler) {
150
+ console.error(`${C.red}error:${C.reset} unknown tool: ${parsed.toolName}. Supported: ${Object.keys(TOOL_HANDLERS).join(", ")}`);
151
+ return 2;
152
+ }
153
+ const inputAbs = resolvePath(parsed.inputPath);
154
+ if (!existsSync(inputAbs)) {
155
+ console.error(`${C.red}error:${C.reset} input file not found: ${inputAbs}`);
156
+ return 2;
157
+ }
158
+ let raw;
159
+ try {
160
+ raw = JSON.parse(readFileSync(inputAbs, "utf8"));
161
+ }
162
+ catch (err) {
163
+ console.error(`${C.red}error:${C.reset} failed to parse ${inputAbs} as JSON: ${err instanceof Error ? err.message : String(err)}`);
164
+ return 2;
165
+ }
166
+ const validated = handler.parse(raw);
167
+ const result = await handler.run(validated);
168
+ process.stdout.write(JSON.stringify(result, null, 2) + "\n");
169
+ if (result.ok === false)
170
+ return 1;
171
+ if (result.passed === false)
172
+ return 1;
173
+ return 0;
174
+ }
76
175
  function truncate(s, max) {
77
176
  return s.length > max ? s.slice(0, max - 1) + "…" : s;
78
177
  }
@@ -164,6 +263,7 @@ async function runAnalyze(memgraphPath, asJson) {
164
263
  fullChains: false,
165
264
  verbosity: "compact",
166
265
  maxClassesInChain: 10,
266
+ referenceTreeTopN: 20,
167
267
  });
168
268
  if (asJson) {
169
269
  process.stdout.write(JSON.stringify(result, null, 2) + "\n");
@@ -273,6 +373,9 @@ export async function runCli(args) {
273
373
  }
274
374
  return await runClassify(parsed.path, parsed.json);
275
375
  }
376
+ case "tool": {
377
+ return await runTool(rest);
378
+ }
276
379
  default: {
277
380
  const suggestion = suggestCommand(cmd ?? "");
278
381
  const tail = suggestion ? `\n Did you mean: ${C.bold}${suggestion}${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;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,CAAC,GAAG;IACR,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;CACjB,CAAC;AAEF,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAAC,KAAK;;EAE7C,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,KAAK;;;;;;EAMrB,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,KAAK;;;;EAIrB,CAAC,CAAC,GAAG,yEAAyE,CAAC,CAAC,KAAK;EACrF,CAAC,CAAC,GAAG,2EA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