[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-microsoft-context-intelligence-graph-query":3,"mdc-dbs619-key":34,"related-org-microsoft-context-intelligence-graph-query":5043,"related-repo-microsoft-context-intelligence-graph-query":5235},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":32,"mdContent":33},"context-intelligence-graph-query","query context intelligence property graphs","Use when querying the context-intelligence property graph for session history, tool call traces, LLM iteration analysis, execution scale metrics, agent delegation trees, skill loading, and recipe orchestration. Covers all graph layers, cross-layer SOURCED_FROM joins, SST navigation, blob handling, and verified Cypher patterns.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"microsoft","Microsoft","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fmicrosoft.png",[12,16,19,20],{"name":13,"slug":14,"type":15},"Graph Analysis","graph-analysis","tag",{"name":17,"slug":18,"type":15},"Data Analysis","data-analysis",{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},"Agents","agents",3,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-context-intelligence","2026-07-07T06:52:37.897652","MIT",4,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":31},[],"Context Intelligence bundle for the Amplifier project","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-context-intelligence\u002Ftree\u002FHEAD\u002Fskills\u002Fcontext-intelligence-graph-query","---\nname: context-intelligence-graph-query\ndescription: >\n  Use when querying the context-intelligence property graph for session history,\n  tool call traces, LLM iteration analysis, execution scale metrics, agent\n  delegation trees, skill loading, and recipe orchestration. Covers all graph\n  layers, cross-layer SOURCED_FROM joins, SST navigation, blob handling, and\n  verified Cypher patterns.\nlicense: MIT\nmetadata:\n  version: \"2.2.0\"\n  changelog:\n    - \"2.2.0: Corrected the Section 2 workspace\u002Fworking_dir claims — workspace is a lifted, reliable (~100%) scoping slug, not the literal working directory; working_dir is a sparsely-populated (~7%, 238\u002F3,259 sessions) payload-only field with no canonical per-session source, and must never be used to scope a population. Consolidated one visible+correct in-graph APOC payload-parse pattern: dot-access on a JSON-string field (e.g. e.data.working_dir) raises a type error, not a silent null — parse in-graph with apoc.convert.fromJsonMap and return only the scalar needed. De-duplicated the Section 6 copy into a pointer at this pattern.\"\n    - \"2.1.0: Reporting guidance — agent-level \u002F self-delegation answers must STATE the resolved self→actor breakdown (root\u002Fmain vs named) as an explicit standalone finding, not fold it into a blended statistic. Tightened the Section 8 agent-rollup: project Session\u002FFORKED (the labels that exist) and roll up by the Session.agent property; agents are NOT a projectable Agent graph.\"\n    - \"2.0.1: Schema accuracy fix: corrected Prompt\u002FSkillLoad\u002FOrchestrator property names, RecipeStep\u002FRecipeRun property placement, RecipeStep→RecipeRun edge (SPAWNED), removed phantom L1 edges, fixed example queries — all validated against the live graph.\"\n---\n\n## When the graph server is not configured\n\nIf the context-intelligence server is unavailable or not configured for this\nsession, graph-based analysis cannot proceed here. Delegate immediately to\n`session-navigator` for all session analysis, event lookup, and delegation\ntree tracing — do not attempt Cypher queries against a server that isn't\nreachable.\n\n---\n\n# Context Intelligence Graph Query\n\nThis skill equips you to navigate and extract insights from the context-intelligence\nproperty graph using the `graph_query` tool. The graph holds a complete record of\nevery Amplifier session — what happened, when, how things connect, and at what scale.\n\n**Read the live schema from the server; read the meaning from this skill.** The\nserver can always tell you the current shapes — labels, relationship types, property\nnames. It CANNOT tell you what those shapes mean, where they lie about their meaning,\nor how to scope, join, and bound a query safely. This skill deliberately does not\nfreeze a schema dictionary (it goes stale and misleads). It keeps the grammar: the\nscoping levers, the traps, the cross-layer joins, and the verified patterns.\n\n---\n\n## Section 1 — Introspect the Live Schema First\n\nBefore writing analytical Cypher against an unfamiliar area of the graph, ask the\nserver what it actually contains. These calls are cheap and always current.\n\n```cypher\nCALL db.labels()                          \u002F\u002F every node label present\nCALL db.relationshipTypes()               \u002F\u002F every edge type present\nCALL db.schema.nodeTypeProperties()       \u002F\u002F property names + types per label\nCALL db.schema.visualization()            \u002F\u002F label\u002Fedge connectivity overview\n```\n\nTo learn the real properties on a specific label (names AND which are populated),\nsample a few live nodes rather than trusting any documented list:\n\n```cypher\nMATCH (n:ToolCall) WITH n LIMIT 25\nUNWIND keys(n) AS k\nRETURN k AS property, count(*) AS present_on_n_nodes\nORDER BY present_on_n_nodes DESC\n```\n\n**The three-layer shape (stable orientation, not a dictionary):**\n\n- **Data layer 1 — raw events.** Every kernel event preserved as an `:Event` node\n  (`:ToolPreEvent`, `:LlmResponseEvent`, `:PromptSubmitEvent`, …). Answers *what\n  happened and when*. `node_id` uses a `__` (double-underscore) separator.\n- **Data layer 2 — semantic entities.** Events assembled into `Session`,\n  `OrchestratorRun`, `Iteration`, `ContentBlock`, `ToolCall`, `Prompt`, and more,\n  connected by typed relationships. Answers *what ran, how, at what scale*. `node_id`\n  uses a `::` (double-colon) separator (a few types — `ToolCall`, concept nodes — use\n  a bare identifier).\n- **Foundation layer — above the kernel.** Delegation trees (`Delegation`, `Agent`),\n  skill loads (`SkillLoad`), recipe orchestration (`RecipeRun`, `RecipeStep`,\n  `Recipe`).\n\nAll layers coexist in one graph, bridged by **`SOURCED_FROM`** edges: every layer-2\nentity points back to the layer-1 event(s) that produced it (Section 4). Use\n`db.schema.nodeTypeProperties()` to confirm exact property names before you rely on\nthem — the sections below cover only the meaning the server cannot self-describe.\n\n### Reading results & citing the source (required)\n\n`graph_query` returns `{\"source\": {\"name\", \"url\", \"origin\"}, \"rows\": [...]}` on\nsuccess. Read your data from `rows`. ALWAYS report `source.name` (its `origin` is\n`source`, `destination`, or `env`) in your answer — the user must know which\nendpoint the outcome came from.\n\nOn **failure**, `source` is present only when an endpoint was actually chosen:\n**endpoint-level** errors (`connection_error`, `timeout`, `http_status`,\n`decode_error`, and input-validation errors like a missing\u002Finvalid `query` that\noccur *after* selection) carry `error.source` — cite it. **Selection\u002Fconfig**\nerrors that occur *before* any endpoint is chosen (`ambiguous_source_selection`,\n`unknown_source`, `source_misconfigured`, `configuration_error`) have **no**\n`source` — there is no single endpoint to name, so report that selection failed\nrather than inventing one.\n\nTo discover what you can reach, call `graph_query` with `list_sources: true` — it\nreturns the connectable set (`{\"connectable_set\": [{name, url, origin}, ...]}`)\nwithout running a query. To target a specific endpoint (a configured read source\nOR a hook upload destination), pass `source: \"\u003Cname>\"`.\n\n---\n\n## Section 2 — Scoping (Mandatory, and Not Self-Describing)\n\nScoping is the single most error-prone part of querying this graph, and the server\ncannot tell you how its client scopes. Get this right first.\n\n### The `workspace` tool argument — NOT a Cypher param\n\n**The `graph_query` tool reads a top-level `workspace` argument.** It injects that\nvalue as `$workspace` into your Cypher. Do **not** try to set the workspace through\n`params: {\"workspace\": ...}` — the tool does not read the workspace from `params`, and\na mis-set workspace silently scopes to a tiny `\"default\"` decoy partition instead of\nthe real one. If your counts look implausibly small (a handful of sessions where you\nexpected hundreds), you are almost certainly scoped to the decoy.\n\n```cypher\n\u002F\u002F Correct: reference $workspace; set the workspace via the tool's top-level\n\u002F\u002F `workspace` argument, not via params.\nMATCH (s:Session {workspace: $workspace})\nRETURN count(s) AS session_count\n```\n\n### The two real scoping levers\n\nBoth live as first-class properties on nodes — confirm them by sampling:\n\n- **`created_by`** — *who* produced the data (present on every node; the data is\n  typically single-user).\n- **`workspace`** — *where*: a **lifted, dash-slugified label\u002Fslug** (e.g.\n  `-mnt-linuxdata-workspaces-...-dashboard-ui`), reliable at ~100% coverage. It is a **label,\n  not the literal working directory**: the true directory lives in the event `data` payload as\n  `working_dir`, and the **same `working_dir`** (`\u002Fhome\u002Fuser\u002Fproject`) can map to **different**\n  `workspace` slugs (`myproject`, `proj`, `multi`). Treat `workspace` as the reliable scoping\n  slug; treat `working_dir` as a **payload field, sparsely populated (~7% of sessions)** with no\n  canonical per-session source — read it via the APOC parse in Section 8, but do **not** scope by\n  it. The `\u002Fcypher` request's own `workspace` scope is a second, orthogonal server-side filter\n  layered on top.\n\n**Always anchor scope on the first `MATCH`** so the workspace index is used:\n\n```cypher\n\u002F\u002F CORRECT — workspace on the anchor node\nMATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(run:OrchestratorRun)\nRETURN run.orchestrator_name, run.started_at\n\n\u002F\u002F INCORRECT — workspace on a downstream node misses the index\nMATCH (s:Session {node_id: $session_id})\n      -[:HAS_EXECUTION]->(run:OrchestratorRun {workspace: $workspace})\nRETURN run.orchestrator_name, run.started_at\n```\n\nTo discover which workspaces exist before scoping, aggregate across all of them\n(use sparingly — it skips the partition index):\n\n```cypher\nMATCH (s:Session)\nWHERE s.workspace \u003C> ''\nRETURN s.workspace, s.created_by, count(s) AS sessions\nORDER BY sessions DESC\nLIMIT 25\n```\n\n---\n\n## Section 3 — Traps: Where the Shapes Lie About Their Meaning\n\nThese are the highest-value items in this skill. Each is a place where reading the\nschema literally leads you to a **wrong answer that looks rigorous**. The server will\nhappily hand you the misleading shape; only domain knowledge corrects it.\n\n### Trap 1 — Delegation lineage: use `FORKED` + `Session.parent_id`, not the edge walk\n\nThe true delegation\u002Ffork lineage is carried by the **`FORKED` edge** together with\n**`Session.parent_id`**. This is the authoritative source for delegation depth and\nancestry. Verified live: the fork lineage reaches **max depth 3**.\n\n```cypher\n\u002F\u002F Authoritative lineage depth via the FORKED edge.\n\u002F\u002F Bound the path (never bare `*` — Section 7): *1..20 is generous headroom over the\n\u002F\u002F observed max depth of 3, and the RETURN is aggregate-only (no rows materialized).\nMATCH path = (root:Session {workspace: $workspace})-[:FORKED*1..20]->(leaf:Session)\nWHERE root.parent_id IS NULL\nRETURN max(length(path)) AS max_fork_depth, count(path) AS lineages\n```\n\n`Session.parent_id` lets you reconstruct the same chain by property when an edge walk\nis inconvenient (each child names its parent):\n\n```cypher\nMATCH (child:Session {workspace: $workspace})\nWHERE child.parent_id IS NOT NULL\nRETURN child.node_id, child.parent_id\nORDER BY child.node_id LIMIT 200   \u002F\u002F bounded (Section 7); anchor on a node_id to walk one specific chain\n```\n\n**Two known undercounts — do NOT trust either for depth:**\n\n- **`HAS_SUBSESSION` is a single hop only.** It materializes only the immediate\n  parent→child link; each sub-session is ingested as its own root, so a multi-hop walk\n  `(:Session)-[:HAS_SUBSESSION*]->()` collapses to depth 1. It is a one-level lookup,\n  **not** the delegation tree.\n- **The `Delegation` property-join (`sub_session_id → parent_session_id`) undercounts\n  beyond hop 1.** It is more complete than the `HAS_SUBSESSION` walk (it finds a second\n  hop), which is exactly why it is dangerous: it *looks* like the answer and reports\n  depth 2, but it still misses the deeper lineage that `FORKED`\u002F`parent_id` reveals.\n  Use it to enumerate individual delegations, not to measure tree depth.\n\n### Trap 2 — `context_depth` \u002F `context_scope` are inheritance modes, NOT tree depth\n\nOn `Delegation` nodes, `context_depth` and `context_scope` describe **how much parent\ncontext a delegation inherited** — an inheritance mode with values like `none`,\n`recent`, `all`. The name invites reading it as nesting\u002Ftree depth. It is not.\nSelf-delegations are almost always `none`; regular delegations spread across\n`none` \u002F `recent` \u002F `all`.\n\n### Trap 3 — Tool data lives on `ToolCall`, not `ToolExecution`\n\n`:ToolCall` carries the tool data you want: `tool_name`, `tool_input`, `started_at`,\n`ended_at`, `result_success`, `result_error`, `result_output`. `:ToolExecution` is\n**property-less — a dead end**; do not route tool queries through it. `ToolCall` is the\ncorrect, simple source (verified: `tool_name` and `started_at` populated on 100% of\n`ToolCall` nodes in a real workspace).\n\n```cypher\nMATCH (t:ToolCall {workspace: $workspace})\nRETURN t.tool_name AS tool, count(*) AS n\nORDER BY n DESC LIMIT 12\n```\n\n### Trap 4 — `self` is a self-delegation marker, never a real agent\n\nSelf-delegation is recorded explicitly as **`Delegation.is_self_delegation = true`**\n(equivalently the child `Session.agent = 'self'`). Never infer it by string-matching\n`tool_input` or comparing names.\n\n**`'self'` is a marker, not an identity** — it means \"this session spawned a fresh\nsub-context of *itself*,\" so `self` is never the real actor. Before any per-agent stat\n(centrality, counts, durations), **resolve it up the fork chain** to the nearest ancestor\nwhose `agent \u003C> 'self'`. That actor is often the **root\u002Fmain session** (`agent IS NULL` —\nthe user's top-level session, not a named sub-agent); occasionally a named agent that\nself-delegated. Empirically the chain is a single hop (no `self`→`self`→…).\n\n```cypher\n\u002F\u002F Resolve every self-session to the actor that actually spawned it\nMATCH (s:Session {workspace: $workspace, agent: 'self'})\nOPTIONAL MATCH pth = (anc:Session)-[:FORKED*1..20]->(s)\nWHERE anc.agent IS NULL OR anc.agent \u003C> 'self'\nWITH s, anc, pth ORDER BY length(pth) ASC\nWITH s, head(collect(coalesce(anc.agent, 'root\u002Fmain session'))) AS actor\nRETURN coalesce(actor, 'unresolved') AS real_actor, count(*) AS self_delegations\nORDER BY self_delegations DESC\n```\n\nSelf-delegation is itself a **first-class signal** (an actor extending its own context —\ncontinuation \u002F context management): count it *as* self-delegation when that is the\nquestion, and *resolve* it when you need the real actor. A raw `self` bucket in a\nper-agent aggregate is a bug — it attributes real work to a non-existent agent.\n\n**Report the resolved breakdown as an explicit finding — do not bury it in a blended\nstat.** The resolve-self join above only pays off if its result reaches the answer as\nits *own stated fact*. For any agent-level or self-delegation question, **lead with the\nresolved `self`→actor split as a standalone sentence** — how many, and what percent, of\nself-delegations resolve to the **root\u002Fmain session continuing itself** (`agent IS NULL`)\nversus to **named agents** — *before* any roll-up or combined figure. Computing the\nnumber correctly but folding it into a mixed \"X% of all delegations are root-launched\"\nstatistic hides the very fact the question asked for. This is a general output-shape\nprinciple: surface the load-bearing breakdown first, then add supporting context — state\nit, don't just compute it.\n\n```cypher\n\u002F\u002F The plain self-delegation split (the signal itself)\nMATCH (d:Delegation {workspace: $workspace})\nRETURN d.is_self_delegation AS self_delegation, count(*) AS n\nORDER BY n DESC\n```\n\n### Trap 5 — Timestamps are ZONED DATETIME; durations are computed\n\nEvery `*_at` property (`started_at`, `ended_at`, `occurred_at`, …) and `last_updated`\n— on nodes and on the edges that carry `occurred_at` (`HAS_EVENT`, `HAS_SUBSESSION`,\n`FORKED`) — is stored as a native Neo4j **`ZONED DATETIME`**, not a string.\n\n- ❌ `WHERE s.started_at > '2026-05-01'` — comparing to a string literal silently\n  returns nothing (no error raised).\n- ✅ `WHERE s.started_at > datetime('2026-05-01')` — wrap every literal in `datetime()`.\n- ✅ Rolling windows: `WHERE s.started_at > datetime() - duration('P30D')`.\n\n**Durations are not stored — compute them** with `duration.between()`:\n\n```cypher\nMATCH (t:ToolCall {workspace: $workspace})\nWHERE t.started_at IS NOT NULL AND t.ended_at IS NOT NULL\nWITH t, duration.between(t.started_at, t.ended_at) AS d\nRETURN t.tool_name AS tool, d.seconds AS secs\nORDER BY secs DESC LIMIT 8\n```\n\n---\n\n## Section 4 — Cross-Layer Joins (SOURCED_FROM)\n\nData layer 1 (raw events) and data layer 2 (semantic entities) coexist in one graph.\nThe canonical bridge is the **`SOURCED_FROM`** edge: every layer-2 entity points to the\nlayer-1 event(s) that produced it. Use layer 1 for exact raw fields\u002Ftimeline; use\nlayer 2 for structure, scale, and causation; move between them with `SOURCED_FROM`.\n\n```cypher\n\u002F\u002F Semantic ToolCall → its originating raw event (canonical)\nMATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(:OrchestratorRun)\n      -[:HAS_PART]->(iter:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)\nMATCH (tc)-[:SOURCED_FROM]->(pre:ToolPreEvent)\nRETURN iter.iteration_number AS iteration,\n       tc.tool_name          AS tool,\n       tc.result_success     AS succeeded,\n       pre.occurred_at       AS event_fired_at\nORDER BY pre.occurred_at\nLIMIT 25\n```\n\n**Fallback joins** (only when `SOURCED_FROM` is absent — older sessions ingested before\nthe handler existed; check with the query in Gotcha 5):\n\n- **ToolCall direct match** — `:ToolCall.node_id` is the provider's `tool_call_id`,\n  which `:ToolPreEvent` also lifts as `tool_call_id`. Join on that shared key. Works\n  for `ToolCall` only.\n\n  ```cypher\n  MATCH (e:ToolPreEvent {workspace: $workspace, tool_call_id: $tool_call_id})\n  MATCH (tc:ToolCall {node_id: e.tool_call_id})\n  RETURN e.tool_name, e.occurred_at, tc.result_success, tc.result_output\n  ```\n\n- **Session containment** — join through the shared `:Session`: layer 1 attaches raw\n  events via `HAS_EVENT`; layer 2 attaches entities via `HAS_EXECUTION`\u002F`HAS_PART`.\n  Correlate on a shared scalar (e.g. `iteration_number`).\n\n---\n\n## Section 5 — SST Navigation (Reasoning by Semantic Type)\n\nLayer-2 nodes carry an **SST type label** that classifies each node by its fundamental\ncharacter, letting you query across entity boundaries without knowing specific labels\nin advance. Confirm the current partition with `db.labels()`; the meaning is:\n\n- **`:SST_EVENT`** — a temporal, bounded occurrence (Session, OrchestratorRun,\n  Iteration, ContentBlock, ToolCall, Prompt, Delegation, SkillLoad, RecipeRun, …).\n- **`:SST_THING`** — a persistent resource\u002Fartifact (e.g. MountPlan).\n- **`:SST_CONCEPT`** — an abstract, reusable identity (Orchestrator, Agent, Recipe).\n\nLayer-2 edges carry an **`sst_semantic`** property expressing the abstract relationship\nindependent of concrete edge type: `CONTAINS` (containment), `LEADS_TO` (causal\u002F\nsequential), `EXPRESSES` (attribution), `NEAR` (concurrency). This lets you query\ncausation or containment uniformly.\n\n```cypher\n\u002F\u002F All temporal events in the most recent session, mixed types sorted correctly\nMATCH (s:Session {workspace: $workspace})\nWITH s ORDER BY s.started_at DESC LIMIT 1\nMATCH (s)-[:HAS_EXECUTION|HAS_PART*1..3]->(e:SST_EVENT)\nRETURN labels(e) AS types,\n       coalesce(e.started_at, e.occurred_at) AS at\nORDER BY at\nLIMIT 50\n```\n\n> **Two temporal keys across `:SST_EVENT`:** span nodes (Iteration, ContentBlock,\n> ToolCall, Session, OrchestratorRun) store `started_at`; occurrence nodes (Prompt,\n> Cancellation, ContextCompaction) store `occurred_at`. When you sweep a mixed set,\n> use `coalesce(e.started_at, e.occurred_at)` in both projection and `ORDER BY` so\n> occurrence nodes are not silently null and sorted out of order.\n\n**Hierarchy traversal** — reach the full Session → Run → Iteration → ContentBlock tree\nwith a bounded variable-length path. Bound it (`*1..3`) to prevent runaway fanout:\n\n```cypher\nMATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION|HAS_PART*1..3]->(iter:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)\nRETURN tc.tool_name, tc.started_at, tc.result_success\nORDER BY tc.started_at\nLIMIT 50\n```\n\n---\n\n## Section 6 — Text Extraction: Bounded Always, Blobs Carefully\n\nLarge text fields are the fastest way to destroy your context window. **One unbounded\n`p.prompt` query returned 1.21M tokens and overflowed the context.** Treat every large\ntext field with discipline.\n\n### Firm rule — never return full text of many rows\n\nFor any large text field (`prompt`, `data`, `data.content`, `tool_input`,\n`result_output`), you MUST bound it — no exceptions:\n\n- Add a small `LIMIT`, **and**\n- Truncate with `substring(field, 0, 200)`, or return only `size(field)` to gauge\n  scale first, or aggregate (`count`, `collect` of a truncated projection).\n\n```cypher\n\u002F\u002F WRONG — full prompt text over many rows → context overflow\nMATCH (p:Prompt {workspace: $workspace}) RETURN p.prompt\n\n\u002F\u002F RIGHT — measure scale first\nMATCH (p:Prompt {workspace: $workspace})\nRETURN count(p) AS n, max(size(p.prompt)) AS longest_chars\n\n\u002F\u002F RIGHT — bounded preview when you do need text\nMATCH (p:Prompt {workspace: $workspace})\nWHERE p.session_id = $session_id\nRETURN substring(p.prompt, 0, 200) AS prompt_preview\nORDER BY p.occurred_at\nLIMIT 25\n```\n\n### The `data` field is a JSON string, not a Cypher map\n\n`:Event.data` is a serialized JSON string. Dot notation (`e.data.tool_name`) does **not**\nwork in Cypher — it raises a type-mismatch error, not a silent null. Prefer **lifted\nproperties** (`tool_name`, `tool_call_id`, `model`, `provider`, …) when they exist; when you\nneed a raw field that is **only** in the payload, parse it **in-graph with APOC** — see the\none authoritative pattern **\"Lift payload fields in-graph with APOC\" in Section 8**. Always bounded.\n\n**Inline vs blob — know which you have.** Some payloads live inline; some are offloaded.\nFor example, orchestrator steering text lives **inline** at\n`OrchestratorSteeringInjectedEvent.data.content` (a JSON string — parse it, no blob\nhop). Do not assume a `ci-blob:\u002F\u002F` indirection where the text is actually inline.\n\n### `ci-blob:\u002F\u002F` references and the `\u002Fblobs` endpoint\n\nWhen a payload exceeds the storage threshold, the server replaces `data` with a\n`ci-blob:\u002F\u002FSESSION_ID\u002FEVENT_KEY` URI. Resolve it via the blob store — the `\u002Fblobs`\nendpoint (`GET {url}\u002Fblobs\u002F{session_id}[\u002F{key}]`), or the `blob_read` tool which\nreturns a local **file path**, not content:\n\n```python\nresult = blob_read(uri=\"ci-blob:\u002F\u002FSESSION_ID\u002FEVENT_KEY\")  # -> {\"path\": \"...\", \"source\": {name, url, origin}}\n```\n\nThen extract only the fields you need with `jq` — never load a whole blob into context:\n\n```bash\njq 'keys' \u002Ftmp\u002Fci-blobs\u002FSESSION_ID\u002FEVENT_KEY.json          # structure first\njq '.messages[-1].content' \u002Ftmp\u002Fci-blobs\u002FSESSION_ID\u002FEVENT_KEY.json\n```\n\n**Rules:** check for a `ci-blob:\u002F\u002F` prefix before parsing as JSON; lifted properties\nbypass blobs entirely; always bound before loading.\n\n---\n\n## Section 7 — Verified Query Patterns\n\nThese are validated against the live layer-2\u002Ffoundation schema. All reference\n`$workspace` (set via the tool's `workspace` argument, Section 2) and are bounded.\n\n**Full conversation turn trace** — prompt → run → iterations → tool calls:\n\n```cypher\nMATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_PART]->(p:Prompt)\n      -[:TRIGGERS]->(run:OrchestratorRun)\n      -[:HAS_PART]->(iter:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)\nRETURN p.occurred_at AS turn_start, iter.iteration_number AS iteration,\n       tc.tool_name AS tool, tc.result_success AS succeeded\nORDER BY p.occurred_at, iter.iteration_number, tc.started_at\nLIMIT 100\n```\n\n**Tool usage per iteration** — how many tools each LLM round fired:\n\n```cypher\nMATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(:OrchestratorRun)\n      -[:HAS_PART]->(iter:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)\nRETURN iter.iteration_number AS iteration,\n       collect(tc.tool_name) AS tools, count(tc) AS tool_count\nORDER BY iter.iteration_number\nLIMIT 50\n```\n\n**Failed tool calls** — scope to one session; add `ORDER BY tc.started_at DESC` for\nmost-recent-first:\n\n```cypher\nMATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(:OrchestratorRun)\n      -[:HAS_PART]->(iter:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)\nWHERE tc.result_success = false\nRETURN iter.iteration_number AS iteration, tc.tool_name AS tool,\n       tc.result_error AS error, tc.started_at AS failed_at\nORDER BY tc.started_at\nLIMIT 50\n```\n\n**Delegations in a session** — which tool call triggered which agent (enumeration, not\ndepth — see Trap 1 for lineage\u002Fdepth):\n\n```cypher\nMATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(:OrchestratorRun)-[:HAS_PART]->(:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)-[:TRIGGERED]->(d:Delegation)\nRETURN d.agent, d.sub_session_id, d.is_self_delegation, d.context_depth,\n       d.started_at, tc.tool_name AS via_tool\nORDER BY d.started_at\nLIMIT 50\n```\n\n**Skills active per iteration** — note skills loaded before the first request attach to\n`Session`, not `Iteration` (Gotcha 6):\n\n```cypher\nMATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(:OrchestratorRun)-[:HAS_PART]->(iter:Iteration)\n      -[:HAS_SKILL_LOAD]->(sl:SkillLoad)\nRETURN iter.iteration_number, sl.skill_name, sl.content_length, sl.started_at\nORDER BY iter.iteration_number, sl.started_at\nLIMIT 100\n```\n\n**Recipe run trace:**\n\n```cypher\nMATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_RECIPE_RUN]->(rr:RecipeRun)-[:HAS_STEP]->(step:RecipeStep)\nOPTIONAL MATCH (step)-[:TRIGGERED]->(target)\nRETURN rr.name, rr.status, step.name,\n       labels(target) AS triggered_type, target.node_id AS triggered_id\nORDER BY step.started_at\nLIMIT 50\n```\n\n### Size discipline (the cardinal rule)\n\nThe graph can hold thousands of sessions. **Every traversal query MUST have a `LIMIT`.**\nWork as a funnel:\n\n1. **Count first.** `RETURN count(...)` costs almost nothing — run it before any wide\n   query over an unknown population.\n2. **Anchor on a session** (`node_id: $session_id` or `WHERE s.node_id IN [...]`)\n   before traversing; an un-anchored `MATCH (s:Session {workspace: $workspace})` spans\n   every session and multiplies rows.\n3. **Filter and aggregate in Cypher**, not in the client — every unneeded row is wasted\n   context.\n4. **Bound variable-length paths** (`*1..3`), never bare `*`.\n5. **Paginate** with `ORDER BY \u003Cstable key> SKIP n LIMIT m` when you genuinely need more\n   than one page.\n\n---\n\n## Section 8 — Push Work to the Database (APOC \u002F GDS)\n\n**Prefer one server-side computation over many client round-trips.** When an analysis\nneeds a deep or variable-length traversal, path-finding, centrality\u002Finfluence, community\nstructure, or a multi-step aggregation that would otherwise mean pulling rows to the\nclient and iterating, do the work **inside the graph**. It is faster and keeps the\nprotocol un-chatty — fewer tool calls, less context churn. Both plugins are installed and\n**run on the live target** (Neo4j Community here — GDS works). Rule of thumb: **if\nanswering the question the naive way means many round-trips or a large client-side pull,\npush that computation into the database.** Probe once, compute server-side, and still\n**bound the RETURNED result** (count \u002F aggregate \u002F `LIMIT`).\n\nProbe availability: `CALL apoc.help('path')`, `RETURN gds.version()` (or `CALL gds.list()`).\n\n- **APOC — in-graph helpers.** `apoc.convert.fromJsonMap(e.data)` parses a `data` JSON\n  string into a map without a client `jq` hop. `apoc.path.expandConfig(...)` runs\n  configurable in-graph traversals — subject to the **same 1-hop caveat as\n  `HAS_SUBSESSION`** (Trap 1): for delegation depth, expand over `FORKED`\u002F`parent_id`.\n  Still bound your output.\n- **GDS — real graph analytics in one pass.** For centrality\u002Finfluence, community\u002Fcluster\n  detection, or pathfinding **across many sessions**, project once and run the algorithm\n  server-side instead of reconstructing the graph client-side. Always `gds.graph.drop`\n  the projection when done:\n\n  ```cypher\n  CALL gds.graph.project('g', 'Session', 'FORKED')\n  YIELD nodeCount, relationshipCount;\n\n  CALL gds.pageRank.stream('g')          \u002F\u002F or gds.degree \u002F gds.betweenness (influence)\n  YIELD nodeId, score\n  RETURN gds.util.asNode(nodeId).node_id AS session, score\n  ORDER BY score DESC LIMIT 20;\n\n  CALL gds.wcc.stream('g')               \u002F\u002F or gds.louvain (community structure)\n  YIELD componentId\n  RETURN componentId, count(*) AS size ORDER BY size DESC LIMIT 20;\n\n  CALL gds.graph.drop('g') YIELD graphName;   \u002F\u002F always release the projection\n  ```\n\n  **Agent-level, not session-level — agents are a PROPERTY to roll up by, not a projectable graph.**\n  \"Which *agent* is a hub\" ≠ \"which *session* is a hub\": one session can be highly central\n  while its agent is not. `Agent` concept nodes *do* exist (Section 1; Gotcha 4), but they\n  carry only inbound `HAS_AGENT` edges from sessions — there is **no Agent→Agent edge\n  structure to project**, so GDS centrality has nothing to traverse at the agent level. Do NOT\n  `gds.graph.project.cypher(...)` an agent-level graph; it returns an empty projection and\n  is a dead end. Instead **project the labels that exist** — `Session` (nodes) and `FORKED`\n  (relationships) — run the algorithm over *sessions*, then **roll the per-session scores up\n  by the `Session.agent` property in the `RETURN`**. For the named-agent-hub ranking, drop\n  the `self` marker and the root\u002Fmain session (`agent IS NULL`) — a \"which named agent\"\n  question is about named agents:\n\n  ```cypher\n  \u002F\u002F 'g' is the Session \u002F FORKED projection from above — agents are NOT projected;\n  \u002F\u002F agent-level results come from aggregating session scores by the s.agent PROPERTY.\n  CALL gds.pageRank.stream('g') YIELD nodeId, score\n  WITH gds.util.asNode(nodeId) AS s, score\n  WHERE s.agent IS NOT NULL AND s.agent \u003C> 'self'   \u002F\u002F named agents only (see Trap 4 for 'self')\n  RETURN s.agent AS agent, round(sum(score), 2) AS agent_influence, count(*) AS sessions\n  ORDER BY agent_influence DESC LIMIT 20\n  ```\n\n  Excluding `self` here answers \"which *named* agent is a hub\" — it does **not** make `self`\n  vanish from the story. If the question also touches self-delegation, resolve `self` up the\n  `FORKED` chain (Trap 4) and **state that root\u002Fmain-vs-named breakdown as its own finding**;\n  don't let the exclusion above silently drop it.\n\n  Skip GDS for a simple count or grouping that one plain Cypher statement already does —\n  reach for it when the naive alternative is iterative client-side fetching.\n\n---\n\n### Lift payload fields in-graph with APOC (the one authoritative pattern)\n\n**Problem.** `Event.data` (and nested payloads) is a serialized JSON **string**, not a Cypher\nmap. Dot-access like `e.data.working_dir` **fails loudly** — Neo4j raises:\n\n```\nNeo.ClientError.Statement.TypeError: Type mismatch: expected a map but was String(...)\n```\n\nYou **must** parse the string before reading a field. (Do **not** confuse this with the\nsilent-null trap in **Trap 5** — that one is comparing a *zoned datetime to a string literal*,\nwhich returns `null` with no error. This APOC case is a *loud* error, a different failure mode.)\n\n**Pattern — parse in-graph, project only the scalar you need:**\n\n```cypher\nWITH apoc.convert.fromJsonMap(e.data) AS d\nRETURN d.working_dir AS working_dir      \u002F\u002F one scalar, not the whole payload\n```\n\nUse `apoc.convert.fromJsonList(...)` for arrays. **Never** pull the full `data` string to the\nclient to parse with `jq`.\n\n**Two wins:**\n- **Correctness** — dot-access on the string errors out; parsing with APOC is the *only* way to\n  read the real value.\n- **Leanness** — the parse **and** the field-selection happen server-side; the payload never\n  crosses the wire or enters context — same discipline as Section 6 (\"never return full text\").\n\n**Rule.** Prefer lifted first-class properties when they exist; when a field is **only** in the\npayload, lift it in-graph with APOC and return just the scalar. (`working_dir` is the worked\nexample here — proven, and the whole point of the pattern — but per Section 2, it is **not**\na scoping lever: it is sparsely populated (~7% of sessions) with no canonical per-session\nsource, so use it to read one session's directory, never to scope a population.)\n\n---\n\n## Gotchas\n\n1. **Layer-2 \u002F foundation nodes only exist if handlers ran, or the feature was used.**\n   Sessions ingested before a handler was deployed, or with no delegation\u002Fskills\u002Frecipes,\n   simply lack those nodes. Use `OPTIONAL MATCH` when joining them against arbitrary\n   sessions.\n\n2. **`result_success = false` is the error path;** `result_error` holds the message. A\n   null `result_success` means the post\u002Ferror event hasn't been processed — the call is\n   in-flight or its handler didn't run.\n\n3. **`ENABLES` edges are sparse.** The `OrchestratorRun → next Prompt` edge exists only\n   for multi-turn chains (N prompts ⇒ N−1 edges). Do not use its presence to judge clean\n   session termination.\n\n4. **Concept nodes (`Agent`, `Recipe`, `Orchestrator`) are shared across sessions,**\n   merged by name. Querying `(a:Agent)` without a session anchor spans everything — reach\n   them through the session (`HAS_AGENT` from the sub-session, `HAS_RECIPE` from a\n   `RecipeRun`).\n\n5. **`SOURCED_FROM` may be absent on older sessions.** Detect and fall back to the\n   Section 4 fallback joins:\n\n   ```cypher\n   MATCH (n:SST_EVENT) WHERE NOT (n)-[:SOURCED_FROM]->() AND NOT n:Session\n   RETURN labels(n), count(*)\n   ```\n\n6. **`SkillLoad` may attach to `Session`, not `Iteration`.** Skills loaded before the\n   first request have no active iteration. Add\n   `OPTIONAL MATCH (s)-[:HAS_SKILL_LOAD]->(sl:SkillLoad)` to catch session-level loads.\n\n7. **`IncompleteSession` is a health marker, not a terminal label.** It reached\n   `session:end` with no captured `session:start`\u002F`fork`, carries `has_terminal: false`,\n   and none of `:RootSession`\u002F`:SubSession`\u002F`:ForkedSession`. Exclude it from normal\n   terminal-session queries with `WHERE NOT s:IncompleteSession`. A spike in its count\n   signals upstream event loss.\n\n8. **The node MERGE key is `{node_id, workspace}`.** The same logical entity (e.g. an\n   Orchestrator named `loop-streaming`) exists as a separate node per workspace. A\n   cross-workspace query returns one node per workspace — account for this when\n   aggregating.\n",{"data":35,"body":42},{"name":4,"description":6,"license":26,"metadata":36},{"version":37,"changelog":38},"2.2.0",[39,40,41],"2.2.0: Corrected the Section 2 workspace\u002Fworking_dir claims — workspace is a lifted, reliable (~100%) scoping slug, not the literal working directory; working_dir is a sparsely-populated (~7%, 238\u002F3,259 sessions) payload-only field with no canonical per-session source, and must never be used to scope a population. Consolidated one visible+correct in-graph APOC payload-parse pattern: dot-access on a JSON-string field (e.g. e.data.working_dir) raises a type error, not a silent null — parse in-graph with apoc.convert.fromJsonMap and return only the scalar needed. De-duplicated the Section 6 copy into a pointer at this pattern.","2.1.0: Reporting guidance — agent-level \u002F self-delegation answers must STATE the resolved self→actor breakdown (root\u002Fmain vs named) as an explicit standalone finding, not fold it into a blended statistic. Tightened the Section 8 agent-rollup: project Session\u002FFORKED (the labels that exist) and roll up by the Session.agent property; agents are NOT a projectable Agent graph.","2.0.1: Schema accuracy fix: corrected Prompt\u002FSkillLoad\u002FOrchestrator property names, RecipeStep\u002FRecipeRun property placement, RecipeStep→RecipeRun edge (SPAWNED), removed phantom L1 edges, fixed example queries — all validated against the live graph.",{"type":43,"children":44},"root",[45,54,69,73,79,92,103,106,112,117,164,169,208,216,423,447,454,519,651,687,690,696,701,715,777,816,822,827,1004,1020,1104,1109,1156,1159,1165,1177,1199,1232,1287,1297,1336,1344,1430,1452,1531,1550,1651,1682,1696,1727,1800,1871,1904,1960,1999,2005,2083,2131,2148,2194,2197,2203,2224,2328,2345,2472,2475,2481,2501,2546,2594,2664,2714,2732,2784,2787,2793,2813,2819,2857,2913,3021,3033,3112,3145,3164,3214,3230,3243,3313,3330,3333,3339,3358,3368,3444,3454,3519,3537,3610,3620,3681,3704,3757,3765,3826,3832,3850,3955,3958,3964,4008,4035,4480,4483,4489,4527,4537,4584,4592,4615,4648,4656,4691,4720,4723,4729,5037],{"type":46,"tag":47,"props":48,"children":50},"element","h2",{"id":49},"when-the-graph-server-is-not-configured",[51],{"type":52,"value":53},"text","When the graph server is not configured",{"type":46,"tag":55,"props":56,"children":57},"p",{},[58,60,67],{"type":52,"value":59},"If the context-intelligence server is unavailable or not configured for this\nsession, graph-based analysis cannot proceed here. Delegate immediately to\n",{"type":46,"tag":61,"props":62,"children":64},"code",{"className":63},[],[65],{"type":52,"value":66},"session-navigator",{"type":52,"value":68}," for all session analysis, event lookup, and delegation\ntree tracing — do not attempt Cypher queries against a server that isn't\nreachable.",{"type":46,"tag":70,"props":71,"children":72},"hr",{},[],{"type":46,"tag":74,"props":75,"children":76},"h1",{"id":4},[77],{"type":52,"value":78},"Context Intelligence Graph Query",{"type":46,"tag":55,"props":80,"children":81},{},[82,84,90],{"type":52,"value":83},"This skill equips you to navigate and extract insights from the context-intelligence\nproperty graph using the ",{"type":46,"tag":61,"props":85,"children":87},{"className":86},[],[88],{"type":52,"value":89},"graph_query",{"type":52,"value":91}," tool. The graph holds a complete record of\nevery Amplifier session — what happened, when, how things connect, and at what scale.",{"type":46,"tag":55,"props":93,"children":94},{},[95,101],{"type":46,"tag":96,"props":97,"children":98},"strong",{},[99],{"type":52,"value":100},"Read the live schema from the server; read the meaning from this skill.",{"type":52,"value":102}," The\nserver can always tell you the current shapes — labels, relationship types, property\nnames. It CANNOT tell you what those shapes mean, where they lie about their meaning,\nor how to scope, join, and bound a query safely. This skill deliberately does not\nfreeze a schema dictionary (it goes stale and misleads). It keeps the grammar: the\nscoping levers, the traps, the cross-layer joins, and the verified patterns.",{"type":46,"tag":70,"props":104,"children":105},{},[],{"type":46,"tag":47,"props":107,"children":109},{"id":108},"section-1-introspect-the-live-schema-first",[110],{"type":52,"value":111},"Section 1 — Introspect the Live Schema First",{"type":46,"tag":55,"props":113,"children":114},{},[115],{"type":52,"value":116},"Before writing analytical Cypher against an unfamiliar area of the graph, ask the\nserver what it actually contains. These calls are cheap and always current.",{"type":46,"tag":118,"props":119,"children":124},"pre",{"className":120,"code":121,"language":122,"meta":123,"style":123},"language-cypher shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","CALL db.labels()                          \u002F\u002F every node label present\nCALL db.relationshipTypes()               \u002F\u002F every edge type present\nCALL db.schema.nodeTypeProperties()       \u002F\u002F property names + types per label\nCALL db.schema.visualization()            \u002F\u002F label\u002Fedge connectivity overview\n","cypher","",[125],{"type":46,"tag":61,"props":126,"children":127},{"__ignoreMap":123},[128,139,148,156],{"type":46,"tag":129,"props":130,"children":133},"span",{"class":131,"line":132},"line",1,[134],{"type":46,"tag":129,"props":135,"children":136},{},[137],{"type":52,"value":138},"CALL db.labels()                          \u002F\u002F every node label present\n",{"type":46,"tag":129,"props":140,"children":142},{"class":131,"line":141},2,[143],{"type":46,"tag":129,"props":144,"children":145},{},[146],{"type":52,"value":147},"CALL db.relationshipTypes()               \u002F\u002F every edge type present\n",{"type":46,"tag":129,"props":149,"children":150},{"class":131,"line":23},[151],{"type":46,"tag":129,"props":152,"children":153},{},[154],{"type":52,"value":155},"CALL db.schema.nodeTypeProperties()       \u002F\u002F property names + types per label\n",{"type":46,"tag":129,"props":157,"children":158},{"class":131,"line":27},[159],{"type":46,"tag":129,"props":160,"children":161},{},[162],{"type":52,"value":163},"CALL db.schema.visualization()            \u002F\u002F label\u002Fedge connectivity overview\n",{"type":46,"tag":55,"props":165,"children":166},{},[167],{"type":52,"value":168},"To learn the real properties on a specific label (names AND which are populated),\nsample a few live nodes rather than trusting any documented list:",{"type":46,"tag":118,"props":170,"children":172},{"className":120,"code":171,"language":122,"meta":123,"style":123},"MATCH (n:ToolCall) WITH n LIMIT 25\nUNWIND keys(n) AS k\nRETURN k AS property, count(*) AS present_on_n_nodes\nORDER BY present_on_n_nodes DESC\n",[173],{"type":46,"tag":61,"props":174,"children":175},{"__ignoreMap":123},[176,184,192,200],{"type":46,"tag":129,"props":177,"children":178},{"class":131,"line":132},[179],{"type":46,"tag":129,"props":180,"children":181},{},[182],{"type":52,"value":183},"MATCH (n:ToolCall) WITH n LIMIT 25\n",{"type":46,"tag":129,"props":185,"children":186},{"class":131,"line":141},[187],{"type":46,"tag":129,"props":188,"children":189},{},[190],{"type":52,"value":191},"UNWIND keys(n) AS k\n",{"type":46,"tag":129,"props":193,"children":194},{"class":131,"line":23},[195],{"type":46,"tag":129,"props":196,"children":197},{},[198],{"type":52,"value":199},"RETURN k AS property, count(*) AS present_on_n_nodes\n",{"type":46,"tag":129,"props":201,"children":202},{"class":131,"line":27},[203],{"type":46,"tag":129,"props":204,"children":205},{},[206],{"type":52,"value":207},"ORDER BY present_on_n_nodes DESC\n",{"type":46,"tag":55,"props":209,"children":210},{},[211],{"type":46,"tag":96,"props":212,"children":213},{},[214],{"type":52,"value":215},"The three-layer shape (stable orientation, not a dictionary):",{"type":46,"tag":217,"props":218,"children":219},"ul",{},[220,286,368],{"type":46,"tag":221,"props":222,"children":223},"li",{},[224,229,231,237,239,245,247,253,254,260,262,268,270,276,278,284],{"type":46,"tag":96,"props":225,"children":226},{},[227],{"type":52,"value":228},"Data layer 1 — raw events.",{"type":52,"value":230}," Every kernel event preserved as an ",{"type":46,"tag":61,"props":232,"children":234},{"className":233},[],[235],{"type":52,"value":236},":Event",{"type":52,"value":238}," node\n(",{"type":46,"tag":61,"props":240,"children":242},{"className":241},[],[243],{"type":52,"value":244},":ToolPreEvent",{"type":52,"value":246},", ",{"type":46,"tag":61,"props":248,"children":250},{"className":249},[],[251],{"type":52,"value":252},":LlmResponseEvent",{"type":52,"value":246},{"type":46,"tag":61,"props":255,"children":257},{"className":256},[],[258],{"type":52,"value":259},":PromptSubmitEvent",{"type":52,"value":261},", …). Answers ",{"type":46,"tag":263,"props":264,"children":265},"em",{},[266],{"type":52,"value":267},"what\nhappened and when",{"type":52,"value":269},". ",{"type":46,"tag":61,"props":271,"children":273},{"className":272},[],[274],{"type":52,"value":275},"node_id",{"type":52,"value":277}," uses a ",{"type":46,"tag":61,"props":279,"children":281},{"className":280},[],[282],{"type":52,"value":283},"__",{"type":52,"value":285}," (double-underscore) separator.",{"type":46,"tag":221,"props":287,"children":288},{},[289,294,296,302,304,310,311,317,318,324,325,331,332,338,340,345,346,351,353,359,361,366],{"type":46,"tag":96,"props":290,"children":291},{},[292],{"type":52,"value":293},"Data layer 2 — semantic entities.",{"type":52,"value":295}," Events assembled into ",{"type":46,"tag":61,"props":297,"children":299},{"className":298},[],[300],{"type":52,"value":301},"Session",{"type":52,"value":303},",\n",{"type":46,"tag":61,"props":305,"children":307},{"className":306},[],[308],{"type":52,"value":309},"OrchestratorRun",{"type":52,"value":246},{"type":46,"tag":61,"props":312,"children":314},{"className":313},[],[315],{"type":52,"value":316},"Iteration",{"type":52,"value":246},{"type":46,"tag":61,"props":319,"children":321},{"className":320},[],[322],{"type":52,"value":323},"ContentBlock",{"type":52,"value":246},{"type":46,"tag":61,"props":326,"children":328},{"className":327},[],[329],{"type":52,"value":330},"ToolCall",{"type":52,"value":246},{"type":46,"tag":61,"props":333,"children":335},{"className":334},[],[336],{"type":52,"value":337},"Prompt",{"type":52,"value":339},", and more,\nconnected by typed relationships. Answers ",{"type":46,"tag":263,"props":341,"children":342},{},[343],{"type":52,"value":344},"what ran, how, at what scale",{"type":52,"value":269},{"type":46,"tag":61,"props":347,"children":349},{"className":348},[],[350],{"type":52,"value":275},{"type":52,"value":352},"\nuses a ",{"type":46,"tag":61,"props":354,"children":356},{"className":355},[],[357],{"type":52,"value":358},"::",{"type":52,"value":360}," (double-colon) separator (a few types — ",{"type":46,"tag":61,"props":362,"children":364},{"className":363},[],[365],{"type":52,"value":330},{"type":52,"value":367},", concept nodes — use\na bare identifier).",{"type":46,"tag":221,"props":369,"children":370},{},[371,376,378,384,385,391,393,399,401,407,408,414,415,421],{"type":46,"tag":96,"props":372,"children":373},{},[374],{"type":52,"value":375},"Foundation layer — above the kernel.",{"type":52,"value":377}," Delegation trees (",{"type":46,"tag":61,"props":379,"children":381},{"className":380},[],[382],{"type":52,"value":383},"Delegation",{"type":52,"value":246},{"type":46,"tag":61,"props":386,"children":388},{"className":387},[],[389],{"type":52,"value":390},"Agent",{"type":52,"value":392},"),\nskill loads (",{"type":46,"tag":61,"props":394,"children":396},{"className":395},[],[397],{"type":52,"value":398},"SkillLoad",{"type":52,"value":400},"), recipe orchestration (",{"type":46,"tag":61,"props":402,"children":404},{"className":403},[],[405],{"type":52,"value":406},"RecipeRun",{"type":52,"value":246},{"type":46,"tag":61,"props":409,"children":411},{"className":410},[],[412],{"type":52,"value":413},"RecipeStep",{"type":52,"value":303},{"type":46,"tag":61,"props":416,"children":418},{"className":417},[],[419],{"type":52,"value":420},"Recipe",{"type":52,"value":422},").",{"type":46,"tag":55,"props":424,"children":425},{},[426,428,437,439,445],{"type":52,"value":427},"All layers coexist in one graph, bridged by ",{"type":46,"tag":96,"props":429,"children":430},{},[431],{"type":46,"tag":61,"props":432,"children":434},{"className":433},[],[435],{"type":52,"value":436},"SOURCED_FROM",{"type":52,"value":438}," edges: every layer-2\nentity points back to the layer-1 event(s) that produced it (Section 4). Use\n",{"type":46,"tag":61,"props":440,"children":442},{"className":441},[],[443],{"type":52,"value":444},"db.schema.nodeTypeProperties()",{"type":52,"value":446}," to confirm exact property names before you rely on\nthem — the sections below cover only the meaning the server cannot self-describe.",{"type":46,"tag":448,"props":449,"children":451},"h3",{"id":450},"reading-results-citing-the-source-required",[452],{"type":52,"value":453},"Reading results & citing the source (required)",{"type":46,"tag":55,"props":455,"children":456},{},[457,462,464,470,472,478,480,486,488,494,496,502,503,509,511,517],{"type":46,"tag":61,"props":458,"children":460},{"className":459},[],[461],{"type":52,"value":89},{"type":52,"value":463}," returns ",{"type":46,"tag":61,"props":465,"children":467},{"className":466},[],[468],{"type":52,"value":469},"{\"source\": {\"name\", \"url\", \"origin\"}, \"rows\": [...]}",{"type":52,"value":471}," on\nsuccess. Read your data from ",{"type":46,"tag":61,"props":473,"children":475},{"className":474},[],[476],{"type":52,"value":477},"rows",{"type":52,"value":479},". ALWAYS report ",{"type":46,"tag":61,"props":481,"children":483},{"className":482},[],[484],{"type":52,"value":485},"source.name",{"type":52,"value":487}," (its ",{"type":46,"tag":61,"props":489,"children":491},{"className":490},[],[492],{"type":52,"value":493},"origin",{"type":52,"value":495}," is\n",{"type":46,"tag":61,"props":497,"children":499},{"className":498},[],[500],{"type":52,"value":501},"source",{"type":52,"value":246},{"type":46,"tag":61,"props":504,"children":506},{"className":505},[],[507],{"type":52,"value":508},"destination",{"type":52,"value":510},", or ",{"type":46,"tag":61,"props":512,"children":514},{"className":513},[],[515],{"type":52,"value":516},"env",{"type":52,"value":518},") in your answer — the user must know which\nendpoint the outcome came from.",{"type":46,"tag":55,"props":520,"children":521},{},[522,524,529,530,535,537,542,544,550,551,557,558,564,565,571,573,579,581,586,588,594,596,601,603,608,610,616,617,623,624,630,631,637,639,644,649],{"type":52,"value":523},"On ",{"type":46,"tag":96,"props":525,"children":526},{},[527],{"type":52,"value":528},"failure",{"type":52,"value":246},{"type":46,"tag":61,"props":531,"children":533},{"className":532},[],[534],{"type":52,"value":501},{"type":52,"value":536}," is present only when an endpoint was actually chosen:\n",{"type":46,"tag":96,"props":538,"children":539},{},[540],{"type":52,"value":541},"endpoint-level",{"type":52,"value":543}," errors (",{"type":46,"tag":61,"props":545,"children":547},{"className":546},[],[548],{"type":52,"value":549},"connection_error",{"type":52,"value":246},{"type":46,"tag":61,"props":552,"children":554},{"className":553},[],[555],{"type":52,"value":556},"timeout",{"type":52,"value":246},{"type":46,"tag":61,"props":559,"children":561},{"className":560},[],[562],{"type":52,"value":563},"http_status",{"type":52,"value":303},{"type":46,"tag":61,"props":566,"children":568},{"className":567},[],[569],{"type":52,"value":570},"decode_error",{"type":52,"value":572},", and input-validation errors like a missing\u002Finvalid ",{"type":46,"tag":61,"props":574,"children":576},{"className":575},[],[577],{"type":52,"value":578},"query",{"type":52,"value":580}," that\noccur ",{"type":46,"tag":263,"props":582,"children":583},{},[584],{"type":52,"value":585},"after",{"type":52,"value":587}," selection) carry ",{"type":46,"tag":61,"props":589,"children":591},{"className":590},[],[592],{"type":52,"value":593},"error.source",{"type":52,"value":595}," — cite it. ",{"type":46,"tag":96,"props":597,"children":598},{},[599],{"type":52,"value":600},"Selection\u002Fconfig",{"type":52,"value":602},"\nerrors that occur ",{"type":46,"tag":263,"props":604,"children":605},{},[606],{"type":52,"value":607},"before",{"type":52,"value":609}," any endpoint is chosen (",{"type":46,"tag":61,"props":611,"children":613},{"className":612},[],[614],{"type":52,"value":615},"ambiguous_source_selection",{"type":52,"value":303},{"type":46,"tag":61,"props":618,"children":620},{"className":619},[],[621],{"type":52,"value":622},"unknown_source",{"type":52,"value":246},{"type":46,"tag":61,"props":625,"children":627},{"className":626},[],[628],{"type":52,"value":629},"source_misconfigured",{"type":52,"value":246},{"type":46,"tag":61,"props":632,"children":634},{"className":633},[],[635],{"type":52,"value":636},"configuration_error",{"type":52,"value":638},") have ",{"type":46,"tag":96,"props":640,"children":641},{},[642],{"type":52,"value":643},"no",{"type":46,"tag":61,"props":645,"children":647},{"className":646},[],[648],{"type":52,"value":501},{"type":52,"value":650}," — there is no single endpoint to name, so report that selection failed\nrather than inventing one.",{"type":46,"tag":55,"props":652,"children":653},{},[654,656,661,663,669,671,677,679,685],{"type":52,"value":655},"To discover what you can reach, call ",{"type":46,"tag":61,"props":657,"children":659},{"className":658},[],[660],{"type":52,"value":89},{"type":52,"value":662}," with ",{"type":46,"tag":61,"props":664,"children":666},{"className":665},[],[667],{"type":52,"value":668},"list_sources: true",{"type":52,"value":670}," — it\nreturns the connectable set (",{"type":46,"tag":61,"props":672,"children":674},{"className":673},[],[675],{"type":52,"value":676},"{\"connectable_set\": [{name, url, origin}, ...]}",{"type":52,"value":678},")\nwithout running a query. To target a specific endpoint (a configured read source\nOR a hook upload destination), pass ",{"type":46,"tag":61,"props":680,"children":682},{"className":681},[],[683],{"type":52,"value":684},"source: \"\u003Cname>\"",{"type":52,"value":686},".",{"type":46,"tag":70,"props":688,"children":689},{},[],{"type":46,"tag":47,"props":691,"children":693},{"id":692},"section-2-scoping-mandatory-and-not-self-describing",[694],{"type":52,"value":695},"Section 2 — Scoping (Mandatory, and Not Self-Describing)",{"type":46,"tag":55,"props":697,"children":698},{},[699],{"type":52,"value":700},"Scoping is the single most error-prone part of querying this graph, and the server\ncannot tell you how its client scopes. Get this right first.",{"type":46,"tag":448,"props":702,"children":704},{"id":703},"the-workspace-tool-argument-not-a-cypher-param",[705,707,713],{"type":52,"value":706},"The ",{"type":46,"tag":61,"props":708,"children":710},{"className":709},[],[711],{"type":52,"value":712},"workspace",{"type":52,"value":714}," tool argument — NOT a Cypher param",{"type":46,"tag":55,"props":716,"children":717},{},[718,736,738,744,746,751,753,759,761,767,769,775],{"type":46,"tag":96,"props":719,"children":720},{},[721,722,727,729,734],{"type":52,"value":706},{"type":46,"tag":61,"props":723,"children":725},{"className":724},[],[726],{"type":52,"value":89},{"type":52,"value":728}," tool reads a top-level ",{"type":46,"tag":61,"props":730,"children":732},{"className":731},[],[733],{"type":52,"value":712},{"type":52,"value":735}," argument.",{"type":52,"value":737}," It injects that\nvalue as ",{"type":46,"tag":61,"props":739,"children":741},{"className":740},[],[742],{"type":52,"value":743},"$workspace",{"type":52,"value":745}," into your Cypher. Do ",{"type":46,"tag":96,"props":747,"children":748},{},[749],{"type":52,"value":750},"not",{"type":52,"value":752}," try to set the workspace through\n",{"type":46,"tag":61,"props":754,"children":756},{"className":755},[],[757],{"type":52,"value":758},"params: {\"workspace\": ...}",{"type":52,"value":760}," — the tool does not read the workspace from ",{"type":46,"tag":61,"props":762,"children":764},{"className":763},[],[765],{"type":52,"value":766},"params",{"type":52,"value":768},", and\na mis-set workspace silently scopes to a tiny ",{"type":46,"tag":61,"props":770,"children":772},{"className":771},[],[773],{"type":52,"value":774},"\"default\"",{"type":52,"value":776}," decoy partition instead of\nthe real one. If your counts look implausibly small (a handful of sessions where you\nexpected hundreds), you are almost certainly scoped to the decoy.",{"type":46,"tag":118,"props":778,"children":780},{"className":120,"code":779,"language":122,"meta":123,"style":123},"\u002F\u002F Correct: reference $workspace; set the workspace via the tool's top-level\n\u002F\u002F `workspace` argument, not via params.\nMATCH (s:Session {workspace: $workspace})\nRETURN count(s) AS session_count\n",[781],{"type":46,"tag":61,"props":782,"children":783},{"__ignoreMap":123},[784,792,800,808],{"type":46,"tag":129,"props":785,"children":786},{"class":131,"line":132},[787],{"type":46,"tag":129,"props":788,"children":789},{},[790],{"type":52,"value":791},"\u002F\u002F Correct: reference $workspace; set the workspace via the tool's top-level\n",{"type":46,"tag":129,"props":793,"children":794},{"class":131,"line":141},[795],{"type":46,"tag":129,"props":796,"children":797},{},[798],{"type":52,"value":799},"\u002F\u002F `workspace` argument, not via params.\n",{"type":46,"tag":129,"props":801,"children":802},{"class":131,"line":23},[803],{"type":46,"tag":129,"props":804,"children":805},{},[806],{"type":52,"value":807},"MATCH (s:Session {workspace: $workspace})\n",{"type":46,"tag":129,"props":809,"children":810},{"class":131,"line":27},[811],{"type":46,"tag":129,"props":812,"children":813},{},[814],{"type":52,"value":815},"RETURN count(s) AS session_count\n",{"type":46,"tag":448,"props":817,"children":819},{"id":818},"the-two-real-scoping-levers",[820],{"type":52,"value":821},"The two real scoping levers",{"type":46,"tag":55,"props":823,"children":824},{},[825],{"type":52,"value":826},"Both live as first-class properties on nodes — confirm them by sampling:",{"type":46,"tag":217,"props":828,"children":829},{},[830,851],{"type":46,"tag":221,"props":831,"children":832},{},[833,842,844,849],{"type":46,"tag":96,"props":834,"children":835},{},[836],{"type":46,"tag":61,"props":837,"children":839},{"className":838},[],[840],{"type":52,"value":841},"created_by",{"type":52,"value":843}," — ",{"type":46,"tag":263,"props":845,"children":846},{},[847],{"type":52,"value":848},"who",{"type":52,"value":850}," produced the data (present on every node; the data is\ntypically single-user).",{"type":46,"tag":221,"props":852,"children":853},{},[854,862,863,868,870,875,877,883,885,890,892,898,900,906,908,918,920,926,928,933,938,940,946,947,953,954,960,962,967,969,974,976,981,983,987,989,995,997,1002],{"type":46,"tag":96,"props":855,"children":856},{},[857],{"type":46,"tag":61,"props":858,"children":860},{"className":859},[],[861],{"type":52,"value":712},{"type":52,"value":843},{"type":46,"tag":263,"props":864,"children":865},{},[866],{"type":52,"value":867},"where",{"type":52,"value":869},": a ",{"type":46,"tag":96,"props":871,"children":872},{},[873],{"type":52,"value":874},"lifted, dash-slugified label\u002Fslug",{"type":52,"value":876}," (e.g.\n",{"type":46,"tag":61,"props":878,"children":880},{"className":879},[],[881],{"type":52,"value":882},"-mnt-linuxdata-workspaces-...-dashboard-ui",{"type":52,"value":884},"), reliable at ~100% coverage. It is a ",{"type":46,"tag":96,"props":886,"children":887},{},[888],{"type":52,"value":889},"label,\nnot the literal working directory",{"type":52,"value":891},": the true directory lives in the event ",{"type":46,"tag":61,"props":893,"children":895},{"className":894},[],[896],{"type":52,"value":897},"data",{"type":52,"value":899}," payload as\n",{"type":46,"tag":61,"props":901,"children":903},{"className":902},[],[904],{"type":52,"value":905},"working_dir",{"type":52,"value":907},", and the ",{"type":46,"tag":96,"props":909,"children":910},{},[911,913],{"type":52,"value":912},"same ",{"type":46,"tag":61,"props":914,"children":916},{"className":915},[],[917],{"type":52,"value":905},{"type":52,"value":919}," (",{"type":46,"tag":61,"props":921,"children":923},{"className":922},[],[924],{"type":52,"value":925},"\u002Fhome\u002Fuser\u002Fproject",{"type":52,"value":927},") can map to ",{"type":46,"tag":96,"props":929,"children":930},{},[931],{"type":52,"value":932},"different",{"type":46,"tag":61,"props":934,"children":936},{"className":935},[],[937],{"type":52,"value":712},{"type":52,"value":939}," slugs (",{"type":46,"tag":61,"props":941,"children":943},{"className":942},[],[944],{"type":52,"value":945},"myproject",{"type":52,"value":246},{"type":46,"tag":61,"props":948,"children":950},{"className":949},[],[951],{"type":52,"value":952},"proj",{"type":52,"value":246},{"type":46,"tag":61,"props":955,"children":957},{"className":956},[],[958],{"type":52,"value":959},"multi",{"type":52,"value":961},"). Treat ",{"type":46,"tag":61,"props":963,"children":965},{"className":964},[],[966],{"type":52,"value":712},{"type":52,"value":968}," as the reliable scoping\nslug; treat ",{"type":46,"tag":61,"props":970,"children":972},{"className":971},[],[973],{"type":52,"value":905},{"type":52,"value":975}," as a ",{"type":46,"tag":96,"props":977,"children":978},{},[979],{"type":52,"value":980},"payload field, sparsely populated (~7% of sessions)",{"type":52,"value":982}," with no\ncanonical per-session source — read it via the APOC parse in Section 8, but do ",{"type":46,"tag":96,"props":984,"children":985},{},[986],{"type":52,"value":750},{"type":52,"value":988}," scope by\nit. The ",{"type":46,"tag":61,"props":990,"children":992},{"className":991},[],[993],{"type":52,"value":994},"\u002Fcypher",{"type":52,"value":996}," request's own ",{"type":46,"tag":61,"props":998,"children":1000},{"className":999},[],[1001],{"type":52,"value":712},{"type":52,"value":1003}," scope is a second, orthogonal server-side filter\nlayered on top.",{"type":46,"tag":55,"props":1005,"children":1006},{},[1007,1018],{"type":46,"tag":96,"props":1008,"children":1009},{},[1010,1012],{"type":52,"value":1011},"Always anchor scope on the first ",{"type":46,"tag":61,"props":1013,"children":1015},{"className":1014},[],[1016],{"type":52,"value":1017},"MATCH",{"type":52,"value":1019}," so the workspace index is used:",{"type":46,"tag":118,"props":1021,"children":1023},{"className":120,"code":1022,"language":122,"meta":123,"style":123},"\u002F\u002F CORRECT — workspace on the anchor node\nMATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(run:OrchestratorRun)\nRETURN run.orchestrator_name, run.started_at\n\n\u002F\u002F INCORRECT — workspace on a downstream node misses the index\nMATCH (s:Session {node_id: $session_id})\n      -[:HAS_EXECUTION]->(run:OrchestratorRun {workspace: $workspace})\nRETURN run.orchestrator_name, run.started_at\n",[1024],{"type":46,"tag":61,"props":1025,"children":1026},{"__ignoreMap":123},[1027,1035,1043,1051,1059,1069,1078,1087,1096],{"type":46,"tag":129,"props":1028,"children":1029},{"class":131,"line":132},[1030],{"type":46,"tag":129,"props":1031,"children":1032},{},[1033],{"type":52,"value":1034},"\u002F\u002F CORRECT — workspace on the anchor node\n",{"type":46,"tag":129,"props":1036,"children":1037},{"class":131,"line":141},[1038],{"type":46,"tag":129,"props":1039,"children":1040},{},[1041],{"type":52,"value":1042},"MATCH (s:Session {workspace: $workspace, node_id: $session_id})\n",{"type":46,"tag":129,"props":1044,"children":1045},{"class":131,"line":23},[1046],{"type":46,"tag":129,"props":1047,"children":1048},{},[1049],{"type":52,"value":1050},"      -[:HAS_EXECUTION]->(run:OrchestratorRun)\n",{"type":46,"tag":129,"props":1052,"children":1053},{"class":131,"line":27},[1054],{"type":46,"tag":129,"props":1055,"children":1056},{},[1057],{"type":52,"value":1058},"RETURN run.orchestrator_name, run.started_at\n",{"type":46,"tag":129,"props":1060,"children":1062},{"class":131,"line":1061},5,[1063],{"type":46,"tag":129,"props":1064,"children":1066},{"emptyLinePlaceholder":1065},true,[1067],{"type":52,"value":1068},"\n",{"type":46,"tag":129,"props":1070,"children":1072},{"class":131,"line":1071},6,[1073],{"type":46,"tag":129,"props":1074,"children":1075},{},[1076],{"type":52,"value":1077},"\u002F\u002F INCORRECT — workspace on a downstream node misses the index\n",{"type":46,"tag":129,"props":1079,"children":1081},{"class":131,"line":1080},7,[1082],{"type":46,"tag":129,"props":1083,"children":1084},{},[1085],{"type":52,"value":1086},"MATCH (s:Session {node_id: $session_id})\n",{"type":46,"tag":129,"props":1088,"children":1090},{"class":131,"line":1089},8,[1091],{"type":46,"tag":129,"props":1092,"children":1093},{},[1094],{"type":52,"value":1095},"      -[:HAS_EXECUTION]->(run:OrchestratorRun {workspace: $workspace})\n",{"type":46,"tag":129,"props":1097,"children":1099},{"class":131,"line":1098},9,[1100],{"type":46,"tag":129,"props":1101,"children":1102},{},[1103],{"type":52,"value":1058},{"type":46,"tag":55,"props":1105,"children":1106},{},[1107],{"type":52,"value":1108},"To discover which workspaces exist before scoping, aggregate across all of them\n(use sparingly — it skips the partition index):",{"type":46,"tag":118,"props":1110,"children":1112},{"className":120,"code":1111,"language":122,"meta":123,"style":123},"MATCH (s:Session)\nWHERE s.workspace \u003C> ''\nRETURN s.workspace, s.created_by, count(s) AS sessions\nORDER BY sessions DESC\nLIMIT 25\n",[1113],{"type":46,"tag":61,"props":1114,"children":1115},{"__ignoreMap":123},[1116,1124,1132,1140,1148],{"type":46,"tag":129,"props":1117,"children":1118},{"class":131,"line":132},[1119],{"type":46,"tag":129,"props":1120,"children":1121},{},[1122],{"type":52,"value":1123},"MATCH (s:Session)\n",{"type":46,"tag":129,"props":1125,"children":1126},{"class":131,"line":141},[1127],{"type":46,"tag":129,"props":1128,"children":1129},{},[1130],{"type":52,"value":1131},"WHERE s.workspace \u003C> ''\n",{"type":46,"tag":129,"props":1133,"children":1134},{"class":131,"line":23},[1135],{"type":46,"tag":129,"props":1136,"children":1137},{},[1138],{"type":52,"value":1139},"RETURN s.workspace, s.created_by, count(s) AS sessions\n",{"type":46,"tag":129,"props":1141,"children":1142},{"class":131,"line":27},[1143],{"type":46,"tag":129,"props":1144,"children":1145},{},[1146],{"type":52,"value":1147},"ORDER BY sessions DESC\n",{"type":46,"tag":129,"props":1149,"children":1150},{"class":131,"line":1061},[1151],{"type":46,"tag":129,"props":1152,"children":1153},{},[1154],{"type":52,"value":1155},"LIMIT 25\n",{"type":46,"tag":70,"props":1157,"children":1158},{},[],{"type":46,"tag":47,"props":1160,"children":1162},{"id":1161},"section-3-traps-where-the-shapes-lie-about-their-meaning",[1163],{"type":52,"value":1164},"Section 3 — Traps: Where the Shapes Lie About Their Meaning",{"type":46,"tag":55,"props":1166,"children":1167},{},[1168,1170,1175],{"type":52,"value":1169},"These are the highest-value items in this skill. Each is a place where reading the\nschema literally leads you to a ",{"type":46,"tag":96,"props":1171,"children":1172},{},[1173],{"type":52,"value":1174},"wrong answer that looks rigorous",{"type":52,"value":1176},". The server will\nhappily hand you the misleading shape; only domain knowledge corrects it.",{"type":46,"tag":448,"props":1178,"children":1180},{"id":1179},"trap-1-delegation-lineage-use-forked-sessionparent_id-not-the-edge-walk",[1181,1183,1189,1191,1197],{"type":52,"value":1182},"Trap 1 — Delegation lineage: use ",{"type":46,"tag":61,"props":1184,"children":1186},{"className":1185},[],[1187],{"type":52,"value":1188},"FORKED",{"type":52,"value":1190}," + ",{"type":46,"tag":61,"props":1192,"children":1194},{"className":1193},[],[1195],{"type":52,"value":1196},"Session.parent_id",{"type":52,"value":1198},", not the edge walk",{"type":46,"tag":55,"props":1200,"children":1201},{},[1202,1204,1214,1216,1224,1226,1231],{"type":52,"value":1203},"The true delegation\u002Ffork lineage is carried by the ",{"type":46,"tag":96,"props":1205,"children":1206},{},[1207,1212],{"type":46,"tag":61,"props":1208,"children":1210},{"className":1209},[],[1211],{"type":52,"value":1188},{"type":52,"value":1213}," edge",{"type":52,"value":1215}," together with\n",{"type":46,"tag":96,"props":1217,"children":1218},{},[1219],{"type":46,"tag":61,"props":1220,"children":1222},{"className":1221},[],[1223],{"type":52,"value":1196},{"type":52,"value":1225},". This is the authoritative source for delegation depth and\nancestry. Verified live: the fork lineage reaches ",{"type":46,"tag":96,"props":1227,"children":1228},{},[1229],{"type":52,"value":1230},"max depth 3",{"type":52,"value":686},{"type":46,"tag":118,"props":1233,"children":1235},{"className":120,"code":1234,"language":122,"meta":123,"style":123},"\u002F\u002F Authoritative lineage depth via the FORKED edge.\n\u002F\u002F Bound the path (never bare `*` — Section 7): *1..20 is generous headroom over the\n\u002F\u002F observed max depth of 3, and the RETURN is aggregate-only (no rows materialized).\nMATCH path = (root:Session {workspace: $workspace})-[:FORKED*1..20]->(leaf:Session)\nWHERE root.parent_id IS NULL\nRETURN max(length(path)) AS max_fork_depth, count(path) AS lineages\n",[1236],{"type":46,"tag":61,"props":1237,"children":1238},{"__ignoreMap":123},[1239,1247,1255,1263,1271,1279],{"type":46,"tag":129,"props":1240,"children":1241},{"class":131,"line":132},[1242],{"type":46,"tag":129,"props":1243,"children":1244},{},[1245],{"type":52,"value":1246},"\u002F\u002F Authoritative lineage depth via the FORKED edge.\n",{"type":46,"tag":129,"props":1248,"children":1249},{"class":131,"line":141},[1250],{"type":46,"tag":129,"props":1251,"children":1252},{},[1253],{"type":52,"value":1254},"\u002F\u002F Bound the path (never bare `*` — Section 7): *1..20 is generous headroom over the\n",{"type":46,"tag":129,"props":1256,"children":1257},{"class":131,"line":23},[1258],{"type":46,"tag":129,"props":1259,"children":1260},{},[1261],{"type":52,"value":1262},"\u002F\u002F observed max depth of 3, and the RETURN is aggregate-only (no rows materialized).\n",{"type":46,"tag":129,"props":1264,"children":1265},{"class":131,"line":27},[1266],{"type":46,"tag":129,"props":1267,"children":1268},{},[1269],{"type":52,"value":1270},"MATCH path = (root:Session {workspace: $workspace})-[:FORKED*1..20]->(leaf:Session)\n",{"type":46,"tag":129,"props":1272,"children":1273},{"class":131,"line":1061},[1274],{"type":46,"tag":129,"props":1275,"children":1276},{},[1277],{"type":52,"value":1278},"WHERE root.parent_id IS NULL\n",{"type":46,"tag":129,"props":1280,"children":1281},{"class":131,"line":1071},[1282],{"type":46,"tag":129,"props":1283,"children":1284},{},[1285],{"type":52,"value":1286},"RETURN max(length(path)) AS max_fork_depth, count(path) AS lineages\n",{"type":46,"tag":55,"props":1288,"children":1289},{},[1290,1295],{"type":46,"tag":61,"props":1291,"children":1293},{"className":1292},[],[1294],{"type":52,"value":1196},{"type":52,"value":1296}," lets you reconstruct the same chain by property when an edge walk\nis inconvenient (each child names its parent):",{"type":46,"tag":118,"props":1298,"children":1300},{"className":120,"code":1299,"language":122,"meta":123,"style":123},"MATCH (child:Session {workspace: $workspace})\nWHERE child.parent_id IS NOT NULL\nRETURN child.node_id, child.parent_id\nORDER BY child.node_id LIMIT 200   \u002F\u002F bounded (Section 7); anchor on a node_id to walk one specific chain\n",[1301],{"type":46,"tag":61,"props":1302,"children":1303},{"__ignoreMap":123},[1304,1312,1320,1328],{"type":46,"tag":129,"props":1305,"children":1306},{"class":131,"line":132},[1307],{"type":46,"tag":129,"props":1308,"children":1309},{},[1310],{"type":52,"value":1311},"MATCH (child:Session {workspace: $workspace})\n",{"type":46,"tag":129,"props":1313,"children":1314},{"class":131,"line":141},[1315],{"type":46,"tag":129,"props":1316,"children":1317},{},[1318],{"type":52,"value":1319},"WHERE child.parent_id IS NOT NULL\n",{"type":46,"tag":129,"props":1321,"children":1322},{"class":131,"line":23},[1323],{"type":46,"tag":129,"props":1324,"children":1325},{},[1326],{"type":52,"value":1327},"RETURN child.node_id, child.parent_id\n",{"type":46,"tag":129,"props":1329,"children":1330},{"class":131,"line":27},[1331],{"type":46,"tag":129,"props":1332,"children":1333},{},[1334],{"type":52,"value":1335},"ORDER BY child.node_id LIMIT 200   \u002F\u002F bounded (Section 7); anchor on a node_id to walk one specific chain\n",{"type":46,"tag":55,"props":1337,"children":1338},{},[1339],{"type":46,"tag":96,"props":1340,"children":1341},{},[1342],{"type":52,"value":1343},"Two known undercounts — do NOT trust either for depth:",{"type":46,"tag":217,"props":1345,"children":1346},{},[1347,1377],{"type":46,"tag":221,"props":1348,"children":1349},{},[1350,1361,1363,1369,1371,1375],{"type":46,"tag":96,"props":1351,"children":1352},{},[1353,1359],{"type":46,"tag":61,"props":1354,"children":1356},{"className":1355},[],[1357],{"type":52,"value":1358},"HAS_SUBSESSION",{"type":52,"value":1360}," is a single hop only.",{"type":52,"value":1362}," It materializes only the immediate\nparent→child link; each sub-session is ingested as its own root, so a multi-hop walk\n",{"type":46,"tag":61,"props":1364,"children":1366},{"className":1365},[],[1367],{"type":52,"value":1368},"(:Session)-[:HAS_SUBSESSION*]->()",{"type":52,"value":1370}," collapses to depth 1. It is a one-level lookup,\n",{"type":46,"tag":96,"props":1372,"children":1373},{},[1374],{"type":52,"value":750},{"type":52,"value":1376}," the delegation tree.",{"type":46,"tag":221,"props":1378,"children":1379},{},[1380,1399,1401,1406,1408,1413,1415,1420,1422,1428],{"type":46,"tag":96,"props":1381,"children":1382},{},[1383,1384,1389,1391,1397],{"type":52,"value":706},{"type":46,"tag":61,"props":1385,"children":1387},{"className":1386},[],[1388],{"type":52,"value":383},{"type":52,"value":1390}," property-join (",{"type":46,"tag":61,"props":1392,"children":1394},{"className":1393},[],[1395],{"type":52,"value":1396},"sub_session_id → parent_session_id",{"type":52,"value":1398},") undercounts\nbeyond hop 1.",{"type":52,"value":1400}," It is more complete than the ",{"type":46,"tag":61,"props":1402,"children":1404},{"className":1403},[],[1405],{"type":52,"value":1358},{"type":52,"value":1407}," walk (it finds a second\nhop), which is exactly why it is dangerous: it ",{"type":46,"tag":263,"props":1409,"children":1410},{},[1411],{"type":52,"value":1412},"looks",{"type":52,"value":1414}," like the answer and reports\ndepth 2, but it still misses the deeper lineage that ",{"type":46,"tag":61,"props":1416,"children":1418},{"className":1417},[],[1419],{"type":52,"value":1188},{"type":52,"value":1421},"\u002F",{"type":46,"tag":61,"props":1423,"children":1425},{"className":1424},[],[1426],{"type":52,"value":1427},"parent_id",{"type":52,"value":1429}," reveals.\nUse it to enumerate individual delegations, not to measure tree depth.",{"type":46,"tag":448,"props":1431,"children":1433},{"id":1432},"trap-2-context_depth-context_scope-are-inheritance-modes-not-tree-depth",[1434,1436,1442,1444,1450],{"type":52,"value":1435},"Trap 2 — ",{"type":46,"tag":61,"props":1437,"children":1439},{"className":1438},[],[1440],{"type":52,"value":1441},"context_depth",{"type":52,"value":1443}," \u002F ",{"type":46,"tag":61,"props":1445,"children":1447},{"className":1446},[],[1448],{"type":52,"value":1449},"context_scope",{"type":52,"value":1451}," are inheritance modes, NOT tree depth",{"type":46,"tag":55,"props":1453,"children":1454},{},[1455,1456,1461,1463,1468,1470,1475,1477,1482,1484,1490,1491,1497,1498,1504,1506,1511,1513,1518,1519,1524,1525,1530],{"type":52,"value":523},{"type":46,"tag":61,"props":1457,"children":1459},{"className":1458},[],[1460],{"type":52,"value":383},{"type":52,"value":1462}," nodes, ",{"type":46,"tag":61,"props":1464,"children":1466},{"className":1465},[],[1467],{"type":52,"value":1441},{"type":52,"value":1469}," and ",{"type":46,"tag":61,"props":1471,"children":1473},{"className":1472},[],[1474],{"type":52,"value":1449},{"type":52,"value":1476}," describe ",{"type":46,"tag":96,"props":1478,"children":1479},{},[1480],{"type":52,"value":1481},"how much parent\ncontext a delegation inherited",{"type":52,"value":1483}," — an inheritance mode with values like ",{"type":46,"tag":61,"props":1485,"children":1487},{"className":1486},[],[1488],{"type":52,"value":1489},"none",{"type":52,"value":303},{"type":46,"tag":61,"props":1492,"children":1494},{"className":1493},[],[1495],{"type":52,"value":1496},"recent",{"type":52,"value":246},{"type":46,"tag":61,"props":1499,"children":1501},{"className":1500},[],[1502],{"type":52,"value":1503},"all",{"type":52,"value":1505},". The name invites reading it as nesting\u002Ftree depth. It is not.\nSelf-delegations are almost always ",{"type":46,"tag":61,"props":1507,"children":1509},{"className":1508},[],[1510],{"type":52,"value":1489},{"type":52,"value":1512},"; regular delegations spread across\n",{"type":46,"tag":61,"props":1514,"children":1516},{"className":1515},[],[1517],{"type":52,"value":1489},{"type":52,"value":1443},{"type":46,"tag":61,"props":1520,"children":1522},{"className":1521},[],[1523],{"type":52,"value":1496},{"type":52,"value":1443},{"type":46,"tag":61,"props":1526,"children":1528},{"className":1527},[],[1529],{"type":52,"value":1503},{"type":52,"value":686},{"type":46,"tag":448,"props":1532,"children":1534},{"id":1533},"trap-3-tool-data-lives-on-toolcall-not-toolexecution",[1535,1537,1542,1544],{"type":52,"value":1536},"Trap 3 — Tool data lives on ",{"type":46,"tag":61,"props":1538,"children":1540},{"className":1539},[],[1541],{"type":52,"value":330},{"type":52,"value":1543},", not ",{"type":46,"tag":61,"props":1545,"children":1547},{"className":1546},[],[1548],{"type":52,"value":1549},"ToolExecution",{"type":46,"tag":55,"props":1551,"children":1552},{},[1553,1559,1561,1567,1568,1574,1575,1581,1582,1588,1589,1595,1596,1602,1603,1609,1610,1616,1617,1622,1624,1629,1631,1636,1637,1642,1644,1649],{"type":46,"tag":61,"props":1554,"children":1556},{"className":1555},[],[1557],{"type":52,"value":1558},":ToolCall",{"type":52,"value":1560}," carries the tool data you want: ",{"type":46,"tag":61,"props":1562,"children":1564},{"className":1563},[],[1565],{"type":52,"value":1566},"tool_name",{"type":52,"value":246},{"type":46,"tag":61,"props":1569,"children":1571},{"className":1570},[],[1572],{"type":52,"value":1573},"tool_input",{"type":52,"value":246},{"type":46,"tag":61,"props":1576,"children":1578},{"className":1577},[],[1579],{"type":52,"value":1580},"started_at",{"type":52,"value":303},{"type":46,"tag":61,"props":1583,"children":1585},{"className":1584},[],[1586],{"type":52,"value":1587},"ended_at",{"type":52,"value":246},{"type":46,"tag":61,"props":1590,"children":1592},{"className":1591},[],[1593],{"type":52,"value":1594},"result_success",{"type":52,"value":246},{"type":46,"tag":61,"props":1597,"children":1599},{"className":1598},[],[1600],{"type":52,"value":1601},"result_error",{"type":52,"value":246},{"type":46,"tag":61,"props":1604,"children":1606},{"className":1605},[],[1607],{"type":52,"value":1608},"result_output",{"type":52,"value":269},{"type":46,"tag":61,"props":1611,"children":1613},{"className":1612},[],[1614],{"type":52,"value":1615},":ToolExecution",{"type":52,"value":495},{"type":46,"tag":96,"props":1618,"children":1619},{},[1620],{"type":52,"value":1621},"property-less — a dead end",{"type":52,"value":1623},"; do not route tool queries through it. ",{"type":46,"tag":61,"props":1625,"children":1627},{"className":1626},[],[1628],{"type":52,"value":330},{"type":52,"value":1630}," is the\ncorrect, simple source (verified: ",{"type":46,"tag":61,"props":1632,"children":1634},{"className":1633},[],[1635],{"type":52,"value":1566},{"type":52,"value":1469},{"type":46,"tag":61,"props":1638,"children":1640},{"className":1639},[],[1641],{"type":52,"value":1580},{"type":52,"value":1643}," populated on 100% of\n",{"type":46,"tag":61,"props":1645,"children":1647},{"className":1646},[],[1648],{"type":52,"value":330},{"type":52,"value":1650}," nodes in a real workspace).",{"type":46,"tag":118,"props":1652,"children":1654},{"className":120,"code":1653,"language":122,"meta":123,"style":123},"MATCH (t:ToolCall {workspace: $workspace})\nRETURN t.tool_name AS tool, count(*) AS n\nORDER BY n DESC LIMIT 12\n",[1655],{"type":46,"tag":61,"props":1656,"children":1657},{"__ignoreMap":123},[1658,1666,1674],{"type":46,"tag":129,"props":1659,"children":1660},{"class":131,"line":132},[1661],{"type":46,"tag":129,"props":1662,"children":1663},{},[1664],{"type":52,"value":1665},"MATCH (t:ToolCall {workspace: $workspace})\n",{"type":46,"tag":129,"props":1667,"children":1668},{"class":131,"line":141},[1669],{"type":46,"tag":129,"props":1670,"children":1671},{},[1672],{"type":52,"value":1673},"RETURN t.tool_name AS tool, count(*) AS n\n",{"type":46,"tag":129,"props":1675,"children":1676},{"class":131,"line":23},[1677],{"type":46,"tag":129,"props":1678,"children":1679},{},[1680],{"type":52,"value":1681},"ORDER BY n DESC LIMIT 12\n",{"type":46,"tag":448,"props":1683,"children":1685},{"id":1684},"trap-4-self-is-a-self-delegation-marker-never-a-real-agent",[1686,1688,1694],{"type":52,"value":1687},"Trap 4 — ",{"type":46,"tag":61,"props":1689,"children":1691},{"className":1690},[],[1692],{"type":52,"value":1693},"self",{"type":52,"value":1695}," is a self-delegation marker, never a real agent",{"type":46,"tag":55,"props":1697,"children":1698},{},[1699,1701,1710,1712,1718,1720,1725],{"type":52,"value":1700},"Self-delegation is recorded explicitly as ",{"type":46,"tag":96,"props":1702,"children":1703},{},[1704],{"type":46,"tag":61,"props":1705,"children":1707},{"className":1706},[],[1708],{"type":52,"value":1709},"Delegation.is_self_delegation = true",{"type":52,"value":1711},"\n(equivalently the child ",{"type":46,"tag":61,"props":1713,"children":1715},{"className":1714},[],[1716],{"type":52,"value":1717},"Session.agent = 'self'",{"type":52,"value":1719},"). Never infer it by string-matching\n",{"type":46,"tag":61,"props":1721,"children":1723},{"className":1722},[],[1724],{"type":52,"value":1573},{"type":52,"value":1726}," or comparing names.",{"type":46,"tag":55,"props":1728,"children":1729},{},[1730,1741,1743,1748,1750,1755,1757,1762,1764,1770,1772,1777,1778,1784,1786,1791,1793,1798],{"type":46,"tag":96,"props":1731,"children":1732},{},[1733,1739],{"type":46,"tag":61,"props":1734,"children":1736},{"className":1735},[],[1737],{"type":52,"value":1738},"'self'",{"type":52,"value":1740}," is a marker, not an identity",{"type":52,"value":1742}," — it means \"this session spawned a fresh\nsub-context of ",{"type":46,"tag":263,"props":1744,"children":1745},{},[1746],{"type":52,"value":1747},"itself",{"type":52,"value":1749},",\" so ",{"type":46,"tag":61,"props":1751,"children":1753},{"className":1752},[],[1754],{"type":52,"value":1693},{"type":52,"value":1756}," is never the real actor. Before any per-agent stat\n(centrality, counts, durations), ",{"type":46,"tag":96,"props":1758,"children":1759},{},[1760],{"type":52,"value":1761},"resolve it up the fork chain",{"type":52,"value":1763}," to the nearest ancestor\nwhose ",{"type":46,"tag":61,"props":1765,"children":1767},{"className":1766},[],[1768],{"type":52,"value":1769},"agent \u003C> 'self'",{"type":52,"value":1771},". That actor is often the ",{"type":46,"tag":96,"props":1773,"children":1774},{},[1775],{"type":52,"value":1776},"root\u002Fmain session",{"type":52,"value":919},{"type":46,"tag":61,"props":1779,"children":1781},{"className":1780},[],[1782],{"type":52,"value":1783},"agent IS NULL",{"type":52,"value":1785}," —\nthe user's top-level session, not a named sub-agent); occasionally a named agent that\nself-delegated. Empirically the chain is a single hop (no ",{"type":46,"tag":61,"props":1787,"children":1789},{"className":1788},[],[1790],{"type":52,"value":1693},{"type":52,"value":1792},"→",{"type":46,"tag":61,"props":1794,"children":1796},{"className":1795},[],[1797],{"type":52,"value":1693},{"type":52,"value":1799},"→…).",{"type":46,"tag":118,"props":1801,"children":1803},{"className":120,"code":1802,"language":122,"meta":123,"style":123},"\u002F\u002F Resolve every self-session to the actor that actually spawned it\nMATCH (s:Session {workspace: $workspace, agent: 'self'})\nOPTIONAL MATCH pth = (anc:Session)-[:FORKED*1..20]->(s)\nWHERE anc.agent IS NULL OR anc.agent \u003C> 'self'\nWITH s, anc, pth ORDER BY length(pth) ASC\nWITH s, head(collect(coalesce(anc.agent, 'root\u002Fmain session'))) AS actor\nRETURN coalesce(actor, 'unresolved') AS real_actor, count(*) AS self_delegations\nORDER BY self_delegations DESC\n",[1804],{"type":46,"tag":61,"props":1805,"children":1806},{"__ignoreMap":123},[1807,1815,1823,1831,1839,1847,1855,1863],{"type":46,"tag":129,"props":1808,"children":1809},{"class":131,"line":132},[1810],{"type":46,"tag":129,"props":1811,"children":1812},{},[1813],{"type":52,"value":1814},"\u002F\u002F Resolve every self-session to the actor that actually spawned it\n",{"type":46,"tag":129,"props":1816,"children":1817},{"class":131,"line":141},[1818],{"type":46,"tag":129,"props":1819,"children":1820},{},[1821],{"type":52,"value":1822},"MATCH (s:Session {workspace: $workspace, agent: 'self'})\n",{"type":46,"tag":129,"props":1824,"children":1825},{"class":131,"line":23},[1826],{"type":46,"tag":129,"props":1827,"children":1828},{},[1829],{"type":52,"value":1830},"OPTIONAL MATCH pth = (anc:Session)-[:FORKED*1..20]->(s)\n",{"type":46,"tag":129,"props":1832,"children":1833},{"class":131,"line":27},[1834],{"type":46,"tag":129,"props":1835,"children":1836},{},[1837],{"type":52,"value":1838},"WHERE anc.agent IS NULL OR anc.agent \u003C> 'self'\n",{"type":46,"tag":129,"props":1840,"children":1841},{"class":131,"line":1061},[1842],{"type":46,"tag":129,"props":1843,"children":1844},{},[1845],{"type":52,"value":1846},"WITH s, anc, pth ORDER BY length(pth) ASC\n",{"type":46,"tag":129,"props":1848,"children":1849},{"class":131,"line":1071},[1850],{"type":46,"tag":129,"props":1851,"children":1852},{},[1853],{"type":52,"value":1854},"WITH s, head(collect(coalesce(anc.agent, 'root\u002Fmain session'))) AS actor\n",{"type":46,"tag":129,"props":1856,"children":1857},{"class":131,"line":1080},[1858],{"type":46,"tag":129,"props":1859,"children":1860},{},[1861],{"type":52,"value":1862},"RETURN coalesce(actor, 'unresolved') AS real_actor, count(*) AS self_delegations\n",{"type":46,"tag":129,"props":1864,"children":1865},{"class":131,"line":1089},[1866],{"type":46,"tag":129,"props":1867,"children":1868},{},[1869],{"type":52,"value":1870},"ORDER BY self_delegations DESC\n",{"type":46,"tag":55,"props":1872,"children":1873},{},[1874,1876,1881,1883,1888,1890,1895,1897,1902],{"type":52,"value":1875},"Self-delegation is itself a ",{"type":46,"tag":96,"props":1877,"children":1878},{},[1879],{"type":52,"value":1880},"first-class signal",{"type":52,"value":1882}," (an actor extending its own context —\ncontinuation \u002F context management): count it ",{"type":46,"tag":263,"props":1884,"children":1885},{},[1886],{"type":52,"value":1887},"as",{"type":52,"value":1889}," self-delegation when that is the\nquestion, and ",{"type":46,"tag":263,"props":1891,"children":1892},{},[1893],{"type":52,"value":1894},"resolve",{"type":52,"value":1896}," it when you need the real actor. A raw ",{"type":46,"tag":61,"props":1898,"children":1900},{"className":1899},[],[1901],{"type":52,"value":1693},{"type":52,"value":1903}," bucket in a\nper-agent aggregate is a bug — it attributes real work to a non-existent agent.",{"type":46,"tag":55,"props":1905,"children":1906},{},[1907,1912,1914,1919,1921,1933,1935,1940,1941,1946,1948,1953,1954,1958],{"type":46,"tag":96,"props":1908,"children":1909},{},[1910],{"type":52,"value":1911},"Report the resolved breakdown as an explicit finding — do not bury it in a blended\nstat.",{"type":52,"value":1913}," The resolve-self join above only pays off if its result reaches the answer as\nits ",{"type":46,"tag":263,"props":1915,"children":1916},{},[1917],{"type":52,"value":1918},"own stated fact",{"type":52,"value":1920},". For any agent-level or self-delegation question, ",{"type":46,"tag":96,"props":1922,"children":1923},{},[1924,1926,1931],{"type":52,"value":1925},"lead with the\nresolved ",{"type":46,"tag":61,"props":1927,"children":1929},{"className":1928},[],[1930],{"type":52,"value":1693},{"type":52,"value":1932},"→actor split as a standalone sentence",{"type":52,"value":1934}," — how many, and what percent, of\nself-delegations resolve to the ",{"type":46,"tag":96,"props":1936,"children":1937},{},[1938],{"type":52,"value":1939},"root\u002Fmain session continuing itself",{"type":52,"value":919},{"type":46,"tag":61,"props":1942,"children":1944},{"className":1943},[],[1945],{"type":52,"value":1783},{"type":52,"value":1947},")\nversus to ",{"type":46,"tag":96,"props":1949,"children":1950},{},[1951],{"type":52,"value":1952},"named agents",{"type":52,"value":843},{"type":46,"tag":263,"props":1955,"children":1956},{},[1957],{"type":52,"value":607},{"type":52,"value":1959}," any roll-up or combined figure. Computing the\nnumber correctly but folding it into a mixed \"X% of all delegations are root-launched\"\nstatistic hides the very fact the question asked for. This is a general output-shape\nprinciple: surface the load-bearing breakdown first, then add supporting context — state\nit, don't just compute it.",{"type":46,"tag":118,"props":1961,"children":1963},{"className":120,"code":1962,"language":122,"meta":123,"style":123},"\u002F\u002F The plain self-delegation split (the signal itself)\nMATCH (d:Delegation {workspace: $workspace})\nRETURN d.is_self_delegation AS self_delegation, count(*) AS n\nORDER BY n DESC\n",[1964],{"type":46,"tag":61,"props":1965,"children":1966},{"__ignoreMap":123},[1967,1975,1983,1991],{"type":46,"tag":129,"props":1968,"children":1969},{"class":131,"line":132},[1970],{"type":46,"tag":129,"props":1971,"children":1972},{},[1973],{"type":52,"value":1974},"\u002F\u002F The plain self-delegation split (the signal itself)\n",{"type":46,"tag":129,"props":1976,"children":1977},{"class":131,"line":141},[1978],{"type":46,"tag":129,"props":1979,"children":1980},{},[1981],{"type":52,"value":1982},"MATCH (d:Delegation {workspace: $workspace})\n",{"type":46,"tag":129,"props":1984,"children":1985},{"class":131,"line":23},[1986],{"type":46,"tag":129,"props":1987,"children":1988},{},[1989],{"type":52,"value":1990},"RETURN d.is_self_delegation AS self_delegation, count(*) AS n\n",{"type":46,"tag":129,"props":1992,"children":1993},{"class":131,"line":27},[1994],{"type":46,"tag":129,"props":1995,"children":1996},{},[1997],{"type":52,"value":1998},"ORDER BY n DESC\n",{"type":46,"tag":448,"props":2000,"children":2002},{"id":2001},"trap-5-timestamps-are-zoned-datetime-durations-are-computed",[2003],{"type":52,"value":2004},"Trap 5 — Timestamps are ZONED DATETIME; durations are computed",{"type":46,"tag":55,"props":2006,"children":2007},{},[2008,2010,2016,2018,2023,2024,2029,2030,2036,2038,2044,2046,2051,2052,2058,2059,2064,2065,2070,2072,2081],{"type":52,"value":2009},"Every ",{"type":46,"tag":61,"props":2011,"children":2013},{"className":2012},[],[2014],{"type":52,"value":2015},"*_at",{"type":52,"value":2017}," property (",{"type":46,"tag":61,"props":2019,"children":2021},{"className":2020},[],[2022],{"type":52,"value":1580},{"type":52,"value":246},{"type":46,"tag":61,"props":2025,"children":2027},{"className":2026},[],[2028],{"type":52,"value":1587},{"type":52,"value":246},{"type":46,"tag":61,"props":2031,"children":2033},{"className":2032},[],[2034],{"type":52,"value":2035},"occurred_at",{"type":52,"value":2037},", …) and ",{"type":46,"tag":61,"props":2039,"children":2041},{"className":2040},[],[2042],{"type":52,"value":2043},"last_updated",{"type":52,"value":2045},"\n— on nodes and on the edges that carry ",{"type":46,"tag":61,"props":2047,"children":2049},{"className":2048},[],[2050],{"type":52,"value":2035},{"type":52,"value":919},{"type":46,"tag":61,"props":2053,"children":2055},{"className":2054},[],[2056],{"type":52,"value":2057},"HAS_EVENT",{"type":52,"value":246},{"type":46,"tag":61,"props":2060,"children":2062},{"className":2061},[],[2063],{"type":52,"value":1358},{"type":52,"value":303},{"type":46,"tag":61,"props":2066,"children":2068},{"className":2067},[],[2069],{"type":52,"value":1188},{"type":52,"value":2071},") — is stored as a native Neo4j ",{"type":46,"tag":96,"props":2073,"children":2074},{},[2075],{"type":46,"tag":61,"props":2076,"children":2078},{"className":2077},[],[2079],{"type":52,"value":2080},"ZONED DATETIME",{"type":52,"value":2082},", not a string.",{"type":46,"tag":217,"props":2084,"children":2085},{},[2086,2099,2119],{"type":46,"tag":221,"props":2087,"children":2088},{},[2089,2091,2097],{"type":52,"value":2090},"❌ ",{"type":46,"tag":61,"props":2092,"children":2094},{"className":2093},[],[2095],{"type":52,"value":2096},"WHERE s.started_at > '2026-05-01'",{"type":52,"value":2098}," — comparing to a string literal silently\nreturns nothing (no error raised).",{"type":46,"tag":221,"props":2100,"children":2101},{},[2102,2104,2110,2112,2118],{"type":52,"value":2103},"✅ ",{"type":46,"tag":61,"props":2105,"children":2107},{"className":2106},[],[2108],{"type":52,"value":2109},"WHERE s.started_at > datetime('2026-05-01')",{"type":52,"value":2111}," — wrap every literal in ",{"type":46,"tag":61,"props":2113,"children":2115},{"className":2114},[],[2116],{"type":52,"value":2117},"datetime()",{"type":52,"value":686},{"type":46,"tag":221,"props":2120,"children":2121},{},[2122,2124,2130],{"type":52,"value":2123},"✅ Rolling windows: ",{"type":46,"tag":61,"props":2125,"children":2127},{"className":2126},[],[2128],{"type":52,"value":2129},"WHERE s.started_at > datetime() - duration('P30D')",{"type":52,"value":686},{"type":46,"tag":55,"props":2132,"children":2133},{},[2134,2139,2140,2146],{"type":46,"tag":96,"props":2135,"children":2136},{},[2137],{"type":52,"value":2138},"Durations are not stored — compute them",{"type":52,"value":662},{"type":46,"tag":61,"props":2141,"children":2143},{"className":2142},[],[2144],{"type":52,"value":2145},"duration.between()",{"type":52,"value":2147},":",{"type":46,"tag":118,"props":2149,"children":2151},{"className":120,"code":2150,"language":122,"meta":123,"style":123},"MATCH (t:ToolCall {workspace: $workspace})\nWHERE t.started_at IS NOT NULL AND t.ended_at IS NOT NULL\nWITH t, duration.between(t.started_at, t.ended_at) AS d\nRETURN t.tool_name AS tool, d.seconds AS secs\nORDER BY secs DESC LIMIT 8\n",[2152],{"type":46,"tag":61,"props":2153,"children":2154},{"__ignoreMap":123},[2155,2162,2170,2178,2186],{"type":46,"tag":129,"props":2156,"children":2157},{"class":131,"line":132},[2158],{"type":46,"tag":129,"props":2159,"children":2160},{},[2161],{"type":52,"value":1665},{"type":46,"tag":129,"props":2163,"children":2164},{"class":131,"line":141},[2165],{"type":46,"tag":129,"props":2166,"children":2167},{},[2168],{"type":52,"value":2169},"WHERE t.started_at IS NOT NULL AND t.ended_at IS NOT NULL\n",{"type":46,"tag":129,"props":2171,"children":2172},{"class":131,"line":23},[2173],{"type":46,"tag":129,"props":2174,"children":2175},{},[2176],{"type":52,"value":2177},"WITH t, duration.between(t.started_at, t.ended_at) AS d\n",{"type":46,"tag":129,"props":2179,"children":2180},{"class":131,"line":27},[2181],{"type":46,"tag":129,"props":2182,"children":2183},{},[2184],{"type":52,"value":2185},"RETURN t.tool_name AS tool, d.seconds AS secs\n",{"type":46,"tag":129,"props":2187,"children":2188},{"class":131,"line":1061},[2189],{"type":46,"tag":129,"props":2190,"children":2191},{},[2192],{"type":52,"value":2193},"ORDER BY secs DESC LIMIT 8\n",{"type":46,"tag":70,"props":2195,"children":2196},{},[],{"type":46,"tag":47,"props":2198,"children":2200},{"id":2199},"section-4-cross-layer-joins-sourced_from",[2201],{"type":52,"value":2202},"Section 4 — Cross-Layer Joins (SOURCED_FROM)",{"type":46,"tag":55,"props":2204,"children":2205},{},[2206,2208,2216,2218,2223],{"type":52,"value":2207},"Data layer 1 (raw events) and data layer 2 (semantic entities) coexist in one graph.\nThe canonical bridge is the ",{"type":46,"tag":96,"props":2209,"children":2210},{},[2211],{"type":46,"tag":61,"props":2212,"children":2214},{"className":2213},[],[2215],{"type":52,"value":436},{"type":52,"value":2217}," edge: every layer-2 entity points to the\nlayer-1 event(s) that produced it. Use layer 1 for exact raw fields\u002Ftimeline; use\nlayer 2 for structure, scale, and causation; move between them with ",{"type":46,"tag":61,"props":2219,"children":2221},{"className":2220},[],[2222],{"type":52,"value":436},{"type":52,"value":686},{"type":46,"tag":118,"props":2225,"children":2227},{"className":120,"code":2226,"language":122,"meta":123,"style":123},"\u002F\u002F Semantic ToolCall → its originating raw event (canonical)\nMATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(:OrchestratorRun)\n      -[:HAS_PART]->(iter:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)\nMATCH (tc)-[:SOURCED_FROM]->(pre:ToolPreEvent)\nRETURN iter.iteration_number AS iteration,\n       tc.tool_name          AS tool,\n       tc.result_success     AS succeeded,\n       pre.occurred_at       AS event_fired_at\nORDER BY pre.occurred_at\nLIMIT 25\n",[2228],{"type":46,"tag":61,"props":2229,"children":2230},{"__ignoreMap":123},[2231,2239,2246,2254,2262,2270,2278,2286,2294,2302,2311,2320],{"type":46,"tag":129,"props":2232,"children":2233},{"class":131,"line":132},[2234],{"type":46,"tag":129,"props":2235,"children":2236},{},[2237],{"type":52,"value":2238},"\u002F\u002F Semantic ToolCall → its originating raw event (canonical)\n",{"type":46,"tag":129,"props":2240,"children":2241},{"class":131,"line":141},[2242],{"type":46,"tag":129,"props":2243,"children":2244},{},[2245],{"type":52,"value":1042},{"type":46,"tag":129,"props":2247,"children":2248},{"class":131,"line":23},[2249],{"type":46,"tag":129,"props":2250,"children":2251},{},[2252],{"type":52,"value":2253},"      -[:HAS_EXECUTION]->(:OrchestratorRun)\n",{"type":46,"tag":129,"props":2255,"children":2256},{"class":131,"line":27},[2257],{"type":46,"tag":129,"props":2258,"children":2259},{},[2260],{"type":52,"value":2261},"      -[:HAS_PART]->(iter:Iteration)\n",{"type":46,"tag":129,"props":2263,"children":2264},{"class":131,"line":1061},[2265],{"type":46,"tag":129,"props":2266,"children":2267},{},[2268],{"type":52,"value":2269},"      -[:HAS_TOOL_CALL]->(tc:ToolCall)\n",{"type":46,"tag":129,"props":2271,"children":2272},{"class":131,"line":1071},[2273],{"type":46,"tag":129,"props":2274,"children":2275},{},[2276],{"type":52,"value":2277},"MATCH (tc)-[:SOURCED_FROM]->(pre:ToolPreEvent)\n",{"type":46,"tag":129,"props":2279,"children":2280},{"class":131,"line":1080},[2281],{"type":46,"tag":129,"props":2282,"children":2283},{},[2284],{"type":52,"value":2285},"RETURN iter.iteration_number AS iteration,\n",{"type":46,"tag":129,"props":2287,"children":2288},{"class":131,"line":1089},[2289],{"type":46,"tag":129,"props":2290,"children":2291},{},[2292],{"type":52,"value":2293},"       tc.tool_name          AS tool,\n",{"type":46,"tag":129,"props":2295,"children":2296},{"class":131,"line":1098},[2297],{"type":46,"tag":129,"props":2298,"children":2299},{},[2300],{"type":52,"value":2301},"       tc.result_success     AS succeeded,\n",{"type":46,"tag":129,"props":2303,"children":2305},{"class":131,"line":2304},10,[2306],{"type":46,"tag":129,"props":2307,"children":2308},{},[2309],{"type":52,"value":2310},"       pre.occurred_at       AS event_fired_at\n",{"type":46,"tag":129,"props":2312,"children":2314},{"class":131,"line":2313},11,[2315],{"type":46,"tag":129,"props":2316,"children":2317},{},[2318],{"type":52,"value":2319},"ORDER BY pre.occurred_at\n",{"type":46,"tag":129,"props":2321,"children":2323},{"class":131,"line":2322},12,[2324],{"type":46,"tag":129,"props":2325,"children":2326},{},[2327],{"type":52,"value":1155},{"type":46,"tag":55,"props":2329,"children":2330},{},[2331,2336,2338,2343],{"type":46,"tag":96,"props":2332,"children":2333},{},[2334],{"type":52,"value":2335},"Fallback joins",{"type":52,"value":2337}," (only when ",{"type":46,"tag":61,"props":2339,"children":2341},{"className":2340},[],[2342],{"type":52,"value":436},{"type":52,"value":2344}," is absent — older sessions ingested before\nthe handler existed; check with the query in Gotcha 5):",{"type":46,"tag":217,"props":2346,"children":2347},{},[2348,2425],{"type":46,"tag":221,"props":2349,"children":2350},{},[2351,2356,2357,2363,2365,2371,2373,2378,2380,2385,2387,2392,2394],{"type":46,"tag":96,"props":2352,"children":2353},{},[2354],{"type":52,"value":2355},"ToolCall direct match",{"type":52,"value":843},{"type":46,"tag":61,"props":2358,"children":2360},{"className":2359},[],[2361],{"type":52,"value":2362},":ToolCall.node_id",{"type":52,"value":2364}," is the provider's ",{"type":46,"tag":61,"props":2366,"children":2368},{"className":2367},[],[2369],{"type":52,"value":2370},"tool_call_id",{"type":52,"value":2372},",\nwhich ",{"type":46,"tag":61,"props":2374,"children":2376},{"className":2375},[],[2377],{"type":52,"value":244},{"type":52,"value":2379}," also lifts as ",{"type":46,"tag":61,"props":2381,"children":2383},{"className":2382},[],[2384],{"type":52,"value":2370},{"type":52,"value":2386},". Join on that shared key. Works\nfor ",{"type":46,"tag":61,"props":2388,"children":2390},{"className":2389},[],[2391],{"type":52,"value":330},{"type":52,"value":2393}," only.",{"type":46,"tag":118,"props":2395,"children":2397},{"className":120,"code":2396,"language":122,"meta":123,"style":123},"MATCH (e:ToolPreEvent {workspace: $workspace, tool_call_id: $tool_call_id})\nMATCH (tc:ToolCall {node_id: e.tool_call_id})\nRETURN e.tool_name, e.occurred_at, tc.result_success, tc.result_output\n",[2398],{"type":46,"tag":61,"props":2399,"children":2400},{"__ignoreMap":123},[2401,2409,2417],{"type":46,"tag":129,"props":2402,"children":2403},{"class":131,"line":132},[2404],{"type":46,"tag":129,"props":2405,"children":2406},{},[2407],{"type":52,"value":2408},"MATCH (e:ToolPreEvent {workspace: $workspace, tool_call_id: $tool_call_id})\n",{"type":46,"tag":129,"props":2410,"children":2411},{"class":131,"line":141},[2412],{"type":46,"tag":129,"props":2413,"children":2414},{},[2415],{"type":52,"value":2416},"MATCH (tc:ToolCall {node_id: e.tool_call_id})\n",{"type":46,"tag":129,"props":2418,"children":2419},{"class":131,"line":23},[2420],{"type":46,"tag":129,"props":2421,"children":2422},{},[2423],{"type":52,"value":2424},"RETURN e.tool_name, e.occurred_at, tc.result_success, tc.result_output\n",{"type":46,"tag":221,"props":2426,"children":2427},{},[2428,2433,2435,2441,2443,2448,2450,2456,2457,2463,2465,2471],{"type":46,"tag":96,"props":2429,"children":2430},{},[2431],{"type":52,"value":2432},"Session containment",{"type":52,"value":2434}," — join through the shared ",{"type":46,"tag":61,"props":2436,"children":2438},{"className":2437},[],[2439],{"type":52,"value":2440},":Session",{"type":52,"value":2442},": layer 1 attaches raw\nevents via ",{"type":46,"tag":61,"props":2444,"children":2446},{"className":2445},[],[2447],{"type":52,"value":2057},{"type":52,"value":2449},"; layer 2 attaches entities via ",{"type":46,"tag":61,"props":2451,"children":2453},{"className":2452},[],[2454],{"type":52,"value":2455},"HAS_EXECUTION",{"type":52,"value":1421},{"type":46,"tag":61,"props":2458,"children":2460},{"className":2459},[],[2461],{"type":52,"value":2462},"HAS_PART",{"type":52,"value":2464},".\nCorrelate on a shared scalar (e.g. ",{"type":46,"tag":61,"props":2466,"children":2468},{"className":2467},[],[2469],{"type":52,"value":2470},"iteration_number",{"type":52,"value":422},{"type":46,"tag":70,"props":2473,"children":2474},{},[],{"type":46,"tag":47,"props":2476,"children":2478},{"id":2477},"section-5-sst-navigation-reasoning-by-semantic-type",[2479],{"type":52,"value":2480},"Section 5 — SST Navigation (Reasoning by Semantic Type)",{"type":46,"tag":55,"props":2482,"children":2483},{},[2484,2486,2491,2493,2499],{"type":52,"value":2485},"Layer-2 nodes carry an ",{"type":46,"tag":96,"props":2487,"children":2488},{},[2489],{"type":52,"value":2490},"SST type label",{"type":52,"value":2492}," that classifies each node by its fundamental\ncharacter, letting you query across entity boundaries without knowing specific labels\nin advance. Confirm the current partition with ",{"type":46,"tag":61,"props":2494,"children":2496},{"className":2495},[],[2497],{"type":52,"value":2498},"db.labels()",{"type":52,"value":2500},"; the meaning is:",{"type":46,"tag":217,"props":2502,"children":2503},{},[2504,2518,2532],{"type":46,"tag":221,"props":2505,"children":2506},{},[2507,2516],{"type":46,"tag":96,"props":2508,"children":2509},{},[2510],{"type":46,"tag":61,"props":2511,"children":2513},{"className":2512},[],[2514],{"type":52,"value":2515},":SST_EVENT",{"type":52,"value":2517}," — a temporal, bounded occurrence (Session, OrchestratorRun,\nIteration, ContentBlock, ToolCall, Prompt, Delegation, SkillLoad, RecipeRun, …).",{"type":46,"tag":221,"props":2519,"children":2520},{},[2521,2530],{"type":46,"tag":96,"props":2522,"children":2523},{},[2524],{"type":46,"tag":61,"props":2525,"children":2527},{"className":2526},[],[2528],{"type":52,"value":2529},":SST_THING",{"type":52,"value":2531}," — a persistent resource\u002Fartifact (e.g. MountPlan).",{"type":46,"tag":221,"props":2533,"children":2534},{},[2535,2544],{"type":46,"tag":96,"props":2536,"children":2537},{},[2538],{"type":46,"tag":61,"props":2539,"children":2541},{"className":2540},[],[2542],{"type":52,"value":2543},":SST_CONCEPT",{"type":52,"value":2545}," — an abstract, reusable identity (Orchestrator, Agent, Recipe).",{"type":46,"tag":55,"props":2547,"children":2548},{},[2549,2551,2560,2562,2568,2570,2576,2578,2584,2586,2592],{"type":52,"value":2550},"Layer-2 edges carry an ",{"type":46,"tag":96,"props":2552,"children":2553},{},[2554],{"type":46,"tag":61,"props":2555,"children":2557},{"className":2556},[],[2558],{"type":52,"value":2559},"sst_semantic",{"type":52,"value":2561}," property expressing the abstract relationship\nindependent of concrete edge type: ",{"type":46,"tag":61,"props":2563,"children":2565},{"className":2564},[],[2566],{"type":52,"value":2567},"CONTAINS",{"type":52,"value":2569}," (containment), ",{"type":46,"tag":61,"props":2571,"children":2573},{"className":2572},[],[2574],{"type":52,"value":2575},"LEADS_TO",{"type":52,"value":2577}," (causal\u002F\nsequential), ",{"type":46,"tag":61,"props":2579,"children":2581},{"className":2580},[],[2582],{"type":52,"value":2583},"EXPRESSES",{"type":52,"value":2585}," (attribution), ",{"type":46,"tag":61,"props":2587,"children":2589},{"className":2588},[],[2590],{"type":52,"value":2591},"NEAR",{"type":52,"value":2593}," (concurrency). This lets you query\ncausation or containment uniformly.",{"type":46,"tag":118,"props":2595,"children":2597},{"className":120,"code":2596,"language":122,"meta":123,"style":123},"\u002F\u002F All temporal events in the most recent session, mixed types sorted correctly\nMATCH (s:Session {workspace: $workspace})\nWITH s ORDER BY s.started_at DESC LIMIT 1\nMATCH (s)-[:HAS_EXECUTION|HAS_PART*1..3]->(e:SST_EVENT)\nRETURN labels(e) AS types,\n       coalesce(e.started_at, e.occurred_at) AS at\nORDER BY at\nLIMIT 50\n",[2598],{"type":46,"tag":61,"props":2599,"children":2600},{"__ignoreMap":123},[2601,2609,2616,2624,2632,2640,2648,2656],{"type":46,"tag":129,"props":2602,"children":2603},{"class":131,"line":132},[2604],{"type":46,"tag":129,"props":2605,"children":2606},{},[2607],{"type":52,"value":2608},"\u002F\u002F All temporal events in the most recent session, mixed types sorted correctly\n",{"type":46,"tag":129,"props":2610,"children":2611},{"class":131,"line":141},[2612],{"type":46,"tag":129,"props":2613,"children":2614},{},[2615],{"type":52,"value":807},{"type":46,"tag":129,"props":2617,"children":2618},{"class":131,"line":23},[2619],{"type":46,"tag":129,"props":2620,"children":2621},{},[2622],{"type":52,"value":2623},"WITH s ORDER BY s.started_at DESC LIMIT 1\n",{"type":46,"tag":129,"props":2625,"children":2626},{"class":131,"line":27},[2627],{"type":46,"tag":129,"props":2628,"children":2629},{},[2630],{"type":52,"value":2631},"MATCH (s)-[:HAS_EXECUTION|HAS_PART*1..3]->(e:SST_EVENT)\n",{"type":46,"tag":129,"props":2633,"children":2634},{"class":131,"line":1061},[2635],{"type":46,"tag":129,"props":2636,"children":2637},{},[2638],{"type":52,"value":2639},"RETURN labels(e) AS types,\n",{"type":46,"tag":129,"props":2641,"children":2642},{"class":131,"line":1071},[2643],{"type":46,"tag":129,"props":2644,"children":2645},{},[2646],{"type":52,"value":2647},"       coalesce(e.started_at, e.occurred_at) AS at\n",{"type":46,"tag":129,"props":2649,"children":2650},{"class":131,"line":1080},[2651],{"type":46,"tag":129,"props":2652,"children":2653},{},[2654],{"type":52,"value":2655},"ORDER BY at\n",{"type":46,"tag":129,"props":2657,"children":2658},{"class":131,"line":1089},[2659],{"type":46,"tag":129,"props":2660,"children":2661},{},[2662],{"type":52,"value":2663},"LIMIT 50\n",{"type":46,"tag":2665,"props":2666,"children":2667},"blockquote",{},[2668],{"type":46,"tag":55,"props":2669,"children":2670},{},[2671,2682,2684,2689,2691,2696,2698,2704,2706,2712],{"type":46,"tag":96,"props":2672,"children":2673},{},[2674,2676,2681],{"type":52,"value":2675},"Two temporal keys across ",{"type":46,"tag":61,"props":2677,"children":2679},{"className":2678},[],[2680],{"type":52,"value":2515},{"type":52,"value":2147},{"type":52,"value":2683}," span nodes (Iteration, ContentBlock,\nToolCall, Session, OrchestratorRun) store ",{"type":46,"tag":61,"props":2685,"children":2687},{"className":2686},[],[2688],{"type":52,"value":1580},{"type":52,"value":2690},"; occurrence nodes (Prompt,\nCancellation, ContextCompaction) store ",{"type":46,"tag":61,"props":2692,"children":2694},{"className":2693},[],[2695],{"type":52,"value":2035},{"type":52,"value":2697},". When you sweep a mixed set,\nuse ",{"type":46,"tag":61,"props":2699,"children":2701},{"className":2700},[],[2702],{"type":52,"value":2703},"coalesce(e.started_at, e.occurred_at)",{"type":52,"value":2705}," in both projection and ",{"type":46,"tag":61,"props":2707,"children":2709},{"className":2708},[],[2710],{"type":52,"value":2711},"ORDER BY",{"type":52,"value":2713}," so\noccurrence nodes are not silently null and sorted out of order.",{"type":46,"tag":55,"props":2715,"children":2716},{},[2717,2722,2724,2730],{"type":46,"tag":96,"props":2718,"children":2719},{},[2720],{"type":52,"value":2721},"Hierarchy traversal",{"type":52,"value":2723}," — reach the full Session → Run → Iteration → ContentBlock tree\nwith a bounded variable-length path. Bound it (",{"type":46,"tag":61,"props":2725,"children":2727},{"className":2726},[],[2728],{"type":52,"value":2729},"*1..3",{"type":52,"value":2731},") to prevent runaway fanout:",{"type":46,"tag":118,"props":2733,"children":2735},{"className":120,"code":2734,"language":122,"meta":123,"style":123},"MATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION|HAS_PART*1..3]->(iter:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)\nRETURN tc.tool_name, tc.started_at, tc.result_success\nORDER BY tc.started_at\nLIMIT 50\n",[2736],{"type":46,"tag":61,"props":2737,"children":2738},{"__ignoreMap":123},[2739,2746,2754,2761,2769,2777],{"type":46,"tag":129,"props":2740,"children":2741},{"class":131,"line":132},[2742],{"type":46,"tag":129,"props":2743,"children":2744},{},[2745],{"type":52,"value":1042},{"type":46,"tag":129,"props":2747,"children":2748},{"class":131,"line":141},[2749],{"type":46,"tag":129,"props":2750,"children":2751},{},[2752],{"type":52,"value":2753},"      -[:HAS_EXECUTION|HAS_PART*1..3]->(iter:Iteration)\n",{"type":46,"tag":129,"props":2755,"children":2756},{"class":131,"line":23},[2757],{"type":46,"tag":129,"props":2758,"children":2759},{},[2760],{"type":52,"value":2269},{"type":46,"tag":129,"props":2762,"children":2763},{"class":131,"line":27},[2764],{"type":46,"tag":129,"props":2765,"children":2766},{},[2767],{"type":52,"value":2768},"RETURN tc.tool_name, tc.started_at, tc.result_success\n",{"type":46,"tag":129,"props":2770,"children":2771},{"class":131,"line":1061},[2772],{"type":46,"tag":129,"props":2773,"children":2774},{},[2775],{"type":52,"value":2776},"ORDER BY tc.started_at\n",{"type":46,"tag":129,"props":2778,"children":2779},{"class":131,"line":1071},[2780],{"type":46,"tag":129,"props":2781,"children":2782},{},[2783],{"type":52,"value":2663},{"type":46,"tag":70,"props":2785,"children":2786},{},[],{"type":46,"tag":47,"props":2788,"children":2790},{"id":2789},"section-6-text-extraction-bounded-always-blobs-carefully",[2791],{"type":52,"value":2792},"Section 6 — Text Extraction: Bounded Always, Blobs Carefully",{"type":46,"tag":55,"props":2794,"children":2795},{},[2796,2798,2811],{"type":52,"value":2797},"Large text fields are the fastest way to destroy your context window. ",{"type":46,"tag":96,"props":2799,"children":2800},{},[2801,2803,2809],{"type":52,"value":2802},"One unbounded\n",{"type":46,"tag":61,"props":2804,"children":2806},{"className":2805},[],[2807],{"type":52,"value":2808},"p.prompt",{"type":52,"value":2810}," query returned 1.21M tokens and overflowed the context.",{"type":52,"value":2812}," Treat every large\ntext field with discipline.",{"type":46,"tag":448,"props":2814,"children":2816},{"id":2815},"firm-rule-never-return-full-text-of-many-rows",[2817],{"type":52,"value":2818},"Firm rule — never return full text of many rows",{"type":46,"tag":55,"props":2820,"children":2821},{},[2822,2824,2830,2831,2836,2837,2843,2844,2849,2850,2855],{"type":52,"value":2823},"For any large text field (",{"type":46,"tag":61,"props":2825,"children":2827},{"className":2826},[],[2828],{"type":52,"value":2829},"prompt",{"type":52,"value":246},{"type":46,"tag":61,"props":2832,"children":2834},{"className":2833},[],[2835],{"type":52,"value":897},{"type":52,"value":246},{"type":46,"tag":61,"props":2838,"children":2840},{"className":2839},[],[2841],{"type":52,"value":2842},"data.content",{"type":52,"value":246},{"type":46,"tag":61,"props":2845,"children":2847},{"className":2846},[],[2848],{"type":52,"value":1573},{"type":52,"value":303},{"type":46,"tag":61,"props":2851,"children":2853},{"className":2852},[],[2854],{"type":52,"value":1608},{"type":52,"value":2856},"), you MUST bound it — no exceptions:",{"type":46,"tag":217,"props":2858,"children":2859},{},[2860,2877],{"type":46,"tag":221,"props":2861,"children":2862},{},[2863,2865,2871,2872],{"type":52,"value":2864},"Add a small ",{"type":46,"tag":61,"props":2866,"children":2868},{"className":2867},[],[2869],{"type":52,"value":2870},"LIMIT",{"type":52,"value":246},{"type":46,"tag":96,"props":2873,"children":2874},{},[2875],{"type":52,"value":2876},"and",{"type":46,"tag":221,"props":2878,"children":2879},{},[2880,2882,2888,2890,2896,2898,2904,2905,2911],{"type":52,"value":2881},"Truncate with ",{"type":46,"tag":61,"props":2883,"children":2885},{"className":2884},[],[2886],{"type":52,"value":2887},"substring(field, 0, 200)",{"type":52,"value":2889},", or return only ",{"type":46,"tag":61,"props":2891,"children":2893},{"className":2892},[],[2894],{"type":52,"value":2895},"size(field)",{"type":52,"value":2897}," to gauge\nscale first, or aggregate (",{"type":46,"tag":61,"props":2899,"children":2901},{"className":2900},[],[2902],{"type":52,"value":2903},"count",{"type":52,"value":246},{"type":46,"tag":61,"props":2906,"children":2908},{"className":2907},[],[2909],{"type":52,"value":2910},"collect",{"type":52,"value":2912}," of a truncated projection).",{"type":46,"tag":118,"props":2914,"children":2916},{"className":120,"code":2915,"language":122,"meta":123,"style":123},"\u002F\u002F WRONG — full prompt text over many rows → context overflow\nMATCH (p:Prompt {workspace: $workspace}) RETURN p.prompt\n\n\u002F\u002F RIGHT — measure scale first\nMATCH (p:Prompt {workspace: $workspace})\nRETURN count(p) AS n, max(size(p.prompt)) AS longest_chars\n\n\u002F\u002F RIGHT — bounded preview when you do need text\nMATCH (p:Prompt {workspace: $workspace})\nWHERE p.session_id = $session_id\nRETURN substring(p.prompt, 0, 200) AS prompt_preview\nORDER BY p.occurred_at\nLIMIT 25\n",[2917],{"type":46,"tag":61,"props":2918,"children":2919},{"__ignoreMap":123},[2920,2928,2936,2943,2951,2959,2967,2974,2982,2989,2997,3005,3013],{"type":46,"tag":129,"props":2921,"children":2922},{"class":131,"line":132},[2923],{"type":46,"tag":129,"props":2924,"children":2925},{},[2926],{"type":52,"value":2927},"\u002F\u002F WRONG — full prompt text over many rows → context overflow\n",{"type":46,"tag":129,"props":2929,"children":2930},{"class":131,"line":141},[2931],{"type":46,"tag":129,"props":2932,"children":2933},{},[2934],{"type":52,"value":2935},"MATCH (p:Prompt {workspace: $workspace}) RETURN p.prompt\n",{"type":46,"tag":129,"props":2937,"children":2938},{"class":131,"line":23},[2939],{"type":46,"tag":129,"props":2940,"children":2941},{"emptyLinePlaceholder":1065},[2942],{"type":52,"value":1068},{"type":46,"tag":129,"props":2944,"children":2945},{"class":131,"line":27},[2946],{"type":46,"tag":129,"props":2947,"children":2948},{},[2949],{"type":52,"value":2950},"\u002F\u002F RIGHT — measure scale first\n",{"type":46,"tag":129,"props":2952,"children":2953},{"class":131,"line":1061},[2954],{"type":46,"tag":129,"props":2955,"children":2956},{},[2957],{"type":52,"value":2958},"MATCH (p:Prompt {workspace: $workspace})\n",{"type":46,"tag":129,"props":2960,"children":2961},{"class":131,"line":1071},[2962],{"type":46,"tag":129,"props":2963,"children":2964},{},[2965],{"type":52,"value":2966},"RETURN count(p) AS n, max(size(p.prompt)) AS longest_chars\n",{"type":46,"tag":129,"props":2968,"children":2969},{"class":131,"line":1080},[2970],{"type":46,"tag":129,"props":2971,"children":2972},{"emptyLinePlaceholder":1065},[2973],{"type":52,"value":1068},{"type":46,"tag":129,"props":2975,"children":2976},{"class":131,"line":1089},[2977],{"type":46,"tag":129,"props":2978,"children":2979},{},[2980],{"type":52,"value":2981},"\u002F\u002F RIGHT — bounded preview when you do need text\n",{"type":46,"tag":129,"props":2983,"children":2984},{"class":131,"line":1098},[2985],{"type":46,"tag":129,"props":2986,"children":2987},{},[2988],{"type":52,"value":2958},{"type":46,"tag":129,"props":2990,"children":2991},{"class":131,"line":2304},[2992],{"type":46,"tag":129,"props":2993,"children":2994},{},[2995],{"type":52,"value":2996},"WHERE p.session_id = $session_id\n",{"type":46,"tag":129,"props":2998,"children":2999},{"class":131,"line":2313},[3000],{"type":46,"tag":129,"props":3001,"children":3002},{},[3003],{"type":52,"value":3004},"RETURN substring(p.prompt, 0, 200) AS prompt_preview\n",{"type":46,"tag":129,"props":3006,"children":3007},{"class":131,"line":2322},[3008],{"type":46,"tag":129,"props":3009,"children":3010},{},[3011],{"type":52,"value":3012},"ORDER BY p.occurred_at\n",{"type":46,"tag":129,"props":3014,"children":3016},{"class":131,"line":3015},13,[3017],{"type":46,"tag":129,"props":3018,"children":3019},{},[3020],{"type":52,"value":1155},{"type":46,"tag":448,"props":3022,"children":3024},{"id":3023},"the-data-field-is-a-json-string-not-a-cypher-map",[3025,3026,3031],{"type":52,"value":706},{"type":46,"tag":61,"props":3027,"children":3029},{"className":3028},[],[3030],{"type":52,"value":897},{"type":52,"value":3032}," field is a JSON string, not a Cypher map",{"type":46,"tag":55,"props":3034,"children":3035},{},[3036,3042,3044,3050,3052,3056,3058,3063,3064,3069,3070,3075,3076,3082,3083,3089,3091,3096,3098,3103,3105,3110],{"type":46,"tag":61,"props":3037,"children":3039},{"className":3038},[],[3040],{"type":52,"value":3041},":Event.data",{"type":52,"value":3043}," is a serialized JSON string. Dot notation (",{"type":46,"tag":61,"props":3045,"children":3047},{"className":3046},[],[3048],{"type":52,"value":3049},"e.data.tool_name",{"type":52,"value":3051},") does ",{"type":46,"tag":96,"props":3053,"children":3054},{},[3055],{"type":52,"value":750},{"type":52,"value":3057},"\nwork in Cypher — it raises a type-mismatch error, not a silent null. Prefer ",{"type":46,"tag":96,"props":3059,"children":3060},{},[3061],{"type":52,"value":3062},"lifted\nproperties",{"type":52,"value":919},{"type":46,"tag":61,"props":3065,"children":3067},{"className":3066},[],[3068],{"type":52,"value":1566},{"type":52,"value":246},{"type":46,"tag":61,"props":3071,"children":3073},{"className":3072},[],[3074],{"type":52,"value":2370},{"type":52,"value":246},{"type":46,"tag":61,"props":3077,"children":3079},{"className":3078},[],[3080],{"type":52,"value":3081},"model",{"type":52,"value":246},{"type":46,"tag":61,"props":3084,"children":3086},{"className":3085},[],[3087],{"type":52,"value":3088},"provider",{"type":52,"value":3090},", …) when they exist; when you\nneed a raw field that is ",{"type":46,"tag":96,"props":3092,"children":3093},{},[3094],{"type":52,"value":3095},"only",{"type":52,"value":3097}," in the payload, parse it ",{"type":46,"tag":96,"props":3099,"children":3100},{},[3101],{"type":52,"value":3102},"in-graph with APOC",{"type":52,"value":3104}," — see the\none authoritative pattern ",{"type":46,"tag":96,"props":3106,"children":3107},{},[3108],{"type":52,"value":3109},"\"Lift payload fields in-graph with APOC\" in Section 8",{"type":52,"value":3111},". Always bounded.",{"type":46,"tag":55,"props":3113,"children":3114},{},[3115,3120,3122,3127,3129,3135,3137,3143],{"type":46,"tag":96,"props":3116,"children":3117},{},[3118],{"type":52,"value":3119},"Inline vs blob — know which you have.",{"type":52,"value":3121}," Some payloads live inline; some are offloaded.\nFor example, orchestrator steering text lives ",{"type":46,"tag":96,"props":3123,"children":3124},{},[3125],{"type":52,"value":3126},"inline",{"type":52,"value":3128}," at\n",{"type":46,"tag":61,"props":3130,"children":3132},{"className":3131},[],[3133],{"type":52,"value":3134},"OrchestratorSteeringInjectedEvent.data.content",{"type":52,"value":3136}," (a JSON string — parse it, no blob\nhop). Do not assume a ",{"type":46,"tag":61,"props":3138,"children":3140},{"className":3139},[],[3141],{"type":52,"value":3142},"ci-blob:\u002F\u002F",{"type":52,"value":3144}," indirection where the text is actually inline.",{"type":46,"tag":448,"props":3146,"children":3148},{"id":3147},"ci-blob-references-and-the-blobs-endpoint",[3149,3154,3156,3162],{"type":46,"tag":61,"props":3150,"children":3152},{"className":3151},[],[3153],{"type":52,"value":3142},{"type":52,"value":3155}," references and the ",{"type":46,"tag":61,"props":3157,"children":3159},{"className":3158},[],[3160],{"type":52,"value":3161},"\u002Fblobs",{"type":52,"value":3163}," endpoint",{"type":46,"tag":55,"props":3165,"children":3166},{},[3167,3169,3174,3176,3182,3184,3189,3191,3197,3199,3205,3207,3212],{"type":52,"value":3168},"When a payload exceeds the storage threshold, the server replaces ",{"type":46,"tag":61,"props":3170,"children":3172},{"className":3171},[],[3173],{"type":52,"value":897},{"type":52,"value":3175}," with a\n",{"type":46,"tag":61,"props":3177,"children":3179},{"className":3178},[],[3180],{"type":52,"value":3181},"ci-blob:\u002F\u002FSESSION_ID\u002FEVENT_KEY",{"type":52,"value":3183}," URI. Resolve it via the blob store — the ",{"type":46,"tag":61,"props":3185,"children":3187},{"className":3186},[],[3188],{"type":52,"value":3161},{"type":52,"value":3190},"\nendpoint (",{"type":46,"tag":61,"props":3192,"children":3194},{"className":3193},[],[3195],{"type":52,"value":3196},"GET {url}\u002Fblobs\u002F{session_id}[\u002F{key}]",{"type":52,"value":3198},"), or the ",{"type":46,"tag":61,"props":3200,"children":3202},{"className":3201},[],[3203],{"type":52,"value":3204},"blob_read",{"type":52,"value":3206}," tool which\nreturns a local ",{"type":46,"tag":96,"props":3208,"children":3209},{},[3210],{"type":52,"value":3211},"file path",{"type":52,"value":3213},", not content:",{"type":46,"tag":118,"props":3215,"children":3219},{"className":3216,"code":3217,"language":3218,"meta":123,"style":123},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","result = blob_read(uri=\"ci-blob:\u002F\u002FSESSION_ID\u002FEVENT_KEY\")  # -> {\"path\": \"...\", \"source\": {name, url, origin}}\n","python",[3220],{"type":46,"tag":61,"props":3221,"children":3222},{"__ignoreMap":123},[3223],{"type":46,"tag":129,"props":3224,"children":3225},{"class":131,"line":132},[3226],{"type":46,"tag":129,"props":3227,"children":3228},{},[3229],{"type":52,"value":3217},{"type":46,"tag":55,"props":3231,"children":3232},{},[3233,3235,3241],{"type":52,"value":3234},"Then extract only the fields you need with ",{"type":46,"tag":61,"props":3236,"children":3238},{"className":3237},[],[3239],{"type":52,"value":3240},"jq",{"type":52,"value":3242}," — never load a whole blob into context:",{"type":46,"tag":118,"props":3244,"children":3248},{"className":3245,"code":3246,"language":3247,"meta":123,"style":123},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","jq 'keys' \u002Ftmp\u002Fci-blobs\u002FSESSION_ID\u002FEVENT_KEY.json          # structure first\njq '.messages[-1].content' \u002Ftmp\u002Fci-blobs\u002FSESSION_ID\u002FEVENT_KEY.json\n","bash",[3249],{"type":46,"tag":61,"props":3250,"children":3251},{"__ignoreMap":123},[3252,3288],{"type":46,"tag":129,"props":3253,"children":3254},{"class":131,"line":132},[3255,3260,3266,3272,3277,3282],{"type":46,"tag":129,"props":3256,"children":3258},{"style":3257},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[3259],{"type":52,"value":3240},{"type":46,"tag":129,"props":3261,"children":3263},{"style":3262},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[3264],{"type":52,"value":3265}," '",{"type":46,"tag":129,"props":3267,"children":3269},{"style":3268},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[3270],{"type":52,"value":3271},"keys",{"type":46,"tag":129,"props":3273,"children":3274},{"style":3262},[3275],{"type":52,"value":3276},"'",{"type":46,"tag":129,"props":3278,"children":3279},{"style":3268},[3280],{"type":52,"value":3281}," \u002Ftmp\u002Fci-blobs\u002FSESSION_ID\u002FEVENT_KEY.json",{"type":46,"tag":129,"props":3283,"children":3285},{"style":3284},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[3286],{"type":52,"value":3287},"          # structure first\n",{"type":46,"tag":129,"props":3289,"children":3290},{"class":131,"line":141},[3291,3295,3299,3304,3308],{"type":46,"tag":129,"props":3292,"children":3293},{"style":3257},[3294],{"type":52,"value":3240},{"type":46,"tag":129,"props":3296,"children":3297},{"style":3262},[3298],{"type":52,"value":3265},{"type":46,"tag":129,"props":3300,"children":3301},{"style":3268},[3302],{"type":52,"value":3303},".messages[-1].content",{"type":46,"tag":129,"props":3305,"children":3306},{"style":3262},[3307],{"type":52,"value":3276},{"type":46,"tag":129,"props":3309,"children":3310},{"style":3268},[3311],{"type":52,"value":3312}," \u002Ftmp\u002Fci-blobs\u002FSESSION_ID\u002FEVENT_KEY.json\n",{"type":46,"tag":55,"props":3314,"children":3315},{},[3316,3321,3323,3328],{"type":46,"tag":96,"props":3317,"children":3318},{},[3319],{"type":52,"value":3320},"Rules:",{"type":52,"value":3322}," check for a ",{"type":46,"tag":61,"props":3324,"children":3326},{"className":3325},[],[3327],{"type":52,"value":3142},{"type":52,"value":3329}," prefix before parsing as JSON; lifted properties\nbypass blobs entirely; always bound before loading.",{"type":46,"tag":70,"props":3331,"children":3332},{},[],{"type":46,"tag":47,"props":3334,"children":3336},{"id":3335},"section-7-verified-query-patterns",[3337],{"type":52,"value":3338},"Section 7 — Verified Query Patterns",{"type":46,"tag":55,"props":3340,"children":3341},{},[3342,3344,3349,3351,3356],{"type":52,"value":3343},"These are validated against the live layer-2\u002Ffoundation schema. All reference\n",{"type":46,"tag":61,"props":3345,"children":3347},{"className":3346},[],[3348],{"type":52,"value":743},{"type":52,"value":3350}," (set via the tool's ",{"type":46,"tag":61,"props":3352,"children":3354},{"className":3353},[],[3355],{"type":52,"value":712},{"type":52,"value":3357}," argument, Section 2) and are bounded.",{"type":46,"tag":55,"props":3359,"children":3360},{},[3361,3366],{"type":46,"tag":96,"props":3362,"children":3363},{},[3364],{"type":52,"value":3365},"Full conversation turn trace",{"type":52,"value":3367}," — prompt → run → iterations → tool calls:",{"type":46,"tag":118,"props":3369,"children":3371},{"className":120,"code":3370,"language":122,"meta":123,"style":123},"MATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_PART]->(p:Prompt)\n      -[:TRIGGERS]->(run:OrchestratorRun)\n      -[:HAS_PART]->(iter:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)\nRETURN p.occurred_at AS turn_start, iter.iteration_number AS iteration,\n       tc.tool_name AS tool, tc.result_success AS succeeded\nORDER BY p.occurred_at, iter.iteration_number, tc.started_at\nLIMIT 100\n",[3372],{"type":46,"tag":61,"props":3373,"children":3374},{"__ignoreMap":123},[3375,3382,3390,3398,3405,3412,3420,3428,3436],{"type":46,"tag":129,"props":3376,"children":3377},{"class":131,"line":132},[3378],{"type":46,"tag":129,"props":3379,"children":3380},{},[3381],{"type":52,"value":1042},{"type":46,"tag":129,"props":3383,"children":3384},{"class":131,"line":141},[3385],{"type":46,"tag":129,"props":3386,"children":3387},{},[3388],{"type":52,"value":3389},"      -[:HAS_PART]->(p:Prompt)\n",{"type":46,"tag":129,"props":3391,"children":3392},{"class":131,"line":23},[3393],{"type":46,"tag":129,"props":3394,"children":3395},{},[3396],{"type":52,"value":3397},"      -[:TRIGGERS]->(run:OrchestratorRun)\n",{"type":46,"tag":129,"props":3399,"children":3400},{"class":131,"line":27},[3401],{"type":46,"tag":129,"props":3402,"children":3403},{},[3404],{"type":52,"value":2261},{"type":46,"tag":129,"props":3406,"children":3407},{"class":131,"line":1061},[3408],{"type":46,"tag":129,"props":3409,"children":3410},{},[3411],{"type":52,"value":2269},{"type":46,"tag":129,"props":3413,"children":3414},{"class":131,"line":1071},[3415],{"type":46,"tag":129,"props":3416,"children":3417},{},[3418],{"type":52,"value":3419},"RETURN p.occurred_at AS turn_start, iter.iteration_number AS iteration,\n",{"type":46,"tag":129,"props":3421,"children":3422},{"class":131,"line":1080},[3423],{"type":46,"tag":129,"props":3424,"children":3425},{},[3426],{"type":52,"value":3427},"       tc.tool_name AS tool, tc.result_success AS succeeded\n",{"type":46,"tag":129,"props":3429,"children":3430},{"class":131,"line":1089},[3431],{"type":46,"tag":129,"props":3432,"children":3433},{},[3434],{"type":52,"value":3435},"ORDER BY p.occurred_at, iter.iteration_number, tc.started_at\n",{"type":46,"tag":129,"props":3437,"children":3438},{"class":131,"line":1098},[3439],{"type":46,"tag":129,"props":3440,"children":3441},{},[3442],{"type":52,"value":3443},"LIMIT 100\n",{"type":46,"tag":55,"props":3445,"children":3446},{},[3447,3452],{"type":46,"tag":96,"props":3448,"children":3449},{},[3450],{"type":52,"value":3451},"Tool usage per iteration",{"type":52,"value":3453}," — how many tools each LLM round fired:",{"type":46,"tag":118,"props":3455,"children":3457},{"className":120,"code":3456,"language":122,"meta":123,"style":123},"MATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(:OrchestratorRun)\n      -[:HAS_PART]->(iter:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)\nRETURN iter.iteration_number AS iteration,\n       collect(tc.tool_name) AS tools, count(tc) AS tool_count\nORDER BY iter.iteration_number\nLIMIT 50\n",[3458],{"type":46,"tag":61,"props":3459,"children":3460},{"__ignoreMap":123},[3461,3468,3475,3482,3489,3496,3504,3512],{"type":46,"tag":129,"props":3462,"children":3463},{"class":131,"line":132},[3464],{"type":46,"tag":129,"props":3465,"children":3466},{},[3467],{"type":52,"value":1042},{"type":46,"tag":129,"props":3469,"children":3470},{"class":131,"line":141},[3471],{"type":46,"tag":129,"props":3472,"children":3473},{},[3474],{"type":52,"value":2253},{"type":46,"tag":129,"props":3476,"children":3477},{"class":131,"line":23},[3478],{"type":46,"tag":129,"props":3479,"children":3480},{},[3481],{"type":52,"value":2261},{"type":46,"tag":129,"props":3483,"children":3484},{"class":131,"line":27},[3485],{"type":46,"tag":129,"props":3486,"children":3487},{},[3488],{"type":52,"value":2269},{"type":46,"tag":129,"props":3490,"children":3491},{"class":131,"line":1061},[3492],{"type":46,"tag":129,"props":3493,"children":3494},{},[3495],{"type":52,"value":2285},{"type":46,"tag":129,"props":3497,"children":3498},{"class":131,"line":1071},[3499],{"type":46,"tag":129,"props":3500,"children":3501},{},[3502],{"type":52,"value":3503},"       collect(tc.tool_name) AS tools, count(tc) AS tool_count\n",{"type":46,"tag":129,"props":3505,"children":3506},{"class":131,"line":1080},[3507],{"type":46,"tag":129,"props":3508,"children":3509},{},[3510],{"type":52,"value":3511},"ORDER BY iter.iteration_number\n",{"type":46,"tag":129,"props":3513,"children":3514},{"class":131,"line":1089},[3515],{"type":46,"tag":129,"props":3516,"children":3517},{},[3518],{"type":52,"value":2663},{"type":46,"tag":55,"props":3520,"children":3521},{},[3522,3527,3529,3535],{"type":46,"tag":96,"props":3523,"children":3524},{},[3525],{"type":52,"value":3526},"Failed tool calls",{"type":52,"value":3528}," — scope to one session; add ",{"type":46,"tag":61,"props":3530,"children":3532},{"className":3531},[],[3533],{"type":52,"value":3534},"ORDER BY tc.started_at DESC",{"type":52,"value":3536}," for\nmost-recent-first:",{"type":46,"tag":118,"props":3538,"children":3540},{"className":120,"code":3539,"language":122,"meta":123,"style":123},"MATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(:OrchestratorRun)\n      -[:HAS_PART]->(iter:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)\nWHERE tc.result_success = false\nRETURN iter.iteration_number AS iteration, tc.tool_name AS tool,\n       tc.result_error AS error, tc.started_at AS failed_at\nORDER BY tc.started_at\nLIMIT 50\n",[3541],{"type":46,"tag":61,"props":3542,"children":3543},{"__ignoreMap":123},[3544,3551,3558,3565,3572,3580,3588,3596,3603],{"type":46,"tag":129,"props":3545,"children":3546},{"class":131,"line":132},[3547],{"type":46,"tag":129,"props":3548,"children":3549},{},[3550],{"type":52,"value":1042},{"type":46,"tag":129,"props":3552,"children":3553},{"class":131,"line":141},[3554],{"type":46,"tag":129,"props":3555,"children":3556},{},[3557],{"type":52,"value":2253},{"type":46,"tag":129,"props":3559,"children":3560},{"class":131,"line":23},[3561],{"type":46,"tag":129,"props":3562,"children":3563},{},[3564],{"type":52,"value":2261},{"type":46,"tag":129,"props":3566,"children":3567},{"class":131,"line":27},[3568],{"type":46,"tag":129,"props":3569,"children":3570},{},[3571],{"type":52,"value":2269},{"type":46,"tag":129,"props":3573,"children":3574},{"class":131,"line":1061},[3575],{"type":46,"tag":129,"props":3576,"children":3577},{},[3578],{"type":52,"value":3579},"WHERE tc.result_success = false\n",{"type":46,"tag":129,"props":3581,"children":3582},{"class":131,"line":1071},[3583],{"type":46,"tag":129,"props":3584,"children":3585},{},[3586],{"type":52,"value":3587},"RETURN iter.iteration_number AS iteration, tc.tool_name AS tool,\n",{"type":46,"tag":129,"props":3589,"children":3590},{"class":131,"line":1080},[3591],{"type":46,"tag":129,"props":3592,"children":3593},{},[3594],{"type":52,"value":3595},"       tc.result_error AS error, tc.started_at AS failed_at\n",{"type":46,"tag":129,"props":3597,"children":3598},{"class":131,"line":1089},[3599],{"type":46,"tag":129,"props":3600,"children":3601},{},[3602],{"type":52,"value":2776},{"type":46,"tag":129,"props":3604,"children":3605},{"class":131,"line":1098},[3606],{"type":46,"tag":129,"props":3607,"children":3608},{},[3609],{"type":52,"value":2663},{"type":46,"tag":55,"props":3611,"children":3612},{},[3613,3618],{"type":46,"tag":96,"props":3614,"children":3615},{},[3616],{"type":52,"value":3617},"Delegations in a session",{"type":52,"value":3619}," — which tool call triggered which agent (enumeration, not\ndepth — see Trap 1 for lineage\u002Fdepth):",{"type":46,"tag":118,"props":3621,"children":3623},{"className":120,"code":3622,"language":122,"meta":123,"style":123},"MATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(:OrchestratorRun)-[:HAS_PART]->(:Iteration)\n      -[:HAS_TOOL_CALL]->(tc:ToolCall)-[:TRIGGERED]->(d:Delegation)\nRETURN d.agent, d.sub_session_id, d.is_self_delegation, d.context_depth,\n       d.started_at, tc.tool_name AS via_tool\nORDER BY d.started_at\nLIMIT 50\n",[3624],{"type":46,"tag":61,"props":3625,"children":3626},{"__ignoreMap":123},[3627,3634,3642,3650,3658,3666,3674],{"type":46,"tag":129,"props":3628,"children":3629},{"class":131,"line":132},[3630],{"type":46,"tag":129,"props":3631,"children":3632},{},[3633],{"type":52,"value":1042},{"type":46,"tag":129,"props":3635,"children":3636},{"class":131,"line":141},[3637],{"type":46,"tag":129,"props":3638,"children":3639},{},[3640],{"type":52,"value":3641},"      -[:HAS_EXECUTION]->(:OrchestratorRun)-[:HAS_PART]->(:Iteration)\n",{"type":46,"tag":129,"props":3643,"children":3644},{"class":131,"line":23},[3645],{"type":46,"tag":129,"props":3646,"children":3647},{},[3648],{"type":52,"value":3649},"      -[:HAS_TOOL_CALL]->(tc:ToolCall)-[:TRIGGERED]->(d:Delegation)\n",{"type":46,"tag":129,"props":3651,"children":3652},{"class":131,"line":27},[3653],{"type":46,"tag":129,"props":3654,"children":3655},{},[3656],{"type":52,"value":3657},"RETURN d.agent, d.sub_session_id, d.is_self_delegation, d.context_depth,\n",{"type":46,"tag":129,"props":3659,"children":3660},{"class":131,"line":1061},[3661],{"type":46,"tag":129,"props":3662,"children":3663},{},[3664],{"type":52,"value":3665},"       d.started_at, tc.tool_name AS via_tool\n",{"type":46,"tag":129,"props":3667,"children":3668},{"class":131,"line":1071},[3669],{"type":46,"tag":129,"props":3670,"children":3671},{},[3672],{"type":52,"value":3673},"ORDER BY d.started_at\n",{"type":46,"tag":129,"props":3675,"children":3676},{"class":131,"line":1080},[3677],{"type":46,"tag":129,"props":3678,"children":3679},{},[3680],{"type":52,"value":2663},{"type":46,"tag":55,"props":3682,"children":3683},{},[3684,3689,3691,3696,3697,3702],{"type":46,"tag":96,"props":3685,"children":3686},{},[3687],{"type":52,"value":3688},"Skills active per iteration",{"type":52,"value":3690}," — note skills loaded before the first request attach to\n",{"type":46,"tag":61,"props":3692,"children":3694},{"className":3693},[],[3695],{"type":52,"value":301},{"type":52,"value":1543},{"type":46,"tag":61,"props":3698,"children":3700},{"className":3699},[],[3701],{"type":52,"value":316},{"type":52,"value":3703}," (Gotcha 6):",{"type":46,"tag":118,"props":3705,"children":3707},{"className":120,"code":3706,"language":122,"meta":123,"style":123},"MATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_EXECUTION]->(:OrchestratorRun)-[:HAS_PART]->(iter:Iteration)\n      -[:HAS_SKILL_LOAD]->(sl:SkillLoad)\nRETURN iter.iteration_number, sl.skill_name, sl.content_length, sl.started_at\nORDER BY iter.iteration_number, sl.started_at\nLIMIT 100\n",[3708],{"type":46,"tag":61,"props":3709,"children":3710},{"__ignoreMap":123},[3711,3718,3726,3734,3742,3750],{"type":46,"tag":129,"props":3712,"children":3713},{"class":131,"line":132},[3714],{"type":46,"tag":129,"props":3715,"children":3716},{},[3717],{"type":52,"value":1042},{"type":46,"tag":129,"props":3719,"children":3720},{"class":131,"line":141},[3721],{"type":46,"tag":129,"props":3722,"children":3723},{},[3724],{"type":52,"value":3725},"      -[:HAS_EXECUTION]->(:OrchestratorRun)-[:HAS_PART]->(iter:Iteration)\n",{"type":46,"tag":129,"props":3727,"children":3728},{"class":131,"line":23},[3729],{"type":46,"tag":129,"props":3730,"children":3731},{},[3732],{"type":52,"value":3733},"      -[:HAS_SKILL_LOAD]->(sl:SkillLoad)\n",{"type":46,"tag":129,"props":3735,"children":3736},{"class":131,"line":27},[3737],{"type":46,"tag":129,"props":3738,"children":3739},{},[3740],{"type":52,"value":3741},"RETURN iter.iteration_number, sl.skill_name, sl.content_length, sl.started_at\n",{"type":46,"tag":129,"props":3743,"children":3744},{"class":131,"line":1061},[3745],{"type":46,"tag":129,"props":3746,"children":3747},{},[3748],{"type":52,"value":3749},"ORDER BY iter.iteration_number, sl.started_at\n",{"type":46,"tag":129,"props":3751,"children":3752},{"class":131,"line":1071},[3753],{"type":46,"tag":129,"props":3754,"children":3755},{},[3756],{"type":52,"value":3443},{"type":46,"tag":55,"props":3758,"children":3759},{},[3760],{"type":46,"tag":96,"props":3761,"children":3762},{},[3763],{"type":52,"value":3764},"Recipe run trace:",{"type":46,"tag":118,"props":3766,"children":3768},{"className":120,"code":3767,"language":122,"meta":123,"style":123},"MATCH (s:Session {workspace: $workspace, node_id: $session_id})\n      -[:HAS_RECIPE_RUN]->(rr:RecipeRun)-[:HAS_STEP]->(step:RecipeStep)\nOPTIONAL MATCH (step)-[:TRIGGERED]->(target)\nRETURN rr.name, rr.status, step.name,\n       labels(target) AS triggered_type, target.node_id AS triggered_id\nORDER BY step.started_at\nLIMIT 50\n",[3769],{"type":46,"tag":61,"props":3770,"children":3771},{"__ignoreMap":123},[3772,3779,3787,3795,3803,3811,3819],{"type":46,"tag":129,"props":3773,"children":3774},{"class":131,"line":132},[3775],{"type":46,"tag":129,"props":3776,"children":3777},{},[3778],{"type":52,"value":1042},{"type":46,"tag":129,"props":3780,"children":3781},{"class":131,"line":141},[3782],{"type":46,"tag":129,"props":3783,"children":3784},{},[3785],{"type":52,"value":3786},"      -[:HAS_RECIPE_RUN]->(rr:RecipeRun)-[:HAS_STEP]->(step:RecipeStep)\n",{"type":46,"tag":129,"props":3788,"children":3789},{"class":131,"line":23},[3790],{"type":46,"tag":129,"props":3791,"children":3792},{},[3793],{"type":52,"value":3794},"OPTIONAL MATCH (step)-[:TRIGGERED]->(target)\n",{"type":46,"tag":129,"props":3796,"children":3797},{"class":131,"line":27},[3798],{"type":46,"tag":129,"props":3799,"children":3800},{},[3801],{"type":52,"value":3802},"RETURN rr.name, rr.status, step.name,\n",{"type":46,"tag":129,"props":3804,"children":3805},{"class":131,"line":1061},[3806],{"type":46,"tag":129,"props":3807,"children":3808},{},[3809],{"type":52,"value":3810},"       labels(target) AS triggered_type, target.node_id AS triggered_id\n",{"type":46,"tag":129,"props":3812,"children":3813},{"class":131,"line":1071},[3814],{"type":46,"tag":129,"props":3815,"children":3816},{},[3817],{"type":52,"value":3818},"ORDER BY step.started_at\n",{"type":46,"tag":129,"props":3820,"children":3821},{"class":131,"line":1080},[3822],{"type":46,"tag":129,"props":3823,"children":3824},{},[3825],{"type":52,"value":2663},{"type":46,"tag":448,"props":3827,"children":3829},{"id":3828},"size-discipline-the-cardinal-rule",[3830],{"type":52,"value":3831},"Size discipline (the cardinal rule)",{"type":46,"tag":55,"props":3833,"children":3834},{},[3835,3837,3848],{"type":52,"value":3836},"The graph can hold thousands of sessions. ",{"type":46,"tag":96,"props":3838,"children":3839},{},[3840,3842,3847],{"type":52,"value":3841},"Every traversal query MUST have a ",{"type":46,"tag":61,"props":3843,"children":3845},{"className":3844},[],[3846],{"type":52,"value":2870},{"type":52,"value":686},{"type":52,"value":3849},"\nWork as a funnel:",{"type":46,"tag":3851,"props":3852,"children":3853},"ol",{},[3854,3872,3905,3915,3938],{"type":46,"tag":221,"props":3855,"children":3856},{},[3857,3862,3864,3870],{"type":46,"tag":96,"props":3858,"children":3859},{},[3860],{"type":52,"value":3861},"Count first.",{"type":52,"value":3863}," ",{"type":46,"tag":61,"props":3865,"children":3867},{"className":3866},[],[3868],{"type":52,"value":3869},"RETURN count(...)",{"type":52,"value":3871}," costs almost nothing — run it before any wide\nquery over an unknown population.",{"type":46,"tag":221,"props":3873,"children":3874},{},[3875,3880,3881,3887,3889,3895,3897,3903],{"type":46,"tag":96,"props":3876,"children":3877},{},[3878],{"type":52,"value":3879},"Anchor on a session",{"type":52,"value":919},{"type":46,"tag":61,"props":3882,"children":3884},{"className":3883},[],[3885],{"type":52,"value":3886},"node_id: $session_id",{"type":52,"value":3888}," or ",{"type":46,"tag":61,"props":3890,"children":3892},{"className":3891},[],[3893],{"type":52,"value":3894},"WHERE s.node_id IN [...]",{"type":52,"value":3896},")\nbefore traversing; an un-anchored ",{"type":46,"tag":61,"props":3898,"children":3900},{"className":3899},[],[3901],{"type":52,"value":3902},"MATCH (s:Session {workspace: $workspace})",{"type":52,"value":3904}," spans\nevery session and multiplies rows.",{"type":46,"tag":221,"props":3906,"children":3907},{},[3908,3913],{"type":46,"tag":96,"props":3909,"children":3910},{},[3911],{"type":52,"value":3912},"Filter and aggregate in Cypher",{"type":52,"value":3914},", not in the client — every unneeded row is wasted\ncontext.",{"type":46,"tag":221,"props":3916,"children":3917},{},[3918,3923,3924,3929,3931,3937],{"type":46,"tag":96,"props":3919,"children":3920},{},[3921],{"type":52,"value":3922},"Bound variable-length paths",{"type":52,"value":919},{"type":46,"tag":61,"props":3925,"children":3927},{"className":3926},[],[3928],{"type":52,"value":2729},{"type":52,"value":3930},"), never bare ",{"type":46,"tag":61,"props":3932,"children":3934},{"className":3933},[],[3935],{"type":52,"value":3936},"*",{"type":52,"value":686},{"type":46,"tag":221,"props":3939,"children":3940},{},[3941,3946,3947,3953],{"type":46,"tag":96,"props":3942,"children":3943},{},[3944],{"type":52,"value":3945},"Paginate",{"type":52,"value":662},{"type":46,"tag":61,"props":3948,"children":3950},{"className":3949},[],[3951],{"type":52,"value":3952},"ORDER BY \u003Cstable key> SKIP n LIMIT m",{"type":52,"value":3954}," when you genuinely need more\nthan one page.",{"type":46,"tag":70,"props":3956,"children":3957},{},[],{"type":46,"tag":47,"props":3959,"children":3961},{"id":3960},"section-8-push-work-to-the-database-apoc-gds",[3962],{"type":52,"value":3963},"Section 8 — Push Work to the Database (APOC \u002F GDS)",{"type":46,"tag":55,"props":3965,"children":3966},{},[3967,3972,3974,3979,3981,3986,3988,3993,3995,4000,4002,4007],{"type":46,"tag":96,"props":3968,"children":3969},{},[3970],{"type":52,"value":3971},"Prefer one server-side computation over many client round-trips.",{"type":52,"value":3973}," When an analysis\nneeds a deep or variable-length traversal, path-finding, centrality\u002Finfluence, community\nstructure, or a multi-step aggregation that would otherwise mean pulling rows to the\nclient and iterating, do the work ",{"type":46,"tag":96,"props":3975,"children":3976},{},[3977],{"type":52,"value":3978},"inside the graph",{"type":52,"value":3980},". It is faster and keeps the\nprotocol un-chatty — fewer tool calls, less context churn. Both plugins are installed and\n",{"type":46,"tag":96,"props":3982,"children":3983},{},[3984],{"type":52,"value":3985},"run on the live target",{"type":52,"value":3987}," (Neo4j Community here — GDS works). Rule of thumb: ",{"type":46,"tag":96,"props":3989,"children":3990},{},[3991],{"type":52,"value":3992},"if\nanswering the question the naive way means many round-trips or a large client-side pull,\npush that computation into the database.",{"type":52,"value":3994}," Probe once, compute server-side, and still\n",{"type":46,"tag":96,"props":3996,"children":3997},{},[3998],{"type":52,"value":3999},"bound the RETURNED result",{"type":52,"value":4001}," (count \u002F aggregate \u002F ",{"type":46,"tag":61,"props":4003,"children":4005},{"className":4004},[],[4006],{"type":52,"value":2870},{"type":52,"value":422},{"type":46,"tag":55,"props":4009,"children":4010},{},[4011,4013,4019,4020,4026,4028,4034],{"type":52,"value":4012},"Probe availability: ",{"type":46,"tag":61,"props":4014,"children":4016},{"className":4015},[],[4017],{"type":52,"value":4018},"CALL apoc.help('path')",{"type":52,"value":246},{"type":46,"tag":61,"props":4021,"children":4023},{"className":4022},[],[4024],{"type":52,"value":4025},"RETURN gds.version()",{"type":52,"value":4027}," (or ",{"type":46,"tag":61,"props":4029,"children":4031},{"className":4030},[],[4032],{"type":52,"value":4033},"CALL gds.list()",{"type":52,"value":422},{"type":46,"tag":217,"props":4036,"children":4037},{},[4038,4102],{"type":46,"tag":221,"props":4039,"children":4040},{},[4041,4046,4047,4053,4055,4060,4062,4067,4069,4075,4077,4087,4089,4094,4095,4100],{"type":46,"tag":96,"props":4042,"children":4043},{},[4044],{"type":52,"value":4045},"APOC — in-graph helpers.",{"type":52,"value":3863},{"type":46,"tag":61,"props":4048,"children":4050},{"className":4049},[],[4051],{"type":52,"value":4052},"apoc.convert.fromJsonMap(e.data)",{"type":52,"value":4054}," parses a ",{"type":46,"tag":61,"props":4056,"children":4058},{"className":4057},[],[4059],{"type":52,"value":897},{"type":52,"value":4061}," JSON\nstring into a map without a client ",{"type":46,"tag":61,"props":4063,"children":4065},{"className":4064},[],[4066],{"type":52,"value":3240},{"type":52,"value":4068}," hop. ",{"type":46,"tag":61,"props":4070,"children":4072},{"className":4071},[],[4073],{"type":52,"value":4074},"apoc.path.expandConfig(...)",{"type":52,"value":4076}," runs\nconfigurable in-graph traversals — subject to the ",{"type":46,"tag":96,"props":4078,"children":4079},{},[4080,4082],{"type":52,"value":4081},"same 1-hop caveat as\n",{"type":46,"tag":61,"props":4083,"children":4085},{"className":4084},[],[4086],{"type":52,"value":1358},{"type":52,"value":4088}," (Trap 1): for delegation depth, expand over ",{"type":46,"tag":61,"props":4090,"children":4092},{"className":4091},[],[4093],{"type":52,"value":1188},{"type":52,"value":1421},{"type":46,"tag":61,"props":4096,"children":4098},{"className":4097},[],[4099],{"type":52,"value":1427},{"type":52,"value":4101},".\nStill bound your output.",{"type":46,"tag":221,"props":4103,"children":4104},{},[4105,4110,4112,4117,4119,4125,4127,4235,4239,4244,4246,4251,4253,4258,4260,4265,4267,4272,4274,4280,4282,4287,4289,4295,4297,4302,4303,4308,4310,4315,4317,4322,4324,4343,4345,4350,4352,4357,4359,4422,4425,4427,4432,4434,4439,4441,4445,4447,4452,4454,4459,4461,4466,4468,4473,4475,4478],{"type":46,"tag":96,"props":4106,"children":4107},{},[4108],{"type":52,"value":4109},"GDS — real graph analytics in one pass.",{"type":52,"value":4111}," For centrality\u002Finfluence, community\u002Fcluster\ndetection, or pathfinding ",{"type":46,"tag":96,"props":4113,"children":4114},{},[4115],{"type":52,"value":4116},"across many sessions",{"type":52,"value":4118},", project once and run the algorithm\nserver-side instead of reconstructing the graph client-side. Always ",{"type":46,"tag":61,"props":4120,"children":4122},{"className":4121},[],[4123],{"type":52,"value":4124},"gds.graph.drop",{"type":52,"value":4126},"\nthe projection when done:",{"type":46,"tag":118,"props":4128,"children":4130},{"className":120,"code":4129,"language":122,"meta":123,"style":123},"CALL gds.graph.project('g', 'Session', 'FORKED')\nYIELD nodeCount, relationshipCount;\n\nCALL gds.pageRank.stream('g')          \u002F\u002F or gds.degree \u002F gds.betweenness (influence)\nYIELD nodeId, score\nRETURN gds.util.asNode(nodeId).node_id AS session, score\nORDER BY score DESC LIMIT 20;\n\nCALL gds.wcc.stream('g')               \u002F\u002F or gds.louvain (community structure)\nYIELD componentId\nRETURN componentId, count(*) AS size ORDER BY size DESC LIMIT 20;\n\nCALL gds.graph.drop('g') YIELD graphName;   \u002F\u002F always release the projection\n",[4131],{"type":46,"tag":61,"props":4132,"children":4133},{"__ignoreMap":123},[4134,4142,4150,4157,4165,4173,4181,4189,4196,4204,4212,4220,4227],{"type":46,"tag":129,"props":4135,"children":4136},{"class":131,"line":132},[4137],{"type":46,"tag":129,"props":4138,"children":4139},{},[4140],{"type":52,"value":4141},"CALL gds.graph.project('g', 'Session', 'FORKED')\n",{"type":46,"tag":129,"props":4143,"children":4144},{"class":131,"line":141},[4145],{"type":46,"tag":129,"props":4146,"children":4147},{},[4148],{"type":52,"value":4149},"YIELD nodeCount, relationshipCount;\n",{"type":46,"tag":129,"props":4151,"children":4152},{"class":131,"line":23},[4153],{"type":46,"tag":129,"props":4154,"children":4155},{"emptyLinePlaceholder":1065},[4156],{"type":52,"value":1068},{"type":46,"tag":129,"props":4158,"children":4159},{"class":131,"line":27},[4160],{"type":46,"tag":129,"props":4161,"children":4162},{},[4163],{"type":52,"value":4164},"CALL gds.pageRank.stream('g')          \u002F\u002F or gds.degree \u002F gds.betweenness (influence)\n",{"type":46,"tag":129,"props":4166,"children":4167},{"class":131,"line":1061},[4168],{"type":46,"tag":129,"props":4169,"children":4170},{},[4171],{"type":52,"value":4172},"YIELD nodeId, score\n",{"type":46,"tag":129,"props":4174,"children":4175},{"class":131,"line":1071},[4176],{"type":46,"tag":129,"props":4177,"children":4178},{},[4179],{"type":52,"value":4180},"RETURN gds.util.asNode(nodeId).node_id AS session, score\n",{"type":46,"tag":129,"props":4182,"children":4183},{"class":131,"line":1080},[4184],{"type":46,"tag":129,"props":4185,"children":4186},{},[4187],{"type":52,"value":4188},"ORDER BY score DESC LIMIT 20;\n",{"type":46,"tag":129,"props":4190,"children":4191},{"class":131,"line":1089},[4192],{"type":46,"tag":129,"props":4193,"children":4194},{"emptyLinePlaceholder":1065},[4195],{"type":52,"value":1068},{"type":46,"tag":129,"props":4197,"children":4198},{"class":131,"line":1098},[4199],{"type":46,"tag":129,"props":4200,"children":4201},{},[4202],{"type":52,"value":4203},"CALL gds.wcc.stream('g')               \u002F\u002F or gds.louvain (community structure)\n",{"type":46,"tag":129,"props":4205,"children":4206},{"class":131,"line":2304},[4207],{"type":46,"tag":129,"props":4208,"children":4209},{},[4210],{"type":52,"value":4211},"YIELD componentId\n",{"type":46,"tag":129,"props":4213,"children":4214},{"class":131,"line":2313},[4215],{"type":46,"tag":129,"props":4216,"children":4217},{},[4218],{"type":52,"value":4219},"RETURN componentId, count(*) AS size ORDER BY size DESC LIMIT 20;\n",{"type":46,"tag":129,"props":4221,"children":4222},{"class":131,"line":2322},[4223],{"type":46,"tag":129,"props":4224,"children":4225},{"emptyLinePlaceholder":1065},[4226],{"type":52,"value":1068},{"type":46,"tag":129,"props":4228,"children":4229},{"class":131,"line":3015},[4230],{"type":46,"tag":129,"props":4231,"children":4232},{},[4233],{"type":52,"value":4234},"CALL gds.graph.drop('g') YIELD graphName;   \u002F\u002F always release the projection\n",{"type":46,"tag":4236,"props":4237,"children":4238},"br",{},[],{"type":46,"tag":96,"props":4240,"children":4241},{},[4242],{"type":52,"value":4243},"Agent-level, not session-level — agents are a PROPERTY to roll up by, not a projectable graph.",{"type":52,"value":4245},"\n\"Which ",{"type":46,"tag":263,"props":4247,"children":4248},{},[4249],{"type":52,"value":4250},"agent",{"type":52,"value":4252}," is a hub\" ≠ \"which ",{"type":46,"tag":263,"props":4254,"children":4255},{},[4256],{"type":52,"value":4257},"session",{"type":52,"value":4259}," is a hub\": one session can be highly central\nwhile its agent is not. ",{"type":46,"tag":61,"props":4261,"children":4263},{"className":4262},[],[4264],{"type":52,"value":390},{"type":52,"value":4266}," concept nodes ",{"type":46,"tag":263,"props":4268,"children":4269},{},[4270],{"type":52,"value":4271},"do",{"type":52,"value":4273}," exist (Section 1; Gotcha 4), but they\ncarry only inbound ",{"type":46,"tag":61,"props":4275,"children":4277},{"className":4276},[],[4278],{"type":52,"value":4279},"HAS_AGENT",{"type":52,"value":4281}," edges from sessions — there is ",{"type":46,"tag":96,"props":4283,"children":4284},{},[4285],{"type":52,"value":4286},"no Agent→Agent edge\nstructure to project",{"type":52,"value":4288},", so GDS centrality has nothing to traverse at the agent level. Do NOT\n",{"type":46,"tag":61,"props":4290,"children":4292},{"className":4291},[],[4293],{"type":52,"value":4294},"gds.graph.project.cypher(...)",{"type":52,"value":4296}," an agent-level graph; it returns an empty projection and\nis a dead end. Instead ",{"type":46,"tag":96,"props":4298,"children":4299},{},[4300],{"type":52,"value":4301},"project the labels that exist",{"type":52,"value":843},{"type":46,"tag":61,"props":4304,"children":4306},{"className":4305},[],[4307],{"type":52,"value":301},{"type":52,"value":4309}," (nodes) and ",{"type":46,"tag":61,"props":4311,"children":4313},{"className":4312},[],[4314],{"type":52,"value":1188},{"type":52,"value":4316},"\n(relationships) — run the algorithm over ",{"type":46,"tag":263,"props":4318,"children":4319},{},[4320],{"type":52,"value":4321},"sessions",{"type":52,"value":4323},", then ",{"type":46,"tag":96,"props":4325,"children":4326},{},[4327,4329,4335,4337],{"type":52,"value":4328},"roll the per-session scores up\nby the ",{"type":46,"tag":61,"props":4330,"children":4332},{"className":4331},[],[4333],{"type":52,"value":4334},"Session.agent",{"type":52,"value":4336}," property in the ",{"type":46,"tag":61,"props":4338,"children":4340},{"className":4339},[],[4341],{"type":52,"value":4342},"RETURN",{"type":52,"value":4344},". For the named-agent-hub ranking, drop\nthe ",{"type":46,"tag":61,"props":4346,"children":4348},{"className":4347},[],[4349],{"type":52,"value":1693},{"type":52,"value":4351}," marker and the root\u002Fmain session (",{"type":46,"tag":61,"props":4353,"children":4355},{"className":4354},[],[4356],{"type":52,"value":1783},{"type":52,"value":4358},") — a \"which named agent\"\nquestion is about named agents:",{"type":46,"tag":118,"props":4360,"children":4362},{"className":120,"code":4361,"language":122,"meta":123,"style":123},"\u002F\u002F 'g' is the Session \u002F FORKED projection from above — agents are NOT projected;\n\u002F\u002F agent-level results come from aggregating session scores by the s.agent PROPERTY.\nCALL gds.pageRank.stream('g') YIELD nodeId, score\nWITH gds.util.asNode(nodeId) AS s, score\nWHERE s.agent IS NOT NULL AND s.agent \u003C> 'self'   \u002F\u002F named agents only (see Trap 4 for 'self')\nRETURN s.agent AS agent, round(sum(score), 2) AS agent_influence, count(*) AS sessions\nORDER BY agent_influence DESC LIMIT 20\n",[4363],{"type":46,"tag":61,"props":4364,"children":4365},{"__ignoreMap":123},[4366,4374,4382,4390,4398,4406,4414],{"type":46,"tag":129,"props":4367,"children":4368},{"class":131,"line":132},[4369],{"type":46,"tag":129,"props":4370,"children":4371},{},[4372],{"type":52,"value":4373},"\u002F\u002F 'g' is the Session \u002F FORKED projection from above — agents are NOT projected;\n",{"type":46,"tag":129,"props":4375,"children":4376},{"class":131,"line":141},[4377],{"type":46,"tag":129,"props":4378,"children":4379},{},[4380],{"type":52,"value":4381},"\u002F\u002F agent-level results come from aggregating session scores by the s.agent PROPERTY.\n",{"type":46,"tag":129,"props":4383,"children":4384},{"class":131,"line":23},[4385],{"type":46,"tag":129,"props":4386,"children":4387},{},[4388],{"type":52,"value":4389},"CALL gds.pageRank.stream('g') YIELD nodeId, score\n",{"type":46,"tag":129,"props":4391,"children":4392},{"class":131,"line":27},[4393],{"type":46,"tag":129,"props":4394,"children":4395},{},[4396],{"type":52,"value":4397},"WITH gds.util.asNode(nodeId) AS s, score\n",{"type":46,"tag":129,"props":4399,"children":4400},{"class":131,"line":1061},[4401],{"type":46,"tag":129,"props":4402,"children":4403},{},[4404],{"type":52,"value":4405},"WHERE s.agent IS NOT NULL AND s.agent \u003C> 'self'   \u002F\u002F named agents only (see Trap 4 for 'self')\n",{"type":46,"tag":129,"props":4407,"children":4408},{"class":131,"line":1071},[4409],{"type":46,"tag":129,"props":4410,"children":4411},{},[4412],{"type":52,"value":4413},"RETURN s.agent AS agent, round(sum(score), 2) AS agent_influence, count(*) AS sessions\n",{"type":46,"tag":129,"props":4415,"children":4416},{"class":131,"line":1080},[4417],{"type":46,"tag":129,"props":4418,"children":4419},{},[4420],{"type":52,"value":4421},"ORDER BY agent_influence DESC LIMIT 20\n",{"type":46,"tag":4236,"props":4423,"children":4424},{},[],{"type":52,"value":4426},"Excluding ",{"type":46,"tag":61,"props":4428,"children":4430},{"className":4429},[],[4431],{"type":52,"value":1693},{"type":52,"value":4433}," here answers \"which ",{"type":46,"tag":263,"props":4435,"children":4436},{},[4437],{"type":52,"value":4438},"named",{"type":52,"value":4440}," agent is a hub\" — it does ",{"type":46,"tag":96,"props":4442,"children":4443},{},[4444],{"type":52,"value":750},{"type":52,"value":4446}," make ",{"type":46,"tag":61,"props":4448,"children":4450},{"className":4449},[],[4451],{"type":52,"value":1693},{"type":52,"value":4453},"\nvanish from the story. If the question also touches self-delegation, resolve ",{"type":46,"tag":61,"props":4455,"children":4457},{"className":4456},[],[4458],{"type":52,"value":1693},{"type":52,"value":4460}," up the\n",{"type":46,"tag":61,"props":4462,"children":4464},{"className":4463},[],[4465],{"type":52,"value":1188},{"type":52,"value":4467}," chain (Trap 4) and ",{"type":46,"tag":96,"props":4469,"children":4470},{},[4471],{"type":52,"value":4472},"state that root\u002Fmain-vs-named breakdown as its own finding",{"type":52,"value":4474},";\ndon't let the exclusion above silently drop it.",{"type":46,"tag":4236,"props":4476,"children":4477},{},[],{"type":52,"value":4479},"Skip GDS for a simple count or grouping that one plain Cypher statement already does —\nreach for it when the naive alternative is iterative client-side fetching.",{"type":46,"tag":70,"props":4481,"children":4482},{},[],{"type":46,"tag":448,"props":4484,"children":4486},{"id":4485},"lift-payload-fields-in-graph-with-apoc-the-one-authoritative-pattern",[4487],{"type":52,"value":4488},"Lift payload fields in-graph with APOC (the one authoritative pattern)",{"type":46,"tag":55,"props":4490,"children":4491},{},[4492,4497,4498,4504,4506,4511,4513,4519,4520,4525],{"type":46,"tag":96,"props":4493,"children":4494},{},[4495],{"type":52,"value":4496},"Problem.",{"type":52,"value":3863},{"type":46,"tag":61,"props":4499,"children":4501},{"className":4500},[],[4502],{"type":52,"value":4503},"Event.data",{"type":52,"value":4505}," (and nested payloads) is a serialized JSON ",{"type":46,"tag":96,"props":4507,"children":4508},{},[4509],{"type":52,"value":4510},"string",{"type":52,"value":4512},", not a Cypher\nmap. Dot-access like ",{"type":46,"tag":61,"props":4514,"children":4516},{"className":4515},[],[4517],{"type":52,"value":4518},"e.data.working_dir",{"type":52,"value":3863},{"type":46,"tag":96,"props":4521,"children":4522},{},[4523],{"type":52,"value":4524},"fails loudly",{"type":52,"value":4526}," — Neo4j raises:",{"type":46,"tag":118,"props":4528,"children":4532},{"className":4529,"code":4531,"language":52},[4530],"language-text","Neo.ClientError.Statement.TypeError: Type mismatch: expected a map but was String(...)\n",[4533],{"type":46,"tag":61,"props":4534,"children":4535},{"__ignoreMap":123},[4536],{"type":52,"value":4531},{"type":46,"tag":55,"props":4538,"children":4539},{},[4540,4542,4547,4549,4553,4555,4560,4562,4567,4569,4575,4577,4582],{"type":52,"value":4541},"You ",{"type":46,"tag":96,"props":4543,"children":4544},{},[4545],{"type":52,"value":4546},"must",{"type":52,"value":4548}," parse the string before reading a field. (Do ",{"type":46,"tag":96,"props":4550,"children":4551},{},[4552],{"type":52,"value":750},{"type":52,"value":4554}," confuse this with the\nsilent-null trap in ",{"type":46,"tag":96,"props":4556,"children":4557},{},[4558],{"type":52,"value":4559},"Trap 5",{"type":52,"value":4561}," — that one is comparing a ",{"type":46,"tag":263,"props":4563,"children":4564},{},[4565],{"type":52,"value":4566},"zoned datetime to a string literal",{"type":52,"value":4568},",\nwhich returns ",{"type":46,"tag":61,"props":4570,"children":4572},{"className":4571},[],[4573],{"type":52,"value":4574},"null",{"type":52,"value":4576}," with no error. This APOC case is a ",{"type":46,"tag":263,"props":4578,"children":4579},{},[4580],{"type":52,"value":4581},"loud",{"type":52,"value":4583}," error, a different failure mode.)",{"type":46,"tag":55,"props":4585,"children":4586},{},[4587],{"type":46,"tag":96,"props":4588,"children":4589},{},[4590],{"type":52,"value":4591},"Pattern — parse in-graph, project only the scalar you need:",{"type":46,"tag":118,"props":4593,"children":4595},{"className":120,"code":4594,"language":122,"meta":123,"style":123},"WITH apoc.convert.fromJsonMap(e.data) AS d\nRETURN d.working_dir AS working_dir      \u002F\u002F one scalar, not the whole payload\n",[4596],{"type":46,"tag":61,"props":4597,"children":4598},{"__ignoreMap":123},[4599,4607],{"type":46,"tag":129,"props":4600,"children":4601},{"class":131,"line":132},[4602],{"type":46,"tag":129,"props":4603,"children":4604},{},[4605],{"type":52,"value":4606},"WITH apoc.convert.fromJsonMap(e.data) AS d\n",{"type":46,"tag":129,"props":4608,"children":4609},{"class":131,"line":141},[4610],{"type":46,"tag":129,"props":4611,"children":4612},{},[4613],{"type":52,"value":4614},"RETURN d.working_dir AS working_dir      \u002F\u002F one scalar, not the whole payload\n",{"type":46,"tag":55,"props":4616,"children":4617},{},[4618,4620,4626,4628,4633,4635,4640,4642,4647],{"type":52,"value":4619},"Use ",{"type":46,"tag":61,"props":4621,"children":4623},{"className":4622},[],[4624],{"type":52,"value":4625},"apoc.convert.fromJsonList(...)",{"type":52,"value":4627}," for arrays. ",{"type":46,"tag":96,"props":4629,"children":4630},{},[4631],{"type":52,"value":4632},"Never",{"type":52,"value":4634}," pull the full ",{"type":46,"tag":61,"props":4636,"children":4638},{"className":4637},[],[4639],{"type":52,"value":897},{"type":52,"value":4641}," string to the\nclient to parse with ",{"type":46,"tag":61,"props":4643,"children":4645},{"className":4644},[],[4646],{"type":52,"value":3240},{"type":52,"value":686},{"type":46,"tag":55,"props":4649,"children":4650},{},[4651],{"type":46,"tag":96,"props":4652,"children":4653},{},[4654],{"type":52,"value":4655},"Two wins:",{"type":46,"tag":217,"props":4657,"children":4658},{},[4659,4675],{"type":46,"tag":221,"props":4660,"children":4661},{},[4662,4667,4669,4673],{"type":46,"tag":96,"props":4663,"children":4664},{},[4665],{"type":52,"value":4666},"Correctness",{"type":52,"value":4668}," — dot-access on the string errors out; parsing with APOC is the ",{"type":46,"tag":263,"props":4670,"children":4671},{},[4672],{"type":52,"value":3095},{"type":52,"value":4674}," way to\nread the real value.",{"type":46,"tag":221,"props":4676,"children":4677},{},[4678,4683,4685,4689],{"type":46,"tag":96,"props":4679,"children":4680},{},[4681],{"type":52,"value":4682},"Leanness",{"type":52,"value":4684}," — the parse ",{"type":46,"tag":96,"props":4686,"children":4687},{},[4688],{"type":52,"value":2876},{"type":52,"value":4690}," the field-selection happen server-side; the payload never\ncrosses the wire or enters context — same discipline as Section 6 (\"never return full text\").",{"type":46,"tag":55,"props":4692,"children":4693},{},[4694,4699,4701,4705,4707,4712,4714,4718],{"type":46,"tag":96,"props":4695,"children":4696},{},[4697],{"type":52,"value":4698},"Rule.",{"type":52,"value":4700}," Prefer lifted first-class properties when they exist; when a field is ",{"type":46,"tag":96,"props":4702,"children":4703},{},[4704],{"type":52,"value":3095},{"type":52,"value":4706}," in the\npayload, lift it in-graph with APOC and return just the scalar. (",{"type":46,"tag":61,"props":4708,"children":4710},{"className":4709},[],[4711],{"type":52,"value":905},{"type":52,"value":4713}," is the worked\nexample here — proven, and the whole point of the pattern — but per Section 2, it is ",{"type":46,"tag":96,"props":4715,"children":4716},{},[4717],{"type":52,"value":750},{"type":52,"value":4719},"\na scoping lever: it is sparsely populated (~7% of sessions) with no canonical per-session\nsource, so use it to read one session's directory, never to scope a population.)",{"type":46,"tag":70,"props":4721,"children":4722},{},[],{"type":46,"tag":47,"props":4724,"children":4726},{"id":4725},"gotchas",[4727],{"type":52,"value":4728},"Gotchas",{"type":46,"tag":3851,"props":4730,"children":4731},{},[4732,4750,4779,4803,4862,4900,4935,5012],{"type":46,"tag":221,"props":4733,"children":4734},{},[4735,4740,4742,4748],{"type":46,"tag":96,"props":4736,"children":4737},{},[4738],{"type":52,"value":4739},"Layer-2 \u002F foundation nodes only exist if handlers ran, or the feature was used.",{"type":52,"value":4741},"\nSessions ingested before a handler was deployed, or with no delegation\u002Fskills\u002Frecipes,\nsimply lack those nodes. Use ",{"type":46,"tag":61,"props":4743,"children":4745},{"className":4744},[],[4746],{"type":52,"value":4747},"OPTIONAL MATCH",{"type":52,"value":4749}," when joining them against arbitrary\nsessions.",{"type":46,"tag":221,"props":4751,"children":4752},{},[4753,4764,4765,4770,4772,4777],{"type":46,"tag":96,"props":4754,"children":4755},{},[4756,4762],{"type":46,"tag":61,"props":4757,"children":4759},{"className":4758},[],[4760],{"type":52,"value":4761},"result_success = false",{"type":52,"value":4763}," is the error path;",{"type":52,"value":3863},{"type":46,"tag":61,"props":4766,"children":4768},{"className":4767},[],[4769],{"type":52,"value":1601},{"type":52,"value":4771}," holds the message. A\nnull ",{"type":46,"tag":61,"props":4773,"children":4775},{"className":4774},[],[4776],{"type":52,"value":1594},{"type":52,"value":4778}," means the post\u002Ferror event hasn't been processed — the call is\nin-flight or its handler didn't run.",{"type":46,"tag":221,"props":4780,"children":4781},{},[4782,4793,4795,4801],{"type":46,"tag":96,"props":4783,"children":4784},{},[4785,4791],{"type":46,"tag":61,"props":4786,"children":4788},{"className":4787},[],[4789],{"type":52,"value":4790},"ENABLES",{"type":52,"value":4792}," edges are sparse.",{"type":52,"value":4794}," The ",{"type":46,"tag":61,"props":4796,"children":4798},{"className":4797},[],[4799],{"type":52,"value":4800},"OrchestratorRun → next Prompt",{"type":52,"value":4802}," edge exists only\nfor multi-turn chains (N prompts ⇒ N−1 edges). Do not use its presence to judge clean\nsession termination.",{"type":46,"tag":221,"props":4804,"children":4805},{},[4806,4831,4833,4839,4841,4846,4848,4854,4856,4861],{"type":46,"tag":96,"props":4807,"children":4808},{},[4809,4811,4816,4817,4822,4823,4829],{"type":52,"value":4810},"Concept nodes (",{"type":46,"tag":61,"props":4812,"children":4814},{"className":4813},[],[4815],{"type":52,"value":390},{"type":52,"value":246},{"type":46,"tag":61,"props":4818,"children":4820},{"className":4819},[],[4821],{"type":52,"value":420},{"type":52,"value":246},{"type":46,"tag":61,"props":4824,"children":4826},{"className":4825},[],[4827],{"type":52,"value":4828},"Orchestrator",{"type":52,"value":4830},") are shared across sessions,",{"type":52,"value":4832},"\nmerged by name. Querying ",{"type":46,"tag":61,"props":4834,"children":4836},{"className":4835},[],[4837],{"type":52,"value":4838},"(a:Agent)",{"type":52,"value":4840}," without a session anchor spans everything — reach\nthem through the session (",{"type":46,"tag":61,"props":4842,"children":4844},{"className":4843},[],[4845],{"type":52,"value":4279},{"type":52,"value":4847}," from the sub-session, ",{"type":46,"tag":61,"props":4849,"children":4851},{"className":4850},[],[4852],{"type":52,"value":4853},"HAS_RECIPE",{"type":52,"value":4855}," from a\n",{"type":46,"tag":61,"props":4857,"children":4859},{"className":4858},[],[4860],{"type":52,"value":406},{"type":52,"value":422},{"type":46,"tag":221,"props":4863,"children":4864},{},[4865,4875,4877],{"type":46,"tag":96,"props":4866,"children":4867},{},[4868,4873],{"type":46,"tag":61,"props":4869,"children":4871},{"className":4870},[],[4872],{"type":52,"value":436},{"type":52,"value":4874}," may be absent on older sessions.",{"type":52,"value":4876}," Detect and fall back to the\nSection 4 fallback joins:",{"type":46,"tag":118,"props":4878,"children":4880},{"className":120,"code":4879,"language":122,"meta":123,"style":123},"MATCH (n:SST_EVENT) WHERE NOT (n)-[:SOURCED_FROM]->() AND NOT n:Session\nRETURN labels(n), count(*)\n",[4881],{"type":46,"tag":61,"props":4882,"children":4883},{"__ignoreMap":123},[4884,4892],{"type":46,"tag":129,"props":4885,"children":4886},{"class":131,"line":132},[4887],{"type":46,"tag":129,"props":4888,"children":4889},{},[4890],{"type":52,"value":4891},"MATCH (n:SST_EVENT) WHERE NOT (n)-[:SOURCED_FROM]->() AND NOT n:Session\n",{"type":46,"tag":129,"props":4893,"children":4894},{"class":131,"line":141},[4895],{"type":46,"tag":129,"props":4896,"children":4897},{},[4898],{"type":52,"value":4899},"RETURN labels(n), count(*)\n",{"type":46,"tag":221,"props":4901,"children":4902},{},[4903,4925,4927,4933],{"type":46,"tag":96,"props":4904,"children":4905},{},[4906,4911,4913,4918,4919,4924],{"type":46,"tag":61,"props":4907,"children":4909},{"className":4908},[],[4910],{"type":52,"value":398},{"type":52,"value":4912}," may attach to ",{"type":46,"tag":61,"props":4914,"children":4916},{"className":4915},[],[4917],{"type":52,"value":301},{"type":52,"value":1543},{"type":46,"tag":61,"props":4920,"children":4922},{"className":4921},[],[4923],{"type":52,"value":316},{"type":52,"value":686},{"type":52,"value":4926}," Skills loaded before the\nfirst request have no active iteration. Add\n",{"type":46,"tag":61,"props":4928,"children":4930},{"className":4929},[],[4931],{"type":52,"value":4932},"OPTIONAL MATCH (s)-[:HAS_SKILL_LOAD]->(sl:SkillLoad)",{"type":52,"value":4934}," to catch session-level loads.",{"type":46,"tag":221,"props":4936,"children":4937},{},[4938,4949,4951,4957,4959,4965,4966,4972,4974,4980,4982,4988,4989,4995,4996,5002,5004,5010],{"type":46,"tag":96,"props":4939,"children":4940},{},[4941,4947],{"type":46,"tag":61,"props":4942,"children":4944},{"className":4943},[],[4945],{"type":52,"value":4946},"IncompleteSession",{"type":52,"value":4948}," is a health marker, not a terminal label.",{"type":52,"value":4950}," It reached\n",{"type":46,"tag":61,"props":4952,"children":4954},{"className":4953},[],[4955],{"type":52,"value":4956},"session:end",{"type":52,"value":4958}," with no captured ",{"type":46,"tag":61,"props":4960,"children":4962},{"className":4961},[],[4963],{"type":52,"value":4964},"session:start",{"type":52,"value":1421},{"type":46,"tag":61,"props":4967,"children":4969},{"className":4968},[],[4970],{"type":52,"value":4971},"fork",{"type":52,"value":4973},", carries ",{"type":46,"tag":61,"props":4975,"children":4977},{"className":4976},[],[4978],{"type":52,"value":4979},"has_terminal: false",{"type":52,"value":4981},",\nand none of ",{"type":46,"tag":61,"props":4983,"children":4985},{"className":4984},[],[4986],{"type":52,"value":4987},":RootSession",{"type":52,"value":1421},{"type":46,"tag":61,"props":4990,"children":4992},{"className":4991},[],[4993],{"type":52,"value":4994},":SubSession",{"type":52,"value":1421},{"type":46,"tag":61,"props":4997,"children":4999},{"className":4998},[],[5000],{"type":52,"value":5001},":ForkedSession",{"type":52,"value":5003},". Exclude it from normal\nterminal-session queries with ",{"type":46,"tag":61,"props":5005,"children":5007},{"className":5006},[],[5008],{"type":52,"value":5009},"WHERE NOT s:IncompleteSession",{"type":52,"value":5011},". A spike in its count\nsignals upstream event loss.",{"type":46,"tag":221,"props":5013,"children":5014},{},[5015,5027,5029,5035],{"type":46,"tag":96,"props":5016,"children":5017},{},[5018,5020,5026],{"type":52,"value":5019},"The node MERGE key is ",{"type":46,"tag":61,"props":5021,"children":5023},{"className":5022},[],[5024],{"type":52,"value":5025},"{node_id, workspace}",{"type":52,"value":686},{"type":52,"value":5028}," The same logical entity (e.g. an\nOrchestrator named ",{"type":46,"tag":61,"props":5030,"children":5032},{"className":5031},[],[5033],{"type":52,"value":5034},"loop-streaming",{"type":52,"value":5036},") exists as a separate node per workspace. A\ncross-workspace query returns one node per workspace — account for this when\naggregating.",{"type":46,"tag":5038,"props":5039,"children":5040},"style",{},[5041],{"type":52,"value":5042},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":5044,"total":5234},[5045,5067,5086,5105,5120,5136,5147,5160,5175,5190,5209,5222],{"slug":5046,"name":5046,"fn":5047,"description":5048,"org":5049,"tags":5050,"stars":5064,"repoUrl":5065,"updatedAt":5066},"rushstack-best-practices","manage Rush monorepos with best practices","Provides best practices and guidance for working with Rush monorepos. Use when the user is working in a Rush-based repository, asks about Rush commands (install, update, build, rebuild), needs help with project selection, dependency management, build caching, subspace configuration, or troubleshooting Rush-specific issues.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5051,5054,5057,5058,5061],{"name":5052,"slug":5053,"type":15},"Engineering","engineering",{"name":5055,"slug":5056,"type":15},"Local Development","local-development",{"name":9,"slug":8,"type":15},{"name":5059,"slug":5060,"type":15},"Project Management","project-management",{"name":5062,"slug":5063,"type":15},"Rush","rush",6484,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Frushstack","2026-04-06T18:34:44.965032",{"slug":5068,"name":5068,"fn":5069,"description":5070,"org":5071,"tags":5072,"stars":5083,"repoUrl":5084,"updatedAt":5085},"azure-ai-agents-persistent-dotnet","build AI agents with Azure .NET SDK","Azure AI Agents Persistent SDK for .NET. Low-level SDK for creating and managing AI agents with threads, messages, runs, and tools. Use for agent CRUD, conversation threads, streaming responses, function calling, file search, and code interpreter. Triggers: \"PersistentAgentsClient\", \"persistent agents\", \"agent threads\", \"agent runs\", \"streaming agents\", \"function calling agents .NET\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5073,5076,5077,5080],{"name":5074,"slug":5075,"type":15},".NET","net",{"name":21,"slug":22,"type":15},{"name":5078,"slug":5079,"type":15},"Azure","azure",{"name":5081,"slug":5082,"type":15},"LLM","llm",2804,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills","2026-07-03T16:32:10.297433",{"slug":5087,"name":5087,"fn":5088,"description":5089,"org":5090,"tags":5091,"stars":5083,"repoUrl":5084,"updatedAt":5104},"azure-ai-anomalydetector-java","build anomaly detection applications with Java","Build anomaly detection applications with Azure AI Anomaly Detector SDK for Java. Use when implementing univariate\u002Fmultivariate anomaly detection, time-series analysis, or AI-powered monitoring.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5092,5095,5096,5097,5100,5101],{"name":5093,"slug":5094,"type":15},"Analytics","analytics",{"name":5078,"slug":5079,"type":15},{"name":17,"slug":18,"type":15},{"name":5098,"slug":5099,"type":15},"Java","java",{"name":9,"slug":8,"type":15},{"name":5102,"slug":5103,"type":15},"Monitoring","monitoring","2026-05-13T06:14:16.261754",{"slug":5106,"name":5106,"fn":5107,"description":5108,"org":5109,"tags":5110,"stars":5083,"repoUrl":5084,"updatedAt":5119},"azure-ai-contentsafety-java","build content moderation applications with Azure AI","Build content moderation applications with Azure AI Content Safety SDK for Java. Use when implementing text\u002Fimage analysis, blocklist management, or harm detection for hate, violence, sexual content, and self-harm.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5111,5114,5115,5116],{"name":5112,"slug":5113,"type":15},"AI Infrastructure","ai-infrastructure",{"name":5078,"slug":5079,"type":15},{"name":5098,"slug":5099,"type":15},{"name":5117,"slug":5118,"type":15},"Security","security","2026-07-07T06:53:31.293235",{"slug":5121,"name":5121,"fn":5122,"description":5123,"org":5124,"tags":5125,"stars":5083,"repoUrl":5084,"updatedAt":5135},"azure-ai-contentsafety-py","detect harmful content with Azure AI Content Safety","Azure AI Content Safety SDK for Python. Use for detecting harmful content in text and images with multi-severity classification.\nTriggers: \"azure-ai-contentsafety\", \"ContentSafetyClient\", \"content moderation\", \"harmful content\", \"text analysis\", \"image analysis\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5126,5127,5130,5131,5132,5134],{"name":5078,"slug":5079,"type":15},{"name":5128,"slug":5129,"type":15},"Compliance","compliance",{"name":5081,"slug":5082,"type":15},{"name":9,"slug":8,"type":15},{"name":5133,"slug":3218,"type":15},"Python",{"name":5117,"slug":5118,"type":15},"2026-07-18T05:14:23.017504",{"slug":5137,"name":5137,"fn":5138,"description":5139,"org":5140,"tags":5141,"stars":5083,"repoUrl":5084,"updatedAt":5146},"azure-ai-language-conversations-py","implement conversational language understanding with Python","Implement Conversational Language Understanding (CLU) using the azure-ai-language-conversations Python SDK. Use when working with ConversationAnalysisClient to analyze conversation intent and entities, building NLP features, or integrating language understanding into applications.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5142,5143,5144,5145],{"name":5093,"slug":5094,"type":15},{"name":5078,"slug":5079,"type":15},{"name":5081,"slug":5082,"type":15},{"name":5133,"slug":3218,"type":15},"2026-07-31T05:54:29.068751",{"slug":5148,"name":5148,"fn":5149,"description":5150,"org":5151,"tags":5152,"stars":5083,"repoUrl":5084,"updatedAt":5159},"azure-ai-translation-text-py","translate text using Azure AI services","Azure AI Text Translation SDK for real-time text translation, transliteration, language detection, and dictionary lookup. Use for translating text content in applications.\nTriggers: \"text translation\", \"translator\", \"translate text\", \"transliterate\", \"TextTranslationClient\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5153,5156,5157,5158],{"name":5154,"slug":5155,"type":15},"API Development","api-development",{"name":5078,"slug":5079,"type":15},{"name":9,"slug":8,"type":15},{"name":5133,"slug":3218,"type":15},"2026-07-18T05:14:16.988376",{"slug":5161,"name":5161,"fn":5162,"description":5163,"org":5164,"tags":5165,"stars":5083,"repoUrl":5084,"updatedAt":5174},"azure-ai-vision-imageanalysis-py","analyze images with Azure AI Vision","Azure AI Vision Image Analysis SDK for captions, tags, objects, OCR, people detection, and smart cropping. Use for computer vision and image understanding tasks.\nTriggers: \"image analysis\", \"computer vision\", \"OCR\", \"object detection\", \"ImageAnalysisClient\", \"image caption\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5166,5167,5170,5173],{"name":5078,"slug":5079,"type":15},{"name":5168,"slug":5169,"type":15},"Computer Vision","computer-vision",{"name":5171,"slug":5172,"type":15},"Images","images",{"name":5133,"slug":3218,"type":15},"2026-07-18T05:14:18.007737",{"slug":5176,"name":5176,"fn":5177,"description":5178,"org":5179,"tags":5180,"stars":5083,"repoUrl":5084,"updatedAt":5189},"azure-appconfiguration-java","manage configuration with Azure App Configuration","Azure App Configuration SDK for Java. Centralized application configuration management with key-value settings, feature flags, and snapshots.\nTriggers: \"ConfigurationClient java\", \"app configuration java\", \"feature flag java\", \"configuration setting java\", \"azure config java\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5181,5182,5185,5188],{"name":5078,"slug":5079,"type":15},{"name":5183,"slug":5184,"type":15},"Configuration","configuration",{"name":5186,"slug":5187,"type":15},"Feature Flags","feature-flags",{"name":5098,"slug":5099,"type":15},"2026-07-03T16:32:01.278468",{"slug":5191,"name":5191,"fn":5192,"description":5193,"org":5194,"tags":5195,"stars":5083,"repoUrl":5084,"updatedAt":5208},"azure-cosmos-rust","build applications with Azure Cosmos DB","Azure Cosmos DB library for Rust (NoSQL API). Document CRUD, containers, and globally distributed data.\nTriggers: \"cosmos db rust\", \"CosmosClient rust\", \"document crud rust\", \"NoSQL rust\", \"partition key rust\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5196,5199,5202,5205],{"name":5197,"slug":5198,"type":15},"Cosmos DB","cosmos-db",{"name":5200,"slug":5201,"type":15},"Database","database",{"name":5203,"slug":5204,"type":15},"NoSQL","nosql",{"name":5206,"slug":5207,"type":15},"Rust","rust","2026-07-31T05:54:27.021432",{"slug":5210,"name":5210,"fn":5192,"description":5211,"org":5212,"tags":5213,"stars":5083,"repoUrl":5084,"updatedAt":5221},"azure-cosmos-ts","Azure Cosmos DB JavaScript\u002FTypeScript SDK (@azure\u002Fcosmos) for data plane operations. Use for CRUD operations on documents, queries, bulk operations, and container management. Triggers: \"Cosmos DB\", \"@azure\u002Fcosmos\", \"CosmosClient\", \"document CRUD\", \"NoSQL queries\", \"bulk operations\", \"partition key\", \"container.items\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5214,5215,5216,5217,5218],{"name":5197,"slug":5198,"type":15},{"name":5200,"slug":5201,"type":15},{"name":9,"slug":8,"type":15},{"name":5203,"slug":5204,"type":15},{"name":5219,"slug":5220,"type":15},"TypeScript","typescript","2026-07-03T16:31:19.368382",{"slug":5223,"name":5223,"fn":5224,"description":5225,"org":5226,"tags":5227,"stars":5083,"repoUrl":5084,"updatedAt":5233},"azure-data-tables-java","build table storage applications with Java","Build table storage applications with Azure Tables SDK for Java. Use when working with Azure Table Storage or Cosmos DB Table API for NoSQL key-value data, schemaless storage, or structured data at scale.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5228,5229,5230,5231,5232],{"name":5078,"slug":5079,"type":15},{"name":5197,"slug":5198,"type":15},{"name":5200,"slug":5201,"type":15},{"name":5098,"slug":5099,"type":15},{"name":5203,"slug":5204,"type":15},"2026-05-13T06:14:17.582229",267,{"items":5236,"total":1071},[5237,5251,5266,5273,5283,5300],{"slug":5238,"name":5238,"fn":5239,"description":5240,"org":5241,"tags":5242,"stars":23,"repoUrl":24,"updatedAt":5250},"blob-reading","extract fields from blob URIs","Safe resolution of ci-blob:\u002F\u002F URIs — extract specific fields without dumping full payloads",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5243,5246,5249],{"name":5244,"slug":5245,"type":15},"Data Engineering","data-engineering",{"name":5247,"slug":5248,"type":15},"File Storage","file-storage",{"name":9,"slug":8,"type":15},"2026-07-07T06:52:39.196485",{"slug":5252,"name":5252,"fn":5253,"description":5254,"org":5255,"tags":5256,"stars":23,"repoUrl":24,"updatedAt":5265},"context-intelligence-evaluation-methodology","design evaluation metrics for tool signals","Use when deciding how to measure a context-intelligence tool signal — metric design across quality\u002Fefficiency\u002Fefficacy axes, artifact-metric avoidance via precursor measurement, A\u002FB and statistical-N discipline, and test-data fidelity.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5257,5258,5261,5262],{"name":17,"slug":18,"type":15},{"name":5259,"slug":5260,"type":15},"Evals","evals",{"name":9,"slug":8,"type":15},{"name":5263,"slug":5264,"type":15},"Statistics","statistics","2026-07-07T06:52:41.770083",{"slug":4,"name":4,"fn":5,"description":6,"org":5267,"tags":5268,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5269,5270,5271,5272],{"name":21,"slug":22,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":5274,"name":5274,"fn":5275,"description":5276,"org":5277,"tags":5278,"stars":23,"repoUrl":24,"updatedAt":5282},"context-intelligence-session-navigation","navigate and extract session data","Use when extracting session data directly from JSONL files — the baseline path when the graph server is unavailable or when operating outside graph-analyst",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5279,5280,5281],{"name":21,"slug":22,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},"2026-07-07T06:52:40.507052",{"slug":5284,"name":5284,"fn":5285,"description":5286,"org":5287,"tags":5288,"stars":23,"repoUrl":24,"updatedAt":5299},"context-intelligence-session-reconstruction","reconstruct local Amplifier session files","Reconstruct local Amplifier session files from the context-intelligence graph server — events.jsonl, transcript.jsonl, and metadata.json",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5289,5292,5295,5296],{"name":5290,"slug":5291,"type":15},"Amplifier","amplifier",{"name":5293,"slug":5294,"type":15},"Metadata","metadata",{"name":9,"slug":8,"type":15},{"name":5297,"slug":5298,"type":15},"Observability","observability","2026-07-03T16:31:03.605475",{"slug":5301,"name":5301,"fn":5302,"description":5303,"org":5304,"tags":5305,"stars":23,"repoUrl":24,"updatedAt":5314},"workflow-pattern-analysis","analyze workflow success and failure patterns","Analyse failure and success patterns across many runs of a specific workflow using context-intelligence session data. Use when you want to answer: \"How is \u003Cworkflow> failing?\", \"What does a successful run look like vs a failing one?\", \"Which steps are the most common failure points?\", or \"What patterns appear consistently across sessions?\" Triggers on: workflow failure patterns, session failure analysis, compare successful and failing runs, what patterns appear across sessions, session behaviour investigation, how is the workflow failing, success patterns, failure signals, identify session signals.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5306,5307,5310,5311],{"name":17,"slug":18,"type":15},{"name":5308,"slug":5309,"type":15},"Debugging","debugging",{"name":9,"slug":8,"type":15},{"name":5312,"slug":5313,"type":15},"Workflow Automation","workflow-automation","2026-07-07T06:52:43.061859"]