Orchestrate Resolver
Plugin-backed subagent inference layer that classifies an unknown Datarim pane line into a slash-command via a multi-backend AI CLI chain (coworker → claude → codex). Fail-closed; threshold gating lives in the caller.
Overview
The Orchestrate Resolver is the plugin-backed subagent inference layer of the dr-orchestrate plugin (Phase 2). It activates when the rule-based semantic parser returns confidence: 0 for a pane line — i.e. nothing in the rules corpus matched. Given the pane text and the merged rules corpus, it picks the single most likely intended slash-command from the closed Datarim command set and reports a calibrated confidence.
Plugin dependency
This agent is non-functional without the dr-orchestrate plugin. The shell driver (subagent_resolver.sh) and the semantic parser (semantic_parser.sh) live in the plugin. Enable the plugin before invoking this agent: /dr-plugin enable <abs-path>/plugins/dr-orchestrate. The agent file lives in core only so the slash-picker can discover it; its functionality is fully plugin-backed.
Classifier, not decision maker
The caller (cmd_run.sh) gates the result against a threshold (default ≥0.80) for autonomous execution; below the threshold it escalates. The autonomous-vs-escalate boundary belongs to the caller — the resolver itself is a classifier, never a decision maker.
Backend chain
Backends are tried in order from DR_ORCH_SUBAGENT_CHAIN (default: coworker-deepseek claude codex). The first backend that returns a parseable JSON object wins; subsequent backends are not invoked. Each invocation has a wall-clock budget (DR_ORCH_RESOLVER_TIMEOUT_S, default 15 s), suppresses stderr, and a missing backend binary is warned once and silently skipped thereafter.
Lenient JSON parsing
Backend output is parsed in order (first success wins): raw stdout as JSON, then the first fenced ```json … ``` block, then the first balanced { … } block. If none parses, the backend is treated as a miss and the chain continues. The design is fail-closed: an unresolved line escalates rather than executing a guessed command.