From b4bac0d2e808eb0c20fd3bae3bab86bb8d5d3144 Mon Sep 17 00:00:00 2001 From: Paul O'Reilly Date: Fri, 4 Sep 2026 20:49:13 +1200 Subject: [PATCH] =?UTF-8?q?feat:=20hatchmate-plan-review-loop@1=20?= =?UTF-8?q?=E2=80=94=20project-specific=20plan=20review=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hand-sync of hatchmate-crs's plan-review-loop@1 under a project-prefixed name so hatchmate's triggers can reference it via the global WorkflowRegistry. Interim pattern until agent-runtimes ships project-scope template serving via crs_manager (M42 gap: DispatchService only consults the concepts_syncer WorkflowRegistry, not crs_manager's repo store). Template is hatchmate-specific throughout: Fable-low + MiniMax-M3-max + Airouter-Qwen3.8-max reviewers, hatchmate/hatchmate-agents clone URL, hatchmate-aware prompts and conventions. Claude-Session: https://claude.ai/code/session_01PdFrhZypEDBTsbAeTJqHq1 --- .../hatchmate-plan-review-loop@1.yaml | 210 ++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 task-templates/workflow/hatchmate-plan-review-loop@1.yaml diff --git a/task-templates/workflow/hatchmate-plan-review-loop@1.yaml b/task-templates/workflow/hatchmate-plan-review-loop@1.yaml new file mode 100644 index 0000000..02f0594 --- /dev/null +++ b/task-templates/workflow/hatchmate-plan-review-loop@1.yaml @@ -0,0 +1,210 @@ +# agent-runtime-framework — task-templates/workflow/hatchmate-plan-review-loop@1.yaml +# +# Mirrors agent-runtime-framework's task-templates/workflow/plan-review-loop@1.yaml +# structurally (nodes shape, judge + script verdict-gate, loop block, escalation +# map) but is hatchmate-specific throughout: prompts reference the hatchmate +# portal and its conventions (not agent-runtimes' own repo/plan), reviewers are +# three EXPLICIT models spanning three families (a tier resolves ONE model, +# never a trio — see model-registry/tiers.yaml), and the improve node uses +# `tier: build` per plan §3c. +# +# WorkflowTemplate is extra="forbid" (verified against +# agent-runtimes/spec/typed-workflows.md this session) — no `diversity:` key +# here; F-WE-PDIV (registry `family` + template `diversity:` block, concept +# b45ff626 under milestone ae0c7a79) has not landed. `allowed_models` is the +# per-template cost/blast-radius ceiling (WF-SCH-14/WF-MODEL-2) and lists +# exactly: the three explicit reviewer models, the judge model, and the single +# model `tier: build` resolves to today against the merged registry pool +# (model-registry/minimax-m3.yaml — dry-run-verified this session; see +# model-registry/tiers.yaml's `build` tier comments for why framework's +# zero-cost entries don't hijack that resolution). +# +# `cmd: scripts/workflow/verdict-gate` is copied unchanged from the framework +# template — this path resolves image-baked (framework's own script-node +# nodes use the identical relative path with no repo-local +# scripts/workflow/verdict-gate file existing in that repo either), so nothing +# is ported into this repo or hatchmate-agents for it. +name: hatchmate-plan-review-loop +version: 1 +description: > + Fable-low + MiniMax-M3-max + Airouter-Qwen3.8-max review a hatchmate concept's + draft plan, MiniMax-M3 (tier: build) revises, Fable-low judges clean/rework. +runtime: code-minimax-tdd-repo +input: + state: plan-drafted + tags_required: [] + tags_forbidden: [security-sensitive] # HC-25: security-sensitive items are human-present + required_artifacts: [plan_doc] +output: + state: plan-reviewed +allowed_models: + - claude-fable-5-low + - minimax-m3-max + - airouter-qwen38-max + - minimax-m3 +scope_budget: + wall_clock_seconds_max: 7200 # WF-ITER-7: run-level ceiling across ALL iterations — + # must be >= iterations_max * per_iteration_seconds_max + # (5 * 1200 = 6000) plus slack; NOT a per-iteration value + iterations_max: 5 # WF-SCH-19: required whenever loop is set + per_iteration_seconds_max: 1200 +nodes: + - id: review-fable + kind: agent + role: plan-review + model: claude-fable-5-low + runtime_env: + AGENT_REPO_URL: hatchmate/hatchmate-agents + AGENT_BRANCH: "task/${item.uuid}" + prompt: | + The hatchmate project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + hatchmate is a multi-tenant customer portal for NZ small business owners + (identity, app shell, customer/team management, resource catalogue — + see CLAUDE.md and docs/scope.md in the cloned repo). Review the draft + plan document attached to the following work item against hatchmate's + settled conventions (permission grammar `customer:app_group:resource + _type:[id]:noun:verb`, teams-hold-grants-never-users, no-escalation rule, + app onboarding rule — CLAUDE.md § Conventions) before judging it on + general engineering merit. + + **Title**: ${item.title} + + **Original concept**: + ${item.body} + + Steps: + 1. cd /workspace/project + 2. Find and read the draft plan document referenced by this item completely + 3. Review it for CRITICAL and HIGH severity issues: violations of a + settled hatchmate convention or ADR, missing requirements, unaddressed + security implications (multi-tenant boundary crossing, permission + escalation), unworkable sequencing + 4. Write your findings to /workspace/.agent-output/review-fable.md + - id: review-minimax + kind: agent + role: plan-review + model: minimax-m3-max + runtime_env: + AGENT_REPO_URL: hatchmate/hatchmate-agents + AGENT_BRANCH: "task/${item.uuid}" + prompt: | + The hatchmate project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + hatchmate is a multi-tenant customer portal for NZ small business owners. + Review the draft plan document attached to the following work item + against hatchmate's settled conventions in CLAUDE.md (permission + grammar, team-based grants, no-escalation rule, app onboarding rule) and + docs/scope.md before judging it on general engineering merit. + + **Title**: ${item.title} + + **Original concept**: + ${item.body} + + Steps: + 1. cd /workspace/project + 2. Find and read the draft plan document referenced by this item completely + 3. Review it for CRITICAL and HIGH severity issues: violations of a + settled hatchmate convention or ADR, missing requirements, unaddressed + security implications, unworkable sequencing + 4. Write your findings to /workspace/.agent-output/review-minimax.md + - id: review-airouter + kind: agent + role: plan-review + model: airouter-qwen38-max + runtime_env: + AGENT_REPO_URL: hatchmate/hatchmate-agents + AGENT_BRANCH: "task/${item.uuid}" + prompt: | + The hatchmate project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + hatchmate is a multi-tenant customer portal for NZ small business owners. + Review the draft plan document attached to the following work item + against hatchmate's settled conventions in CLAUDE.md (permission + grammar, team-based grants, no-escalation rule, app onboarding rule) and + docs/scope.md before judging it on general engineering merit. + + **Title**: ${item.title} + + **Original concept**: + ${item.body} + + Steps: + 1. cd /workspace/project + 2. Find and read the draft plan document referenced by this item completely + 3. Review it for CRITICAL and HIGH severity issues: violations of a + settled hatchmate convention or ADR, missing requirements, unaddressed + security implications, unworkable sequencing + 4. Write your findings to /workspace/.agent-output/review-airouter.md + - id: improve-build + kind: agent + role: plan-review + tier: build + depends_on: [review-fable, review-minimax, review-airouter] + runtime_env: + AGENT_REPO_URL: hatchmate/hatchmate-agents + AGENT_BRANCH: "task/${item.uuid}" + prompt: | + The hatchmate project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Revise the draft plan document for the following hatchmate concept to + address all three reviews left on this branch. + + **Title**: ${item.title} + + Steps: + 1. cd /workspace/project + 2. Read /workspace/.agent-output/review-fable.md, + /workspace/.agent-output/review-minimax.md, and + /workspace/.agent-output/review-airouter.md + 3. Revise the plan document in place to address every CRITICAL/HIGH + finding from all three reviews, keeping it consistent with + hatchmate's CLAUDE.md conventions + 4. Commit the revised plan on this branch + - id: judge-fable + kind: agent + role: plan-review + model: claude-fable-5-low + depends_on: [improve-build] + runtime_env: + AGENT_REPO_URL: hatchmate/hatchmate-agents + AGENT_BRANCH: "task/${item.uuid}" + prompt: | + The hatchmate project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Judge the revised plan document for the following hatchmate concept. + + **Title**: ${item.title} + + Steps: + 1. cd /workspace/project + 2. Read the revised plan document + 3. Check whether every CRITICAL/HIGH finding from + /workspace/.agent-output/review-fable.md, + /workspace/.agent-output/review-minimax.md, and + /workspace/.agent-output/review-airouter.md has been addressed + 4. Write exactly CLEAN or NEEDS_REWORK (nothing else, no trailing + punctuation or explanation) to /workspace/.workflow/verdict + - id: judge-gate + kind: script + cmd: scripts/workflow/verdict-gate + depends_on: [judge-fable] +loop: + body: [review-fable, review-minimax, review-airouter, improve-build, judge-fable, judge-gate] + condition_node: judge-gate + on_max_reached: escalate +escalation: + loop_max_reached: null # WF-SCH-19/WF-ITER-5: required whenever on_max_reached + # is "escalate" (the default); no hatchmate escalation + # template exists yet (spec-review-loop@1 etc. are + # reserved for a later task per spec/crs.md), so this + # explicitly escalates to a human (no dispatch target) + # rather than naming a template that doesn't exist — + # `escalation: dict[str, str | None]` permits null + # (verified against typed-workflows.md this session)