memorydetective 1.6.0 → 1.8.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 (45) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +76 -34
  3. package/USAGE.md +112 -41
  4. package/dist/index.js +43 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/runtime/axe.d.ts +86 -0
  7. package/dist/runtime/axe.js +249 -0
  8. package/dist/runtime/axe.js.map +1 -0
  9. package/dist/runtime/buildSettings.d.ts +27 -0
  10. package/dist/runtime/buildSettings.js +88 -0
  11. package/dist/runtime/buildSettings.js.map +1 -0
  12. package/dist/runtime/exec.d.ts +8 -1
  13. package/dist/runtime/exec.js +8 -2
  14. package/dist/runtime/exec.js.map +1 -1
  15. package/dist/runtime/fixTemplates.d.ts +27 -0
  16. package/dist/runtime/fixTemplates.js +757 -0
  17. package/dist/runtime/fixTemplates.js.map +1 -0
  18. package/dist/runtime/simctl.d.ts +68 -0
  19. package/dist/runtime/simctl.js +194 -0
  20. package/dist/runtime/simctl.js.map +1 -0
  21. package/dist/runtime/staticAnalysisHints.js +8 -0
  22. package/dist/runtime/staticAnalysisHints.js.map +1 -1
  23. package/dist/tools/bootAndLaunchForLeakInvestigation.d.ts +166 -0
  24. package/dist/tools/bootAndLaunchForLeakInvestigation.js +367 -0
  25. package/dist/tools/bootAndLaunchForLeakInvestigation.js.map +1 -0
  26. package/dist/tools/captureMemgraph.d.ts +29 -1
  27. package/dist/tools/captureMemgraph.js +148 -6
  28. package/dist/tools/captureMemgraph.js.map +1 -1
  29. package/dist/tools/captureScenarioState.d.ts +77 -0
  30. package/dist/tools/captureScenarioState.js +159 -0
  31. package/dist/tools/captureScenarioState.js.map +1 -0
  32. package/dist/tools/classifyCycle.d.ts +7 -0
  33. package/dist/tools/classifyCycle.js +31 -0
  34. package/dist/tools/classifyCycle.js.map +1 -1
  35. package/dist/tools/compareTracesByPattern.d.ts +112 -0
  36. package/dist/tools/compareTracesByPattern.js +312 -0
  37. package/dist/tools/compareTracesByPattern.js.map +1 -0
  38. package/dist/tools/detectLeaksInXCUITest.d.ts +2 -2
  39. package/dist/tools/getInvestigationPlaybook.d.ts +15 -0
  40. package/dist/tools/getInvestigationPlaybook.js +24 -1
  41. package/dist/tools/getInvestigationPlaybook.js.map +1 -1
  42. package/dist/tools/replayScenario.d.ts +243 -0
  43. package/dist/tools/replayScenario.js +187 -0
  44. package/dist/tools/replayScenario.js.map +1 -0
  45. package/package.json +2 -2
