From 78229c5dba743915415cf16cc558730300c1cc08 Mon Sep 17 00:00:00 2001 From: Paul O'Reilly Date: Sun, 12 Jul 2026 19:03:51 +1200 Subject: [PATCH] feat(routing): add tiers.yaml + rename spec/review-arch templates to airouter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit W1 stage-routing work: - model-registry/tiers.yaml: defines planning/spec-test/coding tier floors (complexity≥9/creativity≥9/context≥9 | spec_adherence≥9/test_pass_rate≥9 | spec_adherence≥7/test_pass_rate≥7) with qualifies_today lists - spec-draft-airouter@2.yaml: honest name for what was spec-draft-opus@1 (always ran Qwen3.6/airouter, not Opus) - review-spec-arch-airouter@1.yaml: honest name for review-spec-arch-opus@1 Old @1 files kept for in-flight task backward-compatibility. Claude-Session: https://claude.ai/code/session_01B35bPAKv5uyW1F9gzMcRN7 --- model-registry/tiers.yaml | 56 +++++++++++++++++++ .../workflow/review-spec-arch-airouter@1.yaml | 49 ++++++++++++++++ .../workflow/spec-draft-airouter@2.yaml | 47 ++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 model-registry/tiers.yaml create mode 100644 task-templates/workflow/review-spec-arch-airouter@1.yaml create mode 100644 task-templates/workflow/spec-draft-airouter@2.yaml diff --git a/model-registry/tiers.yaml b/model-registry/tiers.yaml new file mode 100644 index 0000000..3899bc1 --- /dev/null +++ b/model-registry/tiers.yaml @@ -0,0 +1,56 @@ +# Model capability tiers for typed-pipeline routing. +# +# Each tier defines score floors (against model-registry/*.yaml `scores` dimensions). +# The CP picks the cheapest registry entry meeting ALL floors (MR-9/MR-11 — cheapest-wins). +# +# Stages that need a specific tier set `tier:` on their `kind: agent` node (W2). +# Until W2 lands, templates hardcode `model:` directly and these floors serve as +# documentation of the intended constraint. +# +# See claude/stage-routing.md for the authoritative pipeline stage map. + +tiers: + + planning: + description: > + Judgment-heavy work: plan generation, spec re-draft (replan-spec-opus), + architecture review escalation (review-spec-opus). Requires sustained + reasoning over large context windows. + min_scores: + complexity: 9 + creativity: 9 + context_utilisation: 9 + qualifies_today: + - deepseek-v4flash # benchmark-inflated 9s; hold to allowed_models ceiling + - minimax + - claude-opus-4 + note: > + WF-SCH-14 allowed_models ceiling remains authoritative until M7 observed-score + recalibration corrects benchmark-inflated registry entries. + + spec-test: + description: > + Spec-adherent structured work: spec drafting, spec arch review, scope/decompose, + test writing, impl review, merge verdict. Needs reliable spec adherence and + test execution. + min_scores: + spec_adherence: 9 + test_pass_rate: 9 + qualifies_today: + - minimax + - claude-sonnet-4 + - claude-opus-4 + + coding: + description: > + Narrow TDD implementation against pre-validated tests. Lower floors because + tests already constrain the solution space. + min_scores: + spec_adherence: 7 + test_pass_rate: 7 + qualifies_today: + - airouter-qwen3 + - airouter-deepseekv4flash + - minimax + - claude-sonnet-4 + - claude-opus-4 diff --git a/task-templates/workflow/review-spec-arch-airouter@1.yaml b/task-templates/workflow/review-spec-arch-airouter@1.yaml new file mode 100644 index 0000000..32044b5 --- /dev/null +++ b/task-templates/workflow/review-spec-arch-airouter@1.yaml @@ -0,0 +1,49 @@ +name: review-spec-arch-airouter +version: 1 +description: Architecture review of a spec draft +runtime: best-practices-airouter-repo +input: + state: spec-draft + tags_forbidden: [security-sensitive] + required_artifacts: [spec_file] +output: + state: spec-reviewed-arch +scope_budget: + files_modified_max: 2 + lines_diff_max: 150 + wall_clock_seconds_max: 1800 +nodes: + - id: agent + kind: agent + template: best-practices-airouter-repo + cli: agentic + model: Qwen3.6 + labels: [airouter] + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "spec/auto-draft" + prompt: | + The agent-runtimes project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Review the spec draft for the following concept. + + **Title**: ${item.title} + + **Original concept**: + ${item.body} + + Steps: + 1. cd /workspace/project + 2. Find the spec file: ls spec/ and look for a file matching the concept title slug + 3. Read the spec file completely + 4. Review it against architectural best practices: + - Are requirements testable and unambiguous? + - Are there security implications not addressed? + - Are interfaces and data contracts clearly defined? + - Are edge cases and failure modes covered? + 5. Write your review findings to /workspace/.agent-output/review.md with a PASS or + REWORK verdict and specific findings + 6. Call task_complete with "PASS" or "REWORK: " +escalation: + contract_ambiguous: review-spec-opus \ No newline at end of file diff --git a/task-templates/workflow/spec-draft-airouter@2.yaml b/task-templates/workflow/spec-draft-airouter@2.yaml new file mode 100644 index 0000000..54902cd --- /dev/null +++ b/task-templates/workflow/spec-draft-airouter@2.yaml @@ -0,0 +1,47 @@ +name: spec-draft-airouter +version: 2 +description: Draft a spec from an idea using spec-writer agent +runtime: spec-writing-airouter-repo +input: + state: idea + tags_required: [] + tags_forbidden: [security-sensitive] + required_artifacts: [] +output: + state: spec-draft +scope_budget: + files_modified_max: 5 + lines_diff_max: 300 + wall_clock_seconds_max: 3600 +nodes: + - id: agent + kind: agent + template: spec-writing-airouter-repo + cli: agentic + model: Qwen3.6 + labels: [airouter] + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "spec/auto-draft" + prompt: | + The agent-runtimes project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Draft a spec for the following concept and commit it to the repo. + + **Title**: ${item.title} + + ${item.body} + + Steps: + 1. cd /workspace/project + 2. Read existing specs in spec/ to understand the format + 3. Create a slug from the title (lowercase, hyphens instead of spaces) + 4. Write the spec to spec/.md following the project spec format + 5. git add spec/.md && git commit -m "spec: auto-draft ${item.title}" && git push + 6. Call task_complete with a one-sentence summary + + The spec should have numbered requirement IDs, clear acceptance criteria, + and error handling. Follow the format of existing specs in spec/. +escalation: + scope_exceeded: replan-spec-opus \ No newline at end of file