fix(graph-query-skill): correct schema names to match live graph (stop misleading agents)#51
Merged
Merged
Conversation
…ive graph Corrects property names and edge types in the documented schema to match what the code actually writes to the graph, fixing silent nulls that mislead agents. Fixes: - Prompt: prompt_text → prompt, started_at → occurred_at - SkillLoad: loaded_at → started_at - Orchestrator: name → orchestrator - RecipeStep/RecipeRun: relocates current_step to RecipeStep, removes phantom RecipeStep.status - RecipeStep→RecipeRun edge: SPAWNED (TRIGGERED retained for real ToolCall and Delegation targets) - Removes 3 phantom Layer-1 edges (HAS_FORK, Session→ToolCall HAS_TOOL_CALL, ToolCall→Event HAS_EVENT; retains Session→Event HAS_EVENT) - Fixes 7 example queries that returned null; adds coalesce(started_at, occurred_at) for mixed temporal sweeps All changes validated against the live production graph (3,071 sessions, 968,442 nodes): every corrected property name now returns populated data. Bumps skill version 2.0.0 → 2.0.1. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
… reality Corrected two brittle test assertions to match validated SKILL.md corrections: - Version pin updated 2.0.0 → 2.0.1 - Removed assertions for phantom Layer-1 edges HAS_FORK and Session→ToolCall HAS_TOOL_CALL (confirmed absent across 1.5M live edges via graph validation) - Retained HAS_EVENT assertion (Session→Event edge, real and validated) Full unit suite verified locally before push: uv run pytest tests/ -m 'not neo4j and not integration' → 1800 passed, 2 skipped (Previously-failing tests now pass; no regression) Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
context-intelligence-graph-querySKILL is the schema contract agents load to write Cypher. Because the graph store persists property keys verbatim and Cypher returnsnullfor absent properties without error, wrong names in the doc are silent nulls — agents get empty results, retry, and burn LLM roundtrips with no signal that the schema doc is wrong. A misleading schema doc is worse than a missing one.This started from a real bug:
Prompt.prompt_textis null on every node graph-wide. Investigation showed it was systematic, not isolated.What was wrong (all confirmed against the LIVE graph: 3,071 sessions · 968,442 nodes)
Prompt.prompt_textpromptPrompt.started_atoccurred_atSkillLoad.loaded_atstarted_atOrchestrator.nameorchestratorRecipeStep.statusRecipeRun.current_stepRecipeStepRecipeStep→RecipeRun TRIGGEREDSPAWNEDHAS_FORK,HAS_TOOL_CALL,HAS_EVENT(ToolCall→Event)What this PR changes (doc-only; code keys are the contract)
:SST_EVENTtemporal sweeps now usecoalesce(started_at, occurred_at)(occurrence nodes useoccurred_at, span nodes usestarted_at).TRIGGEREDis retained — it is a real, heavily-used edge forRecipeStep→ToolCall(336) and→Delegation(82); only the→RecipeRuntarget was wrong.current_stepwas relocated, not deleted.Validation (proof, not assertion)
Every corrected name was re-queried against the live graph and returns populated data:
prompt/occurred_at100%,SkillLoad.started_at100%,Orchestrator.orchestrator100%,RecipeStep.current_step99.5%,RecipeRun.status100%,SPAWNEDedges present, andcoalesce(started_at, occurred_at)covers 99.91% of SST_EVENT nodes.Recommended follow-up (not in this PR)
Add a CI guard that diffs handler
upsert_node/upsert_edgedict keys against the SKILL schema tables — this class of doc↔code drift is mechanically detectable and would turn silent nulls into a failing check.