memorydetective 1.12.0 → 1.14.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 (49) hide show
  1. package/CHANGELOG.md +65 -1
  2. package/README.md +15 -5
  3. package/USAGE.md +29 -0
  4. package/dist/index.js +20 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/parsers/schemaDiscovery.d.ts +88 -0
  7. package/dist/parsers/schemaDiscovery.js +144 -0
  8. package/dist/parsers/schemaDiscovery.js.map +1 -0
  9. package/dist/parsers/xctraceXml.d.ts +5 -0
  10. package/dist/parsers/xctraceXml.js +3 -0
  11. package/dist/parsers/xctraceXml.js.map +1 -1
  12. package/dist/runtime/prompts.js +49 -0
  13. package/dist/runtime/prompts.js.map +1 -1
  14. package/dist/tools/analyzeAllocations.d.ts +5 -1
  15. package/dist/tools/analyzeAllocations.js +17 -1
  16. package/dist/tools/analyzeAllocations.js.map +1 -1
  17. package/dist/tools/analyzeAnimationHitches.d.ts +5 -1
  18. package/dist/tools/analyzeAnimationHitches.js +17 -1
  19. package/dist/tools/analyzeAnimationHitches.js.map +1 -1
  20. package/dist/tools/analyzeAppLaunch.d.ts +3 -0
  21. package/dist/tools/analyzeAppLaunch.js +17 -1
  22. package/dist/tools/analyzeAppLaunch.js.map +1 -1
  23. package/dist/tools/analyzeHangs.d.ts +63 -3
  24. package/dist/tools/analyzeHangs.js +143 -19
  25. package/dist/tools/analyzeHangs.js.map +1 -1
  26. package/dist/tools/analyzeNetworkActivity.d.ts +99 -0
  27. package/dist/tools/analyzeNetworkActivity.js +312 -0
  28. package/dist/tools/analyzeNetworkActivity.js.map +1 -0
  29. package/dist/tools/analyzeTimeProfile.d.ts +10 -1
  30. package/dist/tools/analyzeTimeProfile.js +63 -8
  31. package/dist/tools/analyzeTimeProfile.js.map +1 -1
  32. package/dist/tools/captureScenarioState.d.ts +2 -2
  33. package/dist/tools/countAlive.d.ts +35 -1
  34. package/dist/tools/countAlive.js +124 -29
  35. package/dist/tools/countAlive.js.map +1 -1
  36. package/dist/tools/inspectTrace.js +112 -18
  37. package/dist/tools/inspectTrace.js.map +1 -1
  38. package/dist/tools/recordTimeProfile.d.ts +83 -0
  39. package/dist/tools/recordTimeProfile.js +135 -0
  40. package/dist/tools/recordTimeProfile.js.map +1 -1
  41. package/dist/tools/replayScenario.d.ts +4 -4
  42. package/dist/tools/summarizeTrace.d.ts +147 -0
  43. package/dist/tools/summarizeTrace.js +424 -0
  44. package/dist/tools/summarizeTrace.js.map +1 -0
  45. package/dist/tools/verifyFix.d.ts +27 -0
  46. package/dist/tools/verifyFix.js +78 -4
  47. package/dist/tools/verifyFix.js.map +1 -1
  48. package/dist/types.d.ts +28 -0
  49. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -6,6 +6,69 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.14.0] - 2026-05-15
10
+
11
+ Trace-side reliability + breadth release. v1.13 shipped `summarizeTrace`, the trace-to-summary-card-in-one-call play. v1.14 fixes two parser bugs that were causing it to return empty results against real Apple-produced traces, expands schema coverage to include hang risks + network activity, robustens the analyzer pipeline against future xctrace schema renames, and adds three opt-in UX paths around the macOS 26.x xctrace wedge regression (pre-flight probe, auto-open Instruments, README callout). Plus FLEX-inspired memgraph size view on `countAlive` and an MLeaksFinder + DebugSwift-inspired whitelist on `verifyFix`. 11 changes landed across one day. Suite 546 -> 626 (+80 tests). 37 MCP tools.
12
+
13
+ ### Fixed
14
+
15
+ - **`inspectTrace` + `summarizeTrace` now work against real Apple-produced `.trace` bundles.** The previous implementation ran `xctrace export --xpath '/trace-toc/run'`, which returns "This node has no content to export." against bundles produced by `xcrun xctrace record` (and by Instruments.app GUI saves). Cascaded into `summarizeTrace` reporting "No user-perceptible perf events detected" even when the trace had 35 hangs and 44k time-profile samples. Fix switches discovery to `xctrace export --toc` and adds async parallel xpath row-count queries for the 5 known analyzer schemas. `parseTraceToc` also now accepts self-closing `<table schema=X/>` (Apple's TOC shape) in addition to the open-close form (test fixtures), extracts device/OS from `<device>` attributes, and reads `<start-date>` for the recording timestamp. Validated end-to-end against a Time Profiler trace from a physical iPhone 17 Pro Max: 40 schemas detected, summarizeTrace headline becomes "1164ms hang at t=89.01s. Likely user-visible freeze." 8 new tests against the real Apple TOC fixture.
16
+ - **`analyzeTimeProfile` now returns real symbol names instead of the weight column.** Two cascading bugs: (1) the parser keyed cells by schema mnemonic, so the backtrace cell was at `row.stack`, not `row.backtrace`; (2) `XctraceValue` only captured `@_fmt`, dropping `@_name` from `<frame>` and `<binary>` elements where the symbol identity lives. Added an `XctraceValue.name` field and rewrote `analyzeTimeProfile` to walk `row.stack.nested.frame.name` with fallback to the leaf frame's binary name for unsymbolicated hex addresses. Validated end-to-end against the same Time Profiler trace: top symbol becomes `CFStringHashCString` (2429 samples), followed by `-[CoreTelephonyClientMux _computeNotificationSet_sync:completion:]` (2214). Unsymbolicated frames cluster by binary as `libsystem_kernel.dylib (0x24c0aacd5)` etc. 2 new tests.
17
+
18
+ ### Added
19
+
20
+ - **`analyzeNetworkActivity` MCP tool (37th, `[mg.trace]`).** Parses the `network-connections` schema from a `.trace` recorded with a Network template. Returns per-request URL / host / method / status code / response time / bytes in / bytes out, plus aggregates: total bytes in/out, longest + average response time, status-code buckets (2xx / 3xx / 4xx / 5xx / n/a), top-N by duration (which calls blocked the user), top-N by bytes (which calls bloated the budget), and per-host aggregates (which SDKs are chatty). The pure helper `analyzeNetworkActivityFromXml` accepts multiple plausible mnemonic names per field (time / event-time / start / connect-time, url / host / endpoint, bytes-in / response-bytes / received-bytes, etc.) so it survives xctrace column-name drift across iOS versions. Registered in `inspectTrace.SCHEMA_TO_ANALYZER` so the discovery path auto-suggests it when the trace has a Network schema. 15 new tests on the parser plus 4 on the host-extraction helper. Closes the "network is slow" / "chatty SDK" / "slow launch from one API call" coverage gap in the trace family.
21
+
22
+ ### `supportStatus[]` unified status surface (v1.14 item I)
23
+
24
+ - **New `SupportStatus` type in `src/types.ts`** with `kind` (one of `potential-hangs`, `hang-risks`, `animation-hitches`, `time-profile`, `allocations`, `app-launch`, `network-connections`), `status` (`available` / `partial` / `not_exportable` / `not_present` / `failed`), optional `reason`, optional `sourceSchemas`. Mirrors XcodeTraceMCP's surface shape so cross-tool LLM drivers can branch consistently. All 6 trace-side analyzers (`analyzeHangs`, `analyzeAnimationHitches`, `analyzeTimeProfile`, `analyzeAllocations`, `analyzeAppLaunch`, `analyzeNetworkActivity`) now return a populated `supportStatus[]` array. `analyzeHangs` returns 1 entry by default and 2 when hang-risks XML is also provided (one per schema). `analyzeTimeProfile`'s SIGSEGV path surfaces the workaround tip in `supportStatus[0].reason`. Old `status: DataStatus` and `notice?: string` aliases stay on each result with `@deprecated` JSDoc for backwards compatibility with v1.13 callers; both alias and new field always agree on the status value. 10 new cross-analyzer tests verifying the kind / status / reason / sourceSchemas surfacing per analyzer.
25
+
26
+ ### Pattern-matching schema discovery refactor (v1.14 item B)
27
+
28
+ - **New `src/parsers/schemaDiscovery.ts` module** with SCHEMA_FAMILIES (11 families: hangs, hang-risks, animation-hitches, time-profile, time-sample, allocations, app-launch, memory, network, energy, leaks), CANONICAL_SCHEMA_NAME fallbacks, and `discoverSchema` / `discoverSchemas` / `fetchDiscoveredSchemas` helpers. Each family maps to a list of case-insensitive RegExp patterns deliberately conservative so they don't false-positive on unrelated schemas. The async `fetchDiscoveredSchemas` runs `xctrace export --toc` once and bulk-resolves multiple families in one pass. Inspired by XcodeTraceMCP's pattern-matching approach.
29
+ - **All 5 trace-side analyzers refactored** (`analyzeAllocations`, `analyzeAnimationHitches`, `analyzeAppLaunch`, `analyzeTimeProfile`, `analyzeHangs`) to call `fetchDiscoveredSchemas` before their xpath query. Survives future Apple renames: when the trace uses a renamed schema name, discovery picks it up; when nothing matches, falls back to the canonical pre-v1.14 hardcoded name (preserves backwards compat). `analyzeHangs` bulk-discovers all three schemas it consumes (hangs + hang-risks + time-profile) in a single TOC pass.
30
+ - Cost: one extra `xctrace --toc` invocation per analyze call (~100-500ms on real traces).
31
+
32
+ - **`recordTimeProfile` auto-opens Instruments.app on timeout (opt-in).** Set `MEMORYDETECTIVE_AUTO_OPEN_INSTRUMENTS=1` to make a timed-out recording fire-and-forget invoke `open -a Instruments <tracePath>` so the partial `.trace` opens in the GUI. Instruments.app on macOS 26.x can still symbolicate and display traces the `xctrace export` CLI path rejects, giving a manual escape hatch. The response gains an `openedInInstrumentsApp: boolean` field reporting whether the open was invoked. Off by default to avoid spamming agent / CI runs. XcodeTraceMCP-inspired UX pattern. 4 new tests on the env-gated helper.
33
+ - **`recordTimeProfile` pre-flights the xctrace wedge on macOS 26.x simulator attach.** New 2-second probe runs before the user's actual recording. When the probe times out, recordTimeProfile bails fast with the same `workaroundNotice` instead of waiting the full `durationSec + 30s grace` on a wedge. Cuts user-visible failure latency from `~70s` (a 30s recording with the timeout wrapper firing) to `~8s` (probe wrapper window). Gated to the known-broken combo by default: macOS 26.x host + simulator target + attach mode. `--launch` mode is excluded so we never double-launch the app. New `MEMORYDETECTIVE_PREFLIGHT_XCTRACE=1` forces on; `0` forces off. 7 new tests covering the env-flag overrides, platform detection, target/mode gating, and `MEMORYDETECTIVE_SUPPRESS_PLATFORM_ADVISORY=1` propagation.
34
+ - **`countAlive` returns per-class `instanceSizeBytes` + `totalBytes` and accepts `sortBy: "count" | "totalBytes"`.** Inspired by FLEX's Live Objects "Size" sort column. The `.memgraph` format already carried per-class size data (cycle-side `[N]` annotations + reference-tree per-class totals); we just were not surfacing it. New `countByClassWithBytes` pure helper aggregates both. `sortBy: "totalBytes"` is FLEX-equivalent memory-budget rank; default `"count"` preserves v1.13 ranking. Per-instance size is the first non-null observed (cycle-side) or `round(totalBytes / count)` (reference-tree fallback). Validated against a real abandoned-memory memgraph: top by totalBytes surfaces 2 MB NSMutableDictionary, 1.3 MB CFString; `actionableCounts[]` (framework-noise filtered) leads with 800 KB Kernel Pointers, 460 KB CGDataProvider. 5 new tests.
35
+ - **`verifyFix` accepts `expectedAliveClasses[]` whitelist + curated default list.** Singletons, framework registrars, and persistent caches legitimately stay alive across before/after snapshots. Pre-v1.14 they landed in `regressionClasses[]` and could flip the verdict to FAIL on otherwise-clean fixes. New `expectedAliveClasses?: string[]` schema input (substring patterns, case-insensitive) + `disableDefaultWhitelist: boolean` (default false). Exported `DEFAULT_EXPECTED_ALIVE_CLASSES` constant: 11 entries sourced from DebugSwift's `Performance.LeakDetector.swift` curation (system VCs like `UICompatibilityInputViewController` + `UIPredictionViewController`, internal views like `PLTileContainerView`, OS-retained windows like `UIRemoteKeyboardWindow`). Whitelist hits are moved out of `regressionClasses[]` into a new `expectedAlive: string[]` field on the response for transparency, without affecting magnitude / verdict computation. MLeaksFinder + DebugSwift-inspired UX pattern. Validated against real notelet memgraphs: user whitelist of `[pthread_mutex_t, SwiftUI.ObjectCache, NSCache]` filtered 5 entries (including substring matches for both Font and Color ObjectCaches). 5 new tests.
36
+ - **`analyzeHangs` now reads the `hang-risks` schema alongside `potential-hangs`.** xctrace emits two complementary hang-related schemas in Time Profiler / Hangs templates: `potential-hangs` (measured durations) and `hang-risks` (runtime risk annotations like "Hang Risk" / "Severe Hang Risk" narrative events with backtraces). Pre-v1.14 we only read the former. The result schema gains optional `risks: HangRiskEntry[]` and `risksTotals: { rows, bySeverity }` populated when the second schema is exported, absent otherwise. New pure `analyzeHangRisksFromXml` helper. The async wrapper fires both exports in parallel via Promise.all; hang-risks failure is non-fatal. Diagnosis appends "N hang risk annotations from the iOS runtime" with severe count when the bySeverity bucket has any "Severe ..." entries. XcodeTraceMCP-inspired schema discovery extension. 9 new tests.
37
+
38
+ ### Documentation
39
+
40
+ - **README + USAGE.md gained a `macOS 26.x xctrace record` callout.** `xcrun xctrace record --time-limit Ns` against iOS simulator targets is broken on macOS 26.x. The recording wedges past the requested time limit, exits when SIGKILL fires, and produces a `.trace` bundle that fails template export. Apple-side regression; survives Xcode 26.5 (build 17F42, xctrace 16.0) per the 2026-05-15 re-validation. Hits every `xctrace`-based tool the same way. README highlights the issue near the top with `task_for_pid` callout; USAGE.md Troubleshooting gains a ranked recovery list (older macOS host, Instruments.app GUI, physical device, wait for Apple). Trace-side analyzers (`inspectTrace`, `summarizeTrace`, `analyzeHangs`, `analyzeTimeProfile`, `analyzeAnimationHitches`, `compareTracesByPattern`) all work normally against Instruments-recorded `.trace` bundles, so the workaround path stays automatable end-to-end after the recording step.
41
+
42
+ ## [1.13.0] - 2026-05-14
43
+
44
+ Trace-depth synthesis differentiator. v1.11 added `inspectTrace` (discovery), v1.12 added cross-schema correlation inside `analyzeHangs`. v1.13 ties everything together: one call returns a cross-schema summary card tuned for direct presentation to the user, instead of chaining 5-6 analyzers manually and reasoning over the JSON.
45
+
46
+ ### Added
47
+
48
+ - **`summarizeTrace` MCP tool (36th tool, `[mg.synthesize]`).** Single call that:
49
+ 1. Inspects the TOC via the existing inspectTrace path.
50
+ 2. Chains `analyzeHangs` (with `includeStackClassification: true` to auto-classify main-thread violations), `analyzeAnimationHitches` (with Apple's 100ms perceptible threshold), `analyzeTimeProfile`, `analyzeAllocations`, `analyzeAppLaunch` in parallel via Promise.all guards.
51
+ 3. Builds cross-area correlations (Phase 2: hangs+hitches timestamp overlap detection with HIGH/MEDIUM/LOW confidence tiers).
52
+ 4. Returns BOTH a structured per-area result AND a pre-rendered compact markdown card (< 10 KB at default settings, validated by a card-size guard in the unit tests).
53
+
54
+ The card layout: H1 title, device/OS/template metadata, headline (1-2 sentences naming the biggest user-impact finding ranked by hang>=250ms > launch>1s > perceptible hitches > short hang), per-area sub-sections (suppressed when empty to reduce noise), cross-correlations section with confidence badges, suggested next calls from inspectTrace.
55
+
56
+ Optional inputs: `focus: "hangs" | "hitches" | "allocations" | "launch" | "all"` to bias the summary toward one area; `verbose: true` to expand each section's top-N from 5 to 15+ and surface low-confidence correlations inline.
57
+
58
+ Failed analyzers (e.g. xctrace SIGSEGV on time-profile) surface their workaround notice inline; other sections unaffected. Empty schemas don't fail the call.
59
+
60
+ - **`correlateHangsAndHitches()` pure cross-correlation helper.** Detects hangs whose time windows overlap with animation hitches. When a user sees a hang AND a hitch in the same window, they almost certainly perceived the impact (main-thread block delayed render commits). Confidence tiers: `high` when both events >= 250ms AND overlap span >= 100ms; `medium` when at least one event >= 250ms; `low` when both sub-250ms but touching. Results sorted by `atSec` ascending so the markdown card lists correlations in trace order. Allocation-based correlations (hangs+allocations, hitches+allocations) are deferred to v1.14+ because the existing `analyzeAllocations` doesn't expose per-timestamp allocation rows.
61
+
62
+ - **`/summarize-trace` MCP prompt (6th prompt).** Counterpart to the `summarizeTrace` tool. Unlike the existing 5 prompts (which wrap multi-step playbooks), `/summarize-trace` wraps a single tool call. The brief tells the agent to (1) call `summarizeTrace`, (2) present `result.markdown` verbatim instead of paraphrasing, (3) offer drill-ins via `suggestedNextCalls`. Surfaces the "present the result; don't re-summarize" pattern that agents often get wrong with structured data.
63
+
64
+ ### Changed
65
+
66
+ - `package.json` + `server.json`: 1.12.0 → 1.13.0.
67
+
68
+ ### Test count
69
+
70
+ 523 → 546 (+23): 14 buildHeadline/buildMarkdownCard tests in Phase 1, 9 correlation tests in Phase 2, +0 in Phase 3 (the prompts test was updated, not extended).
71
+
9
72
  ## [1.12.0] - 2026-05-14
10
73
 
11
74
  Four-phase patch completing the v1.10 retro §7.2 propagation (`countAlive`, `findRetainers`, `verifyFix` reference-tree integrations) and internalizing the v1.9 cross-schema correlation (`analyzeHangs` auto-classification). The agent chain `analyzeAbandonedMemory` → `findRetainers` → `countAlive` → `verifyFix` no longer falls off a cliff after the first call.
@@ -448,7 +511,8 @@ When called with no arguments it starts the MCP server over stdio.
448
511
  - **`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.
449
512
  - **`detectLeaksInXCUITest`** is flagged experimental: orchestration logic is implemented but not yet validated against a wide set of production XCUITest runs.
450
513
 
451
- [Unreleased]: https://github.com/carloshpdoc/memorydetective/compare/v1.12.0...HEAD
514
+ [Unreleased]: https://github.com/carloshpdoc/memorydetective/compare/v1.13.0...HEAD
515
+ [1.13.0]: https://github.com/carloshpdoc/memorydetective/compare/v1.12.0...v1.13.0
452
516
  [1.12.0]: https://github.com/carloshpdoc/memorydetective/compare/v1.11.0...v1.12.0
453
517
  [1.11.0]: https://github.com/carloshpdoc/memorydetective/compare/v1.10.0...v1.11.0
454
518
  [1.10.0]: https://github.com/carloshpdoc/memorydetective/compare/v1.9.0...v1.10.0
package/README.md CHANGED
@@ -17,12 +17,14 @@
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.12** (2026-05-14): four-phase patch completing the v1.10 retro propagation across the remaining tools that had the reference-tree blind spot. (1) `countAlive({ includeReferenceTree: true })` now surfaces heap-wide instance counts (AVPlayerItem 685 = AVPlayerItem + AVPlayerItemInternal, via the substring match semantic) plus a noise-filtered `actionableCounts[]` view. (2) `verifyFix` chains internally into `analyzeAbandonedMemory` when no cycle patterns fire on either side; the notelet pair now returns `verdict: PASS` with `verdictSource: "abandoned-memory"` and a structured `freedClasses[]` list, instead of `verdict: undefined`. (3) `findRetainers({ includeReferenceTree: true })` parses `leaks --debug=stacks` and returns per-call-stack-fingerprint aggregated chains: the notelet AVPlayerItem case surfaces `MediaNoteItemVideoView.prepareVideo` as the allocation site + `_CFXNotificationRegistrarAddObject` (KVO global registry) as the retainer. (4) `analyzeHangs({ includeStackClassification: true })` now internally exports the time-profile schema alongside potential-hangs and auto-populates `mainThreadViolations[]` without the caller building a `topFramesByHangStartNs` map. 500523 tests.
20
+ > **What's new in v1.14** (2026-05-15): trace-side reliability + breadth release. Fixes two parser bugs that were causing `inspectTrace` + `summarizeTrace` to return empty results against real Apple-produced traces (xpath now uses `--toc`; symbol extraction now reads frame name not weight column). New `analyzeNetworkActivity` MCP tool (37th) for the network family. Extended `analyzeHangs` to read the `hang-risks` schema alongside `potential-hangs`. Pattern-matching schema discovery refactor: all 5 trace analyzers now resolve schema names through a regex map so future xctrace renames degrade gracefully. Unified `supportStatus[]` surface across all 6 trace analyzers (XcodeTraceMCP-pattern). Three opt-in UX paths around the macOS 26.x xctrace `--time-limit` regression: a 2-second pre-flight probe (`MEMORYDETECTIVE_PREFLIGHT_XCTRACE`), auto-open of the partial `.trace` in Instruments.app (`MEMORYDETECTIVE_AUTO_OPEN_INSTRUMENTS`), and a README + USAGE callout naming the bug. FLEX-inspired `countAlive` size view (`sortBy: "totalBytes"`, `instanceSizeBytes` per class). MLeaksFinder + DebugSwift-inspired `verifyFix` `expectedAliveClasses[]` whitelist with curated default list. 546626 tests. 37 MCP tools.
21
21
  >
22
- > **Also recent**: v1.11 added `inspectTrace`, `diffMemgraphs` reference-tree, and CLI abandoned-memory mini-table. v1.10 closed the notelet retro feedback loop with parser fixes + classifier guards + `verify-fix-table` output. v1.9 shipped `analyzeAbandonedMemory` + `detectLeaksInXCTest` + `cleanupTraces` + `mainThreadViolations` + security env flags. Full notes in [CHANGELOG](./CHANGELOG.md).
22
+ > **Also recent**: v1.13 shipped `summarizeTrace` + `/summarize-trace` MCP prompt. v1.12 completed reference-tree propagation across countAlive / findRetainers / verifyFix and added auto cross-schema correlation in analyzeHangs. v1.11 added inspectTrace, diffMemgraphs reference-tree, and CLI abandoned-memory mini-table. v1.10 closed the notelet retro feedback loop. v1.9 shipped analyzeAbandonedMemory, detectLeaksInXCTest, cleanupTraces, mainThreadViolations. Full notes in [CHANGELOG](./CHANGELOG.md).
23
23
 
24
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.
25
25
 
26
+ > **Also on macOS 26.x: `xctrace record` is broken for simulator targets.** Independent from the `task_for_pid` regression above, `xcrun xctrace record --time-limit Ns` against iOS simulator processes wedges past the time limit, eventually exits when killed, and the resulting `.trace` bundle is missing template metadata. `xctrace export --toc` then fails with `Document Missing Template Error`. Re-validated against Xcode 26.5 (build 17F42, xctrace 16.0) 2026-05-15: regression survives the update. This hits the entire `xctrace`-based ecosystem the same way (`memorydetective.recordTimeProfile`, XcodeTraceMCP, and naked `xcrun xctrace record` calls all fail identically). **Workarounds:** (1) record from an older macOS host with Xcode 26.0 if you have one; (2) record via Instruments.app GUI which still works on macOS 26.x and produces a valid `.trace` that memorydetective's trace-side analyzers (`inspectTrace`, `summarizeTrace`, `analyzeHangs`, `analyzeTimeProfile`, `analyzeAnimationHitches`, `compareTracesByPattern`) read cleanly; (3) record against a physical device (the regression appears to be simulator-specific). USAGE.md > Troubleshooting has a step-by-step.
27
+
26
28
  ## Quickstart
27
29
 
28
30
  ```bash
@@ -290,12 +292,14 @@ Copilot's MCP integration moves fast. If this snippet is stale, see the [VS Code
290
292
  | `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
293
  | `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
294
  | `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. |
295
+ | `MEMORYDETECTIVE_AUTO_OPEN_INSTRUMENTS` | unset | Set to `1` to make `recordTimeProfile` invoke `open -a Instruments <tracePath>` as a fire-and-forget escape hatch when xctrace times out (the macOS 26.x regression). The partial `.trace` opens in Instruments.app, which can still symbolicate + display traces the CLI export path rejects. Off by default so unattended agent runs and CI do not spam the user's GUI. The response's `openedInInstrumentsApp` field reports whether the open was invoked. |
296
+ | `MEMORYDETECTIVE_PREFLIGHT_XCTRACE` | unset (auto) | Controls the pre-flight probe in `recordTimeProfile` that detects the macOS 26.x xctrace wedge in ~3-5 seconds instead of paying the user's full `durationSec` plus 30s grace. `1` forces on regardless of platform / target. `0` forces off. When unset, the probe auto-enables on macOS 26.x simulator attach (the known-broken combo) and stays off elsewhere. Pre-flight is skipped for `--launch` mode to avoid double-launching the app. Side-effect of auto-enable: 2-second probe runs before the full recording starts. Set to `0` if you have already settled on a workaround and want maximum recording-start latency. |
293
297
 
294
298
  ---
295
299
 
296
300
  ## API
297
301
 
298
- **35 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.
302
+ **36 MCP tools + 34 Resources + 6 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.
299
303
 
300
304
  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.
301
305
 
@@ -352,6 +356,12 @@ These three tools combine into a single deterministic verify-fix loop: launch th
352
356
  | `listTraceTemplates` | Parse `xcrun xctrace list templates` (standard + custom). |
353
357
  | `inspectTrace` | Orientation tool for `.trace` bundles. Returns schemas present + row counts + device/OS/template metadata + `suggestedNextCalls[]` mapping each populated known schema to its analyzer. Use this as the FIRST call on any `.trace`. New in v1.11. |
354
358
 
359
+ ### Synthesize (1)
360
+
361
+ | Tool | What |
362
+ |---|---|
363
+ | `summarizeTrace` | Single call that chains `inspectTrace` + the 5 analyzers in parallel + cross-correlates findings (hangs overlapping with hitches, etc.) + pre-renders a compact (<10 KB) markdown summary card with a 1-sentence headline, per-area sub-sections, and suggestedNextCalls. The "trace-to-summary-card-in-one-call" play. Use this when you want one synthesis pass instead of chaining 5-6 analyzers manually. New in v1.13. |
364
+
355
365
  ### Render (1)
356
366
 
357
367
  | Tool | What |
@@ -490,7 +500,7 @@ The `tool` subcommand dispatches to any registered MCP tool by name, reading inp
490
500
  git clone https://github.com/carloshpdoc/memorydetective
491
501
  cd memorydetective
492
502
  npm install
493
- npm test # 523 unit tests
503
+ npm test # 546 unit tests
494
504
  npm run build # build → dist/
495
505
  npm run dev # tsx, stdio mode (dev mode)
496
506
  ./scripts/demo.sh # full demo against a real .memgraph (set MEMGRAPH=path)
@@ -501,7 +511,7 @@ npm run dev # tsx, stdio mode (dev mode)
501
511
  Contributions are welcome. Bug reports, feature requests, new cycle patterns, all of it.
502
512
 
503
513
  - **Bugs / feature requests**: [open an issue](https://github.com/carloshpdoc/memorydetective/issues).
504
- - **PRs**: fork → branch → `npm install` → make changes → `npm test` (523 tests must stay green) → open a PR with a concise description of what changed and why.
514
+ - **PRs**: fork → branch → `npm install` → make changes → `npm test` (546 tests must stay green) → open a PR with a concise description of what changed and why.
505
515
 
506
516
  ### Adding a cycle pattern to `classifyCycle`
507
517
 
package/USAGE.md CHANGED
@@ -398,6 +398,35 @@ Set `MEMORYDETECTIVE_SUPPRESS_PLATFORM_ADVISORY=1` to silence the proactive stde
398
398
 
399
399
  The `getInvestigationPlaybook({ kind: "memgraph-leak" })` response carries a `troubleshooting` field with these recovery paths inline so an LLM agent can branch deterministically.
400
400
 
401
+ ### `recordTimeProfile` times out / produces a 52K bundle that fails to export
402
+
403
+ `xcrun xctrace record --time-limit Ns` is broken on macOS 26.x for simulator targets. The recording wedges past the requested time limit, exits when SIGKILL fires, and produces a `.trace` bundle that contains only `Trace1.run/RunIssues.storedata` (no actual schema data). `xctrace export --toc` against the resulting bundle returns `Document Missing Template Error`. The bug is upstream (Apple) and survives Xcode 26.5 (build 17F42, xctrace 16.0) per the 2026-05-15 re-validation.
404
+
405
+ The symptom in memorydetective:
406
+
407
+ ```jsonc
408
+ {
409
+ "ok": false,
410
+ "recordingTimedOut": true,
411
+ "tracePath": "/tmp/x.trace",
412
+ "workaroundNotice": {
413
+ "issue": "macos-26-xctrace-record-broken",
414
+ "...": "..."
415
+ }
416
+ }
417
+ ```
418
+
419
+ It hits every `xctrace`-based tool the same way (this MCP, XcodeTraceMCP, raw `xcrun xctrace record` calls in a shell, third-party scripts wrapping the CLI). Not a memorydetective bug.
420
+
421
+ Recovery options, ranked by automation cost:
422
+
423
+ 1. **Record on an older macOS host with Xcode 26.0 if you have one available.** Pre-regression `xctrace record` produces clean traces. The 2026-05-15 validation used `~/Desktop/wishlist-tti-device.trace`, a Time Profiler trace captured this way: 91s recording, 35 hangs detected, 44 418 time-profile samples, fully analyzable by memorydetective's trace-side tools.
424
+ 2. **Record via Instruments.app GUI.** Instruments.app on macOS 26.x still produces valid `.trace` bundles. Open Instruments, pick a template, choose the simulator + app, hit Record, drive the scenario, Stop, Save. Then point `inspectTrace` / `summarizeTrace` / `analyzeHangs` / `analyzeTimeProfile` / `compareTracesByPattern` at the saved bundle. All trace-side analyzers work normally on Instruments-recorded `.trace` bundles.
425
+ 3. **Record against a physical device (USB or wireless).** The regression appears to be simulator-specific. `xctrace record --device <UUID> --launch <app>` against a real iPhone / iPad does NOT exhibit the same wedge. Use this when you have a physical target available.
426
+ 4. **Wait for Apple.** The Feedback assistant is the right escalation path. The regression has shipped through Xcode 26.4 + 26.5; expect a fix in 26.6 or later.
427
+
428
+ memorydetective's roadmap items `recordViaInstrumentsApp` (Group II-G) and the pre-flight probe (Group II-H) will narrow the manual-step surface as they land.
429
+
401
430
  ### `replayScenario` returns `workaroundNotice: { issue: "axe-not-found" }`
402
431
 
403
432
  The `axe` CLI is not on your `$PATH`. Install with:
package/dist/index.js CHANGED
@@ -13,6 +13,7 @@ import { analyzeTimeProfile, analyzeTimeProfileSchema, } from "./tools/analyzeTi
13
13
  import { listTraceDevices, listTraceDevicesSchema, } from "./tools/listTraceDevices.js";
14
14
  import { listTraceTemplates, listTraceTemplatesSchema, } from "./tools/listTraceTemplates.js";
15
15
  import { inspectTrace, inspectTraceSchema, } from "./tools/inspectTrace.js";
16
+ import { summarizeTrace, summarizeTraceSchema, } from "./tools/summarizeTrace.js";
16
17
  import { recordTimeProfile, recordTimeProfileShape, } from "./tools/recordTimeProfile.js";
17
18
  import { captureMemgraph, captureMemgraphShape, } from "./tools/captureMemgraph.js";
18
19
  import { bootAndLaunchForLeakInvestigation, bootAndLaunchForLeakInvestigationShape, } from "./tools/bootAndLaunchForLeakInvestigation.js";
@@ -21,6 +22,7 @@ import { captureScenarioState, captureScenarioStateShape, } from "./tools/captur
21
22
  import { analyzeAnimationHitches, analyzeAnimationHitchesSchema, } from "./tools/analyzeAnimationHitches.js";
22
23
  import { analyzeAllocations, analyzeAllocationsSchema, } from "./tools/analyzeAllocations.js";
23
24
  import { analyzeAppLaunch, analyzeAppLaunchSchema, } from "./tools/analyzeAppLaunch.js";
25
+ import { analyzeNetworkActivity, analyzeNetworkActivitySchema, } from "./tools/analyzeNetworkActivity.js";
24
26
  import { renderCycleGraph, renderCycleGraphSchema, } from "./tools/renderCycleGraph.js";
25
27
  import { logShow, logShowSchema, logStream, logStreamSchema, } from "./tools/logShow.js";
26
28
  import { detectLeaksInXCUITest, detectLeaksInXCUITestSchema, } from "./tools/detectLeaksInXCUITest.js";
@@ -165,6 +167,16 @@ server.registerTool("inspectTrace", {
165
167
  content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
166
168
  };
167
169
  });
170
+ server.registerTool("summarizeTrace", {
171
+ title: "Single-call cross-schema summary card for a .trace bundle",
172
+ description: "[mg.synthesize] The trace-to-summary-card-in-one-call play. Chains `inspectTrace` + the matching `analyze*` tools (potential-hangs, animation-hitches, time-profile, allocations, app-launch) and returns BOTH a structured per-area result AND a pre-rendered compact markdown card (< 10 KB at default settings). Use this as the FIRST call when handed a `.trace` if you want one synthesis pass instead of chaining 5-6 analyzers manually. The markdown card carries a 1-sentence headline naming the biggest user-impact finding, then per-area sub-sections, then `suggestedNextCalls[]` for drilling in. Empty schemas are suppressed from the card to reduce noise. Failed analyzers (e.g. xctrace SIGSEGV on time-profile) surface inline with their workaround notice. Pass `verbose: true` to expand each section's top-N from 5 to 15+. Pass `focus: \"hangs\" | \"hitches\" | \"allocations\" | \"launch\"` to bias the summary toward a specific area.",
173
+ inputSchema: summarizeTraceSchema.shape,
174
+ }, async (input) => {
175
+ const result = await summarizeTrace(input);
176
+ return {
177
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
178
+ };
179
+ });
168
180
  server.registerTool("recordTimeProfile", {
169
181
  title: "Record a Time Profiler trace",
170
182
  description: "[mg.trace] Wrapper around `xcrun xctrace record`. Capture a `.trace` bundle from a running app on a device or simulator. Required: exactly 1 of `deviceId`/`simulatorId`, exactly 1 of `attachAppName`/`attachPid`/`launchBundleId`, an `output` path ending in `.trace`. Defaults: template = \"Time Profiler\", durationSec = 90.",
@@ -239,6 +251,14 @@ server.registerTool("analyzeAppLaunch", {
239
251
  const result = await analyzeAppLaunch(input);
240
252
  return formatMcpResponse(result, "analyzeAppLaunch", input.outputFormat);
241
253
  });
254
+ server.registerTool("analyzeNetworkActivity", {
255
+ title: "Analyze HTTP / connection activity from a Network trace",
256
+ description: "[mg.trace] Parse the `network-connections` schema from a `.trace` recorded with a Network template. Returns per-request URL/host, method, status code, response time, bytes in/out. Top-N rankings by duration (which calls blocked the user) and by bytes (which calls bloat the budget) plus per-host aggregates surfacing chatty SDKs. v1.14+.",
257
+ inputSchema: analyzeNetworkActivitySchema.shape,
258
+ }, async (input) => {
259
+ const result = await analyzeNetworkActivity(input);
260
+ return formatMcpResponse(result, "analyzeNetworkActivity", input.outputFormat);
261
+ });
242
262
  server.registerTool("renderCycleGraph", {
243
263
  title: "Render a retain cycle as Mermaid or DOT graph",
244
264
  description: "[mg.render] Read a `.memgraph`, pick a ROOT CYCLE by index, and emit the chain as a Mermaid graph definition (default — embeddable in markdown / GitHub) or a Graphviz DOT file. App-level classes are highlighted; CYCLE BACK terminators are styled distinctly. Use `cycleIndex` to render cycles other than the first.",
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,OAAO,EACL,eAAe,EACf,qBAA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;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,qEAAqE;IACrE,qEAAqE;IACrE,sEAAsE;IACtE,yBAAyB,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC9C,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,88 @@
1
+ /**
2
+ * Pattern-matching schema discovery for `.trace` bundles. v1.14 item B.
3
+ *
4
+ * Pre-v1.14 the trace-side analyzers hardcoded their schema names
5
+ * (`potential-hangs`, `time-profile`, etc.) into the xpath queries
6
+ * (`/trace-toc/run/data/table[@schema="X"]`). Robust as long as Apple
7
+ * never renames a schema. When they DO rename one (or split into
8
+ * `hang-risks` alongside `potential-hangs`, see item F), the analyzer
9
+ * silently returns "schema absent" against a trace that has the data
10
+ * just under a different name.
11
+ *
12
+ * XcodeTraceMCP solves this with a regex-pattern lookup: each schema
13
+ * "family" maps to a list of regex patterns; discovery walks the TOC,
14
+ * matches schema names against the patterns, returns the first hit.
15
+ * Falls through gracefully when nothing matches (callers fall back to
16
+ * the hardcoded canonical name).
17
+ *
18
+ * The patterns mirror XcodeTraceMCP's `SCHEMA_PATTERNS` plus the
19
+ * families memorydetective already analyzes:
20
+ * `hangs`, `animation-hitches`, `time-profile`, `allocations`,
21
+ * `app-launch`, `memory`, `network`, `energy`, `leaks`.
22
+ */
23
+ export declare const SCHEMA_FAMILIES: {
24
+ readonly hangs: [RegExp];
25
+ readonly "hang-risks": [RegExp];
26
+ readonly "animation-hitches": [RegExp, RegExp];
27
+ readonly "time-profile": [RegExp];
28
+ readonly "time-sample": [RegExp];
29
+ readonly allocations: [RegExp, RegExp, RegExp];
30
+ readonly "app-launch": [RegExp, RegExp];
31
+ readonly memory: [RegExp, RegExp, RegExp];
32
+ readonly network: [RegExp, RegExp, RegExp];
33
+ readonly energy: [RegExp, RegExp, RegExp, RegExp];
34
+ readonly leaks: [RegExp, RegExp];
35
+ };
36
+ export type SchemaFamily = keyof typeof SCHEMA_FAMILIES;
37
+ /** Canonical schema name we hardcoded before v1.14. Used as the fallback
38
+ * when discovery does not match anything in the TOC. */
39
+ export declare const CANONICAL_SCHEMA_NAME: Record<SchemaFamily, string>;
40
+ /**
41
+ * Pure: extract all `<table schema="X" .../>` names from a TOC XML
42
+ * string. Returns the names in document order, including duplicates
43
+ * (a trace can have the same schema appear with different filter
44
+ * attributes; the caller decides what to do with duplicates).
45
+ *
46
+ * Accepts both self-closing `<table schema="X"/>` (Apple's --toc shape)
47
+ * and open-close `<table schema="X">...</table>` (test fixtures).
48
+ */
49
+ export declare function extractSchemaNamesFromToc(tocXml: string): string[];
50
+ /**
51
+ * Pure: find the schema name in the TOC that matches the requested
52
+ * family. Returns the FIRST match in document order so deterministic
53
+ * across runs. Falls back to the canonical hardcoded name when no
54
+ * pattern matches; never returns null so callers can plug the result
55
+ * straight into an xpath query.
56
+ *
57
+ * The hardcoded fallback preserves pre-v1.14 behavior: if the trace
58
+ * uses the canonical name, the xpath still works because the canonical
59
+ * name itself matches its own family pattern.
60
+ */
61
+ export declare function discoverSchema(tocXml: string, family: SchemaFamily): string;
62
+ /**
63
+ * Pure: bulk variant. Resolves multiple families against the same TOC
64
+ * in one pass. Useful when an analyzer needs more than one schema
65
+ * (e.g. `analyzeHangs` reading both `hangs` and `hang-risks`).
66
+ */
67
+ export declare function discoverSchemas<F extends SchemaFamily>(tocXml: string, families: readonly F[]): Record<F, string>;
68
+ /**
69
+ * Async wrapper for the trace-side analyzers. Runs `xcrun xctrace
70
+ * export --input <trace> --toc` once and applies {@link discoverSchemas}
71
+ * to the result. Failures (xctrace error, parse glitch, missing trace)
72
+ * fall back to the canonical hardcoded names so the analyzer pipeline
73
+ * still works at pre-v1.14 behavior. v1.14 item B.
74
+ *
75
+ * `runCommand` is injected (not imported from runtime/exec) to keep
76
+ * this module dependency-free and unit-testable without spawning
77
+ * processes.
78
+ */
79
+ export interface SchemaDiscoveryRunner {
80
+ (cmd: string, args: string[], options: {
81
+ timeoutMs: number;
82
+ }): Promise<{
83
+ code: number;
84
+ stdout: string;
85
+ stderr: string;
86
+ }>;
87
+ }
88
+ export declare function fetchDiscoveredSchemas<F extends SchemaFamily>(runCommand: SchemaDiscoveryRunner, tracePath: string, families: readonly F[]): Promise<Record<F, string>>;
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Pattern-matching schema discovery for `.trace` bundles. v1.14 item B.
3
+ *
4
+ * Pre-v1.14 the trace-side analyzers hardcoded their schema names
5
+ * (`potential-hangs`, `time-profile`, etc.) into the xpath queries
6
+ * (`/trace-toc/run/data/table[@schema="X"]`). Robust as long as Apple
7
+ * never renames a schema. When they DO rename one (or split into
8
+ * `hang-risks` alongside `potential-hangs`, see item F), the analyzer
9
+ * silently returns "schema absent" against a trace that has the data
10
+ * just under a different name.
11
+ *
12
+ * XcodeTraceMCP solves this with a regex-pattern lookup: each schema
13
+ * "family" maps to a list of regex patterns; discovery walks the TOC,
14
+ * matches schema names against the patterns, returns the first hit.
15
+ * Falls through gracefully when nothing matches (callers fall back to
16
+ * the hardcoded canonical name).
17
+ *
18
+ * The patterns mirror XcodeTraceMCP's `SCHEMA_PATTERNS` plus the
19
+ * families memorydetective already analyzes:
20
+ * `hangs`, `animation-hitches`, `time-profile`, `allocations`,
21
+ * `app-launch`, `memory`, `network`, `energy`, `leaks`.
22
+ */
23
+ export const SCHEMA_FAMILIES = {
24
+ hangs: [/potential-hangs/i],
25
+ "hang-risks": [/hang-risks?/i],
26
+ "animation-hitches": [/animation-hitches?/i, /hitches?/i],
27
+ "time-profile": [/^time-profile$/i],
28
+ "time-sample": [/^time-samples?$/i],
29
+ allocations: [/^allocations?$/i, /\balloc\b/i, /\bmalloc\b/i],
30
+ "app-launch": [/app-launch/i, /launch-period/i],
31
+ memory: [/memory-footprint/i, /resident-memory/i, /\bvm-regions?\b/i],
32
+ network: [/network-connections?/i, /\bnetwork\b/i, /\bhttp\b/i],
33
+ energy: [/energy-impact/i, /power-draw/i, /\bwakeups?\b/i, /\bbattery\b/i],
34
+ leaks: [/^leaks?$/i, /leak-events?/i],
35
+ };
36
+ /** Canonical schema name we hardcoded before v1.14. Used as the fallback
37
+ * when discovery does not match anything in the TOC. */
38
+ export const CANONICAL_SCHEMA_NAME = {
39
+ hangs: "potential-hangs",
40
+ "hang-risks": "hang-risks",
41
+ "animation-hitches": "animation-hitches",
42
+ "time-profile": "time-profile",
43
+ "time-sample": "time-sample",
44
+ allocations: "allocations",
45
+ "app-launch": "app-launch",
46
+ memory: "memory-footprint",
47
+ network: "network-connections",
48
+ energy: "energy-impact",
49
+ leaks: "leaks",
50
+ };
51
+ /**
52
+ * Pure: extract all `<table schema="X" .../>` names from a TOC XML
53
+ * string. Returns the names in document order, including duplicates
54
+ * (a trace can have the same schema appear with different filter
55
+ * attributes; the caller decides what to do with duplicates).
56
+ *
57
+ * Accepts both self-closing `<table schema="X"/>` (Apple's --toc shape)
58
+ * and open-close `<table schema="X">...</table>` (test fixtures).
59
+ */
60
+ export function extractSchemaNamesFromToc(tocXml) {
61
+ const out = [];
62
+ // Self-closing form.
63
+ const selfClose = /<table\b[^>]*\bschema="([^"]+)"[^>]*\/>/g;
64
+ let m;
65
+ while ((m = selfClose.exec(tocXml)) !== null)
66
+ out.push(m[1]);
67
+ // Open-close form. Walk separately; the two regex passes can
68
+ // double-count if the same `<table>` is matched twice, but the
69
+ // patterns are mutually exclusive (`/>` vs `>...</table>`) so this is
70
+ // safe in practice.
71
+ const openClose = /<table\b[^>]*\bschema="([^"]+)"[^>]*>[\s\S]*?<\/table>/g;
72
+ while ((m = openClose.exec(tocXml)) !== null) {
73
+ if (!out.includes(m[1]))
74
+ out.push(m[1]);
75
+ }
76
+ return out;
77
+ }
78
+ /**
79
+ * Pure: find the schema name in the TOC that matches the requested
80
+ * family. Returns the FIRST match in document order so deterministic
81
+ * across runs. Falls back to the canonical hardcoded name when no
82
+ * pattern matches; never returns null so callers can plug the result
83
+ * straight into an xpath query.
84
+ *
85
+ * The hardcoded fallback preserves pre-v1.14 behavior: if the trace
86
+ * uses the canonical name, the xpath still works because the canonical
87
+ * name itself matches its own family pattern.
88
+ */
89
+ export function discoverSchema(tocXml, family) {
90
+ const names = extractSchemaNamesFromToc(tocXml);
91
+ const patterns = SCHEMA_FAMILIES[family];
92
+ for (const name of names) {
93
+ for (const pat of patterns) {
94
+ if (pat.test(name))
95
+ return name;
96
+ }
97
+ }
98
+ return CANONICAL_SCHEMA_NAME[family];
99
+ }
100
+ /**
101
+ * Pure: bulk variant. Resolves multiple families against the same TOC
102
+ * in one pass. Useful when an analyzer needs more than one schema
103
+ * (e.g. `analyzeHangs` reading both `hangs` and `hang-risks`).
104
+ */
105
+ export function discoverSchemas(tocXml, families) {
106
+ const out = {};
107
+ const names = extractSchemaNamesFromToc(tocXml);
108
+ for (const family of families) {
109
+ const patterns = SCHEMA_FAMILIES[family];
110
+ let matched = null;
111
+ for (const name of names) {
112
+ for (const pat of patterns) {
113
+ if (pat.test(name)) {
114
+ matched = name;
115
+ break;
116
+ }
117
+ }
118
+ if (matched)
119
+ break;
120
+ }
121
+ out[family] = matched ?? CANONICAL_SCHEMA_NAME[family];
122
+ }
123
+ return out;
124
+ }
125
+ export async function fetchDiscoveredSchemas(runCommand, tracePath, families) {
126
+ try {
127
+ const result = await runCommand("xcrun", ["xctrace", "export", "--input", tracePath, "--toc"], { timeoutMs: 60_000 });
128
+ if (result.code !== 0) {
129
+ // TOC fetch failed; return canonical fallback.
130
+ const out = {};
131
+ for (const f of families)
132
+ out[f] = CANONICAL_SCHEMA_NAME[f];
133
+ return out;
134
+ }
135
+ return discoverSchemas(result.stdout, families);
136
+ }
137
+ catch {
138
+ const out = {};
139
+ for (const f of families)
140
+ out[f] = CANONICAL_SCHEMA_NAME[f];
141
+ return out;
142
+ }
143
+ }
144
+ //# sourceMappingURL=schemaDiscovery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaDiscovery.js","sourceRoot":"","sources":["../../src/parsers/schemaDiscovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,KAAK,EAAE,CAAC,kBAAkB,CAAC;IAC3B,YAAY,EAAE,CAAC,cAAc,CAAC;IAC9B,mBAAmB,EAAE,CAAC,qBAAqB,EAAE,WAAW,CAAC;IACzD,cAAc,EAAE,CAAC,iBAAiB,CAAC;IACnC,aAAa,EAAE,CAAC,kBAAkB,CAAC;IACnC,WAAW,EAAE,CAAC,iBAAiB,EAAE,YAAY,EAAE,aAAa,CAAC;IAC7D,YAAY,EAAE,CAAC,aAAa,EAAE,gBAAgB,CAAC;IAC/C,MAAM,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,kBAAkB,CAAC;IACrE,OAAO,EAAE,CAAC,uBAAuB,EAAE,cAAc,EAAE,WAAW,CAAC;IAC/D,MAAM,EAAE,CAAC,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,CAAC;IAC1E,KAAK,EAAE,CAAC,WAAW,EAAE,eAAe,CAAC;CACM,CAAC;AAI9C;yDACyD;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAA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+CAA+C;YAC/C,MAAM,GAAG,GAAG,EAAuB,CAAC;YACpC,KAAK,MAAM,CAAC,IAAI,QAAQ;gBAAE,GAAG,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;YAC5D,OAAO,GAAG,CAAC;QACb,CAAC;QACD,OAAO,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,GAAG,GAAG,EAAuB,CAAC;QACpC,KAAK,MAAM,CAAC,IAAI,QAAQ;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC5D,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC"}
@@ -15,10 +15,15 @@ export interface XctraceTable {
15
15
  * `raw` is the underlying value (timestamp in ns, duration in ns, etc.).
16
16
  * `nested` is present when the value contains structured sub-elements
17
17
  * (e.g. a thread cell containing tid + process + pid).
18
+ *
19
+ * The `name` field carries the `@_name` attribute used by xctrace for
20
+ * `<frame name="..." />` and `<binary name="..." />` elements in stack
21
+ * backtraces. Without it, time-profile rows lose their symbol metadata.
18
22
  */
19
23
  export interface XctraceValue {
20
24
  raw?: string;
21
25
  fmt?: string;
26
+ name?: string;
22
27
  nested?: Record<string, XctraceValue>;
23
28
  }
24
29
  /**
@@ -49,6 +49,9 @@ function nodeToValue(node, byId, depth = 0) {
49
49
  const value = {};
50
50
  if (typeof resolved["@_fmt"] === "string")
51
51
  value.fmt = resolved["@_fmt"];
52
+ // Frame/binary elements carry the symbol/library name in @_name.
53
+ if (typeof resolved["@_name"] === "string")
54
+ value.name = resolved["@_name"];
52
55
  // Body text — appears as #text after parsing.
53
56
  const text = resolved["#text"];
54
57
  if (typeof text === "string" && text.trim())