Skip to content

Routing eval has no route_multi coverage, and two scenario labels conflate out-of-scope with ambiguous #2877

Closed

Description

@malibio

Overview

The shipped routing eval (scripts/eval/fixtures/routing.ts) cannot see one third of Stage 1's decision surface, and two of its 15 scenario labels are arguable. Both found while measuring something else; both would matter regardless.

1. No route_multi coverage at all

Stage 1 offers exactly three tools — route_query, route_clarify, route_multi (routing.rs:154, stage1_tool_definitions). The fixture's expectation model has three kinds, and none of them is multi:

5  kind: "clarify"
6  kind: "search"      ─┐ both mean route_query at Stage 1
7  kind: "skill"       ─┘

Verified: zero occurrences of route_multi or "multi" in the fixture. So the eval scores two of the three routing outcomes and is structurally blind to the third.

That matters more than a coverage percentage suggests. route_multi is the outcome with the most prose devoted to steering it away from the other two — its tool description carries "Do NOT use this for a single intent, however it's phrased, and do NOT use this in place of route_clarify when a single intent is itself ambiguous", and STAGE1_SYSTEM_PROMPT adds "ONLY if the request contains two or more distinct, unambiguous things to do — not one thing phrased at length." Two separate guard clauses exist because it is the easy outcome to over-select. Nothing measures whether they work.

A regression that made the model split single intents into multi would pass this eval cleanly today.

2. Two scenario labels are arguable

Neither is obviously wrong, but both are worth a deliberate decision rather than inheritance.

out-of-scope-weather — "What's the weather like in Tokyo today?", labelled clarify.

This request is perfectly clear. It is not ambiguous; it is out of scope — NodeSpace cannot answer it at all. The router has no "decline" channel, so refusal is currently expressed through route_clarify, and the fixture encodes that workaround as the correct answer. That conflates two different judgments ("I cannot tell what you mean" vs "I understand you and cannot help") under one label, and it means a model that correctly identifies the request as clear-but-unanswerable is scored wrong.

Either the label is right and the conflation should be documented as intentional, or Stage 1 is missing a decline outcome. Worth deciding.

clarification-then-fallthrough — "just show me what I have", labelled search, sits oddly beside ambiguous-manage-projects — "help me manage my projects", labelled clarify. The first is arguably the vaguer of the two, yet it is the one expected to resolve rather than clarify. The scenario id suggests the intent is to test the fall-through path rather than the initial judgment, but as scored it reads as an inconsistency.

Why file this now

Found while running a decision-model probe against these 15 scenarios as ground truth. The probe's result is irrelevant here — what it exposed is that the fixture's own coverage and labelling have gaps that affect any measurement taken against it, including the locked model's own routing accuracy.

