Cloudstill/dsh-research-plugins--packages-research-dsh-research-runtime-subagent ↗★ 0

@deepseek-ai/dsh-research-runtime-subagent

Research subagent runtime: structured-output validation, authority enforcement, and ledger recording for the evidence pipeline 为证据流水线提供子代理执行,适合需结构化研究输出的场景。

패키지
@deepseek-ai/dsh-research-runtime-subagent
호환성
미검증
Harness peer 범위
workspace:^
Cordis peer 범위
workspace:^
버전
0.1.0-rc.5
라이선스
MIT
최근 업데이트
2026. 8. 15.

설치

검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 README 읽기 ↗

@deepseek-ai/dsh-research-runtime-subagent

English | 中文

The research subagent runtime: turns one evidence duty into a delegated subagent run with a fixed contract and authority, validates the structured output (schema + authority + reference checks), and records the outcome as an immutable research/* event on the lead agent's session.

The pipeline

Six roles, each with a fixed authority (enforced in code, never only by prompt):

roleauthoritytask kindoutput schema
scoutdiscoveryliterature_screeningcandidate paper
bibliographic-verifierbibliographic_verificationbibliographic_verificationBibliographicVerdict
extractorevidence_extractionevidence_extractionclaim or experiment
claim-verifierclaim_verificationclaim_verificationClaimVerdict
citation-auditorreviewcitation_auditcitation audit verdict
adjudicatoradjudicationadjudicationAdjudicationVerdict

processRoleOutput classifies the output kind, refuses it through assertOutputAllowed when the assignment's authority may not emit it, validates the shape, runs reference checks (every cited paper must be in the contract's inputRefs), and builds the immutable event. A citation audit that is unsound or needs revision raises an objection (blocking human approval); a sound one records an audit-only review verdict. An adjudication verdict names a decision, not an inputRef, so no reference check applies; an approved adjudication dismisses every still-open objection against that decision so it can proceed to human approval, a revised one folds the decision back to under_review, and a rejected one is terminal.

Data flow

lead → delegate() → research/assignment-created + research/route-decided logged first → subagent transport starts a child with the role's outputSchema → the role processor validates + enforces the fixed authority → the resulting research/* event is appended → consumers fold the ledger.

The subagent transport is optional: it is resolved with ctx.get('subagents') inside delegate(), so headless compositions can route and log assignments without a real transport, and a missing transport fails loudly. The child run is always disposed (try/finally), on success and on every error path.

Partial blind review

buildContract produces a ResearchContract that carries the research question, the assignment's own objective, criteria, and input references — never the lead's conclusions or other reviewers' verdicts.

Model Experience

Child subagent prompt and structured output

What the model sees

A delegated child receives a role prompt (the research question, the assignment's own objective, and the input references — never the lead's conclusions) and the role's outputSchema from the routed profile's provider/model. The child is expected to produce exactly the role's structured output: the runtime classifies the output kind, refuses anything the assignment's fixed authority may not emit, validates the shape against the schema, runs reference checks, and appends the resulting research/* events.

Token effect

Each delegation starts a child conversation on the routed tier; the role prompt and the structured outputSchema are part of that start request, and the child's output is retained in the lead's session as event data.

KV Cache effect

Children start fresh conversations per assignment, so there is no shared request prefix across delegations; the lead's session history grows with the appended research/* events.

Known Limitations and Deferred Work

  • Usage is a size-based estimate — after a structured result, delegate() appends research/usage-observed charging child-prompt bytes plus produced-result bytes to the routed tier (a strong-tier run charges strong-model tokens; anything else charges agent tokens), not real provider token counts; exact counts are unreachable because the settled SubagentResult carries no usage — the minimal upstream change is a usage field on SubagentResult populated by readResult in @deepseek-ai/dsh-subagent-in-process-driver from the child session's usage fold.
  • A refused or malformed child output rejects without a retry — delegate() throws a typed error and appends no result event: only the run's seeded budgets (from createRun) and the already-recorded assignment/route stay on the ledger; there is no automatic retry or re-prompt of the child.
  • The subagent transport is optional — without a composed ctx.subagents provider, delegation fails loudly; headless compositions can route and log assignments but cannot run a real child.

Source: packages/research/dsh-research-runtime-subagent/src/index.ts