/dr-orchestrate
Self-driving Datarim pipeline with snapshot-first resume and fail-closed semantic routing.
Overview
/dr-orchestrate runs the Datarim pipeline through a terminal pane. The command, autonomy floor, and action policy are part of Datarim core. The tmux driver, semantic resolver, bot transport, and audit backends are supplied by the optional dr-orchestrate plugin.
Phase 2 operates at autonomy level L2. Known prompts follow deterministic rules. Unknown prompts enter a bounded resolver chain and may proceed only when confidence and space policy both allow the proposed action. Everything else is escalated.
Usage
/dr-plugin enable /path/to/plugins/dr-orchestrate
dr-orchestrate run
dr-orchestrate run --dry-run
dr-orchestrate run --unknown-prompt "operator prompt"
'short' => 'Tmux-based self-driving Datarim pipeline runner — Phase 2 (Subagent Inference, autonomy L2)',
'body' => <<<'HTML'
Overview
/dr-orchestrate is the framework's reference non-core plugin. Phase 1 (v2.3.0) shipped a lean rule-based tmux runner. Phase 2 (v2.4.0) adds a subagent inference layer that activates when the rule-based parser cannot classify a pane line, plus a flock-race-safe cooldown and audit schema v2. Plugin autonomy is now L2 (assisted): a human still owns escalation, but unknown prompts no longer dead-end at the parser.
The plugin lives at plugins/dr-orchestrate/ in the framework repo and is enabled via the standard plugin CLI (/dr-plugin).
Usage
# Enable the plugin once
/dr-plugin enable dr-orchestrate
# Optional: opt in to send-keys (default fail-closed)
cp ~/.claude/plugins/dr-orchestrate/user-config.template.yaml \
~/.claude/plugins/dr-orchestrate/user-config.yaml
chmod 600 ~/.claude/plugins/dr-orchestrate/user-config.yaml
$EDITOR ~/.claude/plugins/dr-orchestrate/user-config.yaml # set key_injection: true
# Run a single Phase 2 cycle (parse → resolver → autonomous-or-escalate)
/dr-orchestrate run
# Dry-run for validation
/dr-orchestrate run --dry-run
# Manually resolve a pasted prompt without consuming a tmux pane
/dr-orchestrate run --unknown-prompt "operator paste: > /dr-prd ready for strategy gate"One Cycle
- Capture the current tmux pane.
- If a task ID is present, validate and read
datarim/snapshots/{TASK-ID}.snapshot.mdbefore classification. Itsrecommended_nextvalue is a hint, not a constraint. - Run the rule-based semantic parser.
- On a rule hit, record the decision and continue through the action gate.
- On a miss, call
subagent_resolver.sh. Its bounded fallback chain iscoworker, thenclaude, thencodex; the Coworker backend uses the supported classifier profile. - Require the configured confidence threshold (default
0.80) and the space autonomy policy. Operator-gated or invalid policy results are escalated, never executed.
Core and Plugin Boundary
- Core: command contract, space-autonomy resolver, FB policy loader, hard-gated safety rules, and action-to-policy mapping.
- Plugin: tmux capture and send, semantic resolver implementations, HTTP/bot transport, Redis or callback integration, and operational audit tooling.
The command can describe and enforce its policy without a plugin. The pane-driving runtime requires the plugin.
Security Floor
- Every action passes through the space policy and fail-closed action gate.
- Pane text is represented in audit records by SHA-256, never stored raw.
- Potential credentials in reasons are redacted before logging.
- Key injection rejects escape bytes and characters outside the allowlist.
- Per-pane micro and decision cooldowns prevent repeated sends; Linux uses
flockfor atomicity.
Audit
Schema-v2 events record the stage, outcome, confidence, selected backend, escalation backend, and a redacted reason. Rule-hit schema-v1 events remain readable for backward compatibility. Resolver failure, low confidence, cooldown rejection, and policy rejection are explicit terminal outcomes.
Configuration
subagent:
fallback_chain: ["coworker-deepseek", "claude", "codex"]
timeout_s: 15
confidence_threshold: 0.80
escalation:
backend: "mock"
mock_log: ~/.local/share/dr-orchestrate/escalation.jsonl
Current Limits
Automatic rule learning remains out of scope. The default escalation sink is a local JSONL record; a real external consumer must be configured deliberately. Network transports belong to the plugin and must retain loopback or approved private-network exposure.