fix(dispatcher): route sequential tiers by sufficient capability #264

Merged
akira merged 2 commits from akira/hayate-agent-core:feat/sequential-tier-routing into main 2026-11-05 06:46:51 +00:00
Owner

Corrects the existing sequential planner to choose the lowest sufficient model capability for reasoning/task complexity, independently of operational risk. Supersedes the original risk-based calibration at 216e393; that rule was contrary to the requirement.

  • simple: factual/read-only, deterministic mechanical work and known runbook execution, including routine authorized production credential rotation.
  • medium: bounded known-code implementation/fix including tests.
  • high: genuinely complex reasoning beyond medium: ambiguous root cause, difficult concurrency/recovery, architecture.
  • Production/credentials/deployment/irreversible effects alone do not require high. Existing authorization, safety and verification gates remain mandatory at every role; routing grants no permission.
  • One coherent change including tests/verification is ONE step unless the task has genuinely distinct parts. No catalog/pricing/matrix/framework or gate changes.

Only prompt/docs/regression test changed (full diff c248ca1..f352fcb: 3 files, +29/-3).

Current verification

Typecheck passed. 37/37 targeted sequential/planner/model-role tests passed; diff check clean.

Two fresh tool-free real HTTP planner runs on requested=observed homelab/claude-haiku-5-5/medium, identical fixed tasks in each run:

case expected run 1 run 2
staging read-only runbook simple simple simple
same production read-only runbook simple simple simple
staging known credential rotation simple simple simple
same production known credential rotation simple simple simple
bounded code + test medium medium medium
unknown concurrency/data-loss root cause + fix high, one coherent step high high,high

All 12 classifications used the expected tier. 11/12 plans satisfied the single-step expectation: run 2 split the complex root-cause/fix into two high steps. This is model judgement, not guaranteed perfect plan stability. No tools/workers/credential rotations were executed by these probes.

Review: existing bundled engine and existing ledger at ~/scratch/.review-home-tier-routing, base c248ca1; corrected full diff passed its new candidate round with zero findings, fingerprint c35b54e4b90e81a65b1c9247b73c78d2fa890ccc3b7c27f6b5d415339c9ff650. Prior candidate approval is retained in engine history, not claimed valid for this correction; no manual budget reset/extension.

Preserved earlier evidence (historical, not rerun on corrected prompt)

The original baseline high/medium/low mixed planner evidence and real E2E mixed run (simple→haiku, medium→sonnet, high→opus, requested=observed, completed) remain in ~/scratch/tier-routing-evidence, together with the original scripts and archived PR body. The old credential-rotation expected=high classification was wrong and is superseded by the mechanical authorized-runbook probes above; old results are not evidence of corrected-prompt behavior.

Current probe script: capability-probe.mts; outputs capability-run1.jsonl, capability-run2.jsonl. Existing PR author remains unchanged; follow-up push/metadata correction used the existing authenticated Akira account.

Not merged, not activated. No strategy flip, daemon restart or registry reload. PRs #257/#258/#261 and unrelated worktrees untouched.

Corrects the existing sequential planner to choose the **lowest sufficient model capability for reasoning/task complexity**, independently of operational risk. Supersedes the original risk-based calibration at 216e393; that rule was contrary to the requirement. - `simple`: factual/read-only, deterministic mechanical work and known runbook execution, including routine authorized production credential rotation. - `medium`: bounded known-code implementation/fix including tests. - `high`: genuinely complex reasoning beyond medium: ambiguous root cause, difficult concurrency/recovery, architecture. - Production/credentials/deployment/irreversible effects alone do not require high. Existing authorization, safety and verification gates remain mandatory at every role; routing grants no permission. - One coherent change including tests/verification is ONE step unless the task has genuinely distinct parts. No catalog/pricing/matrix/framework or gate changes. Only prompt/docs/regression test changed (full diff c248ca1..f352fcb: 3 files, +29/-3). ## Current verification Typecheck passed. 37/37 targeted sequential/planner/model-role tests passed; diff check clean. Two fresh tool-free real HTTP planner runs on requested=observed `homelab/claude-haiku-5-5/medium`, identical fixed tasks in each run: | case | expected | run 1 | run 2 | |---|---|---|---| | staging read-only runbook | simple | simple | simple | | same production read-only runbook | simple | simple | simple | | staging known credential rotation | simple | simple | simple | | same production known credential rotation | simple | simple | simple | | bounded code + test | medium | medium | medium | | unknown concurrency/data-loss root cause + fix | high, one coherent step | high | high,high | All 12 classifications used the expected tier. 11/12 plans satisfied the single-step expectation: run 2 split the complex root-cause/fix into two high steps. This is model judgement, not guaranteed perfect plan stability. No tools/workers/credential rotations were executed by these probes. Review: existing bundled engine and existing ledger at `~/scratch/.review-home-tier-routing`, base c248ca1; corrected full diff passed its new candidate round with zero findings, fingerprint `c35b54e4b90e81a65b1c9247b73c78d2fa890ccc3b7c27f6b5d415339c9ff650`. Prior candidate approval is retained in engine history, not claimed valid for this correction; no manual budget reset/extension. ## Preserved earlier evidence (historical, not rerun on corrected prompt) The original baseline high/medium/low mixed planner evidence and real E2E mixed run (simple→haiku, medium→sonnet, high→opus, requested=observed, completed) remain in `~/scratch/tier-routing-evidence`, together with the original scripts and archived PR body. The old credential-rotation expected=high classification was wrong and is superseded by the mechanical authorized-runbook probes above; old results are not evidence of corrected-prompt behavior. Current probe script: `capability-probe.mts`; outputs `capability-run1.jsonl`, `capability-run2.jsonl`. Existing PR author remains unchanged; follow-up push/metadata correction used the existing authenticated Akira account. Not merged, not activated. No strategy flip, daemon restart or registry reload. PRs #257/#258/#261 and unrelated worktrees untouched.
akira changed title from feat(dispatcher): calibrate sequential tier criteria by operational risk to fix(dispatcher): route sequential tiers by sufficient capability 2026-11-05 06:34:25 +00:00
akira merged commit 1f8eac5005 into main 2026-11-05 06:46:51 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
harness/core!264
No description provided.