@@ -0,0 +1,312 @@
1
+ import { z } from "zod";
2
+ import { existsSync } from "node:fs";
3
+ import { resolve as resolvePath } from "node:path";
4
+ import { analyzeHangs, } from "./analyzeHangs.js";
5
+ import { analyzeAnimationHitches, } from "./analyzeAnimationHitches.js";
6
+ import { analyzeAppLaunch, } from "./analyzeAppLaunch.js";
7
+ /**
8
+ * Trace-side counterpart to `verifyFix` (which works on `.memgraph`).
9
+ * Compares before/after `.trace` bundles for a specific perf category
10
+ * (hangs, animation-hitches, app-launch) and returns a per-category
11
+ * PASS/PARTIAL/FAIL verdict + numerical deltas.
12
+ *
13
+ * Designed for CI gating: a build script can run a hangs-fix PR's
14
+ * before/after traces through this tool and fail the merge if the
15
+ * regression target isn't met.
16
+ *
17
+ * Composes with the underlying analyzers — same data shape, just
18
+ * surfaced as a diff.
19
+ */
20
+ export const compareTracesByPatternSchema = z.object({
21
+ before: z
22
+ .string()
23
+ .min(1)
24
+ .describe("Absolute path to the baseline `.trace` (pre-fix)."),
25
+ after: z
26
+ .string()
27
+ .min(1)
28
+ .describe("Absolute path to the post-fix `.trace`."),
29
+ category: z
30
+ .enum(["hangs", "animation-hitches", "app-launch"])
31
+ .describe("Which perf category to verify. `hangs` parses the `potential-hangs` schema, `animation-hitches` parses `animation-hitches`, `app-launch` parses the launch breakdown."),
32
+ thresholds: z
33
+ .object({
34
+ hangsMaxLongestMs: z
35
+ .number()
36
+ .nonnegative()
37
+ .optional()
38
+ .describe("For `category: hangs` — PASS requires `after.longestMs <= this`. Default 0 (i.e. PASS only when no hangs remain)."),
39
+ hitchesMaxLongestMs: z
40
+ .number()
41
+ .nonnegative()
42
+ .optional()
43
+ .describe("For `category: animation-hitches` — PASS requires `after.longestMs <= this`. Default 100 (Apple's user-perceptible threshold)."),
44
+ appLaunchMaxTotalMs: z
45
+ .number()
46
+ .nonnegative()
47
+ .optional()
48
+ .describe("For `category: app-launch` — PASS requires `after.totalMs <= this`. Default 1000 (1 second total cold-launch budget)."),
49
+ })
50
+ .optional()
51
+ .default({}),
52
+ hangsMinDurationMs: z
53
+ .number()
54
+ .nonnegative()
55
+ .default(250)
56
+ .describe("For `category: hangs` — only count hangs longer than this. Default 250ms (Apple's user-perceptible threshold for hangs)."),
57
+ hitchesMinDurationMs: z
58
+ .number()
59
+ .nonnegative()
60
+ .default(100)
61
+ .describe("For `category: animation-hitches` — only count hitches longer than this. Default 100ms (Apple's user-perceptible threshold)."),
62
+ });
63
+ /** Pure: build the comparison from two analyzer results. */
64
+ export function compareHangs(before, after, thresholdLongestMs) {
65
+ const beforeStats = {
66
+ count: before.totals.hangs,
67
+ longestMs: before.totals.longestMs,
68
+ averageMs: before.totals.averageMs,
69
+ totalMs: before.totals.totalDurationMs,
70
+ };
71
+ const afterStats = {
72
+ count: after.totals.hangs,
73
+ longestMs: after.totals.longestMs,
74
+ averageMs: after.totals.averageMs,
75
+ totalMs: after.totals.totalDurationMs,
76
+ };
77
+ const delta = {
78
+ count: afterStats.count - beforeStats.count,
79
+ longestMs: afterStats.longestMs - beforeStats.longestMs,
80
+ averageMs: afterStats.averageMs - beforeStats.averageMs,
81
+ totalMs: afterStats.totalMs - beforeStats.totalMs,
82
+ };
83
+ const verdict = decideVerdict({
84
+ beforeCount: beforeStats.count,
85
+ afterCount: afterStats.count,
86
+ afterLongestMs: afterStats.longestMs,
87
+ thresholdLongestMs,
88
+ });
89
+ return { beforeStats, afterStats, delta, verdict };
90
+ }
91
+ /** Pure: same shape as `compareHangs` for animation-hitches. */
92
+ export function compareAnimationHitches(before, after, thresholdLongestMs) {
93
+ // For animation-hitches, "count" reflects user-perceptible hitches (>100ms)
94
+ // — the metric users actually feel. The schema's `rows` field is total
95
+ // hitches including the imperceptible ones.
96
+ const beforeStats = {
97
+ count: before.totals.perceptible,
98
+ longestMs: before.totals.longestMs,
99
+ averageMs: before.totals.averageMs,
100
+ totalMs: before.totals.totalDurationMs,
101
+ };
102
+ const afterStats = {
103
+ count: after.totals.perceptible,
104
+ longestMs: after.totals.longestMs,
105
+ averageMs: after.totals.averageMs,
106
+ totalMs: after.totals.totalDurationMs,
107
+ };
108
+ const delta = {
109
+ count: afterStats.count - beforeStats.count,
110
+ longestMs: afterStats.longestMs - beforeStats.longestMs,
111
+ averageMs: afterStats.averageMs - beforeStats.averageMs,
112
+ totalMs: afterStats.totalMs - beforeStats.totalMs,
113
+ };
114
+ const verdict = decideVerdict({
115
+ beforeCount: beforeStats.count,
116
+ afterCount: afterStats.count,
117
+ afterLongestMs: afterStats.longestMs,
118
+ thresholdLongestMs,
119
+ });
120
+ return { beforeStats, afterStats, delta, verdict };
121
+ }
122
+ /** Pure: app-launch comparison. The "count" field reflects launch-event count
123
+ * (typically 1 per trace); the meaningful number is `totalMs`. */
124
+ export function compareAppLaunch(before, after, thresholdTotalMs) {
125
+ const beforeStats = {
126
+ count: 1,
127
+ longestMs: before.totalLaunchMs,
128
+ averageMs: before.totalLaunchMs,
129
+ totalMs: before.totalLaunchMs,
130
+ };
131
+ const afterStats = {
132
+ count: 1,
133
+ longestMs: after.totalLaunchMs,
134
+ averageMs: after.totalLaunchMs,
135
+ totalMs: after.totalLaunchMs,
136
+ };
137
+ const delta = {
138
+ count: 0,
139
+ longestMs: afterStats.longestMs - beforeStats.longestMs,
140
+ averageMs: afterStats.averageMs - beforeStats.averageMs,
141
+ totalMs: afterStats.totalMs - beforeStats.totalMs,
142
+ };
143
+ // Verdict semantics for app-launch differ: it's about absolute totalMs
144
+ // crossing the threshold, not "did the count drop".
145
+ let verdict;
146
+ if (afterStats.totalMs <= thresholdTotalMs) {
147
+ verdict = "PASS";
148
+ }
149
+ else if (afterStats.totalMs < beforeStats.totalMs) {
150
+ verdict = "PARTIAL";
151
+ }
152
+ else {
153
+ verdict = "FAIL";
154
+ }
155
+ return { beforeStats, afterStats, delta, verdict };
156
+ }
157
+ /** Shared verdict logic for hangs + hitches. */
158
+ function decideVerdict({ beforeCount, afterCount, afterLongestMs, thresholdLongestMs, }) {
159
+ // PASS: nothing left above the threshold.
160
+ if (afterCount === 0 || afterLongestMs <= thresholdLongestMs) {
161
+ return "PASS";
162
+ }
163
+ // PARTIAL: still present but reduced from before.
164
+ if (afterCount < beforeCount) {
165
+ return "PARTIAL";
166
+ }
167
+ // FAIL: same or worse.
168
+ return "FAIL";
169
+ }
170
+ function buildDiagnosis(category, beforeStats, afterStats, verdict, thresholdField, thresholdValue) {
171
+ const verb = category === "hangs"
172
+ ? "hangs"
173
+ : category === "animation-hitches"
174
+ ? "hitches"
175
+ : "launch time";
176
+ if (verdict === "PASS") {
177
+ if (category === "app-launch") {
178
+ return `Launch time fell to ${afterStats.totalMs.toFixed(0)}ms (was ${beforeStats.totalMs.toFixed(0)}ms), within the ${thresholdValue}ms budget. PASS.`;
179
+ }
180
+ if (afterStats.count === 0) {
181
+ return `All ${verb} resolved (was ${beforeStats.count}, now 0). PASS.`;
182
+ }
183
+ return `${verb} reduced to ${afterStats.count} (was ${beforeStats.count}); longest ${afterStats.longestMs.toFixed(0)}ms is below the ${thresholdValue}ms threshold. PASS.`;
184
+ }
185
+ if (verdict === "PARTIAL") {
186
+ return `${verb}: ${beforeStats.count}→${afterStats.count} count, ${beforeStats.longestMs.toFixed(0)}ms→${afterStats.longestMs.toFixed(0)}ms longest. Reduced but still above the ${thresholdValue}ms threshold. PARTIAL.`;
187
+ }
188
+ return `${verb}: ${beforeStats.count}→${afterStats.count} count, ${beforeStats.longestMs.toFixed(0)}ms→${afterStats.longestMs.toFixed(0)}ms longest. No improvement vs. before. FAIL — the fix did not address the regression.`;
189
+ }
190
+ export async function compareTracesByPattern(input) {
191
+ const beforePath = resolvePath(input.before);
192
+ const afterPath = resolvePath(input.after);
193
+ if (!existsSync(beforePath)) {
194
+ throw new Error(`Trace bundle not found: ${beforePath}`);
195
+ }
196
+ if (!existsSync(afterPath)) {
197
+ throw new Error(`Trace bundle not found: ${afterPath}`);
198
+ }
199
+ const t = input.thresholds ?? {};
200
+ if (input.category === "hangs") {
201
+ const threshold = t.hangsMaxLongestMs ?? 0;
202
+ const [b, a] = await Promise.all([
203
+ analyzeHangs({
204
+ tracePath: beforePath,
205
+ topN: 10,
206
+ minDurationMs: input.hangsMinDurationMs ?? 250,
207
+ }),
208
+ analyzeHangs({
209
+ tracePath: afterPath,
210
+ topN: 10,
211
+ minDurationMs: input.hangsMinDurationMs ?? 250,
212
+ }),
213
+ ]);
214
+ const cmp = compareHangs(b, a, threshold);
215
+ const diagnosis = buildDiagnosis("hangs", cmp.beforeStats, cmp.afterStats, cmp.verdict, "hangsMaxLongestMs", threshold);
216
+ return {
217
+ ok: true,
218
+ before: beforePath,
219
+ after: afterPath,
220
+ category: "hangs",
221
+ verdict: cmp.verdict,
222
+ beforeStats: cmp.beforeStats,
223
+ afterStats: cmp.afterStats,
224
+ delta: cmp.delta,
225
+ thresholdApplied: { field: "hangsMaxLongestMs", value: threshold },
226
+ diagnosis,
227
+ ...(cmp.verdict !== "PASS"
228
+ ? {
229
+ suggestedNextCalls: [
230
+ {
231
+ tool: "analyzeHangs",
232
+ args: { tracePath: afterPath, minDurationMs: 250 },
233
+ why: "Inspect the remaining post-fix hangs to identify which call sites still need attention.",
234
+ },
235
+ ],
236
+ }
237
+ : {}),
238
+ };
239
+ }
240
+ if (input.category === "animation-hitches") {
241
+ const threshold = t.hitchesMaxLongestMs ?? 100;
242
+ const [b, a] = await Promise.all([
243
+ analyzeAnimationHitches({
244
+ tracePath: beforePath,
245
+ topN: 10,
246
+ minDurationMs: input.hitchesMinDurationMs ?? 100,
247
+ }),
248
+ analyzeAnimationHitches({
249
+ tracePath: afterPath,
250
+ topN: 10,
251
+ minDurationMs: input.hitchesMinDurationMs ?? 100,
252
+ }),
253
+ ]);
254
+ const cmp = compareAnimationHitches(b, a, threshold);
255
+ const diagnosis = buildDiagnosis("animation-hitches", cmp.beforeStats, cmp.afterStats, cmp.verdict, "hitchesMaxLongestMs", threshold);
256
+ return {
257
+ ok: true,
258
+ before: beforePath,
259
+ after: afterPath,
260
+ category: "animation-hitches",
261
+ verdict: cmp.verdict,
262
+ beforeStats: cmp.beforeStats,
263
+ afterStats: cmp.afterStats,
264
+ delta: cmp.delta,
265
+ thresholdApplied: { field: "hitchesMaxLongestMs", value: threshold },
266
+ diagnosis,
267
+ ...(cmp.verdict !== "PASS"
268
+ ? {
269
+ suggestedNextCalls: [
270
+ {
271
+ tool: "analyzeAnimationHitches",
272
+ args: { tracePath: afterPath, minDurationMs: 100 },
273
+ why: "Identify which views still hitch in the post-fix trace.",
274
+ },
275
+ ],
276
+ }
277
+ : {}),
278
+ };
279
+ }
280
+ // app-launch
281
+ const threshold = t.appLaunchMaxTotalMs ?? 1000;
282
+ const [b, a] = await Promise.all([
283
+ analyzeAppLaunch({ tracePath: beforePath }),
284
+ analyzeAppLaunch({ tracePath: afterPath }),
285
+ ]);
286
+ const cmp = compareAppLaunch(b, a, threshold);
287
+ const diagnosis = buildDiagnosis("app-launch", cmp.beforeStats, cmp.afterStats, cmp.verdict, "appLaunchMaxTotalMs", threshold);
288
+ return {
289
+ ok: true,
290
+ before: beforePath,
291
+ after: afterPath,
292
+ category: "app-launch",
293
+ verdict: cmp.verdict,
294
+ beforeStats: cmp.beforeStats,
295
+ afterStats: cmp.afterStats,
296
+ delta: cmp.delta,
297
+ thresholdApplied: { field: "appLaunchMaxTotalMs", value: threshold },
298
+ diagnosis,
299
+ ...(cmp.verdict !== "PASS"
300
+ ? {
301
+ suggestedNextCalls: [
302
+ {
303
+ tool: "analyzeAppLaunch",
304
+ args: { tracePath: afterPath },
305
+ why: "Find which launch phase (process-creation / dyld / ObjC-init / AppDelegate / first-frame) still dominates the post-fix launch.",
306
+ },
307
+ ],
308
+ }
309
+ : {}),
310
+ };
311
+ }
312
+ //# sourceMappingURL=compareTracesByPattern.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compareTracesByPattern.js","sourceRoot":"","sources":["../../src/tools/compareTracesByPattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EACL,YAAY,GAEb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,GAExB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,gBAAgB,GAEjB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,mDAAmD,CAAC;IAChE,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,yCAAyC,CAAC;IACtD,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,CAAC,OAAO,EAAE,mBAAmB,EAAE,YAAY,CAAC,CAAC;SAClD,QAAQ,CACP,uKAAuK,CACxK;IACH,UAAU,EAAE,CAAC;SACV,MAAM,CAAC;QACN,iBAAiB,EAAE,CAAC;aACjB,MAAM,EAAE;aACR,WAAW,EAAE;aACb,QAAQ,EAAE;aACV,QAAQ,CACP,mHAAmH,CACpH;QACH,mBAAmB,EAAE,CAAC;aACnB,MAAM,EAAE;aACR,WAAW,EAAE;aACb,QAAQ,EAAE;aACV,Q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AAI,CAAC;IAChD,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC/B,gBAAgB,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;QAC3C,gBAAgB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;KAC3C,CAAC,CAAC;IACH,MAAM,GAAG,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,cAAc,CAC9B,YAAY,EACZ,GAAG,CAAC,WAAW,EACf,GAAG,CAAC,UAAU,EACd,GAAG,CAAC,OAAO,EACX,qBAAqB,EACrB,SAAS,CACV,CAAC;IACF,OAAO;QACL,EAAE,EAAE,IAAI;QACR,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,YAAY;QACtB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,gBAAgB,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,SAAS,EAAE;QACpE,SAAS;QACT,GAAG,CAAC,GAAG,CAAC,OAAO,KAAK,MAAM;YACxB,CAAC,CAAC;gBACE,kBAAkB,EAAE;oBAClB;wBACE,IAAI,EAAE,kBAAkB;wBACxB,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;wBAC9B,GAAG,EAAE,gIAAgI;qBACtI;iBACF;aACF;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
@@ -29,9 +29,9 @@ export declare const detectLeaksInXCUITestSchema: z.ZodObject<{
29
29
  appName: string;
30
30
  workspace: string;
31
31
  scheme: string;
32
+ outputDir: string;
32
33
  testIdentifier: string;
33
34
  destination: string;
34
- outputDir: string;
35
35
  allowlistPatterns: string[];
36
36
  skipBuild: boolean;
37
37
  }, {
@@ -39,8 +39,8 @@ export declare const detectLeaksInXCUITestSchema: z.ZodObject<{
39
39
  workspace: string;
40
40
  scheme: string;
41
41
  testIdentifier: string;
42
- destination?: string | undefined;
43
42
  outputDir?: string | undefined;
43
+ destination?: string | undefined;
44
44
  allowlistPatterns?: string[] | undefined;
45
45
  skipBuild?: boolean | undefined;
46
46
  }>;
@@ -27,12 +27,27 @@ export interface PlaybookStep {
27
27
  /** Optional notes about how to interpret the result before moving to the next step. */
28
28
  resultGuidance?: string;
29
29
  }
30
+ export interface PlaybookTroubleshooting {
31
+ /** Tool whose failure this entry addresses. */
32
+ tool: string;
33
+ /**
34
+ * Stable identifier matching `workaroundNotice.issue` when the underlying
35
+ * tool emits one. Lets the LLM agent branch deterministically.
36
+ */
37
+ issueId?: string;
38
+ /** One-line description of the symptom that triggers this entry. */
39
+ trigger: string;
40
+ /** Ordered recovery steps the agent can take. */
41
+ recovery: string[];
42
+ }
30
43
  export interface Playbook {
31
44
  kind: PlaybookKind;
32
45
  summary: string;
33
46
  steps: PlaybookStep[];
34
47
  /** Pointers to alternative playbooks the agent might want next. */
35
48
  seeAlso?: PlaybookKind[];
49
+ /** Known failure modes for tools used in this playbook + recovery paths. */
50
+ troubleshooting?: PlaybookTroubleshooting[];
36
51
  }
37
52
  declare const PLAYBOOKS: Record<PlaybookKind, Playbook>;
38
53
  export interface GetInvestigationPlaybookResult {
@@ -69,7 +69,7 @@ const PLAYBOOKS = {
69
69
  {
70
70
  step: 6,
71
71
  tool: "swiftFindSymbolReferences",
72
- purpose: "List every callsite useful to compare capture-list patterns across them and detect inconsistencies.",
72
+ purpose: "List every callsite, useful to compare capture-list patterns across them and detect inconsistencies.",
73
73
  argsTemplate: {
74
74
  symbolName: "<class from step 3>",
75
75
  filePath: "<from step 5 result>",
@@ -77,6 +77,29 @@ const PLAYBOOKS = {
77
77
  },
78
78
  ],
79
79
  seeAlso: ["verify-fix"],
80
+ troubleshooting: [
81
+ {
82
+ tool: "captureMemgraph",
83
+ issueId: "minimal-corpse",
84
+ trigger: "leaks --outputGraph aborts with 'Failed to get DYLD info for task' on macOS 26.x. Known regression in Apple's leaks tooling.",
85
+ recovery: [
86
+ "Read `workaroundNotice.fallbacks` from the captureMemgraph result for ordered options.",
87
+ "Open Xcode > Debug > View Memory Graph Hierarchy on the running process, then File > Export Memory Graph to save a .memgraph manually. Pass that path to analyzeMemgraph.",
88
+ "Fall back to recordTimeProfile (template Allocations) + analyzeAllocations to identify top live classes. This is not full cycle detection but reveals leak suspects.",
89
+ "Once Phase 2 ships, relaunch the app via bootAndLaunchForLeakInvestigation with MallocStackLogging=1 and retry capture.",
90
+ ],
91
+ },
92
+ {
93
+ tool: "captureMemgraph",
94
+ issueId: "permission-denied",
95
+ trigger: "leaks cannot attach to the target process due to insufficient privileges (task_for_pid failure).",
96
+ recovery: [
97
+ "Confirm the target was built with a debuggable entitlement (DEBUG, not Release).",
98
+ "Grant Developer Tools access to the parent shell in System Settings > Privacy & Security.",
99
+ "Use Xcode's Memory Graph button while the app is attached to the debugger.",
100
+ ],
101
+ },
102
+ ],
80
103
  },
81
104
  "perf-hangs": {
82
105
  kind: "perf-hangs",
@@ -1 +1 @@
1
- {"version":3,"file":"getInvestigationPlaybook.js","sourceRoot":"","sources":["../../src/tools/getInvestigationPlaybook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,eAAe;IACf,YAAY;IACZ,SAAS;IACT,iBAAiB;IACjB,YAAY;CACb,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,gBAAgB,CAAC,QAAQ,CAC7B,8JAA8J,CAC/J;CACF,CAAC,CAAC;AAyBH,MAAM,SAAS,GAA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