v1.13.0: summarizeTrace + cross-correlation + /summarize-trace prompt
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.
Added
-
summarizeTraceMCP tool (36th tool,[mg.synthesize]). Single call that:- Inspects the TOC via the existing inspectTrace path.
- Chains
analyzeHangs(withincludeStackClassification: trueto auto-classify main-thread violations),analyzeAnimationHitches(with Apple's 100ms perceptible threshold),analyzeTimeProfile,analyzeAllocations,analyzeAppLaunchin parallel via Promise.all guards. - Builds cross-area correlations (Phase 2: hangs+hitches timestamp overlap detection with HIGH/MEDIUM/LOW confidence tiers).
- 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).
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.
Optional inputs:
focus: "hangs" | "hitches" | "allocations" | "launch" | "all"to bias the summary toward one area;verbose: trueto expand each section's top-N from 5 to 15+ and surface low-confidence correlations inline.Failed analyzers (e.g. xctrace SIGSEGV on time-profile) surface their workaround notice inline; other sections unaffected. Empty schemas don't fail the call.
-
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:highwhen both events >= 250ms AND overlap span >= 100ms;mediumwhen at least one event >= 250ms;lowwhen both sub-250ms but touching. Results sorted byatSecascending so the markdown card lists correlations in trace order. Allocation-based correlations (hangs+allocations, hitches+allocations) are deferred to v1.14+ because the existinganalyzeAllocationsdoesn't expose per-timestamp allocation rows. -
/summarize-traceMCP prompt (6th prompt). Counterpart to thesummarizeTracetool. Unlike the existing 5 prompts (which wrap multi-step playbooks),/summarize-tracewraps a single tool call. The brief tells the agent to (1) callsummarizeTrace, (2) presentresult.markdownverbatim instead of paraphrasing, (3) offer drill-ins viasuggestedNextCalls. Surfaces the "present the result; don't re-summarize" pattern that agents often get wrong with structured data.
Changed
package.json+server.json: 1.12.0 → 1.13.0.
Test count
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).