Phase 1 — Abstraction seam. Extract command building behind the adapter contract
with Claude as the reference implementation. Zero behavior change.
Scope
- New
lib/agents/ with a registry and lib/agents/claude.sh implementing the
command-build half of the [P0.2] contract.
- Refactor
build_claude_command() in ralph_loop.sh to delegate to the active
adapter. Claude adapter must reproduce today's exact argv:
--model/--effort, --output-format json, --allowedTools …, --resume <id>,
--append-system-prompt <ctx>, -p <prompt>, plus the RALPH_VERBOSE argv dump.
- Keep the
_env_* capture-before-source ordering convention (lib sets defaults at
source time — see sandbox libs).
Acceptance
- Full suite green; argv byte-identical for the Claude path (add a golden-args test).
- No new provider yet; selection still hardcoded to claude.
Depends on: [P0.2]. Blocks: [P1.2], [P1.3], [P3.1].
Phase 1 — Abstraction seam. Extract command building behind the adapter contract
with Claude as the reference implementation. Zero behavior change.
Scope
lib/agents/with a registry andlib/agents/claude.shimplementing thecommand-build half of the [P0.2] contract.
build_claude_command()inralph_loop.shto delegate to the activeadapter. Claude adapter must reproduce today's exact argv:
--model/--effort,--output-format json,--allowedTools …,--resume <id>,--append-system-prompt <ctx>,-p <prompt>, plus the RALPH_VERBOSE argv dump._env_*capture-before-source ordering convention (lib sets defaults atsource time — see sandbox libs).
Acceptance
Depends on: [P0.2]. Blocks: [P1.2], [P1.3], [P3.1].