If you are an AI assistant or a developer building an agentic planner, please refer to the AI Operator Guide for the canonical "Rules of Engagement" and tool-calling patterns.
This guide focuses on Shell Scripting, Sequential Wrappers, and Machine-safe JSON/Exit Code contracts.
Codencer v1 is a local CLI bridge for terminal-capable planners and operators. The planner decides what to do next; Codencer executes one submitted task, records evidence, and reports the result. It does not include a native workflow engine, hidden planning layer, or autonomous task graph execution in v1.
The official v1 sequential model is an explicit wrapper loop outside Codencer:
- Target the Project: Start or verify a daemon instance for a specific
--repo_root. - Verify Identity: Check
./bin/orchestratorctl instance --jsonto ensure the bridge is anchored to the correct repo. - Ensure a Run Exists: Reuse an existing run or start a new one.
- Iterate Tasks: Submit one task at a time with
submit --wait --json. - Inspect & Decide: Use the exit code and terminal JSON payload to decide whether to continue or stop.
- Persistence: All logs, artifacts, and validations are recorded as evidence for later human audit.
That model works for humans, shell planners, PowerShell, Python subprocess wrappers, and any other tool that can launch commands and read stdout/stderr.
For machine-facing automation, use --json:
stdoutcontains exactly one JSON documentstderrcarries progress/help onlysubmit --wait --jsonemits only the terminal payload
Stable wait-related exit codes:
0: success (exitCodeSuccess)1: usage error, invalid input, not found (exitCodeUsage)2: terminal task failure, goal not met, validation failed (exitCodeTerminalFailed)3: timeout (exitCodeTimeout)4: cancelled, paused for gate, manual intervention required (exitCodeIntervention)5: bridge, adapter, or infrastructure failure (exitCodeInfrastructure)
Wrappers should use both:
- the exit code for binary control flow (continue/stop)
- the JSON payload for detailed reporting and next-step context
orchestratorctl submit requires exactly one primary input source:
- positional task file
--task-json <path|->(supports piping JSON strings)--prompt-file <path>(supports large text files)--goal <text>(supports quoted multiline strings)--stdin(supports multiline text via heredocs)
For machine-based planners, --task-json - is the recommended way to submit fully-specified task bundles without writing temporary files:
echo "$TASK_JSON" | ./bin/orchestratorctl submit <runID> --task-json - --wait --jsonPlanners must explicitly specify the antigravity-broker adapter to use the cross-side path:
- Binding: Is repository-scoped (Repo Root).
- Execution: Is run-scoped (Isolated Workspace/Worktree).
The broker automatically receives the worktree as the workspaceFolderAbsoluteUri for the LS.
- Canonical Sources (
task-file,--task-json): Strict JSON/YAML parsing. Conflict if localrun_iddoes not match the submittedrun_id. - Direct Sources (
prompt-file,goal,stdin): Deterministic normalization. Supports convenience metadata like--adapter antigravity-broker.
context and acceptance are preserved in the normalized task and provenance, but they are currently retained metadata rather than separate executor-driving runtime fields.
Codencer v1’s official sequential story lives in examples/automation/:
examples/automation/run_tasks.shexamples/automation/run_tasks.ps1examples/automation/run_tasks.py
Sample task lists:
examples/automation/task_files.txtexamples/automation/task_json_files.txtexamples/automation/prompt_files.txtexamples/automation/goals.txt
examples/automation/run_tasks.sh \
--run-id run-automation-01 \
--project codencer-demo \
--input-mode goal \
--tasks-file examples/automation/goals.txt \
--adapter codex \
--jsonContinue mode can be enabled explicitly:
examples/automation/run_tasks.sh \
--run-id run-automation-01 \
--project codencer-demo \
--input-mode prompt-file \
--tasks-file examples/automation/prompt_files.txt \
--adapter codex \
--continue-on-failureThe bash wrapper prefers jq and falls back to python3 for JSON parsing.
./examples/automation/run_tasks.ps1 `
-RunId run-automation-01 `
-Project codencer-demo `
-InputMode goal `
-TasksFile examples/automation/goals.txt `
-Adapter codexPowerShell uses ConvertFrom-Json.
python3 examples/automation/run_tasks.py \
--run-id run-automation-01 \
--project codencer-demo \
--input-mode task-file \
--tasks-file examples/automation/task_files.txtThe official wrappers:
- require
--run-id,--input-mode, and--tasks-file - reuse an existing run when present
- create a missing run only when
--projectis provided - process plain UTF-8 line lists, ignoring blank lines and
#comments - default to stop-on-failure
- support
CODENCER_CONTINUE_ON_FAILURE=1 - emit progress to
stderr - emit one final JSON summary to
stdout
Each summary includes:
run_idprojectinput_modecontinue_on_failuretasks_totaltasks_succeededtasks_failedresultsfinal_exit_code
results entries include:
indexsourcestep_idstateexit_code
Each accepted submission preserves:
original-input.*normalized-task.json
These live under the attempt artifact root and make it possible to inspect both the exact submitted content and the normalized task Codencer actually executed.
Humans can inspect any machine-submitted step later with:
step resultstep logsstep artifactsstep validations
A typical mixed workflow:
- A script or planner submits tasks one by one with
submit --wait --json. - The wrapper stops or continues based on the exit code policy outside Codencer.
- A human later reviews the resulting step handles with
step result,step logs,step artifacts, andstep validations.
Codencer records the run, step, attempt, and artifact trail either way.
- Codencer v1 does not include a native workflow engine or manifest runner.
- Codencer does not perform hidden planning, branching, decomposition, or next-step selection.
- Codencer is local-first and repo-bound; it is not a hosted automation control plane.
- The PowerShell wrapper is for tools/operators that can reach a running daemon; it does not imply native Windows daemon support.
- Antigravity remains a separate execution path with its own broker/binding constraints.