Note also that collapsing skill and search into route_query (correct for Stage-1 purposes — Stage 1 decides describability; skill-vs-search is Stage 2's job) makes the distribution 11 query / 4 clarify. Any Stage-1 accuracy figure from this fixture is therefore measured against a 73.3% constant-answer baseline, which is worth stating whenever such a figure is quoted.

Acceptance Criteria

  • The expectation model covers route_multi, and scenarios exercise it — including at least one negative case (a single intent phrased at length, which must NOT route multi) since that is what the guard clauses defend against
  • A decision is recorded on out-of-scope-weather: either the clarify-as-decline conflation is intentional and documented, or Stage 1 needs a distinct decline outcome
  • clarification-then-fallthrough vs ambiguous-manage-projects is either justified in a comment or relabelled
  • The fixture header states the constant-answer baseline for its own distribution, so an accuracy figure cannot be read as better than it is
  • Tests pass (bun run test:all), code passes bun run quality:fix

Technical Specifications

Reference Files

  • scripts/eval/fixtures/routing.ts — the 15 scenarios and the ExpectedOutcome union that has no multi variant
  • packages/agent/src/local_agent/routing.rs:154 — stage1_tool_definitions, the three tools actually offered
  • packages/agent/src/local_agent/agent_loop.rs:60 — STAGE1_SYSTEM_PROMPT and its multi guard
  • packages/agent/src/local_agent/routing.rs:243 — parse_route_decision, which already rejects a route_multi carrying fewer than 2 queries; that rejection path is also unmeasured

Related

  • ADR-038 — the two-stage routing design; its Risks section names the routing eval as "the Set up Tauri + Svelte project structure #1 regression guard", which is the reason a blind third of the surface is worth closing

Activity

  1. malibio commented on Sep 23, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 262 files / 5264 tests passed

  2. self-assigned this
    on Sep 23, 2026
  3. malibio commented on Sep 23, 2026

    @malibio
    CollaboratorAuthor

    out-of-scope-weather: take option 1, but assert on the turn outcome rather than the Stage-1 tool

    Option 1 is the right call. Its stated expectation needs one correction before it is built, and there is a prior decision that makes this a labelling error rather than a missing capability.

    ADR-038 already covers this case

    ADR-038's clarification contract:

    "Many intents legitimately resolve to a general search skill. That is a normal outcome, not a routing failure."

    A weather question routing to search, matching nothing above the score bar, and the model answering "I have nothing about that" is already the designed behaviour. Nothing is missing from the architecture. What is wrong is that the fixture labels that path clarify, so a model doing exactly what the ADR specifies scores as failing.

    That reframes the fix: this is correcting a label against an existing contract, not adding a capability.

    The correction to option 1's expectation

    Option 1 says "Stage 1 is expected to route_query (the request can be described)." Do not assert that.

    Two reasons:

    1. It pins an implementation detail. Whether Stage 1 emits route_query for an out-of-scope request is a routing choice that could legitimately change — a future improvement that recognised the request as unanswerable earlier would break a test that was measuring the wrong thing.
    2. It is not what the scenario is testing. The thing worth pinning is that the turn does not ask the user to disambiguate a request that is perfectly clear, and does not mutate anything on the way to saying so.

    So the decline expectation should assert on turn outcome:

    • ❌ no route_clarify — the request is not ambiguous, and asking "did you mean X or Y?" about the Tokyo weather is the failure this scenario exists to catch
    • ❌ no mutating tool call
    • ✅ the turn ends in a refusal or an empty-result answer

    Stage 1's tool choice stays unasserted.

    Against option 3 (a fourth route_decline tool)

    Two independent arguments, and I would not pursue it without new evidence against both.

    It asks the model to make a distinction a purpose-built classifier cannot. A fourth outcome requires separating "I cannot describe this" from "I can describe it and we cannot help." Round 3's measurement (see #2825) found a 421M encoder trained for typed decisions had no rank signal at all on the closely-related ambiguity axis — AUC 0.36-0.57 against chance 0.50, and zero route_clarify predictions across 66 calls in three configurations. That is not evidence Gemma would fail at this specific split, but it is evidence the axis is harder than it looks.

    It contradicts ADR-038's own scaling argument. That ADR's core claim is that enumeration degrades small-model selection as option count grows. Stage 1 is currently a 3-way choice measured against a 73.3% constant-answer baseline on the shipped fixture; adding a fourth option is as likely to make routing worse as better, and nothing currently measures the regression it would cause — which is the other half of this issue.

    If it is ever revisited, it needs its own issue and route_multi coverage landing first, so the regression is visible.

    On option 2

    Cheapest, and better than option 3 — but it leaves the defect in place. A model that correctly reads the request as clear-but-unanswerable still scores wrong, which means the eval penalises the correct behaviour. That is the shape of thing that later gets "fixed" by making the model worse, and it is worth 20 minutes to avoid.

    Summary

    • Option 1, with decline asserting turn outcome, not Stage-1 tool choice
    • Record it as a correction against ADR-038's existing fall-through clause; no ADR amendment needed
    • Option 3 is a separate issue if ever wanted, blocked on route_multi coverage existing first
  4. malibio commented on Sep 23, 2026

    @malibio
    CollaboratorAuthor

    Post-merge routing eval run: failing scenarios

    Run conditions: gemma-4-e4b-q4km, n_ctx 32768, eval commit b0be6446 (clean tree), 3 reps. The run used a separate test daemon (NODESPACE_HOME) whose database was purged and restarted between reps.

    Overall:

    • pass^3 is 14/19 and pass^1 is 14.67/19.
    • Every new scenario from this issue passed 3 out of 3 reps:
      • multi-task-and-search and multi-schema-and-search: Stage 1 returned multi, and the turn acted on both intents.
      • single-intent-long-task and single-intent-long-search: Stage 1 returned query. multi_rejected never appeared.
      • out-of-scope-weather: Stage 1 returned query, the turn made no tool call, and it declined.

    The failures below were already in the fixture before this change. Stage 1 returned query in every one of them. None involve route_multi.

    Scenario Reps passed Skills routed (retrieval) What happened
    indirect-schema-money-owed 0/3 Organization 0.668, Conflict Resolution 0.655, Node Merge 0.629 Schema Creation is never retrieved. The model searches, finds nothing, then offers to "create a new tracker".
    indirect-schema-freelance 0/3 Node Creation 0.774, Bulk Import 0.763, Organization 0.754 Schema Creation is not in the top-3. The model creates a plain node ("I've created a new node to start tracking your freelance projects").
    instance-not-schema-invoice 0/3 Invoice (schema hit) 1.000, Bulk Import 0.682, Conflict Resolution 0.680 Node Creation is never retrieved. With the schema hit and Bulk Import on offer, the model reaches for create_nodes_from_markdown: an import error in rep 1 and a stray node in rep 2. Rep 3 failed on invalid search_nodes arguments.
    clarification-then-fallthrough 0/3 varies by rep; Research & Search appears only in rep 3, at rank 3 (0.784) Search is not reached. The model makes no tool call and asks a second clarifying question in prose. That is the double-clarification ADR-038 forbids, but it arrives through Stage 2 prose, so the clarify_suppressed guard never sees it.
    ambiguous-client-contacts 2/3 (flipped) Organization 0.912, Conflict Resolution 0.855, Relationship Management 0.813 In rep 2 the model searched, then asked for confirmation of a specific node instead of asking which of the two interpretations the user meant.

    Pattern:

    • Three failures are retrieval misses, not model-choice failures. In the three 0/3 skill scenarios, the skill that expectation needs was never in the candidate set. Stage 1's query didn't embed near it, so Stage 2 never had the option. This matches ADR-038 Finding 4 (indirect phrasing doesn't embed near "create schema").
    • clarification-then-fallthrough is a contract gap. The at-most-one-clarification rule only holds when the second clarification goes through route_clarify.

    Results file: /tmp/nodespaced-2877/routing-e4b.json (local, not persisted).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions