v1.12.0: Complete ref-tree propagation (countAlive + findRetainers + verifyFix) + analyzeHangs auto cross-schema correlation
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.
Added
-
countAlivereference-tree integration. NewincludeReferenceTree: booleaninput flag (default false preserves v1.11 behavior). When true, spawnsleaks --referenceTree --groupByType --noContentin parallel with the existing cycle pass, merges counts by class name, and surfaces a newactionableCounts[]field filtered viaisFrameworkNoise. ForcountAlive({ className: "AVPlayerItem", includeReferenceTree: true })on the notelet pre-fix memgraph, returnsinstanceCount: 685(substring match captures both AVPlayerItem 342 + AVPlayerItemInternal 343); for the topN path, surfaces AVCMNotificationDispatcher / __NSObserver / AVPlayerItem instead of NSMutableDictionary / CFString noise. New per-classbyCycle+byReferenceTreebreakdown fields when the flag is on. 3 new schema validation tests. -
verifyFixabandoned-memory verdict fallback. v1.11 returnedoverallVerdict: "PASS"with emptypatternResolution[]on the notelet pair (bothleakCount: 0); v1.12 chains internally intoanalyzeAbandonedMemorywhen no cycle patterns fire on either side. NewverdictSource: "cycle-pattern" | "abandoned-memory",freedClasses[],regressionClasses[]fields. Magnitude-dominance heuristic resolves verdict to PASS / PARTIAL / FAIL by comparing the sum of|freed delta|to|growth delta|at a 2x ratio. Notelet pair now returnsverdict: PASSwith diagnosis "Fix verified via abandoned-memory shrinkage: 10,386 instances freed dominates the residual 4,531-instance growth (typically Swift runtime / font cache / ObjC class table)."isFrameworkNoiseextended to flagN bytes into <X 0xADDR> [size]heap-offset entries so the magnitude check doesn't get fooled by partial-allocation noise. 1 new reference-tree filter test. -
findRetainersreference-tree chains. NewincludeReferenceTree: booleaninput flag (default false). When true, spawnsleaks --debug=stacks --debug='<className>$'and parses the per-instance allocation stack output via a newsrc/parsers/leaksDebugStacks.tsparser. Instances sharing the same call-stack fingerprint aggregate into one chain withinstanceCount. Each chain exposescallStack[](ordered frames from dyld root to allocation site),retainers[](unique retainer classes with aggregate counts),exampleAddress(one representative instance), anduserFrame(the deepest non-system frame, surfacing the actual line a developer would inspect). New 11-test parser file. leaks's--debug=predicate restriction documented in the schema description:^is rejected by leaks, only trailing$works. MallocStackLogging caveat documented: Xcode-exported memgraphs may surface fewer chains than the total instance count becauseleaks --debug=stacksonly emits blocks for instances whose allocation stack was recorded. -
analyzeHangscross-schema correlation. v1.9 addedmainThreadViolations[]enrichment via the caller-suppliedtopFramesByHangStartNsmap; v1.12 internalizes it. NewincludeStackClassification: booleaninput flag (default false preserves v1.9 behavior). When true, exports thetime-profileschema in parallel withpotential-hangs, correlates samples to hang windows by timestamp (sample in[hang.startNs, hang.startNs + hang.durationNs]), picks the dominant top frame per hang by aggregate weight, and runsclassifyHangFrame()on it. New purecorrelateTimeProfileToHangs()helper. Caller-supplied maps still take precedence over the auto-correlation. 8 new pure correlation tests covering empty inputs both sides, in/out-of-window, weight tiebreaker, backtrace fallback, multi-hang independence, default-weight handling.
Changed
package.json+server.json: 1.11.0 → 1.12.0.compareTracesByPatterncall sites ofanalyzeHangsnow passincludeStackClassification: falseexplicitly to satisfy the inferredanalyzeHangsinput type (cosmetic; no behavioral change).