Skip to content

PsychQuant/idd-route-swift

Repository files navigation

idd-route

Data-driven agent routing for IDD methodology.

What is this?

Given a new GitHub issue diagnosed by idd-diagnose, recommends the best agent to delegate implementation to:

  • codex-gpt-5.5-xhigh — OpenAI Codex CLI with GPT-5.5 at xhigh reasoning effort
  • claude-opus-4.7 — Anthropic Claude Opus 4.7 (deepest reasoning, slowest, priciest)
  • claude-sonnet-4.6 — Anthropic Claude Sonnet 4.6 (best coding model, mid-tier)
  • claude-haiku-4.5 — Anthropic Claude Haiku 4.5 (fast, cheap, 90% of Sonnet capability)

Recommendation is based on observed track record per (agent, complexity, scope_class) bucket with exponential decay (recent decisions weight more). Falls back to a static heuristic rubric when fewer than 5 data points exist for a bucket (cold start).

The CLI is invoked from inside the issue-driven-dev plugin's skills:

  • idd-verify calls idd-route record to log a verify outcome
  • idd-close calls idd-route update-outcome to finalize merge/abandon
  • idd-diagnose calls idd-route recommend to surface routing recommendation in the diagnosis comment

End-users typically invoke /idd-route:recommend, /idd-route:stats, /idd-route:backfill via the idd-route plugin (see PsychQuant/issue-driven-development).

Why Swift

Python on macOS is fragmented (system / Homebrew / pyenv / venv version drift). Swift binaries built with Xcode CLI tools are stable and self-contained. Distribution is a single universal binary via GitHub Release, auto-downloaded by the plugin wrapper script.

Commands (v0.1.0)

idd-route record \
  --stats-file <path>/.claude/.idd/routing-stats.jsonl \
  --issue 111 --issue-repo owner/repo \
  --agent codex-gpt-5.5-xhigh --complexity Simple \
  --scope-files 2 --scope-loc 279 \
  --signals explicit_acceptance,single_handler \
  --round-trips 1 \
  --verify-blocking 0 --verify-medium 1 --verify-low 7 \
  --followups 8 --outcome in_review \
  --recorded-by idd-verify-2.38.0

idd-route stats --stats-file <path>
idd-route summarize --stats-file <path> --decay-half-life-days 30

recommend, update-outcome, backfill ship in v0.2.0 / v0.3.0.

Schema

routing-stats.jsonl is append-only, one JSON object per line:

{
  "ts": "2026-05-02T08:54:00Z",
  "issue_number": 111,
  "issue_repo": "PsychQuant/che-word-mcp",
  "agent": "codex-gpt-5.5-xhigh",
  "complexity": "Simple",
  "scope_files": 2,
  "scope_loc": 279,
  "scope_signals": ["explicit_acceptance", "single_handler"],
  "round_trips": 1,
  "verify_blocking": 0,
  "verify_medium": 1,
  "verify_low": 7,
  "followups_spawned": 8,
  "outcome": "merged",
  "outcome_ts": "2026-05-02T01:30:00Z",
  "recorded_by": "idd-verify-2.38.0"
}

Fields are forward-compatible — adding new optional fields doesn't break older records.

Build

swift build -c release --arch arm64 --arch x86_64
# Universal binary at .build/apple/Products/Release/IDDRoute

Test

swift test

License

MIT

About

Data-driven agent routing for IDD methodology — recommends Codex (GPT-5.5 xhigh) vs Claude (Opus 4.7 / Sonnet 4.6 / Haiku 4.5) based on observed track record per (complexity, scope_class) bucket with exponential decay

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages