Repository navigation
Description
Overview
Two plain developer-domain requests in the local AI chat end with nothing created, and the eval that covers one of them scores it as a pass. Measured on main at 7d0698fe, model gemma-4-e4b-q4km, isolated daemon, purged database.
- "Add the cache invalidation decision to our architecture decisions." cannot create the record:
create_nodeis never offered, anddelete_nodeis. - "start tracking our planning cycles" reaches Schema Creation, and the type is never created:
create_schemais refused and the retry is malformed. eval:routingscores the second as a pass, because it checks thatcreate_schemawas called, not that a type exists afterwards.
Problem Statement
1. A record's noun that sounds like another skill's subject takes the turn away from the skill that can write it
Workspace seeded with a design_decision type and a bug type. Three reps, identical each time:
- Routed skills: Node Deletion 0.816, Play Workflow State 0.801, Node Merge 0.787, Bulk Import 0.768.
- Tools offered:
search_nodes,search_semantic,get_node,delete_node,create_nodes_from_markdown,get_conflict,dismiss_conflict,adopt_existing_conflict,get_workflow_state,route_clarify. Nocreate_node. - The turn searches twice and replies: "I couldn't find any existing "Design Decision" nodes matching the query, so I can't directly add it."
- Nothing is created.
"invalidation" is the cause: the request is an add, and it embeds nearest the deletion skill. Node Creation is not in the top 4, so the only skill that holds create_node on this turn is absent, and the destructive tool is offered because Node Deletion is the retrieval winner.
A fix already measured and rejected: an exclusion on Node Deletion naming the adding verbs ("Add them, create them, record them, log them."). It left Node Deletion's score on this request unchanged and took about 0.02 off real deletions, costing "remove all the resolved incidents" its rank 1 in remove_requests_mentioning_a_state_route_node_deletion.
A sibling that did not fail the same way, for scope: "Put the login timeout bug on the release blockers list." routes correctly (Node Creation and Graph Editing are both offered). The model reads it as an update to a bug that does not exist and says it cannot find it. That is a reading of the sentence, not this defect.
2. A bare "start tracking" request never creates its type
Fresh database, four reps, identical each time:
- Routed skills: Schema Creation 0.872, Graph Editing 0.828, Relationship Management 0.800.
create_schemais offered. - Call 1:
create_schema {"fields":[{"friendlyName":"status","name":"status","type":"enum"}],"name":"planning cycle","relationships":[]}→Failed to create schema 'planning_cycle': Node validation failed: Properties validation failed: Enum field 'status' must have at least one value defined (in core_values or user_values). - Calls 2 and 3:
update_schemawith arguments that are not valid JSON →malformed_tool_call, twice. - Reply: "• schema creation failed • schema update failed (2×)".
- No type exists afterwards.
Three things go wrong in sequence. The request names no fields, and the model invents an enum field (the fields-from-request-only rule lives on create_schema's tool schema and did not hold here). The enum carries no values, which the validator refuses. The retry goes to update_schema, for a type that was never created, with malformed arguments, when a create_schema without the field would have succeeded. The user is left with two failure bullets and no question.
3. The routing eval cannot see it
indirect-schema-freelance ("start tracking our planning cycles") passed 3/3 in eval:routing on the same build. The fixture confirms the expected skill from the reply or from the tools called, so a turn whose create_schema call failed counts as routed to Schema Creation. The other schema-creating routing scenarios (direct-schema-create, indirect-schema-money-owed, indirect-schema-expenses, mutating-gate-borderline-schema, multi-schema-and-search) are scored the same way and have not been checked for the same failure.
Proposed Solution
Each part needs its own measurement; none has a known fix.
- Part 1. The lever is retrieval. Options to measure, in the order I would try them: Node Creation's reachability on an add request (it holds the tool the turn needs and is absent), a Stage-1 retrieval query built from the operation and not the record's nouns (the way a lookup already is, through
routing::lookup_retrieval_query), and whether a destructive tool should be offered at all on a turn whose request carries an adding verb. A description reworded to win this one sentence is not a fix: measure on a set of add requests whose nouns collide with a skill ("invalidation", "merge", "conflict", "import", "removal"), with cost-side controls for real deletions. - Part 2. Decide which layer owns it per ADR-064, then measure: the tool schema (make an enum without values unrepresentable, or stop offering
enumwhen the request names no values), the tool result (the refusal says what to resend: the same call without the field, or with values), or the loop (a failedcreate_schemafollowed byupdate_schemafor the same never-created type is not a recovery). - Part 3. Make the schema-creating routing scenarios confirm the outcome: a type exists after the turn. The agent matrix already grades on graph outcome (
scoreOutcome); the routing fixture can assert the same for itsmutatingschema scenarios.
Documentation
- ADR-038 "Confidence bar scales with blast radius" - destructive tools are offered only from the retrieval winner, which is what puts
delete_nodeon an add request in part 1 - ADR-064 rule 1 - tool schemas own argument shape, which decides where part 2's enum fix belongs
- ADR-064 rule 3 - skill descriptions own retrieval matching and may hold only words for what the skill does
- ADR-064 rule 4 - tool results own facts, not procedures, which bounds what part 2's refusal message may say
- Agent evals - the three eval layers, outcome grading, winnability, and how to run them
- Updates:
agent-eval.mdif the routing fixture starts grading outcomes (its layer description says routing asserts which skill is selected)
Architecture Impact
No ADR is reversed. If part 1 ends by withholding a destructive tool on some requests, or by changing how the retrieval query is built for writes, that extends ADR-038 and needs an amendment there, written first.
Acceptance Criteria
- "Add the cache invalidation decision to our architecture decisions." on a workspace with a decision type creates the record in 3 of 3 reps, and
delete_nodeis not offered on that turn - A live retrieval guard covers add requests whose noun collides with another skill's subject (at least five, in the developer domain), asserting a skill that holds
create_nodereaches the top 3 and no destructive skill leads - The deletion guards in
live_skill_retrieval_stability.rsstill pass, with rank 1 for Node Deletion unchanged on every request they list - "start tracking our planning cycles" on a fresh database creates one type in 3 of 3 reps
- A
create_schemarefused for an enum without values is followed by a call that can succeed, or by a question to the user, not byupdate_schemaon the type that was not created -
eval:routing's schema-creating scenarios fail when no type exists after the turn, and a 3-rep run reports which of them were passing on a failed create before the change - Any wording change to a seeded skill description is measured against
main's wording on cost-side controls, and the PR names every request whose leader moved - Code passes
bun run quality:fixandbun run test:changed
Technical Specifications
Reference Files
- Seeded skills:
packages/agent/src/skill_pipeline.rs- descriptions, tool whitelists,exclusion, and the measured history in each row's comment - Candidate selection and tool surface:
packages/agent/src/local_agent/routing.rs-select_candidates,stage2_permitted_names(destructive tools from the winner only),lookup_retrieval_query - Live retrieval guards:
packages/agent/tests/it/live_skill_retrieval_stability.rs- needs only the embedding model; run with.tools/bin/cargo-nextest nextest run -p nodespace-agent --test it -E "test(live_skill_retrieval_stability::)" --run-ignored ignored-only - Schema tools:
packages/agent/src/local_agent/tools.rs-create_schemaandupdate_schemadefinitions and descriptions - Enum validation:
packages/core/src/behaviors/mod.rs- "Enum field must have at least one value defined" - Schema rules:
packages/agent/src/skill_rules.rs,packages/agent/src/seeds/skill-md/schema-rules.md-fields-from-request-onlyand the already-exists and validation-error retry rules - Routing fixture:
scripts/eval/fixtures/routing.ts-ExpectedOutcome, themutatingflag, the scoring function - Outcome grading precedent:
scripts/eval/fixtures/agent-matrix.tsandscripts/eval/graph.ts
Reproducing
Isolate the daemon with NODESPACE_HOME (see "Setup" in agent-eval.md), load gemma-4-e4b-q4km, wait for the skill index, then drive one turn with bun run scripts/aichat.ts ask "<message>". It prints the routed skills with scores, the tools offered, each tool call and the reply. Tool arguments and error text are in the daemon log's Tool executed lines at RUST_LOG=debug. For part 1, seed the types first with nodespace schema create --params '{"name":"Design Decision", ...}'.
Only one generative model fits on a 16 GB machine: a second loaded daemon produces Decode Error -3 on both.
Related Issues
- Chat 'what schemas do we have' still fails, plus two skill-retrieval misses on plain requests (type listing, 'start tracking', single-instance add) #3268 (where both surfaced; its PR routed "start tracking" to Schema Creation and stopped there)
- Re-theme the decision eval's scenarios and seeded workspace into NodeSpace's developer-workflow domain #3513 (the decision fixture's re-theme; a re-themed fixture is where developer-domain adds get scored)
Non-Goals
- Re-theming or re-scoring the decision fixture
- The two requests that lead with Schema Creation by 0.001 and 0.005 after Chat 'what schemas do we have' still fails, plus two skill-retrieval misses on plain requests (type listing, 'start tracking', single-instance add) #3268's PR ("mark the offline sync spec as signed off", "add the offline sync spec to the specs for this cycle"); they are recorded in the guards and were not measured through the model
Activity
malibio commentedon Oct 4, 2026
Affected by ADR-092 (https://github.com/NodeSpaceAI/nodespace-docs/blob/main/decisions/092-spec-plan-and-decision-are-core-types.md): #3542 makes decision a core type and removes the cycle and bug types that came with the Linear-style and Jira-style setups. The first repro here seeds a custom design_decision type and a bug type; after #3542 a request like 'Add the cache invalidation decision to our architecture decisions' targets the core decision type, so the repro workspace and the expected routing should be re-checked against the core model. The second repro ('start tracking our planning cycles') still creates a user-defined type and is unaffected.
malibio commentedon Oct 5, 2026
Baseline on main at 99393ec. Frontend: 318 test files passed, 5770 tests passed.
Create the record on an add that names another skill's subject, and t…
Create the record on an add that names another skill's subject, and t…
Create the record on an add that names another skill's subject, and t…
Create the record on an add that names another skill's subject, and t…
Create the record on an add that names another skill's subject, and t…