Repository navigation
Description
Overview
The skill-mediated routing design (ADR-036) rests on the model reliably (a) forming a good search query from indirect phrasing and (b) judging whether a retrieved skill fits the intent. The supporting evidence so far is ad-hoc and n=1 — sufficient to justify the direction (which rests primarily on the scaling argument), but not sufficient to claim routing is reliable at production rates.
This issue builds a repeatable eval harness that turns those ad-hoc observations into CI regression fixtures, so routing accuracy is measured and guarded rather than assumed. It is the mechanism that earns the reliability claim ADR-036 explicitly defers.
Problem Statement
- Routing accuracy was observed once, by hand, against
llama-serverbuild 8660 — not reproducible, not in CI. - ADR-036's load-bearing assumption is the Stage-2 judgment (is this the right skill?) under indirect/adversarial phrasing. That is exactly what is unproven.
Proposed Solution
A harness that runs a fixture set of (user_message [+ prior context], expected_skill | expect_clarify) cases through the routing pipeline and reports per-case outcomes (matched skill, score, clarify-or-act, latency). Runnable locally and in CI against the upgraded engine.
Fixture coverage (minimum)
- Direct intent → correct skill ("Create an invoice tracking database" → Schema Creation).
- Indirect phrasing → correct skill ("keep tabs on who owes me money" → Schema Creation; "start tracking my freelance projects" → Schema Creation). This is the Set up Tauri + Svelte project structure #1 case — the load-bearing assumption.
- Ambiguous → expect clarification, not a guess ("organize my client contacts" — schema vs collection).
- Existing-type instance vs new-type ("add an invoice for $500" → Node Creation, not Schema Creation).
- General/search → general semantic_search skill (a normal outcome, not a failure).
- No-match / out-of-scope → clarify, bounded to one clarification then fall through.
- Mutating-skill gate: a borderline schema-creation case is gated harder than a borderline read-only case (per ADR-036's blast-radius bar).
Acceptance Criteria
- Fixture set encoding the cases above, with expected outcomes (skill / clarify).
- Harness runs them through the routing pipeline and reports per-case pass/fail, matched skill, score, turn count, latency.
- Runs against the upgraded engine (gated on the llama.cpp upgrade issue); runnable in CI.
- Baseline numbers recorded; regressions fail the run.
- The indirect-phrasing and ambiguous-clarify cases are explicitly asserted (the thin-evidence areas).
- Code passes
bun run quality:fix.
Technical Specifications
Reference Files
scripts/aichat-matrix.ts/scripts/aichat.ts— existing headless harness to extend.packages/core/src/ops/skill_ops.rs—find_skills(the routing/match under test).NODESPACE_PROMPT_DUMP— capture the assembled prompt/decision per case.
Dependencies
- llama.cpp upgrade issue (the harness must run on the verified engine)
- find_skills/search_skills returns each matched skill's full instruction subtree, not just its description #1356 (find_skills returns instructions — affects Stage-2 judgment)
Related Issues
- ADR-036 (this is the regression guard the ADR's Risks section requires)
- Skill-mediated tool routing: LLM-judged two-stage retrieval pipeline with clarification fallback #1352 (routing pipeline under test)
Non-Goals
- Building the routing pipeline itself (separate issue).
Activity
malibio commentedon Jun 6, 2026
Frontend baseline: 134 test files, 3844 tests passed
Address review: fix mutating-tool allowlist, clarification heuristic,…
Routing eval harness: repeatable fixtures for skill-discovery accurac…
Routing eval harness: repeatable fixtures for skill-discovery accurac…