dsh-judgment: Batch Structured Probability Judgment in DSH

Preface

In DeepSeek Harness (DSH), a common approach for building agents is to let the main model “think a step, answer a step” within the conversation: selecting actions, estimating confidence, and assigning scores. While the main model excels at generation, breaking down domain judgments into many rounds of scattered questions leads to repeated transmission of the same state, causing costs and latency to rise. The community plugin directory contains a category of “Model Reasoning” plugins dedicated to connecting judgment capabilities to external decision models. dsh-judgment takes a different path: a single call carries a state and a batch of named questions, returning a batch of structured answers with probabilities; loops, thresholds, and retries remain on your agent side. The following explains its current capabilities based on installation, configuration, and consumption methods.

What is this

dsh-judgment is released by the maintainer j62268781-alt and categorized as Model Reasoning. It registers the ctx.judgment service within DSH and does not expose tools to the model (zero tool surface). The README describes it as “It judges, the consumer decides”—the plugin only performs batch probabilistic judgments and does not provide loop logic such as observation, addressing, or loop transitions.

The shape of a judgment call is: One State + A Batch of Named Questions → A Batch of Probability Answers. The state is sent only once per batch; the README claims an approximate 38-fold magnitude difference in cost compared to “asking one question at a time” (subject to the documentation’s statement).

The three question primitives currently implemented:

Primitive Semantics Answer
noul Single probability p ∈ [0,1] (Yes/No) { probability }
choice 2–255 mutually exclusive candidates (single select) { optionId, probabilities } (full distribution)
score 2–10 ordered levels { value, probabilities } (value is the level position, can be a decimal)

Type contracts are located at the package export path dsh-judgment/contract, containing only types and zero runtime dependencies, facilitating consumer import type for interface alignment.

Core Features (Capability List in Documentation)

The following are all derived from the “Honest List” in the repository README; items not marked as available are not written in.

  • Service & Configuration: ctx.judgment; two-layer configuration (Connection Layer × Purpose Layer); settings page (add/delete/modify, keys, self-check button).
  • Call Surface: ask() batch judgment, health() remote self-check; README states it has been tested on the real SystemOne endpoint (approx. 500ms magnitude).
  • Protocols: system-one (noul) tested on real network; openai-decisions (predicate) checked against public docs, documentation notes no real machine test yet.
  • Strict Validation: Answer set consistency, distribution completeness, normalization tolerance 0.02, argmax 1e-6, model name snapshot, etc.; rejection on failure, no automatic repair.
  • Validation Failure Info: Structured fields (rule, candidate count, Σp, tolerance) and recorded in ledger, allowing consumers to deterministically decide how to shrink candidates and retry.
  • Audit & Metering: Write audit ledger before sending package; record tokens, latency, request_id, fingerprint; disk write failure does not block judgment.
  • Local Quotas: Optional guardrails for connection/purpose layers, default unlimited (0); documentation emphasizes these are local guardrails, not account quotas.
  • Not Implemented: Tool surface judgment/llm-face is an optional component, disabled by default.

Restart DSH is required after plugin update (host half is a Node-side module, loaded once at process startup); if self-check reports HTTP 404 or transport failure, it is mostly related to the host not reloading.

Installation & Enablement

Installation commands follow the README:

# From npm (Recommended; currently 0.1.0)
dsh plugin --profile <profile> add dsh-judgment@0.1.0

# Or install from GitHub (Repo root has cordis.patch.yml, can be installed directly as a plugin package)
dsh plugin --profile <profile> add github:j62268781-alt/dsh-judgment

# Or local path (For development; see ~/.dsh/profiles for profile names)
dsh plugin --profile <profile> add /absolute/path/dsh-judgment

After installation, restart DSH and configure connections in Settings → Decision; there is a self-check in the ⋯ menu at the top right of the connection card. License is MIT (package.json).

Keys are not written into YAML: reference environment variable names via credentialRef (e.g., JUDGMENT_API_KEY_1), or fill in the settings page; priority is Startup Env > Stored File > Project dotenv > User dotenv. New environment variables added during runtime will not be read; they must be set before starting DSH.

Configuration: Connection & Purpose

Configuration can be done via the settings page or written into the profile’s cordis.patch.yml. The connection layer is a (Protocol, Address, Model, Credential) tuple; the purpose layer provides stable logical names for consumers, unknown purpose names will error out directly without silently switching connections.

- id: judgment/provider
  name: dsh-judgment
  config:
    connections:
      typesafe-main:
        protocol: system-one        # system-one | openai-decisions
        baseUrl: https://api.typesafe.ai/v1/systemone
        model: typesafe/jev-1.13
        credentialRef: JUDGMENT_API_KEY_1
        timeoutMs: 10000
    purposes:
      browser.action: { connection: typesafe-main }
      compaction.retain: { connection: typesafe-main }
    defaultConnection: ''

Second protocol example (Endpoint /v1/decisions, model name subject to your account):

    connections:
      openai-decisions:
        protocol: openai-decisions
        baseUrl: https://api.openai.com/v1/decisions
        model: gpt-6-luna
        credentialRef: JUDGMENT_API_KEY_2

README notes: openai-decisions officially supports passing message arrays and images, but this plugin sends state as a JSON string and does not support image input; visual judgment should go through the main model side.

Typical Usage

Consumer example provided in the README (Types from dsh-judgment/contract):

import type { ApiVersion, Judge } from 'dsh-judgment/contract'

const EXPECTED: ApiVersion = 1
const judge = ctx.get('judgment') as Judge | undefined
if (!judge || judge.apiVersion !== EXPECTED) return useFallbackJudge()

const state = { page: 'a11y summary……' }
const questions = {
  action: {
    kind: 'choice',
    prompt: 'Which step best advances the current task?',
    options: { e0: 'Click "Search"', e1: 'Type in the input box' },
  },
  goal_done: { kind: 'noul', prompt: 'The task goal has been achieved' },
  retain: { kind: 'score', prompt: 'How much of this output should be kept verbatim?', levels: ['Discard', 'Truncate', 'Keep'] },
}

const result = await judge.ask(state, questions, { purpose: 'browser.action' })

for (const [id, answer] of Object.entries(result.answers)) {
  if (answer.kind === 'abstain') continue
  if (answer.kind === 'choice') console.log(id, answer.optionId, answer.probabilities)
}

const now = judge.fingerprint(state, questions, { purpose: 'browser.action' })
if (now !== result.fingerprint) return 'stale_state'

The documentation lists a practical consumer including dsh-agent-browser: it gates via ctx.get('judgment'), apiVersion, and status().purposes[].usable before performing batch ask. The action domain purpose preset browser.action suggests choice candidates ≤ 16; too many candidates may trigger validation failures like distribution-normalized, consumers should shrink candidates and retry rather than expecting the plugin to loosen tolerances.

When validation fails, you can use the invalid-response and validation fields of JudgmentError to create deterministic retry strategies (the provider itself does not retry).

Scenarios & Notes

Who it is for: Teams that need to break down judgments like “select action, whether completed, retention strength” into structured probability questions within an agent loop, and connect to TypeSafe Jev, OpenAI Decisions (Luna), or compatible endpoints; willing to implement loops, fingerprint comparison, and invalid-response retry logic themselves.

Permissions & Security: The plugin runs with the current DSH process permissions and will access the remote APIs and local ledger you configured; please read the source code and MIT license before installation, and assess credentials and outbound requests yourself.

Ecosystem Note: DSH adopts “Everything is a plugin”; SkillHub Plugin Directory is a community site, with no official affiliation with DeepSeek / High-Flyer. The GitHub repository currently has 1 star (subject to the directory page info).

Conclusion

dsh-judgment converges “domain judgment” into “State + Batch Named Questions → Probability Answers”, using strict validation, audit ledgers, and purpose-layer configuration to connect reasoning endpoints into DSH, while leaving strategy and loops to the agent. To view the introduction and classification, you can open the SkillHub Directory Page; for source code and full design, see GitHub: j62268781-alt/dsh-judgment.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye