Repository navigation
Description
Summary
Probed a relationship-modeled scenario live (gemma-4-e4b-q4km, scripts/aichat.ts ask, 5 trials per condition) to see whether the agent can use a graph relationship to satisfy a request that names an entity only indirectly — "The incident Rowan was on call for — mark it resolved," where incident_report declares on_call -> person (reverseName incidents_on_call).
Found and fixed two of three chained gaps; the third is a separate, pre-existing issue.
Data model used
schema incident_report:
fields: resolved: boolean
relationships: on_call -> person (reverseName: incidents_on_call)
3 person nodes (Rowan, Dana, Sam), 3 incident_report nodes, each linked via on_call.
Traversal at the CLI/data layer works correctly (nodespace relationship get <Rowan-id> --type incidents_on_call returns the right incident). This is not a data-layer bug — it's a prompt/tool-selection problem.
Gap 1 — relationship names never reach the compact schema block (FIXED)
EntityTypeDescriptor::render_line() (packages/core/src/ops/entity_types_block.rs) deliberately excludes relationships from the EXISTING SCHEMAS block — a documented prior scope decision. Relationships DO reach the model via schema_metadata (the search_skills tool response, EntityTypeDescriptor::to_json()), but only if the model calls search_skills for that type. In this scenario it never did — Stage-2 routing pre-selects skill/operation/schema candidates from lightweight metadata, without a search_skills call, so the model saw only the compact block.
Before: 5/5 trials called search_nodes with a hallucinated assigned_to property filter (doesn't exist). Never called get_related_nodes. Never mentioned on_call.
Fix: render relationships into render_line():
if !self.relationships.is_empty() {
let rendered: Vec<String> = self.relationships.iter().map(|r| match &r.target_type {
Some(t) => format!("{}->{}", r.name, t),
None => r.name.clone(),
}).collect();
line.push_str(&format!(" ~> {}", rendered.join("; ")));
}Renders as: - incident_report "Incident Report" -> resolved: boolean ~> on_call->person
After (this patch alone): 5/5 still failed to complete the task, but the model now correctly named on_call in its response — it just tried to express it as a search_nodes filter (on_call.person), which is invalid syntax, instead of calling get_related_nodes.
Gap 2 — no signal that a ~> name is a relationship, not a filterable property (FIXED)
search_nodes's description didn't warn the model off putting a relationship name in filters, and get_related_nodes's description didn't cross-reference the ~> syntax the model had just learned from gap 1's fix.
Fix, packages/agent/src/local_agent/tools.rs:
search_nodesdescription, appended: "A name shown after '>' in an EXISTING SCHEMAS line is a relationship, not a filterable property — 'filters' only accepts a type's own fields (before '>'). To find a node connected via a relationship (e.g. 'the incident Rowan was on call for'), use get_related_nodes with that relationship's name, not a filter here."get_related_nodesdescription, appended: "Use this — not search_nodes's 'filters' — for any name shown after '~>' in an EXISTING SCHEMAS line; that syntax marks a relationship, and 'filters' only accepts a type's own fields."
After (both patches): 5/5 trials called get_related_nodes with the correct relationship name (on_call) and — once a seeding bug on my end was fixed so the entity tier could resolve "Rowan" to a real id — 5/5 correctly traversed to the right incident (get_related_nodes returned is_error=false, correct node, every trial).
Gap 3 — "mark X resolved" routes to a skill without a write tool (NOT FIXED — separate issue)
Even with gaps 1 and 2 fixed and the traversal succeeding, the agent could not complete the task: Stage-2 routing selects "Conflict Resolution" (score 0.872, beating "Relationship Management" 0.760 and "Node Merge" 0.749) for this message, and the tool list under that skill is read/search/conflict-only — no update_node. The model correctly identifies the incident and the resolved field, then reports it has no tool to make the change.
This is upstream of relationship-modeling entirely — it's the routing layer mapping "mark ... resolved" to conflict-resolution semantics rather than a status-update skill. Filing as context here since it was surfaced by the same probe, but it's a distinct root cause (skill routing / scoring) and should be scoped separately.
Acceptance criteria
-
render_line()includes relationship names (or equivalent visibility) in the compact schema block -
search_nodes/get_related_nodesdescriptions (or equivalent guidance) steer the model to use relationship traversal instead of an invalid property filter - Re-run of this scenario (or an equivalent eval fixture case) shows the agent correctly traverses
on_call/incidents_on_callto find the target node - Gap 3 (routing skips write tools for "mark resolved" phrasing) is filed as its own issue, out of scope here
Evidence
Manual probe outside the eval harness (scripts/aichat.ts ask, gemma-4-e4b-q4km, isolated NODESPACE_HOME), 5 trials per condition:
| Condition | Tool called | Traversal succeeds | Task completes |
|---|---|---|---|
| Before (merged main) | search_nodes (hallucinated filter) |
n/a | 0/5 |
| + relationship rendering only | search_nodes (invalid on_call.person filter) |
n/a | 0/5 |
| + tool description cross-refs | get_related_nodes, correct args |
5/5 | 0/5 (blocked by gap 3) |
🤖 Generated with Claude Code
Activity
malibio commentedon Sep 25, 2026
Frontend baseline: 269 files / 5313 tests passed
malibio commentedon Sep 25, 2026
Live A/B: re-run of this scenario
Setup: gemma-4-e4b-q4km, isolated daemon (
NODESPACE_HOME,served_db_pathchecked),scripts/aichat.ts ask "The incident Rowan was on call for — mark it resolved", 5 trials per arm. Both arms used one identical seed: anincident_reportwithon_call -> person(reverseNameincidents_on_call) plus 3 person/incident pairs.NODESPACE_PROMPT_DUMPconfirmed the arms differ in their prompts.- incident_report "incident_report" -> resolved: booleansearch_nodesper trial, all errors (inventedperson.namefilter)... -> resolved: boolean ~> on_call (person)get_related_nodes(id=<Rowan>, relationship_type=on_call)→get_node(<search index corruption>)Completion is still 0/5, as expected: the turn routes to Conflict Resolution, which has no
update_node. That's gap 3, filed as #2912.Notes
on_call (person), noton_call->person. Therender_linegrammar reserves->for introducing the field list and uses it nowhere else, so a second->would read as another field list. A golden test now pins->to a single occurrence per line.nodespace node create --type person --content Rowanproducestitle: "", because person's title template is{first_name} {last_name}. The MENTIONED ENTITIES tier resolves by title, so "Rowan" never resolves and even the patched arm falls back to a filter (0/5). Setfirst_namewhen seeding persons.guidance_is_not_contaminated_by_eval_prompts, because matrix scenario 13 uses that exact prompt. That scenario modelson_callas a text field, so it doesn't exercise this path.Render schema relationships in EXISTING SCHEMAS and steer traversal t…