Skip to content

Re-theme the routing eval's scenarios into NodeSpace's developer-workflow domain #3189

Closed

Description

@malibio

Overview

The skill-routing eval (bun run eval:routing, scripts/eval/fixtures/routing.ts) is still scored in a generic small-business and personal domain. #1977 re-themed the end-to-end agent matrix into NodeSpace's working domain but explicitly left the routing fixture out of scope. This issue does the same re-theme for the routing fixture, and rewords the clarification-contract re-prompt so it states only what is known — both need the same before/after eval run, so they are measured together.

Problem Statement

Current routing prompts include:

  • "Create an invoice tracking database"
  • "keep tabs on who owes me money"
  • "I need a way to log my business expenses"
  • "Add an invoice for $500 due next Friday"
  • "organize my client contacts"
  • "maybe set up some kind of tracking for vendors"
  • "show me stuff about my customers"
  • "Add a task to renew my passport, and also pull up my notes on the Lisbon trip"
  • "Set up a way to track my vinyl records, then separately find what I wrote about turntables last year"
  • "Create a task to call the dentist tomorrow morning ..."

Routing accuracy decides which skill a request reaches. Whether "keep tabs on who owes me money" reaches Schema Creation says little about whether a developer's "start keeping track of the decisions behind each feature" does. The routing eval is also cited when judging agent changes (clarification contract, skill descriptions, exclusion scoring), so its domain is the domain those decisions are actually measured in.

Proposed Solution

Follow the decision already recorded for the matrix in ../nodespace-docs/development/agent-eval.md ("Scenario domain"): re-theme in place, not a second fixture. Rewrite each prompt into NodeSpace's working domain (specs and their sign-off state, architecture decisions, planning cycles, tasks tied to the feature or decision that constrains them) and change nothing else.

Constraints the re-theme must keep:

  • Every scenario id stays the same, so a baseline recorded before the re-theme still joins against a run after it and a domain-driven change shows up as a change rather than as removals and additions.
  • Every scenario's expected kind and flags stay the same (loadBearing, mutating, adversarial, singleIntentAtLength, and the shape of priorTurns). Only vocabulary changes; what each scenario measures does not.
  • The constant-answer baseline distribution stays the same (13 query / 3 clarify / 2 multi, decline unasserted). scripts/eval/fixtures/routing.test.ts pins it against the scenario list.
  • Ambiguous scenarios stay genuinely ambiguous. A developer phrasing that clearly names one skill turns a clarify scenario into a query scenario and silently shifts the distribution above.
  • Indirect scenarios stay indirect. They must not name the skill or its tool ("schema", "type", "search"); they measure whether intent alone reaches the right skill.
  • Compound scenarios stay two independent intents; single-intent-at-length scenarios stay one intent with several details.
  • The out-of-scope prompt stays out of scope. The weather prompt can stay as is.
  • clarification-then-fallthrough is re-themed last. First record the re-prompt wording result on its current prompts (see "Also in scope" below), then re-theme it. Changing the scenario and the behavior it measures in one step would leave neither measurable.

Also in scope: make the clarification re-prompt accurate

ALREADY_CLARIFIED_NUDGE (packages/agent/src/local_agent/agent_loop.rs) is put to Stage 2 when it replies with no tool call in an intent that is already clarified. "Already clarified" means the intent (every turn since the last successful write) holds a composed route_clarify clarification, or at least two turns that did not write (see session_already_clarified).

The re-prompt's text is:

The user has already answered a clarifying question about this request, and a request gets only one. Do not ask them anything further. Act on the most reasonable reading of what they said by calling the tool that fits it.

That is true for a composed clarification, but not for the two-turn branch. A chat that only reads never closes its intent, so from its third non-writing turn the re-prompt fires on a plain reply. Example: "Do I have Northwind?" (search), then "What about Contoso?" (search), then "thanks". The model is told something false and pushed toward a tool call; when Stage 1 fails open, that surface includes writes.

The wording was left as is because the fix was measured on it: clarification-then-fallthrough went from 0/3 to 5/5 with the re-prompt firing on every scored turn. Rewording it without measuring could quietly undo that.

