Orchestrator Usage (Manual Testing)
Harness Engineering execution plan: this is an agent-executable scenario that shows how the control plane coordinates environment, workflow, guardrails, and feedback loops rather than a one-off agent call.
Agent Collaboration: This document is an agent-executable plan. Open this project in an AI coding agent (Claude Code, OpenCode, Codex, etc.) — the agent reads this plan and orchestrates other agents via the orchestrator CLI to collaboratively complete the task, from resource deployment and execution to result verification, fully autonomously.
This document is a practical, copy-paste oriented guide for manually testing the orchestrator from CLI.
Entry point: orchestrator (CLI client) + orchestratord (daemon).
1. Prerequisites
Run from repository root:
cd "$ORCHESTRATOR_ROOT" # your orchestrator project directory
cargo build --release -p orchestratord -p orchestrator-cliStart the daemon:
orchestratord --foreground --workers 2Verify CLI surface:
orchestrator --help
orchestrator task --help2. Clean Runtime State
orchestrator delete project/<project> --force
orchestrator initRuntime data locations:
- SQLite DB:
~/.orchestratord/agent_orchestrator.db - Logs:
data/logs/
3. Apply Self-Bootstrap Workflow
orchestrator manifest validate -f docs/workflow/self-bootstrap.yaml
# ⚠️ 必须使用 --project,否则真实 AI agent 会注册到全局空间
orchestrator apply -f docs/workflow/execution-profiles.yaml --project self-bootstrap
orchestrator apply -f docs/workflow/self-bootstrap.yaml --project self-bootstrap
orchestrator get workflow
orchestrator get agent
orchestrator get workspaceExpected:
- workspace
self - workflow
self-bootstrap - agents
architect,coder,tester,reviewer
4. (Optional) Low-Cost Smoke Workflow
For fast/cheap verification, use a 3-step flow (plan -> qa_doc_gen -> implement):
cat > /tmp/self-bootstrap-smoke.yaml <<'YAML'
apiVersion: orchestrator.dev/v2
kind: Workflow
metadata:
name: self-bootstrap-smoke
spec:
steps:
- id: plan
type: plan
required_capability: plan
enabled: true
repeatable: false
tty: false
- id: qa_doc_gen
type: qa_doc_gen
required_capability: qa_doc_gen
enabled: true
repeatable: false
tty: false
- id: implement
type: implement
required_capability: implement
enabled: true
repeatable: false
tty: false
- id: loop_guard
type: loop_guard
enabled: true
repeatable: true
is_guard: true
builtin: loop_guard
loop:
mode: once
enabled: true
stop_when_no_unresolved: true
YAML
orchestrator manifest validate -f /tmp/self-bootstrap-smoke.yaml
orchestrator apply -f /tmp/self-bootstrap-smoke.yaml --project self-bootstrap5. Create and Run a Task
Important:
- item-scoped workflows default to scanning QA/Security markdown under workspace
qa_targets - task-scoped-only workflows can be created without QA markdown; the orchestrator uses a synthetic
__UNASSIGNED__anchor item - explicit
--target-filevalues override the default source
Create task without auto start:
orchestrator task create --project self-bootstrap \
-n self-bootstrap-manual \
-w self \
-W self-bootstrap-smoke \
--no-start \
-g "SMOKE RUN: create docs/qa/self-bootstrap/smoke-self-bootstrap.md with marker SB_SMOKE_20260226; keep changes minimal; do not modify core/src/**" \
-t docs/qa/orchestrator/26-self-bootstrap-workflow.mdStart task:
orchestrator task start <task_id>Watch summary:
orchestrator task list -o json
orchestrator task info <task_id> -o jsonWatch logs:
orchestrator task logs <task_id> --tail 506. Validate Step Execution (Events + Runs)
Check step order:
sqlite3 ~/.orchestratord/agent_orchestrator.db "
SELECT id,
event_type,
json_extract(payload_json,'$.step') AS step,
json_extract(payload_json,'$.step_id') AS step_id,
json_extract(payload_json,'$.success') AS success,
json_extract(payload_json,'$.exit_code') AS exit_code,
created_at
FROM events
WHERE task_id='<task_id>'
ORDER BY id;"Check run details and log file paths:
sqlite3 ~/.orchestratord/agent_orchestrator.db "
SELECT id, phase, agent_id, exit_code, validation_status, started_at, ended_at, stdout_path, stderr_path
FROM command_runs
WHERE task_item_id=(SELECT id FROM task_items WHERE task_id='<task_id>' ORDER BY order_no LIMIT 1)
ORDER BY started_at;"7. Validate plan_output Propagation
plan output should be injected into downstream qa_doc_gen/implement commands.
Check command text:
sqlite3 ~/.orchestratord/agent_orchestrator.db "
SELECT phase, command
FROM command_runs
WHERE task_item_id=(SELECT id FROM task_items WHERE task_id='<task_id>' ORDER BY order_no LIMIT 1)
AND phase IN ('qa_doc_gen','implement')
ORDER BY started_at;"Expected:
- command contains concrete plan text
- command does not contain literal
{plan_output}
8. Validate Generated Artifact
ls -la docs/qa/self-bootstrap/smoke-self-bootstrap.md
rg -n 'SB_SMOKE_20260226' docs/qa/self-bootstrap/smoke-self-bootstrap.md
sed -n '1,120p' docs/qa/self-bootstrap/smoke-self-bootstrap.md9. Where plan Is Stored
- Execution plan structure (workflow graph):
tasks.execution_plan_json - Step output payload (including stdout):
command_runs.output_json - Raw output files:
command_runs.stdout_pathandcommand_runs.stderr_path
Quick query:
sqlite3 ~/.orchestratord/agent_orchestrator.db "
SELECT t.id,
substr(t.execution_plan_json,1,120) AS execution_plan_json_head,
r.phase,
substr(json_extract(r.output_json,'$.stdout'),1,120) AS stdout_head,
r.stdout_path
FROM tasks t
JOIN task_items i ON i.task_id=t.id
JOIN command_runs r ON r.task_item_id=i.id
WHERE t.id='<task_id>' AND r.phase='plan'
ORDER BY r.started_at DESC
LIMIT 1;"10. Cleanup
Delete a task:
orchestrator task delete <task_id> -fReset project:
orchestrator delete project/<project> --force