Self-Bootstrap Test Fixture: Echo CLI Subcommand
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 permanent test fixture for validating the orchestrator's self-bootstrap capability. The fixture itself is implementable but should never be merged — simply revert the code after each test to reuse it.
1. Task Objective
Pass the following objective verbatim to the orchestrator as the topic for this round of self-bootstrap:
Topic name:
Echo CLI SubcommandBackground: The current orchestrator CLI does not have an
echosubcommand. To validate the end-to-end RPC pathway (proto definition → daemon handler → CLI command), a neworchestrator echo --message "hello"subcommand is needed. It calls the daemon'sEchoRPC via gRPC, the daemon echoes the message back as-is, and the CLI prints the result.Objectives for this round:
- Add an
EchoRPC,EchoRequest(with amessagefield), andEchoResponse(with areplyfield) inproto/orchestrator.proto.- Implement the
Echohandler incrates/daemon/src/server/system.rsthat returnsrequest.messageas-is.- Add an
echo.rssubcommand incrates/cli/src/commands/that calls the daemon'sEchoRPC and prints the result.- Register the
echosubcommand in the CLI'smod.rsor main command registration point.- Add unit tests.
Constraints:
- Do not modify the behavior of any existing RPC or command.
- The
Echohandler must go through control-plane authorization (authorize(server, &request, "Echo")), with theReadOnlyrole.- Maintain consistency with the existing code style (clap derive, tonic handler patterns).
- Do not introduce new dependencies.
1.1 Expected Outputs
Produced and landed autonomously by the orchestrator:
- An implementation plan (generated by the
planstep). - Necessary QA documentation updates (if deemed needed by
qa_doc_gen). - Code changes (expected to involve
proto/orchestrator.proto,crates/daemon/src/server/system.rs,crates/cli/src/commands/). - New unit tests.
- Self-bootstrap regression verification results.
1.2 Non-Goals
- Do not change the signature or behavior of any existing RPC.
- Do not introduce a new proto service (add to the existing
OrchestratorService). - No gRPC streaming needed — a simple unary RPC is sufficient.
1.3 Design Rationale as a Test Fixture
- Cross-crate completeness: The change spans three layers — proto → daemon → CLI — validating the orchestrator's understanding of module boundaries.
- Compilation gate effectiveness: Proto changes trigger code generation; signature mismatches will be caught by
self_test. - self_restart verification: Adding a new RPC requires rebuilding the daemon binary;
self_restartmust succeed. - Clear completion criteria:
orchestrator echo --message "test"returningtestmeans success. - Should never be merged: The echo command has no production value.
- Idempotent and repeatable: All changes are new files/fields;
git checkoutcleanly reverts everything, ready to run again from a clean tree. - Fixture does not become stale as code evolves: It does not depend on specific function names or internal structures — it remains valid as long as the proto + daemon + CLI architecture is unchanged.
2. Execution Method
This round follows the standard self-bootstrap pipeline:
Cycle 1: plan -> qa_doc_gen -> implement -> self_test -> self_restart
Cycle 2: plan -> qa_doc_gen -> implement -> self_test -> [self_restart skipped] -> qa_testing -> ticket_fix -> align_tests -> doc_governance -> loop_guardHuman responsibilities are limited to two categories:
- Launching and providing the task objective.
- Monitoring execution status, observing behavioral changes, determining if execution is stuck, and recording results.
3. Launch Steps
3.1 Build and Start the Daemon
cd "$ORCHESTRATOR_ROOT" # your orchestrator project directory
cargo build --release -p orchestratord -p orchestrator-cli
# Start the daemon
nohup ./target/release/orchestratord --foreground --workers 2 > /tmp/orchestratord.log 2>&1 &
# Verify the daemon is running
ps aux | grep orchestratord | grep -v grep3.2 Baseline Collection
# Confirm Echo RPC does not exist
grep -n "Echo" proto/orchestrator.proto
# Expected: no matches
# Confirm echo subcommand does not exist
ls crates/cli/src/commands/echo.rs 2>/dev/null
# Expected: file does not exist
# Confirm system.rs has no echo handler
grep -n "echo" crates/daemon/src/server/system.rs
# Expected: no matches3.3 Initialize Database and Load Resources
orchestrator delete project/self-bootstrap --force
orchestrator init
orchestrator apply -f your-secrets.yaml --project self-bootstrap
# apply additional secret manifests as needed --project self-bootstrap
orchestrator apply -f docs/workflow/execution-profiles.yaml --project self-bootstrap
orchestrator apply -f docs/workflow/self-bootstrap.yaml --project self-bootstrap3.4 Verify Resources Are Loaded
orchestrator get workspaces --project self-bootstrap -o json
orchestrator get agents --project self-bootstrap -o json3.5 Create the Task
orchestrator task create \
-n "echo-command-test" \
-w self -W self-bootstrap \
--project self-bootstrap \
-g "Topic: Echo CLI Subcommand. Add an Echo RPC in proto/orchestrator.proto (EchoRequest with a message field, EchoResponse with a reply field). Implement the Echo handler in crates/daemon/src/server/system.rs that returns request.message as-is, with authorize check (ReadOnly role). Add an echo.rs subcommand in crates/cli/src/commands/ that calls the daemon Echo RPC and prints the result. Register the echo subcommand at the CLI main command registration point. Add unit tests. Do not modify the behavior of any existing RPC or command, and do not introduce new dependencies."Record the returned <task_id>.
4. Monitoring Methods
4.1 Status Monitoring
orchestrator task list
orchestrator task info <task_id>
orchestrator task trace <task_id>
orchestrator task watch <task_id>Key observations:
- Current cycle (expected to start at 1, eventually reaching 2)
- Current step name and order
- Whether the task status is progressing
- Whether step order in
task tracematches the pipeline definition in section 2
4.2 Log Monitoring
orchestrator task logs --tail 100 <task_id>
orchestrator task logs --tail 200 <task_id>Key observations:
- Whether
planidentifies the need for changes spanning proto/daemon/CLI layers - Whether
implementcorrectly generates proto definitions, handler, and CLI command - Whether
self_testcompilation passes (proto codegen + handler signatures) - Whether
self_restartsuccessfully rebuilds the daemon binary with the new RPC
4.3 Process / Daemon Monitoring
ps aux | grep orchestratord | grep -v grep
ps aux | grep "claude -p" | grep -v grep
git diff --stat5. Behavioral Change Observations
5.1 Expected Code Changes
| File | Expected Change |
|---|---|
proto/orchestrator.proto | Add rpc Echo, message EchoRequest, message EchoResponse |
crates/daemon/src/server/system.rs | Add echo handler that calls authorize and returns EchoResponse { reply: req.message } |
crates/daemon/src/server/mod.rs | Route registration (if manual registration is required) |
crates/cli/src/commands/echo.rs | Add echo subcommand with clap derive, calling gRPC Echo |
crates/cli/src/commands/mod.rs | Register echo module and subcommand |
5.2 self_restart Behavior Verification
Cycle 1's self_restart rebuilds the daemon binary with the new RPC code. Verify:
cargo build --release -p orchestratordsucceeds (proto codegen + new handler compiles)- New binary passes
--helpverification - exec() hot-reload keeps the daemon PID unchanged
- Cycle 2 continues running on the new binary
6. Key Checkpoints
6.1 Plan Phase Checkpoint
Confirm the orchestrator understands the need to:
- Modify the proto file to add the RPC definition
- Implement the daemon-side handler
- Implement the CLI-side subcommand
- Wire all three layers together while preserving existing behavior
If the plan only proposes modifying one layer while ignoring the others, it should be deemed incomplete.
6.2 Implement Phase Checkpoint
Confirm code changes satisfy:
- Proto contains the
EchoRPC definition - Handler includes the
authorizecall - CLI has clap registration and gRPC call
- No existing RPCs are modified
6.3 Self-Test Phase Checkpoint
cargo checkpasses (proto codegen succeeds)cargo testpasses (no regressions)- Gates are not bypassed
7. Success Criteria
The test is considered passed when all of the following conditions are met:
- The orchestrator completes 2 full cycles of the
self-bootstrappipeline and terminates normally atloop_guard. proto/orchestrator.protocontains theEchoRPC definition.crates/daemon/src/server/system.rscontains theechohandler with anauthorizecall.crates/cli/src/commands/contains theechosubcommand.cargo test --workspace --libpasses.- No new unresolved tickets remain from this round.
8. Post-Test Revert
This fixture should not be merged. After testing, regardless of success or failure, revert the code:
# Revert all changes
git checkout HEAD -- proto/ crates/ core/
# Delete new files that the agent may have created
git clean -fd proto/ crates/ core/ docs/qa/ docs/design_doc/
# Confirm working tree is clean
git status --short
# Verify compilation
cargo checkThe next test can be started from a clean tree.
9. Human Role Boundaries
In this plan, the human role is strictly limited to:
- Providing the objective
- Starting the workflow
- Performing baseline collection (section 3.2)
- Monitoring status and behavioral changes
- Interrupting and recording on anomalies
- Reverting code after the test completes
Humans do not prescribe specific implementation approaches and do not manually modify code.