Change: reword the re-prompt so it asserts only what the structure knows. For example, "You have already replied to this request without acting. If the user's message asks for something to be done, act on the most reasonable reading by calling the tool that fits it; otherwise answer briefly." Update the constant's doc comment to match.

Measure it in the same eval run as the re-theme. Measure clarification-then-fallthrough twice, once with the current wording and once with the new wording. The scenario keeps its current prompts until the wording result is recorded, and is re-themed afterwards. Rewording the re-prompt and re-theming the scenario in one step would leave neither change measurable. Also measure one read-only chat ("look up X", "look up Y", "thanks") to confirm the new wording no longer produces a tool call there.

Architecture Impact

Extends the "Scenario domain" decision in ../nodespace-docs/development/agent-eval.md (re-theme in place, keep ids) from the agent matrix to the routing fixture. No ADR is reversed. Companion docs change: update that section to state it covers both fixtures (commit straight to nodespace-docs main).

Acceptance Criteria

  • Every prompt and priorTurns entry in scripts/eval/fixtures/routing.ts is re-themed into NodeSpace's working domain, with no invoice, expense, client, vendor, customer, passport, vinyl, Lisbon or dentist vocabulary left
  • Every scenario id, expected kind and flag is unchanged, and routing.test.ts still pins the 13 / 3 / 2 constant-answer distribution
  • The scenario descriptions and the file's header comment are updated to match the new prompts
  • New prompts pass guidance_is_not_contaminated_by_eval_prompts (packages/agent/src/agent_guidance.rs)
  • A 3-rep eval:routing run of the re-themed fixture is compared against a 3-rep run of the old fixture on the same build, on a quiet machine with no other model loaded, and the PR names every scenario whose pass rate moved
  • ALREADY_CLARIFIED_NUDGE asserts only what is known (no claim that a clarifying question was answered), and its doc comment matches
  • clarification-then-fallthrough passes at least 5/5 reps with the new wording, measured on its current prompts, and the re-prompt still fires on the scored turn (daemon log line Clarification contract: prose reply after an answered clarification — re-prompting to act)
  • A read-only three-turn chat ending in a tool-free reply makes no tool call after the re-prompt, recorded in the PR
  • ../nodespace-docs/development/agent-eval.md "Scenario domain" says it covers both fixtures
  • bun run test:scripts passes and code passes bun run quality:fix

Technical Specifications

Reference Files

  • Routing fixture: scripts/eval/fixtures/routing.ts — the 20 scenarios, ExpectedOutcome, RoutingScenario flags
  • Routing fixture tests: scripts/eval/fixtures/routing.test.ts — pins the constant-answer baseline against the scenario list
  • Contamination guard: packages/agent/src/agent_guidance.rs (guidance_is_not_contaminated_by_eval_prompts) — parses prompt: literals out of every file in scripts/eval/fixtures/
  • Matrix precedent: scripts/eval/fixtures/agent-matrix.ts — the re-themed vocabulary to stay consistent with
  • Eval docs: ../nodespace-docs/development/agent-eval.md — setup (isolate with NODESPACE_HOME), "Scenario domain", baseline comparison (--baseline)

Running the comparison

Two models on one 16GB machine run each other out of Metal memory (turns fail with Decode Error -3), and heavy concurrent builds push turns past the per-turn timeout, whose tool calls are then attributed to the next scenario. Run both arms with no other nodespaced holding a model and no merge gate running, or the comparison measures contention rather than the domain change.

Non-Goals

  • Adding, removing, or changing the expected outcome of any routing scenario (a coverage change, not a domain change)
  • Fixing routing failures the re-theme exposes; record them, and fix them in their own changes

Dependencies

Related Issues

Activity

  1. malibio commented on Sep 28, 2026

    @malibio
    CollaboratorAuthor

    Frontend: 277 files / 5202 tests passed

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

    @malibio
    CollaboratorAuthor

    WIP handoff: d6ab178 on branch issue-3189-routing-retheme. Fixture re-themed + nudge reworded. Old wording: fallthrough 5/5, read-only 5/5. New wording: fallthrough 0/2 (interrupted, contended machine) — needs 5-rep re-measure on a quiet machine; the reword may regress the #2905 fix. See commit message for the harness recipe and remaining work.

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