Classify ROOT CYCLEs against known patterns
classifyCycleMatches each root cycle in a .memgraph file against 8 known antipatterns, returning pattern ID, confidence, and a fix hint for iOS memory leak investigation.
Instructions
[mg.memory] Match each ROOT CYCLE against a built-in catalog of 8 known antipatterns (TagIndexProjection cycle, ForEachState retention, Combine sink-store-self, Task-without-weak-self, NotificationCenter observer, viewmodel-wrapped-strong closure, UINavigationController host, _DictionaryStorage internal). Returns patternId, confidence, and a fixHint per cycle.
Pipeline: this is the killer tool — after the result, follow suggestedNextCalls which pre-translates each match to a Swift regex (swiftSearchPattern) + the captured class name (swiftGetSymbolDefinition). Discovery is data, not inference.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "classifyCycle"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to a `.memgraph` file. | |
| maxResults | No | Cap on classifications returned (default 20). |