Template: produce_critique_refine
Draft an artifact, critique it in isolated context, then refine under an explicit stop contract. The critique is judgement text (not a deterministic oracle) and feeds the refinement loop.
Item |
Value |
|---|---|
Name |
|
Module |
|
Class |
|
Version |
|
Owning story |
|
When to use
Drafts where an independent critic improves quality but no oracle exists
When same-context self-critique is too lenient but a full review panel is too heavy (compare independent_review and verify_repair)
Topology
produce → critique (isolated) → refine (repeating + StopContract) → complete
Soft points
Name |
Kind |
Default |
Evolvable |
Notes |
|---|---|---|---|---|
|
runner_kind |
|
no |
|
|
runner_kind |
|
no |
|
|
runner_kind |
|
no |
Repeating |
|
runner_kind |
|
no |
|
|
prompt |
critique defects |
yes |
Voice / strictness of the critic |
|
budget |
|
yes |
Or |
|
policy |
|
no |
Critic isolation |
|
policy |
|
no |
On critique/complete |
Only evolvable soft points may be rewritten by an optimizer
(GraphTemplate.assert_evolution_allowed).
Example
from mechaharness.graph_templates import (
GraphTemplateParams,
ProduceCritiqueRefineTemplate,
)
graph = ProduceCritiqueRefineTemplate().instantiate(
GraphTemplateParams(
goal="draft release notes",
acceptance=["no_unverified_claims"],
soft_bindings={"max_rounds": 2},
)
)
assert graph.nodes["critique"].payload["omit_producer_reasoning"] is True
assert graph.nodes["refine"].stop_contract["max_iterations"] == 2
Node components
Parent graph node |
Components |
|---|---|
|
|
|
|
|
|
|
|
See Node components.
Tests
See tests/fixtures/graph_templates/produce_critique_refine_*.json and
tests/test_produce_critique_refine_recipe.py.