Skip to content

[P1.1] Command-construction seam: lib/agents/ registry + Claude reference adapter #312

@frankbria

Description

@frankbria

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].

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmulti-providerMulti-provider agent abstraction (Codex/Gemini/OpenCode/Droid/Kilocode/Copilot)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions