Repository navigation
Description
Found during code review of #1897 (the #1866 fix).
Observation
create_node appears in exactly one skill whitelist — Node Creation (packages/agent/src/skill_pipeline.rs). But #1866's traces record the empty-create_node failure occurring on turns routed to Schema Creation, Relationship Management, Organization — not Node Creation — with an outcome identical to the Node-Creation-routed arms.
On those arms the Node Creation markdown is never assembled into the prompt. So every rule that lives only in that skill body contributes nothing, and the create_node tool schema's description field is the sole surface carrying it.
Why it matters
The tool-schema description is the weaker of the two surfaces — a JSON Schema field competes for far less attention than a routed skill body placed in the system prompt. That means the guidance is thinnest on precisely the arms that were failing.
This is a plausible explanation for #1866's post-fix measurement landing at 2/3 rather than 3/3, and it is distinct from the two mechanisms already filed there (#1895 type-id fidelity, #1896 schema fragmentation). Both of those are about what the model does; this one is about what the model was shown.
More generally: any rule about how to call a tool is only as reachable as the skills that whitelist that tool. Today that coupling is implicit — a rule can be written into a skill body and be silently absent on most turns that actually invoke the tool.
Worth checking first
Before changing anything, confirm the premise by dumping the Stage-2 prompt on a turn routed to Schema Creation that nonetheless calls create_node, and verifying the Node Creation body is absent while create_node is still in the offered tool list. #1841 and the #1866 investigation both turned on guidance referencing something the model could not actually see, so this class of assumption is worth verifying rather than reasoning about.
Directions, roughly in order of preference
- Put invariant tool rules on the tool, not in a skill. If a rule must hold on every
create_nodecall regardless of routing, the tool schema is its correct home — and it should be written to carry that weight, rather than as a terse afterthought to a skill rule. - Whitelist
create_nodeon the skills that demonstrably call it, so the fuller guidance travels with it. Costs prompt budget on those arms; needs measurement. - Enforce in code where the rule is a data invariant rather than a preference — see the ADR-063 discussion on Stop create_node from silently discarding user values with no matching schema field (#1866) #1897, where the same conclusion was reached from a different direction.
Note that (1) and (2) are not exclusive, and (3) is strictly more reliable than either for anything that is genuinely an invariant.
Acceptance criteria
- Confirm whether Node Creation guidance is absent on turns that route elsewhere but still call
create_node - Decide where rules that must hold on every
create_nodecall should live, and move them there - Re-measure agent-matrix scenario 4 to see whether the residual 1/3 failure rate moves
Evidence: #1866's .trace.jsonl (routing decisions per turn) and the 3-run post-fix measurement recorded there.
Activity
malibio commentedon Aug 1, 2026
Hardening found during re-review of #1897
Related to this issue's theme (guidance depending on what the prompt actually contains), and worth folding in here rather than filing a fourth issue.
packages/core/src/ops/context_ops.rs:296-299has nois_corefilter:Retrieval is scoped only by
node_type == "schema", andtext/task/dateare stored schema nodes with embeddable content. The sibling branch writing to the samerelevant_schemasvector does guard:One branch guards, the branch it augments doesn't — reads as oversight.
Why it matters now: #1897's new guidance tells the model to use a bare property key when the type appears in RELEVANT ENTITY TYPES (treating that as proof it is user-defined), and a
custom:prefix on built-in types. If a core type can reach that block, the model reads it as user-defined and writes a bare key onto a core type — the exact ADR-063 violation #1897 just fixed.Currently latent, not live. Seeding uses raw
store.create_node, which does notqueue_root_for_embedding, andbackfill_schema_description_subtreesskips schemas without a legacydescription(core schemas have none) — so core schema nodes are likely un-embedded and unretrievable on a fresh DB. Nothing in the code prevents it: any future backfill, re-index, or touch that embeds them silently activates it, with no test failing.Fix:
.filter(|s| !s.is_core)atcontext_ops.rs:296, mirroringlocal_agent_service.rs:1878; same guard onskill_ops.rs:172as defence-in-depth. Worth a test asserting core types never render into RELEVANT ENTITY TYPES, so the guidance's premise is enforced where it's relied upon.This is pre-existing and not introduced by #1897 — but #1897 turns it from retrieval-hygiene into a correctness premise, which is the difference between that guidance being correct by construction and correct by coincidence.
malibio commentedon Aug 1, 2026
Investigation: the premise does not hold under the current routing code
Checked the first acceptance criterion — whether
create_nodeis reachable on turns where Node Creation doesn't clear the Stage-2 gate, with the Node Creation guidance body absent from the prompt.create_nodecannot be called when Node Creation doesn't clear the gatecreate_nodeis whitelisted only by the Node Creation skill (skill_pipeline.rs:299). Under ADR-038'sstage2_tools(routing.rs:378-400), the tool surface offered to the model is the union of tool whitelists from only the candidates that clear the score gate — not the full registry, and not a fallback-to-full-surface unless that permitted set is empty.create_node'srequires_routed_guidance()isfalse(tools.rs:1128), so it would appear viafail_open_surfaceif the permitted set were empty — but the scenario in question (candidates clearing the gate) isn't the empty case.I wrote a scratch test simulating exactly the scenario named in this issue — retrieval's top-3 being Schema Creation, Relationship Management, and Organization, none of them Node Creation — and ran it against current
routing.rs:create_nodeis absent. So under current code, if those three (and only those three) clear the gate, the model cannot callcreate_nodeat all — the premise that it's called with weaker guidance doesn't apply; it can't be called in that configuration, full stop.The originating claim isn't backed by the trace artifact in the repo
The PR-review finding this issue was filed from (#1897 review, 🟡-2) states: "#1866 records routing landing on
Schema Creation, Relationship Management, Organizationwith the identical empty-call outcome." I checkedscripts/results-e4b.trace.jsonl(the artifact #1866 attached) — its scenario-4 entry hasstage2CandidatesInjected: trueandtoolsCalled: ["create_node"], but noroutedSkillsfield (it's optional pereval/types.ts:53, populated only when the raw daemon log carried arouted_skills=...line andaichat.ts:198parsed it). This file doesn't contain the skill-name evidence the claim rests on — it must have come from an unsaved observation (e.g. watching debug logs live during that run), not from anything reproducible in the repo today.Also worth noting: ADR-038 (
e4ff4890, 2026-07-30) landed before the #1866 traces were captured (4b66ec4f, 2026-08-01), so the traces are evaluating the current top-K=3 routing architecture, not a stale one — that part of the premise is fine. The gap is specifically that "routed elsewhere but still called create_node" isn't reproducible against currentstage2_toolslogic given the exact three skills named.What would make the premise true
The one way
create_nodereaches the model without Node Creation's guidance is if Node Creation is among the eligible (gate-cleared) candidates but retrieval's top-K=3 also included other skills whose names got reported/recalled instead — i.e., the "routed to X, Y, Z" description was incomplete, not that Node Creation was truly absent.render_candidates_for_promptdoes render each cleared candidate's own instructions (routing.rs:283-307), so if Node Creation is in the cleared set, its guidance is in the prompt regardless of what else clears alongside it.Recommendation
Given
create_nodeis architecturally unreachable without Node Creation clearing the gate, I don't think there's a live bug here matching the issue as filed. Rather than move guidance or change whitelists against an unconfirmed premise, I'd:routed_skills=...(requiresRUST_LOG=debug) alongside an empty-propertiescreate_nodecall, confirming Node Creation was genuinely excluded from that turn's cleared candidates — which would be a different, real bug (e.g. in retrieval scoring orstage2_tools) rather than a "guidance lives in the wrong place" issue.Directions 1–3 in the issue body (moving guidance onto the tool schema, widening whitelists, enforcing in code) are all reasonable defenses-in-depth regardless, but I'd hold off implementing them against this issue specifically since the triggering scenario isn't confirmed reachable. Proceeding to close as not-reproduced unless redirected — happy to instead capture a
RUST_LOG=debugrun to try to reproduce first, if that's preferred.malibio commentedon Aug 1, 2026
Agreed — close the original claim as not-reproduced. The methodology here is exactly right: rather than build a fix on an assumed premise, you went back and checked it, found a concrete falsifying result (a scratch test against current
routing.rsshowingcreate_nodeis architecturally absent from the tool surface in that configuration, not weakly-guided), then traced the originating claim to its source and found the trace artifact doesn't actually carry theroutedSkillsevidence it was supposedly based on. That's the same "verify the claim against real source, don't take a prior comment's assertion at face value" standard this whole investigation has been holding everyone else to — good to see it turned on your own earlier finding too. The reopen condition you left (aRUST_LOG=debugrun withrouted_skills=...alongside an empty-propertiescreate_nodecall) is precise and actionable if this ever does reproduce.One thing not to lose in the close: the
is_corefilter asymmetry you folded in (context_ops.rs:296missing the guardlocal_agent_service.rs:1878has) is a real, independently-confirmed latent bug, unrelated to whether #1899's original premise holds. It's currently dormant only because of how seeding/backfill happens to work today, not because anything prevents it — and you correctly noted #1897 turned it from a hygiene nit into a correctness premise (bare-vs-prefixed property keys depending on a core type never appearing in RELEVANT ENTITY TYPES). That should still get fixed — either land the one-line filter directly now while you're in this code, or split it into its own small issue, but don't let it close away silently with the rest of #1899's not-reproduced verdict.malibio commentedon Aug 1, 2026
Closing as not-reproduced against current routing code, per the investigation and agreement above.
The originating premise (Node Creation guidance silently absent while
create_nodeis still callable via other routed skills) didn't hold understage2_tools:create_nodeis architecturally unreachable unless Node Creation itself clears the gate, so the "callable with weaker guidance" scenario this issue was filed for isn't a live configuration. The claim it was based on also wasn't backed by the trace artifact in the repo.The one concrete, real finding that came out of this investigation — the
is_corefilter asymmetry — was split into #1900 and is already merged (70468285, #1903), including the extrarelated_one_hop_schemasguard added during that PR's own review. Nothing left open here.Reopen condition still stands if it ever comes up again: a
RUST_LOG=debugrun capturingrouted_skills=...alongside an empty-propertiescreate_nodecall, confirming Node Creation was genuinely excluded from that turn's cleared candidates.