Cloudstill/dsh-research-plugins--packages-research-dsh-research-router-risk ↗★ 0

@deepseek-ai/dsh-research-router-risk

确定性风险路由器,采用先廉价后升级并支持人工转交。 为研究任务提供成本分级路由,适合需控制模型开销的场景。

套件
@deepseek-ai/dsh-research-router-risk
相容性
待驗證
Harness 依賴範圍
workspace:^
Cordis 依賴範圍
workspace:^
版本
0.1.0-rc.5
授權
MIT
最近更新
2026年8月15日

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗

@deepseek-ai/dsh-research-router-risk

English | 中文

The deterministic risk router for the DSH research service. Registers a ResearchRouter on ctx.research that maps model-free routing features to a Profile / Model / Verification Level decision — cheap-first, with one strong-model escalation, then independent review, then human transfer.

Routing

decideRiskRoute(features, profiles) is a pure, deterministic, replayable function — no I/O, no model self-confidence (plan §八). The escalation ladder:

  • cheap — the task kind's cheapest adequate profile, unless risk demands more;
  • strong — high error impact, two or more disagreements, uncertainty without a locator, sensitive data under high impact;
  • independent — high-stakes disagreement (high impact + two disagreements);
  • human — no agent budget remains, or high impact with no strong-model budget left, or high-stakes disagreement with no strong-model budget.

errorImpact: 'medium' is the neutral baseline (it does not escalate by itself but forces a verification pass); 'low' with a deterministic check available routes to none verification.

Every route is a pure function of the features, so a decision is reconstructable from the research/route-decided event alone. The fallback to a registered profile honors the rung's minimum cost tier (a strong route never silently degrades to the cheapest profile).

Integration

The plugin registers the router under ctx.research (name risk by default, configurable) and unregisters it on unload for HMR safety. The profile ids it selects are the ids @deepseek-ai/dsh-research-profiles-default registers; a cross-package test pins the two id sets together so drift cannot silently downgrade high-impact work.

Model Experience

Route decisions

What the model sees

The package registers no prompt, tool, or schema of its own. Its pure decideRiskRoute maps the assignment's model-free features to a profile, verification level, and reasoning effort — so a route decides which model tier a delegated child runs on, and a route with escalateToHuman: true stops the delegation without starting any child (the lead sees the escalation in the delegation result).

Token effect

The package itself adds no tokens; an escalating route avoids child tokens entirely, and a strong route spends the strong-model tier's budget.

KV Cache effect

Route decisions contribute no request content, so there is no prefix effect; the child it selects starts a fresh conversation per assignment.

Known Limitations and Deferred Work

  • The router is deterministic, not learned — decideRiskRoute is a pure function with no learning or adaptation from outcomes; disagreement and uncertainty inputs are model-supplied tool arguments with conservative defaults, so nothing derives them from the ledger yet.
  • Verification levels are advisory — a route selects a verification level and profile, but the concrete verification action (independent re-check, source verification) is owned by the runtime and tools, not enforced by the router itself.

Source: packages/research/dsh-research-router-risk/src/index.ts