Skip to content

Two plain requests end with nothing created: an add whose noun sounds like another skill, and a bare 'start tracking'; the routing eval passes the second #3533

Closed

Description

@malibio

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.

  1. "Add the cache invalidation decision to our architecture decisions." cannot create the record: create_node is never offered, and delete_node is.
  2. "start tracking our planning cycles" reaches Schema Creation, and the type is never created: create_schema is refused and the retry is malformed.
  3. eval:routing scores the second as a pass, because it checks that create_schema was 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. No create_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_schema is 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_schema with 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 enum when 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 failed create_schema followed by update_schema for 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 its mutating schema scenarios.

Documentation

  • ADR-038 "Confidence bar scales with blast radius" - destructive tools are offered only from the retrieval winner, which is what puts delete_node on 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.md if 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_node is 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_node reaches the top 3 and no destructive skill leads
  • The deletion guards in live_skill_retrieval_stability.rs still 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_schema refused for an enum without values is followed by a call that can succeed, or by a question to the user, not by update_schema on 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:fix and bun 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_schema and update_schema definitions 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-only and the already-exists and validation-error retry rules
  • Routing fixture: scripts/eval/fixtures/routing.ts - ExpectedOutcome, the mutating flag, the scoring function
  • Outcome grading precedent: scripts/eval/fixtures/agent-matrix.ts and scripts/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

Non-Goals

Activity

  1. added
    bug
    on Oct 4, 2026
  2. malibio commented on Oct 4, 2026

    @malibio
    CollaboratorAuthor

    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.

  3. malibio commented on Oct 5, 2026

    @malibio
    CollaboratorAuthor

    Baseline on main at 99393ec. Frontend: 318 test files passed, 5770 tests passed.

  4. self-assigned this
    on Oct 5, 2026
  5. added 4 commits that reference this issue on Oct 5, 2026
    5a36a47
    f8f4b17
    7ef7c85
    2ef7555
  6. added a commit that references this issue on Oct 5, 2026
    0b69d3e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-agentsbugnlp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions