You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(claude): align Codencer adapter with real Claude Code CLI
Codencer's previous Claude adapter assumed a worker-style command contract that does not match the real Claude Code source. This change rewrites the adapter to use the actual headless CLI integration model.
Highlights:
- switch to the real Claude CLI invocation model
- pass task content non-interactively instead of relying on nonexistent worker flags
- execute in the attempt workspace/worktree
- capture raw structured output and synthesize normalized Codencer results
- harden poll/cancel/process lifecycle behavior
- add fake-binary and normalization tests
- update public docs to reflect the real integration contract
This keeps Codencer within its bridge-not-brain doctrine while making the Claude executor path materially correct and auditable.
Copy file name to clipboardExpand all lines: README.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Codencer: The Tactical Orchestration Bridge
2
2
3
-
Codencer is a tactical orchestration bridge that manages execution, isolation, and high-fidelity audit trails for coding agents. It serves as the **system of record** between a high-level **Planner** (human or LLM) and tactical **Coding Agents** (Codex, Claude-code).
3
+
Codencer is a tactical orchestration bridge that manages execution, isolation, and high-fidelity audit trails for coding agents. It serves as the **system of record** between a high-level **Planner** (human or LLM) and tactical **Coding Agents** (Codex, Claude).
4
4
5
5
Designed for **local-first, self-hosted developer toolchains**, Codencer provides the missing "relay" layer that ensures every task attempt is isolated, provisioned, and validated before it ever reaches your production branch.
6
6
@@ -29,7 +29,7 @@ Codencer is a **Tactical Orchestration Bridge**, not a strategic planner. It han
29
29
### Core Roles
30
30
-**Planner (Brain)**: You, a Chat UI, or an agentic planner. Decides **what** to do.
31
31
-**Bridge (Codencer)**: Receives the `TaskSpec`, manages workspace isolation (Git Worktrees), enforces policies, and monitors execution.
32
-
-**Coding Agent (Worker)**: The tactical tool performing the actual work (e.g., `codex-agent`, `claude-code`).
32
+
-**Coding Agent (Worker)**: The tactical tool performing the actual work (e.g., `codex-agent`, `claude`).
33
33
34
34
---
35
35
@@ -85,11 +85,15 @@ Choose your execution tier in `.env` (Simulation is enabled by default in `.env.
85
85
# Start in Simulation Mode (Background)
86
86
make start-sim
87
87
88
-
# OR Start in Real Mode (Requires agent binaries like codex-agent)
88
+
# OR Start in Real Mode (Requires agent binaries like codex-agent or claude)
89
89
# Edit .env: ALL_ADAPTERS_SIMULATION_MODE=0
90
90
make start
91
91
```
92
92
93
+
For Claude, Codencer invokes the installed CLI as `claude -p --output-format json`, sends the step prompt on `stdin`, and runs from the isolated attempt workspace as the process `cwd`.
94
+
95
+
Current support level for the Claude adapter is **Supported (Beta)**: the wrapper contract is implemented and covered by prompt, normalization, lifecycle, fake-binary integration, and simulation conformance tests, but the repo test suite does not run a live authenticated Claude service call.
96
+
93
97
### 3. Run Your First Tactical Task
94
98
Submit a task and wait for the bridge to report results. For the full auditing sequence, see the **[Canonical Local Runbook](docs/EXAMPLES.md)**.
95
99
@@ -168,6 +172,12 @@ Every task execution leaves a permanent audit trail:
168
172
3.**Artifacts**: Every modified file and diff is stored in `.codencer/artifacts/`. Use `./bin/orchestratorctl step artifacts <id>` to see the exact paths and SHA-256 hashes.
169
173
4.**Validations**: Run `./bin/orchestratorctl step validations <id>` to see specific test/lint results.
170
174
175
+
For Claude attempts specifically, the standard evidence set is:
176
+
-`prompt.txt`: the exact prompt Codencer built and sent to Claude
177
+
-`stdout.log`: raw Claude JSON output
178
+
-`stderr.log`: raw Claude stderr
179
+
-`result.json`: synthesized normalized Codencer result
Copy file name to clipboardExpand all lines: docs/06_adapters_and_ide.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,12 +21,23 @@ Why:
21
21
- strong local CLI and IDE support
22
22
- first-class fit for MVP
23
23
24
-
### 3. Claude Code second
24
+
### 3. Claude second
25
25
Why:
26
26
- mature terminal-native coding agent
27
27
- strong second adapter
28
28
- good contrast for adapter-neutral design
29
29
30
+
Status:
31
+
-**Supported (Beta)**: the v1 CLI wrapper contract is implemented and covered by fake-binary integration tests, prompt/normalization unit tests, lifecycle tests, and simulation conformance tests.
32
+
-**Not covered in repo tests**: live authenticated Claude service calls.
33
+
34
+
Current v1 contract:
35
+
- binary: `claude` (configurable via `CLAUDE_BINARY`)
36
+
- invocation: `claude -p --output-format json`
37
+
- prompt path: `stdin`
38
+
- workspace semantics: process `cwd` is the attempt workspace root
39
+
- evidence model: `prompt.txt`, raw `stdout.log`, raw `stderr.log`, plus a synthesized `result.json`
40
+
30
41
### 4. OpenClaw ACPX
31
42
-**Status**: 🧪 **Experimental (Alpha)**
32
43
-**Description**: Standardized ACP (Agent Control Protocol) bridge to the OpenClaw ecosystem.
Copy file name to clipboardExpand all lines: docs/AI_OPERATOR_GUIDE.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,11 @@ Always verify the daemon's identity to ensure you are targeting the correct repo
40
40
41
41
Use `submit --wait --json` for a synchronous hand-off. This simplifies your control flow by blocking until a terminal state is reached.
42
42
43
+
Runtime note:
44
+
- In real mode, Codencer expects the installed agent CLIs to be reachable through their configured binaries.
45
+
- For Claude specifically, the bridge runs `claude -p --output-format json`, sends the submitted prompt on `stdin`, and executes from the isolated attempt workspace.
46
+
- Claude evidence is file-backed: review `prompt.txt`, `stdout.log`, `stderr.log`, and the synthesized `result.json` through normal artifact inspection.
47
+
43
48
### Pattern: The Direct Input Loop
44
49
Ideal for human-in-the-loop or iterative assistant tasks.
45
50
@@ -110,6 +115,7 @@ Follow this sequence for every tactical mission:
Copy file name to clipboardExpand all lines: docs/SETUP.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,12 +51,14 @@ make start-sim
51
51
```
52
52
53
53
### 3.2 Real Mode (Tactical Execution)
54
-
Use this mode for real-world tasks. It requires agents like `codex-agent` or `claude-code` to be installed.
54
+
Use this mode for real-world tasks. It requires agents like `codex-agent` or `claude` to be installed.
55
55
```bash
56
56
# Edit .env to set ALL_ADAPTERS_SIMULATION_MODE=0
57
57
make start
58
58
```
59
59
60
+
Claude is executed in headless print mode as `claude -p --output-format json`. Codencer builds the task prompt, writes it to `prompt.txt`, delivers it on `stdin`, and runs the process from the attempt workspace root.
61
+
60
62
---
61
63
62
64
## 4. Daemon Management & Targeting
@@ -89,9 +91,15 @@ Use the provided script to start and build a daemon instance for a specific proj
89
91
### 4.4 Environment Variables
90
92
Codencer uses these variables to locate agent binaries and target the daemon:
91
93
-`CODEX_BINARY`: Path to the `codex-agent` binary.
94
+
-`CLAUDE_BINARY`: Path to the `claude` binary. Defaults to `claude`.
92
95
-`OPENCLAW_ACPX_BINARY`: Path to the `acpx` CLI (for OpenClaw support).
93
96
-`ORCHESTRATORD_URL`: URL of the daemon (default: `http://localhost:8085`).
94
97
98
+
### 4.5 Claude Adapter Notes
99
+
- Install the Claude CLI so the `claude` binary is available on your `$PATH`, or point `CLAUDE_BINARY` at the full path.
100
+
- Codencer does not pass a workspace flag to Claude. The attempt workspace is supplied via process `cwd`.
101
+
- Claude raw output is preserved in `stdout.log`; Codencer parses that JSON and synthesizes the normalized `result.json`.
|**Claude Adapter**| 🟢 **Supported (Beta)**| CLI Wrapper | Uses `claude -p --output-format json` with stdin prompt delivery, cwd-based execution, synthesized result mapping, and fake-binary integration coverage. Live authenticated Claude service calls are not exercised in repo tests. |
return"", fmt.Errorf("claude binary %q not found or not executable. Set %s to a valid path or enable simulation with %s_SIMULATION_MODE=1: %w", binary, binaryEnvVar, "CLAUDE", err)
0 commit comments