Parent
#12
What to build
Agent loop type becomes routing data. providers/<name>/routing.json gains a new agent-level field:
{
"agents": {
"implementer": { "loop": "backlog", "rules": { ... } },
"fixer": { "loop": "github-pr", "rules": { ... } },
...
}
}
Valid values to start: "backlog" and "github-pr". A future loop type means adding a new value and a new source-file mapping in the dispatcher — no bin/ralph case-statement edits, no new cmd_*_agent function.
bin/ralph's dispatcher collapses:
cmd_agent + cmd_github_agent → one cmd_run_agent(agent_key) that:
- Reads the agent's
loop field from the active provider's routing.json.
- Sources the matching loop library (
ralph-gated-loop.sh for "backlog", ralph-github-loop.sh for "github-pr").
- Calls the matching
ralph_<loop>_loop function with the standard arguments.
- The top-level
case statement's two agent-list branches merge into one branch covering all agents.
All existing routing.json files (jira, linear, github-issues, github-projects, file) gain the loop field for every agent already listed. Validator (whether today's monolith or the refactor from #16) enforces presence and known values.
Acceptance criteria
Blocked by
None — can start immediately.
Parent
#12
What to build
Agent loop type becomes routing data.
providers/<name>/routing.jsongains a new agent-level field:Valid values to start:
"backlog"and"github-pr". A future loop type means adding a new value and a new source-file mapping in the dispatcher — nobin/ralphcase-statement edits, no newcmd_*_agentfunction.bin/ralph's dispatcher collapses:cmd_agent+cmd_github_agent→ onecmd_run_agent(agent_key)that:loopfield from the active provider's routing.json.ralph-gated-loop.shfor"backlog",ralph-github-loop.shfor"github-pr").ralph_<loop>_loopfunction with the standard arguments.casestatement's two agent-list branches merge into one branch covering all agents.All existing routing.json files (jira, linear, github-issues, github-projects, file) gain the
loopfield for every agent already listed. Validator (whether today's monolith or the refactor from #16) enforces presence and known values.Acceptance criteria
routing.jsondeclares aloopfield with a valid value.bin/ralphdispatcher has a singlecmd_run_agentcovering every agent;cmd_agentandcmd_github_agentare gone.casehas a single branch listing all agents, routed throughcmd_run_agent.ralph planner --once,ralph implementer --once, …,ralph fixer --once,ralph merger --once,ralph pr-reviewer --once) sources the correct loop library and behaves identically to today.loopfield is rejected with a clear error message at dispatch time.loopvalue is rejected with a clear error message at dispatch time.loopvalue is rejected; golden output comparison ofralph debug <agent> --preview-promptbefore and after the refactor matches for every agent.tests/harness conventions.CLAUDE.mdandCONTEXT.mdupdated where they describe the two-loop split — replace with the routing-data formulation.Blocked by
None — can start immediately.