Repository navigation
Description
Overview
#2841 gives the local agent entity resolution by pre-resolving a named entity and rendering the fact into its context block — the model is told, never asked. That channel does not exist for external harnesses (Claude Code, Codex, the Claude Desktop Code tab, Gemini CLI, OpenCode), which reach the graph through the nodespace CLI per ADR-035.
This issue propagates the capability to the external surface, where ADR-064's fifth channel says it belongs.
Blocked on #2841. Not merely related — see What this is waiting for below.
Why guidance is the mechanism, not a fallback
ADR-064 rule 5 states the fifth channel owns "procedure expressed in CLI verbs — which command to run, in what order, and how to recover from a failed one." "Resolve a name to an id before you update it" is exactly an ordering rule, so guidance is its correct home.
Worth stating explicitly because it is easy to get backwards: the doctrine's finding that prose is the weakest channel applies to the local agent's resident prose, not here. The same ADR records that skill-file guidance arrives through the harness's prompt — the channel its measurement found most effective (100% continuation, against 44% for the same text delivered as a tool result). Guidance is not a weak substitute for a mechanism on this surface; it is the mechanism.
The rule to convey
Derived from the local agent's measured failure (#2802's baseline), which stalled with:
"I need a Node ID to update the capacity for Northwind Trading."
The ordering rule that prevents it:
Before updating or reading a node you know only by name, resolve the name to an id first. A name in the user's message is not an id. If the lookup returns nothing, the entity does not exist — that means create, not search harder.
Three properties make this belong in this channel rather than elsewhere:
- It is an ordering rule, which rule 5 says this channel owns.
- It names the failure recovery — no match means create, a distinction otherwise invisible to a harness that just sees an empty result.
- It does not restate argument shape the CLI's own
--helpalready gives, which rule 5 explicitly forbids.
What this is waiting for from #2841
Three outputs, in descending confidence, and the third is why this is blocked rather than parallel:
-
The rule's tuned wording. The substance is settled; the phrasing should follow whatever the local tier's seeded guidance proves out. The propagation rule is one-directional — seed nodes lead,
SKILL.mdfollows, and must never trail them on substance — so writing this in parallel risks two versions of a rule neither has validated. -
Whether "no match means create" holds up. It is an acceptance criterion on Entity-grounded routing: resolve named entities to nodes before routing, so one lookup constrains skill, schema and operation #2841. If the eval shows the distinction does not survive contact with the model, the guidance should not assert it.
-
Which command the guidance points at — genuinely unknown today. If Entity-grounded routing: resolve named entities to nodes before routing, so one lookup constrains skill, schema and operation #2841's resolution logic lands as a reusable op, exposing it as a
nodespace resolve <name>verb is cheap and the guidance points there. If it is woven into context assembly and not separable, the guidance points atsearch --type <type> "<name>"instead. The guidance cannot be written without knowing which. -
(Less certain) Whether a rank cutoff or stopword list is established. The precision check on Entity-grounded routing: resolve named entities to nodes before routing, so one lookup constrains skill, schema and operation #2841 found a workable cutoff around -2.5 to -3.0 BM25 and a stopword leak worth filtering. If resolution lives behind a verb, external agents inherit that filtering; if it lives in the agent loop, agents calling
searchraw do not — and the guidance may need to say something about noise words.
Open question, deliberately not decided here
Should a nodespace resolve verb exist at all? Arguments both ways:
- For: at ~0.12 ms per lookup (measured on Entity-grounded routing: resolve named entities to nodes before routing, so one lookup constrains skill, schema and operation #2841), resolution is free enough that an external agent can call it reflexively. A dedicated verb makes the intent unambiguous and lets the agent inherit whatever filtering the local tier establishes.
- Against:
search --type <type> "<name>"already does approximately this. A new verb that duplicates an existing one is surface area, and ADR-064 rule 5 warns against the skill file restating what--helpcovers.
Resolve after #2841 lands, informed by (3) above.
First step: check whether external agents actually fail at this
The local agent's failure is documented; the external one is assumed. Claude Code, Codex and similar are substantially stronger models than the locked Gemma 4 E4B, and may already reach for search unprompted when asked to update something by name.
Before authoring guidance, run a few resolution-shaped tasks through the CLI with a strong external model — "mark the Northwind contract as signed", "what is Contoso's renewal date" — against a seeded workspace, and observe whether it resolves first or asks for an id. If it resolves unprompted, this issue is a small reinforcement rather than a fix, and should be scoped accordingly.
Acceptance Criteria
- Measure whether external agents fail to resolve names unprompted; record the result here before writing guidance
- The ordering rule is added to
packages/skill/SKILL.md, derived from Entity-grounded routing: resolve named entities to nodes before routing, so one lookup constrains skill, schema and operation #2841's tuned local guidance rather than authored independently - The guidance states the no-match-means-create recovery, if Entity-grounded routing: resolve named entities to nodes before routing, so one lookup constrains skill, schema and operation #2841 confirms that distinction holds
- The guidance points at whichever command Entity-grounded routing: resolve named entities to nodes before routing, so one lookup constrains skill, schema and operation #2841's outcome makes correct, and does not restate argument shape
--helpalready gives - If a
resolveverb is added,references/cli.mdregenerates viabun run skill:checkand the verb carries its own guidance in the same change (per the CLI-change-needs-guidance rule) -
SKILL.mddoes not trail the seeded skill nodes on substance - Tests pass (
bun run test:all), code passesbun run quality:fix
Technical Specifications
Reference Files
packages/skill/SKILL.md— the external guidance surface (hand-authored)packages/skill/references/cli.md— generated; regenerate withbun run skill:check/skill:genpackages/agent/src/skill_pipeline.rs—seed_skill_nodes(), the canonical source the external file followspackages/cli/src/commands/— where aresolveverb would live, if one is added
Related
- Entity-grounded routing: resolve named entities to nodes before routing, so one lookup constrains skill, schema and operation #2841 — the local tier this propagates from; blocking
- ADR-064 — rule 5, the fifth channel and its propagation rule
- ADR-035 — the skill + CLI as the external integration surface
Activity
malibio commentedon Sep 22, 2026
Frontend: 262 files / 5264 tests passed
malibio commentedon Sep 22, 2026
Measurement: do external agents resolve names unprompted? (first acceptance criterion)
Short answer: yes. The local failure does not reproduce. But the command
SKILL.mdpoints them at can't find entities, so they get there by trial and error.Setup
nodespacedbuilt frommain@6bc23eb0. Every run gets a throwawayNODESPACE_HOME/socket.companyschema, plusNorthwind Trading,Northwind LogisticsandContoso Ltd(with properties). There are also noise-word decoys ("Trading terms for new customers…", "The companies we sell to…"), a Contoso call note and a Northwind task.claude -p, with the current, unmodifiedpackages/skill/SKILL.mdappended to the system prompt. Tools wereBash(nodespace:*),jqandRead, with theSkilltool disabled so the installed copy could not substitute.Results
Sonnet, 2 reps: 10/10 correct outcomes. It never asked for an id, never made a duplicate, and asked which Northwind both times.
search "Northwind Trading contract"node query --title-contains/query --type companysearch "Contoso renewal date"node query --title-contains/node getsearch "Northwind"node query --title-containssearch "" --type company(enumerate)search "" --type company(enumerate)Haiku, 1 rep: 1/5. This is not a resolution failure. On the four prompts that don't say "contract", it didn't recognise NodeSpace as the data store and searched the empty working directory instead. That's a skill-triggering artefact of my harness (skill appended rather than invoked), so I'm not counting it for or against resolution. On the one it did recognise (update), it went through the same
searchmiss and fallback in 7 calls before updating correctly.The finding that changes the issue:
searchcan't reach entitiesEvery miss above has one cause, and it's by design, not a bug.
nodespace searchis embedding-only, and embeddings cover only the embeddable types (text/header/code-block/schema/table, ADR-029). Theinclude_title_matcheskeyword half exists insearch_semantic, but the CLI path passesNone. So ataskor any user-defined entity type has no vector and is unreachable bysearchat any query. I checked this directly against the seeded daemon:Consequences for this issue:
search --type <type> "<name>", is the wrong target, and a dangerous one. For entity types it returns empty whether the entity exists or not. Combined with "no match means create", it would turn every add-by-name into a duplicate. The guidance must not point there.SKILL.mdcurrently sends agents tosearchfirst ("Find nodes by keywords or meaning →nodespace search"). That's the source of every wasted call above. Sonnet recovered each time because it's persistent, not because the skill told it how.node query --title-containsis already a deterministic title lookup. It's empty when absent and returnsnode_type, which is what you need to tell two same-named entities apart. Sonnet reached for it on its own aftersearchfailed.--title-containsuses a stem fallback, so a query shaped like "Northwind Trading Co" also returns the Northwind task and the "Trading terms" decoy. An empty-list test would be wrong in the other direction. The local tier's tuned wording already frames it this way ("same name, same type"), and the external rule should follow it.Side observation, not in scope here
In a fresh database,
searchreturns the seeded skill/guidance nodes (e.g. one whose content is justTOOL STRATEGY:). Sonnet flagged these as prompt injection in 4 of 10 runs, and in one run it treated the whole database with suspicion. External agents will meet these on every broad search. Noted here, not addressed in this issue.malibio commentedon Sep 22, 2026
Decision and re-measurement
The
resolveverb question: no new verb. The guidance points atnodespace node query --title-contains "<name>", the existing lexical title lookup. It already returns empty when the name is absent and carriesnode_type, which is all the "same name, same type" judgment needs. Aresolveverb would duplicate it for any caller able to pull the name out of the message itself, which an external model can. The token selection and stop-word filtering inresolve_entities_by_titleexist because the local tier feeds it a whole message, and external agents don't need that.search --type(the issue's fallback) is ruled out by the measurement above.The rule's wording follows the local tier's tuned guidance: "same name, same type" and "none found means it doesn't exist". It lives as one shared
skill_rules::NAMED_RECORD_RESOLUTION:SKILL.mdcarries the prose formskill_md_still_mentions_every_interaction_ruletest pins the pairing, and it was mutation-checked by removing the phrase and watching it failSame harness, same scenarios, only
SKILL.mdchangedSKILL.mdsearchmiss--title-containsevery timeHaiku's remaining two failures, stated plainly:
textnote in acompanies:prospectscollection instead of acompany. That's a type-selection error, not a resolution one.This is one rep, so I did not tune the wording against it.
Acceptance criteria
SKILL.md, derived from the local tier's tuned guidancenode query --title-contains, with no argument shape restated beyond the command itselfN/A, no verb added (resolveverb regeneratescli.mdskill:checkis clean)SKILL.mddoes not trail the seed nodes: both render from oneskill_rulesconstquality:fixcleanmalibio commentedon Sep 22, 2026
Correction to the measurement comment above: the behaviour stands, the stated cause does not.
I wrote that user-defined entity types have no vector (ADR-029) and are therefore unreachable by
search. The first half is wrong. User-defined types go throughCustomNodeBehavior, which embeds any non-empty content. What hides them is the defaultknowledgesearch scope: a query-bearing CLIsearchkeeps onlytext | header | code-block | schema | tablerows, and the CLI path passes noinclude_title_matches. Tasks are the only type genuinely left unembedded.The observed result is unchanged, and so is the guidance: a
searchfor an entity's name returns nothing for tasks or typed records. The empty-querysearch "" --type <type>listing skips the scope filter and does list them, which is why Sonnet's enumeration fallback worked. Theskill_rulesdoc comment in #2860 now states the actual mechanism (caught in review).malibio commentedon Sep 23, 2026
Correction to the side observation in the measurement comment: the fragments were not skill guidance.
They are child lines of
agent-guidanceroots, the local agent's system-prompt templates (TOOL STRATEGY:,RESPONSE RULES:, the{{ current_date }}template). Skill text can't surface in general search at all: a keyword hit inside a skill walks up to theskillroot, which the default scope filters out. The prompt templates leak only becauseagent-guidanceis onNON_EMBEDDABLE_CONTAINER_TYPES, which makes each child line count as its own root.The real cause is broader than guidance. Search's keyword half matches
node.contentat every depth instead of root titles. Filed as #2867.