Skip to content

Instantly share code, notes, and snippets.

@jleechan2015
Created March 13, 2026 03:36
Show Gist options
  • Select an option

  • Save jleechan2015/1b292b7eea9e3b45dc76e7c363f17ec8 to your computer and use it in GitHub Desktop.

Select an option

Save jleechan2015/1b292b7eea9e3b45dc76e7c363f17ec8 to your computer and use it in GitHub Desktop.
Value Router proposal and merge-value scoring for Agent Orchestrator

Value Router Proposal for Agent Orchestrator

Single Smartest Addition to the Plan Right Now

Add a closed-loop Value Router (autonomous work allocator) that scores backlog items by expected merge value per agent-hour, then dynamically spawns/pauses/resumes sessions based on live outcomes.

Why This Is the Highest-Leverage Gap

  • You already have backlog auto-claim and decomposition, but it is mostly label/FIFO + fixed capacity (MAX_CONCURRENT_AGENTS = 5) in services.ts.
  • You already collect rich telemetry (success/failure, reasons, durations) in observability, but it is not yet feeding scheduling decisions (observability.md).
  • You already have reaction/lifecycle machinery; this would become the optimizer layer above it.

What Makes It Radically Accretive

  • It turns AO from "automation runner" into a self-optimizing execution system.
  • Every run improves future prioritization (which issue types, repos, agents, and decomposition patterns actually ship fastest with least rework).
  • It compounds throughput and merge quality without increasing operator overhead.

If useful, the next step is a minimal V1 spec and an initial scorer + scheduler loop behind a config flag.

How to Compute Merge Value

Use a normalized expected-value score per candidate issue:

MergeValue = (P_merge_24h * BusinessImpact * StrategicFit * Confidence) / ExpectedAgentHours

Practical Breakdown

  • P_merge_24h (0..1): model from your own history by repo/label/agent/type.
    • Signals: similar issue merged rate, CI pass-on-first-try rate, review churn, reopen rate.
  • BusinessImpact (1..5): configurable weight from labels/metadata.
    • Example: customer-facing=5, reliability=4, tech-debt=2.
  • StrategicFit (0.8..1.3): multiplier for current priorities.
    • Example: if this sprint targets onboarding, onboarding-labeled issues get +30%.
  • Confidence (0.6..1.2): evidence quality factor.
    • Clear acceptance criteria/tests/decomposition quality increase it.
  • ExpectedAgentHours: predicted completion time from past runs.
    • Include expected retries from CI/review loops.

Scheduling Policy

Schedule by descending MergeValue subject to constraints:

  • max parallel sessions,
  • fairness per project,
  • dependency/blocked checks.

Start Simple

  1. Hand-tuned weights + rule-based estimates.
  2. Log predicted vs actual.
  3. Replace each component with learned models once you have enough data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment