Add tier-based critique check filtering. Tag each CritiqueCheckSpec with a tier ('core' or 'extended'). Add checks_for_robustness(robustness) that returns: heavy=all 8 checks, standard=core checks only (~3-4), light=empty tuple (general review only, no structured checks). Update _render_critique_checks() and _render_critique_template() to accept a filtered checks list. Update _critique_prompt() to call checks_for_robustness() and adapt the prompt text: if no checks, just ask for general review via flags array; if checks, render them as today. Single code path, single data source — robustness just filters.
The critique system currently runs all 8 CritiqueCheckSpec checks at every robustness level. The only differentiation is a softer instruction tone for light. This change makes robustness structurally meaningful: heavy gets all 8 checks, standard gets 4 core checks, and light skips structured checks entirely (general review via flags array only, with checks: []).
def checks_for_robustness(robustness: str) -> tuple[CritiqueCheckSpec, ...]:
if robustness == "heavy":
return CRITIQUE_CHECKS
if robustness == "standard":
return tuple(c for c in CRITIQUE_CHECKS if c["tier"] == "core")
return () # light
Updatebuild_empty_template() (checks.py:126-134) to accept an optional checks parameter defaulting to CRITIQUE_CHECKS:
python
def build_empty_template(checks: tuple[CritiqueCheckSpec, ...] | None = None) -> list[dict[str, Any]]:
source = checks if checks is not None else CRITIQUE_CHECKS
return [{"id": c["id"], "question": c["question"], "findings": []} for c in source]
Updatevalidate_critique_checks() (checks.py:152-193) to accept an optional expected_ids: list[str] | None parameter. When provided, use that list instead of get_check_ids(). When expected_ids is empty (light mode), enforce that the checks array in the payload is also empty — if it contains any entries, return those IDs as invalid. This prevents stray checks from leaking into update_flags_after_critique().
python
def validate_critique_checks(payload: Any, *, expected_ids: list[str] | None = None) -> list[str]:
raw_checks = payload.get("checks") if isinstance(payload, dict) else payload
if not isinstance(raw_checks, list):
return expected_ids if expected_ids is not None else get_check_ids()
if expected_ids is not None and not expected_ids:
# Light mode: checks must be empty
return [rc.get("id", "?") for rc in raw_checks if isinstance(rc, dict)] if raw_checks else []
# ... rest uses expected_ids or get_check_ids() as before
Iterate over the passed checks instead of the global CRITIQUE_CHECKS.
Update_render_critique_template() (critique.py:93-168) to accept a checks parameter:
Pass it to build_empty_template(checks) for iteration 1.
For iteration 2+, filter prior findings to only include checks present in the current checks tuple.
Update the "Add any new checks" loop (critique.py:144) to iterate over filtered checks instead of CRITIQUE_CHECKS.
When checks is empty: return a minimal instruction: "Return checks as an empty array: []".
Update_critique_prompt() (critique.py:171-238):
After line 179, call checks_for_robustness(robustness) to get active_checks.
If active_checks is non-empty: render as today. Pass active_checks to _render_critique_checks() and _render_critique_template(). Update the count at line 220 from len(CRITIQUE_CHECKS) to len(active_checks).
If active_checks is empty (light): replace the checks instruction block (lines 220-226) with: "No structured checks at this robustness level. Return checks as an empty array. Perform a general review and add any concerns directly to the flags array." The flags, verified_flag_ids, and disputed_flag_ids fields still apply.
Step 3: Update handler and mock infrastructure (megaplan/handlers.py, megaplan/workers.py)
Scope: Small
In handle_critique() (handlers.py:644): move robustness = configured_robustness(state) earlier (before the worker call at line 649), compute active checks, and pass expected_ids to validation:
python
robustness = configured_robustness(state)
active_checks = checks_for_robustness(robustness)
expected_ids = [c["id"] for c in active_checks]
# ... after worker returns:
invalid_checks = validate_critique_checks(worker.payload, expected_ids=expected_ids)
Remove the duplicate robustness = configured_robustness(state) at line 661.
In _default_mock_critique_payload() (workers.py:347-364): pass checks_for_robustness(robustness) to build_empty_template(). This requires the function to receive robustness — either read it from state["config"]["robustness"] (already available via the state parameter) or call configured_robustness(state). For light mode, build_empty_template(()) returns [], so checks in the mock payload will be [].
Step 4: Update existing tests and add new ones (tests/test_megaplan.py, tests/test_checks.py)
Scope: Small
Fix monkeypatch signatures in tests/test_megaplan.py:693 and tests/test_megaplan.py:704. The lambda must accept the new keyword argument:
python
# Line 693: lambda payload, **kwargs: ["correctness"]
# Line 704: lambda payload, **kwargs: []
Add unit tests for checks_for_robustness(): heavy→8 checks, standard→4 core IDs, light→empty tuple.
Add test for validate_critique_checks() with expected_ids:
Standard mode: validates only core check IDs, ignores absence of extended IDs.
Light mode with empty payload checks: returns [] (valid).
Light mode with stray checks in payload: returns those stray IDs as invalid.
Add test for build_empty_template() with filtered checks: verify output length matches input.
Run full test suite to confirm no regressions.
Execution Order
Step 1 first — data model and filtering function (no callers change yet).
Step 2 — prompt rendering consumes the new filtering.
Step 3 — handler and mock wiring.
Step 4 — fix existing tests and add new coverage.
Validation Order
Run existing tests after Step 1 to confirm tier field addition is backward-compatible.
Run full suite after Step 3 (expect 2 test failures from monkeypatch signature).
Fix tests in Step 4 and run final full suite.
code
Execution tracking state (`finalize.json`):
{
"meta_commentary": "This is a focused 4-file change (checks.py, critique.py, handlers.py, workers.py) plus test updates. The plan is well-specified after addressing all 6 critique flags. Key execution risks: (1) the validate_critique_checks signature change must propagate to test monkeypatches, (2) light-mode prompt must explicitly instruct checks: [] not just omit checks, (3) _render_critique_template for empty checks must short-circuit before trying to render prior findings. Execute steps sequentially \u2014 Step 1 first since Steps 2-3 depend on the new tier field and checks_for_robustness(). Run tests after Step 3 (expect 2 failures), then fix in Step 4.",
"tasks": [
{
"id": "T1",
"description": "Add tier field to CritiqueCheckSpec, tag all 8 checks, add checks_for_robustness(), update build_empty_template() to accept optional checks param, update validate_critique_checks() to accept optional expected_ids with light-mode enforcement, update __all__ (megaplan/checks.py)",
"depends_on": [],
"status": "done",
"executor_notes": "Added tier to CritiqueCheckSpec, tagged all 8 checks, added checks_for_robustness(), and updated build_empty_template() plus validate_critique_checks() to support filtered checks / expected IDs. Verified the heavy/standard/light outputs and the 4-core/4-extended split with a direct Python check.",
"files_changed": [
"megaplan/checks.py"
],
"commands_run": [
"python - <<'PY'\nfrom megaplan.checks import CRITIQUE_CHECKS, checks_for_robustness\ncore_ids = [check['id'] for check in CRITIQUE_CHECKS if check['tier'] == 'core']\nextended_ids = [check['id'] for check in CRITIQUE_CHECKS if check['tier'] == 'extended']\nprint({'core_ids': core_ids, 'extended_ids': extended_ids, 'heavy': len(checks_for_robustness('heavy')), 'standard_ids': [check['id'] for check in checks_for_robustness('standard')], 'light': checks_for_robustness('light')})\nPY"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Update _render_critique_checks() and _render_critique_template() to accept a checks param. Update _critique_prompt() to call checks_for_robustness(robustness), pass active_checks to rendering functions, and for light mode replace the checks instruction block with general-review-only text instructing checks: [] (megaplan/prompts/critique.py)",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Updated the critique prompt rendering path to use checks_for_robustness() as the single source of active checks. Verified with a targeted prompt build that standard mode renders only the 4 core checks, light mode emits general-review-only guidance with explicit checks: [], and the prompt no longer contains Fill in ALL 0 checks.",
"files_changed": [
"megaplan/prompts/critique.py"
],
"commands_run": [
"python - <<'PY' ... targeted critique prompt verification ... PY"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Update handle_critique() to compute active_checks and pass expected_ids to validate_critique_checks(), remove duplicate robustness = configured_robustness(state) call (megaplan/handlers.py). Update _default_mock_critique_payload() to use checks_for_robustness() via configured_robustness(state) so light mode gets checks: [] (megaplan/workers.py)",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Updated handle_critique() to derive filtered expected_ids before validation and removed the duplicate robustness lookup. Updated _default_mock_critique_payload() to build checks from checks_for_robustness(configured_robustness(state)); verified that light robustness now produces checks: [] and standard robustness produces only the filtered core IDs.",
"files_changed": [
"megaplan/handlers.py",
"megaplan/workers.py"
],
"commands_run": [
"python - <<'PY' ... handler source and mock payload verification ... PY"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Fix monkeypatch lambdas at tests/test_megaplan.py:693,704 to accept **kwargs. Add unit tests for: checks_for_robustness() (heavy\u21928, standard\u21924 core IDs, light\u2192empty), validate_critique_checks() with expected_ids (standard mode, light-mode empty valid, light-mode stray rejected), build_empty_template() with filtered checks. Run full test suite until all pass.",
"depends_on": [
"T1",
"T2",
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [
"tests/test_megaplan.py",
"tests/test_checks.py"
],
"commands_run": [
"python -m pytest tests/ -x"
],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"validate_critique_checks() light-mode enforcement: when expected_ids is empty list, any checks in payload must be rejected as invalid \u2014 do NOT just return []",
"Light-mode prompt must explicitly instruct model to return checks: [] (empty array), not omit the field \u2014 schema requires it",
"_render_critique_template() must short-circuit for empty checks tuple and return minimal instruction, not try to render prior findings against an empty check set",
"Test monkeypatch lambdas at test_megaplan.py:693,704 must accept **kwargs to match new validate_critique_checks(payload, *, expected_ids=None) signature",
"_default_mock_critique_payload in workers.py must use filtered checks \u2014 otherwise mock mode will generate 8 checks even in light robustness",
"DEBT: do not modify workflow-state-machine, worker-permissions, handler-boilerplate, or execute-phase-contract code paths",
"_critique_prompt() line 220 count must use len(active_checks) not len(CRITIQUE_CHECKS) \u2014 otherwise light mode says 'Fill in ALL 0 checks'",
"The iteration 2+ path in _render_critique_template must filter prior_checks to only include IDs present in active_checks"
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does CritiqueCheckSpec include tier: str, are exactly 4 checks tagged 'core' (issue_hints, correctness, scope, verification) and 4 tagged 'extended', and does checks_for_robustness return the correct tuple for each robustness level?",
"executor_note": "Confirmed CritiqueCheckSpec now includes tier, exactly 4 checks are tagged core (issue_hints, correctness, scope, verification), 4 are tagged extended, and checks_for_robustness() returns all 8 for heavy, the 4 core checks for standard, and an empty tuple for light.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Does _critique_prompt() for light mode output general-review-only text with explicit checks: [] instruction (no 'Fill in ALL 0 checks'), and for standard mode render only the 4 core checks?",
"executor_note": "Verified create_claude_prompt('critique', ...) now renders only the 4 core check IDs in standard mode, omits extended check IDs, includes explicit checks: [] guidance in light mode, and does not emit Fill in ALL 0 checks.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does handle_critique() compute expected_ids from checks_for_robustness() before validation, and does the mock builder produce checks: [] for light robustness?",
"executor_note": "Verified _default_mock_critique_payload() returns checks: [] for light robustness and the filtered standard check IDs for standard robustness. Also confirmed handle_critique() derives expected_ids from checks_for_robustness() and passes them into validate_critique_checks().",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Do all existing and new tests pass, including coverage for light-mode stray-check rejection and standard-mode filtered validation?",
"executor_note": "New light-mode and standard-mode validation coverage was added and passed in direct offline execution (tests/test_checks.py), and the adjusted critique-handler scenarios also passed under manual execution. I could not verify that the entire existing test suite passes because python -m pytest tests/ -x is blocked here: pytest is unavailable in the local interpreters and network-restricted installs fail.",
"verdict": ""
}
],
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Add tier field, tag checks, add checks_for_robustness(), update build_empty_template() and validate_critique_checks()",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Step 2: Update prompt rendering (_render_critique_checks, _render_critique_template, _critique_prompt) to use filtered checks",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Step 3: Update handle_critique() handler and _default_mock_critique_payload() mock builder",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 4: Fix test monkeypatches, add new unit tests, run full suite",
"finalize_task_ids": [
"T4"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All 4 plan steps map 1:1 to finalize tasks. No new files created \u2014 test_checks.py already exists per plan assumptions. T4 is the final validation task.",
"coverage_complete": true
}
}
code
Plan metadata:
{
"version": 2,
"timestamp": "2026-03-31T13:31:00Z",
"hash": "sha256:5346fb6ffad3fdf0523f7b85f21c401691794893c59eb8fc3261a34438f77212",
"changes_summary": "Addressed all 6 flags: (1) light mode explicitly emits checks: [] with prompt instruction to return empty array; (2) light-mode validation enforces empty checks, rejecting stray entries; (3) mock payload builder in workers.py updated to use filtered checks; (4) test monkeypatch lambdas updated for new keyword arg; (5) added light-mode enforcement test; (6) fixed ambiguous success criteria \u2014 pinned core count to 4, acknowledged test updates needed.",
"flags_addressed": [
"issue_hints",
"correctness",
"all_locations",
"callers",
"verification",
"criteria_quality"
],
"questions": [],
"success_criteria": [
{
"criterion": "CritiqueCheckSpec TypedDict includes a 'tier' field and all 8 checks are tagged as 'core' or 'extended'",
"priority": "must"
},
{
"criterion": "checks_for_robustness('heavy') returns all 8 checks",
"priority": "must"
},
{
"criterion": "checks_for_robustness('standard') returns exactly 4 core checks: issue_hints, correctness, scope, verification",
"priority": "must"
},
{
"criterion": "checks_for_robustness('light') returns empty tuple",
"priority": "must"
},
{
"criterion": "_critique_prompt() for light mode instructs model to return checks: [] and use flags array for general review",
"priority": "must"
},
{
"criterion": "_critique_prompt() for standard mode renders only the 4 core checks",
"priority": "must"
},
{
"criterion": "validate_critique_checks() with empty expected_ids rejects payloads that contain stray checks",
"priority": "must"
},
{
"criterion": "validate_critique_checks() with empty expected_ids returns [] for payloads with checks: []",
"priority": "must"
},
{
"criterion": "_default_mock_critique_payload() uses filtered checks matching the plan's robustness level",
"priority": "must"
},
{
"criterion": "Test monkeypatch lambdas at test_megaplan.py:693,704 updated to accept keyword args",
"priority": "must"
},
{
"criterion": "All tests pass after all changes are applied (existing tests updated where needed)",
"priority": "must"
},
{
"criterion": "Single code path: CRITIQUE_CHECKS remains the sole source of truth, checks_for_robustness just filters",
"priority": "must"
},
{
"criterion": "Unit tests cover checks_for_robustness, filtered validate_critique_checks (including light-mode enforcement), and filtered build_empty_template",
"priority": "should"
},
{
"criterion": "Prompt text for each robustness level reads naturally",
"priority": "should"
},
{
"criterion": "No new files created \u2014 all changes in existing modules",
"priority": "should"
}
],
"assumptions": [
"Core checks are: issue_hints, correctness, scope, verification (4 checks). Extended: all_locations, callers, conventions, criteria_quality.",
"Light mode still requires the flags, verified_flag_ids, and disputed_flag_ids fields \u2014 only structured checks are skipped.",
"The tier field is a simple string ('core' | 'extended'), not an enum or separate type.",
"Light-mode validation enforces checks array is empty, rejecting any stray check entries.",
"Robustness does not change between iterations within a single plan run."
],
"delta_from_previous_percent": 43.69,
"structure_warnings": []
}
code
Gate summary:
{
"passed": false,
"criteria_check": {
"count": 12,
"items": [
{
"criterion": "CritiqueCheckSpec TypedDict includes a 'tier' field and all 8 checks are tagged",
"priority": "must"
},
{
"criterion": "checks_for_robustness('heavy') returns all 8 checks",
"priority": "must"
},
{
"criterion": "checks_for_robustness('standard') returns only core-tier checks (~4)",
"priority": "must"
},
{
"criterion": "checks_for_robustness('light') returns empty tuple",
"priority": "must"
},
{
"criterion": "_critique_prompt() for light mode omits the checks block and asks for general review via flags only",
"priority": "must"
},
{
"criterion": "_critique_prompt() for standard mode renders only core checks in the prompt",
"priority": "must"
},
{
"criterion": "validate_critique_checks() accepts expected_ids parameter and validates only those",
"priority": "must"
},
{
"criterion": "All existing tests pass without modification (backward compat preserved)",
"priority": "must"
},
{
"criterion": "Single code path: CRITIQUE_CHECKS remains the sole source of truth, checks_for_robustness just filters",
"priority": "must"
},
{
"criterion": "Unit tests cover checks_for_robustness, filtered validate_critique_checks, and filtered build_empty_template",
"priority": "should"
},
{
"criterion": "Prompt text for each robustness level reads naturally (no awkward 'Fill in ALL 0 checks' for light)",
"priority": "should"
},
{
"criterion": "No new files created \u2014 all changes in existing modules",
"priority": "should"
}
]
},
"preflight_results": {
"project_dir_exists": true,
"project_dir_writable": true,
"success_criteria_present": true,
"claude_available": true,
"codex_available": true
},
"unresolved_flags": [
{
"id": "issue_hints",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: The light-mode prompt step does not fully satisfy the requested behavior as written. It says to omit the checks block/template entirely, but this repo still requires a checks field in critique payloads (megaplan/schemas.py:198, megaplan/workers.py:220). To make light mode work reliably, the plan needs an explicit checks: [] contract rather than 'flags only' with no checks field guidance.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "The light-mode prompt step does not fully satisfy the requested behavior as written. It says to omit the checks block/template entirely, but this repo still requires a checks field in critique payloads (megaplan/schemas.py:198, megaplan/workers.py:220). To make light mode work reliably, the plan needs an explicit checks: [] contract rather than 'flags only' with no checks field guidance.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "correctness",
"concern": "Are the proposed changes technically correct?: validate_critique_checks() should not blindly return [] when expected_ids is empty. In this repo, update_flags_after_critique() still iterates over critique.get(\"checks\", []) and turns flagged findings into registry flags (megaplan/flags.py:71). Skipping validation entirely would allow stray or unknown structured checks through in light mode instead of enforcing an empty list.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "validate_critique_checks() should not blindly return [] when expected_ids is empty. In this repo, update_flags_after_critique() still iterates over critique.get(\"checks\", []) and turns flagged findings into registry flags (megaplan/flags.py:71). Skipping validation entirely would allow stray or unknown structured checks through in light mode instead of enforcing an empty list.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "all_locations",
"concern": "Does the change touch all locations AND supporting infrastructure?: The plan misses supporting mock infrastructure. megaplan/workers.py:349 builds critique mock payloads from build_empty_template() unconditionally, so a correct light-mode implementation that expects checks: [] also needs the mock critique path updated.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "The plan misses supporting mock infrastructure. megaplan/workers.py:349 builds critique mock payloads from build_empty_template() unconditionally, so a correct light-mode implementation that expects checks: [] also needs the mock critique path updated.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "callers",
"concern": "Is the change in the right place, and would it break any callers?: Changing handle_critique() to call validate_critique_checks(..., expected_ids=...) will break existing test callers that monkeypatch the function with a one-argument lambda in tests/test_megaplan.py:693 and tests/test_megaplan.py:704. The production call site is right, but the plan is incomplete about affected callers/tests.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "Changing handle_critique() to call validate_critique_checks(..., expected_ids=...) will break existing test callers that monkeypatch the function with a one-argument lambda in tests/test_megaplan.py:693 and tests/test_megaplan.py:704. The production call site is right, but the plan is incomplete about affected callers/tests.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "verification",
"concern": "Is there convincing verification for the change?: The proposed tests do not cover the main light-mode failure case. This repo needs a test that light robustness still emits checks: [] and rejects non-empty or unknown structured checks, otherwise the permissive-validation bug can slip through.",
"category": "completeness",
"severity_hint": "uncertain",
"evidence": "The proposed tests do not cover the main light-mode failure case. This repo needs a test that light robustness still emits checks: [] and rejects non-empty or unknown structured checks, otherwise the permissive-validation bug can slip through.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "criteria_quality",
"concern": "Are the success criteria well-prioritized and verifiable?: Two must criteria are weak as written: standard returns only core-tier checks (~4) is ambiguous while the plan still leaves 3-vs-4 core checks unresolved, and All existing tests pass without modification is not realistic against this repo because the changed handler call signature will require test updates.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "Two must criteria are weak as written: standard returns only core-tier checks (~4) is ambiguous while the plan still leaves 3-vs-4 core checks unresolved, and All existing tests pass without modification is not realistic against this repo because the changed handler call signature will require test updates.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
}
],
"recommendation": "ITERATE",
"rationale": "Six significant flags on iteration 1, with two being correctness-category issues that would produce bugs if executed as-written. The correctness flag (validate_critique_checks blindly returning [] allows stray checks through in light mode) and the issue_hints flag (schema requires checks field but plan says to omit it) are planning-level gaps, not execution details. The callers flag also identifies concrete test breakage the plan doesn't account for. At light robustness, the plan should still be coherent enough to execute without known bug paths. One revision pass addressing these 6 flags should bring the score down and make PROCEED viable.",
"signals_assessment": "Iteration 1, weighted score 8.0 (high for light robustness), no prior trajectory. All 6 flags are new \u2014 no recurring critiques or plan delta to compare against. Preflight is clean. The flag distribution is broad (completeness\u00d73, correctness\u00d72, criteria\u00d71), indicating the plan draft was structurally sound but missed integration details: schema contracts, mock paths, test callers, and validation edge cases. No overlap with escalated debt subsystems (workflow-state-machine is unrelated to critique checks).",
"warnings": [
"The correctness flag identifies a real bug: light mode must enforce checks: [] not skip validation entirely, otherwise update_flags_after_critique could process stray check entries.",
"The callers flag at tests/test_megaplan.py:693,704 will cause test failures \u2014 revision must explicitly address monkeypatch signatures.",
"Success criterion 'All existing tests pass without modification' is unrealistic and should be reworded to acknowledge required test updates."
],
"settled_decisions": [
{
"id": "DECISION-001",
"decision": "Core tier checks are: issue_hints, correctness, scope, verification (4 checks). Extended: all_locations, callers, conventions, criteria_quality.",
"rationale": "The plan proposed this split and it was not flagged by critique. These 4 cover the highest-signal axes."
},
{
"id": "DECISION-002",
"decision": "Light mode emits checks: [] (empty list), not omitting the field entirely.",
"rationale": "Schema requires the field; enforcing empty list is simpler and safer than making it optional."
}
],
"override_forced": false,
"orchestrator_guidance": "First iteration; follow gate recommendation: ITERATE. Verify unresolved flags against the plan and project code before accepting.",
"robustness": "light",
"signals": {
"iteration": 1,
"idea": "Add tier-based critique check filtering. Tag each CritiqueCheckSpec with a tier ('core' or 'extended'). Add checks_for_robustness(robustness) that returns: heavy=all 8 checks, standard=core checks only (~3-4), light=empty tuple (general review only, no structured checks). Update _render_critique_checks() and _render_critique_template() to accept a filtered checks list. Update _critique_prompt() to call checks_for_robustness() and adapt the prompt text: if no checks, just ask for general review via flags array; if checks, render them as today. Single code path, single data source \u2014 robustness just filters.",
"significant_flags": 6,
"unresolved_flags": [
{
"id": "issue_hints",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: The light-mode prompt step does not fully satisfy the requested behavior as written. It says to omit the checks block/template entirely, but this repo still requires a checks field in critique payloads (megaplan/schemas.py:198, megaplan/workers.py:220). To make light mode work reliably, the plan needs an explicit checks: [] contract rather than 'flags only' with no checks field guidance.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "correctness",
"concern": "Are the proposed changes technically correct?: validate_critique_checks() should not blindly return [] when expected_ids is empty. In this repo, update_flags_after_critique() still iterates over critique.get(\"checks\", []) and turns flagged findings into registry flags (megaplan/flags.py:71). Skipping validation entirely would allow stray or unknown structured checks through in light mode instead of enforcing an empty list.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "all_locations",
"concern": "Does the change touch all locations AND supporting infrastructure?: The plan misses supporting mock infrastructure. megaplan/workers.py:349 builds critique mock payloads from build_empty_template() unconditionally, so a correct light-mode implementation that expects checks: [] also needs the mock critique path updated.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "callers",
"concern": "Is the change in the right place, and would it break any callers?: Changing handle_critique() to call validate_critique_checks(..., expected_ids=...) will break existing test callers that monkeypatch the function with a one-argument lambda in tests/test_megaplan.py:693 and tests/test_megaplan.py:704. The production call site is right, but the plan is incomplete about affected callers/tests.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "verification",
"concern": "Is there convincing verification for the change?: The proposed tests do not cover the main light-mode failure case. This repo needs a test that light robustness still emits checks: [] and rejects non-empty or unknown structured checks, otherwise the permissive-validation bug can slip through.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "criteria_quality",
"concern": "Are the success criteria well-prioritized and verifiable?: Two must criteria are weak as written: standard returns only core-tier checks (~4) is ambiguous while the plan still leaves 3-vs-4 core checks unresolved, and All existing tests pass without modification is not realistic against this repo because the changed handler call signature will require test updates.",
"category": "completeness",
"severity": "significant",
"status": "open"
}
],
"resolved_flags": [],
"weighted_score": 8.0,
"weighted_history": [],
"plan_delta_from_previous": null,
"recurring_critiques": [],
"scope_creep_flags": [],
"loop_summary": "Iteration 1. Weighted score trajectory: 8.0. Plan deltas: n/a. Recurring critiques: 0. Resolved flags: 0. Open significant flags: 6.",
"debt_overlaps": [],
"escalated_debt_subsystems": []
}
}
code
Settled decisions (verify the executor implemented these correctly):
DECISION-001: Core tier checks are: issue_hints, correctness, scope, verification (4 checks). Extended: all_locations, callers, conventions, criteria_quality. (The plan proposed this split and it was not flagged by critique. These 4 cover the highest-signal axes.)
DECISION-002: Light mode emits checks: [] (empty list), not omitting the field entirely. (Schema requires the field; enforcing empty list is simpler and safer than making it optional.)
code
Execution summary:
{
"output": "Aggregated execute batches: completed 3/3.\nBatch 1: Implemented batch 1 task T1 in megaplan/checks.py and checkpointed the batch update file.\nBatch 2: Implemented batch 2 tasks T2 and T3 and checkpointed the batch update file.\nBatch 3: Updated the T4 test coverage and attempted full-suite verification, but the batch remains verification-blocked because pytest is not installed in the available interpreters and external installs are blocked in this environment.",
"files_changed": [
"megaplan/checks.py",
"megaplan/prompts/critique.py",
"megaplan/handlers.py",
"megaplan/workers.py",
"tests/test_megaplan.py",
"tests/test_checks.py"
],
"commands_run": [
"rg -n "CritiqueCheckSpec|CRITIQUE_CHECKS|build_empty_template|validate_critique_checks|all" megaplan/checks.py",
"sed -n '1,260p' megaplan/checks.py",
"rg -n "robustness|configured_robustness|heavy|standard|light" megaplan tests",
"rg -n "build_empty_template\(|validate_critique_checks\(" megaplan tests",
"rg -n "from megaplan\.checks import|import megaplan\.checks|checks_for_robustness|CritiqueCheckSpec" megaplan tests",
"rg -n "build_empty_template|validate_critique_checks|get_check_ids|CRITIQUE_CHECKS" megaplan/init.py megaplan/_core/init.py megaplan/*.py",
"sed -n '1,240p' megaplan/init.py",
"python - <<'PY'\nfrom megaplan.checks import CRITIQUE_CHECKS, checks_for_robustness\ncore_ids = [check['id'] for check in CRITIQUE_CHECKS if check['tier'] == 'core']\nextended_ids = [check['id'] for check in CRITIQUE_CHECKS if check['tier'] == 'extended']\nprint({'core_ids': core_ids, 'extended_ids': extended_ids, 'heavy': len(checks_for_robustness('heavy')), 'standard_ids': [check['id'] for check in checks_for_robustness('standard')], 'light': checks_for_robustness('light')})\nPY",
"git diff -- megaplan/checks.py",
"sed -n '1,200p' /Users/user_c042661f/Documents/megaplan/.megaplan/plans/add-tier-based-critique-check-20260331-1521/execution_batch_1.json",
"sed -n '1,320p' megaplan/prompts/critique.py",
"sed -n '600,740p' megaplan/handlers.py",
"sed -n '300,390p' megaplan/workers.py",
"rg -n "_render_critique_checks|_render_critique_template|_critique_prompt|handle_critique|_default_mock_critique_payload|build_empty_template|validate_critique_checks|checks_for_robustness" megaplan/prompts/critique.py megaplan/handlers.py megaplan/workers.py",
"sed -n '1,80p' megaplan/handlers.py",
"sed -n '1,60p' megaplan/workers.py",
"sed -n '1,60p' megaplan/prompts/critique.py",
"sed -n '1,220p' .megaplan/schemas/critique.json",
"rg -n "checks: \[\]|Fill in ALL|general review|critique iteration|verified_flag_ids|disputed_flag_ids" tests/test_prompts.py tests/test_megaplan.py megaplan/prompts/critique.py",
"sed -n '1,220p' megaplan/_core/registries.py",
"sed -n '1,180p' megaplan/_core/state.py",
"python - <<'PY'\nimport inspect\nimport tempfile\nfrom pathlib import Path\n\nimport megaplan.handlers as handlers\nfrom megaplan._core import atomic_write_json, atomic_write_text\nfrom megaplan.checks import checks_for_robustness\nfrom megaplan.prompts import create_claude_prompt\nfrom megaplan.workers import _default_mock_critique_payload\n\nwith tempfile.TemporaryDirectory() as tmp:\n root = Path(tmp)\n plan_dir = root / 'plan'\n project_dir = root / 'project'\n plan_dir.mkdir()\n project_dir.mkdir()\n (project_dir / '.git').mkdir()\n\n state = {\n 'name': 'test-plan',\n 'idea': 'collapse the workflow',\n 'current_state': 'critiqued',\n 'iteration': 1,\n 'created_at': '2026-03-20T00:00:00Z',\n 'config': {\n 'project_dir': str(project_dir),\n 'auto_approve': False,\n 'robustness': 'standard',\n },\n 'sessions': {},\n 'plan_versions': [\n {\n 'version': 1,\n 'file': 'plan_v1.md',\n 'hash': 'sha256:test',\n 'timestamp': '2026-03-20T00:00:00Z',\n }\n ],\n 'history': [],\n 'meta': {\n 'significant_counts': [],\n 'weighted_scores': [],\n 'plan_deltas': [],\n 'recurring_critiques': [],\n 'total_cost_usd': 0.0,\n 'overrides': [],\n 'notes': [],\n },\n 'last_gate': {},\n }\n\n atomic_write_text(plan_dir / 'plan_v1.md', '# Plan\nDo the thing.\n')\n atomic_write_json(\n plan_dir / 'plan_v1.meta.json',\n {\n 'version': 1,\n 'timestamp': '2026-03-20T00:00:00Z',\n 'hash': 'sha256:test',\n 'success_criteria': [{'criterion': 'criterion', 'priority': 'must'}],\n 'questions': ['question'],\n 'assumptions': ['assumption'],\n },\n )\n\n standard_prompt = create_claude_prompt('critique', state, plan_dir)\n assert 'Fill in ALL 4 checks below.' in standard_prompt\n for check in checks_for_robustness('standard'):\n assert f'id="{check["id"]}"' in standard_prompt\n for check in checks_for_robustness('heavy'):\n if check['tier'] == 'extended':\n assert f'id="{check["id"]}"' not in standard_prompt\n\n state['config']['robustness'] = 'light'\n light_prompt = create_claude_prompt('critique', state, plan_dir)\n assert 'Fill in ALL 0 checks' not in light_prompt\n assert 'Return checks: []' in light_prompt\n\n light_payload = _default_mock_critique_payload(state, plan_dir)\n assert light_payload['checks'] == []\n\n state['config']['robustness'] = 'standard'\n standard_payload = default_mock_critique_payload(state, plan_dir)\n assert [check['id'] for check in standard_payload['checks']] == [\n check['id'] for check in checks_for_robustness('standard')\n ]\n\nsource = inspect.getsource(handlers.handle_critique)\nassert 'expected_ids = [check["id"] for check in active_checks]' in source\nassert 'validate_critique_checks(worker.payload, expected_ids=expected_ids)' in source\n\nprint('verified')\nPY",
"python -m pytest --version",
"uv --version",
"uv run --with pytest python -m pytest tests/ -x",
"python -m pip --version",
"python -m pip install pytest --target /tmp/pytest-deps",
"python - <<'PY'\nimport importlib\n\nmodule = importlib.import_module('tests.test_checks')\nfor name in dir(module):\n if name.startswith('test'):\n getattr(module, name)()\nprint('manual test_checks passed')\nPY",
"python -m py_compile tests/test_megaplan.py tests/test_checks.py megaplan/checks.py megaplan/prompts/critique.py megaplan/handlers.py megaplan/workers.py",
"python - <<'PY'\nimport json\nimport os\nimport tempfile\nfrom argparse import Namespace\nfrom pathlib import Path\nfrom unittest.mock import patch\n\nimport megaplan\nimport megaplan._core\nimport megaplan.handlers\nimport megaplan.workers\nfrom megaplan.workers import WorkerResult, _build_mock_payload\n\n\ndef make_args_factory(project_dir: Path):\n def make_args(**overrides):\n data = {\n 'plan': None,\n 'idea': 'test idea',\n 'name': 'test-plan',\n 'project_dir': str(project_dir),\n 'auto_approve': False,\n 'robustness': 'standard',\n 'agent': None,\n 'ephemeral': False,\n 'fresh': False,\n 'persist': False,\n 'confirm_destructive': True,\n 'user_approved': False,\n 'confirm_self_review': False,\n 'batch': None,\n 'override_action': None,\n 'note': None,\n 'reason': '',\n }\n data.update(overrides)\n return Namespace(**data)\n return make_args\n\n\nwith tempfile.TemporaryDirectory() as tmp:\n root = Path(tmp) / 'root'\n project_dir = Path(tmp) / 'project'\n root.mkdir()\n project_dir.mkdir()\n (project_dir / '.git').mkdir()\n os.environ[megaplan.MOCK_ENV_VAR] = '1'\n\n with patch.object(megaplan._core.shutil, 'which', side_effect=lambda name: '/usr/bin/mock' if name in {'claude', 'codex'} else None):\n make_args = make_args_factory(project_dir)\n response = megaplan.handle_init(root, make_args(robustness='standard'))\n plan_name = response['plan']\n plan_dir = megaplan.plans_root(root) / plan_name\n\n megaplan.handle_plan(root, make_args(plan=plan_name))\n state = json.loads((plan_dir / 'state.json').read_text(encoding='utf-8'))\n worker = WorkerResult(\n payload=_build_mock_payload('critique', state, plan_dir, checks=[]),\n raw_output='invalid critique payload',\n duration_ms=1,\n cost_usd=0.0,\n session_id='critique-invalid',\n )\n\n with patch.object(megaplan.workers, 'run_step_with_worker', lambda *args, **kwargs: (worker, 'claude', 'persistent', False)), patch.object(megaplan.handlers, 'validate_critique_checks', lambda payload, **kwargs: ['correctness']):\n try:\n megaplan.handle_critique(root, make_args(plan=plan_name))\n except megaplan.CliError:\n pass\n else:\n raise AssertionError('expected critique validation failure')\n\n with patch.object(megaplan._core.shutil, 'which', side_effect=lambda name: '/usr/bin/mock' if name in {'claude', 'codex'} else None):\n root2 = Path(tmp) / 'root2'\n project_dir2 = Path(tmp) / 'project2'\n root2.mkdir()\n project_dir2.mkdir()\n (project_dir2 / '.git').mkdir()\n make_args2 = make_args_factory(project_dir2)\n response2 = megaplan.handle_init(root2, make_args2(robustness='standard', name='test-plan-2'))\n plan_name2 = response2['plan']\n\n with patch.object(megaplan.handlers, 'validate_critique_checks', lambda payload, **kwargs: []):\n megaplan.handle_plan(root2, make_args2(plan=plan_name2, name='test-plan-2'))\n critique_response = megaplan.handle_critique(root2, make_args2(plan=plan_name2, name='test-plan-2'))\n assert critique_response['success'] is True\n\nprint('manual critique handler checks passed')\nPY"
],
"deviations": [
"Advisory quality: code changes lacked test updates: megaplan/checks.py.",
"Advisory audit finding: Executor claimed changed files not present in git status: megaplan/prompts/critique.py, megaplan/workers.py, tests/test_checks.py, tests/test_megaplan.py",
"Advisory audit finding: Git status shows changed files not claimed by any task: evals, megaplan/init.py, megaplan/_core/io.py, megaplan/_core/registries.py, megaplan/_core/state.py, megaplan/cli.py, megaplan/evaluation.py, megaplan/execution.py, megaplan/hermes_worker.py, megaplan/prompts/planning.py, uv.lock",
"Advisory audit finding: Sense check SC2 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC3 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC4 is missing an executor acknowledgment.",
"Advisory quality: megaplan/handlers.py adds unused imports: _validate_merge_inputs.",
"Advisory quality: megaplan/workers.py adds unused imports: run_agent.",
"Advisory quality: code changes lacked test updates: megaplan/handlers.py, megaplan/prompts/critique.py, megaplan/workers.py.",
"Advisory audit finding: Executor claimed changed files not present in git status: tests/test_checks.py, tests/test_megaplan.py",
"Advisory audit finding: Git status shows changed files not claimed by any task: evals, megaplan/init.py, megaplan/_core/io.py, megaplan/_core/registries.py, megaplan/_core/state.py, megaplan/cli.py, megaplan/evaluation.py, megaplan/execution.py, megaplan/hermes_worker.py, megaplan/prompts/planning.py, uv.lock",
"Advisory audit finding: Sense check SC4 is missing an executor acknowledgment.",
"Full-suite verification could not be completed because python -m pytest tests/ -x is unavailable in the local interpreters (No module named pytest), uv-based fallback failed in the sandbox, and network-restricted pip install pytest attempts could not fetch packages.",
"Skipped malformed task_updates[0]: invalid field types or enum values.",
"1/1 batch tasks have no executor update \u2014 tracking is incomplete.",
"Advisory audit finding: Git status shows changed files not claimed by any task: evals, megaplan/init.py, megaplan/_core/io.py, megaplan/_core/registries.py, megaplan/_core/state.py, megaplan/cli.py, megaplan/evaluation.py, megaplan/execution.py, megaplan/hermes_worker.py, megaplan/prompts/planning.py, uv.lock",
"Advisory audit finding: Git status shows changed files not claimed by any task: evals, megaplan/init.py, megaplan/_core/io.py, megaplan/_core/registries.py, megaplan/_core/state.py, megaplan/cli.py, megaplan/evaluation.py, megaplan/execution.py, megaplan/hermes_worker.py, megaplan/prompts/planning.py, uv.lock"
],
"task_updates": [
{
"task_id": "T1",
"status": "done",
"executor_notes": "Added tier to CritiqueCheckSpec, tagged all 8 checks, added checks_for_robustness(), and updated build_empty_template() plus validate_critique_checks() to support filtered checks / expected IDs. Verified the heavy/standard/light outputs and the 4-core/4-extended split with a direct Python check.",
"files_changed": [
"megaplan/checks.py"
],
"commands_run": [
"python - <<'PY'\nfrom megaplan.checks import CRITIQUE_CHECKS, checks_for_robustness\ncore_ids = [check['id'] for check in CRITIQUE_CHECKS if check['tier'] == 'core']\nextended_ids = [check['id'] for check in CRITIQUE_CHECKS if check['tier'] == 'extended']\nprint({'core_ids': core_ids, 'extended_ids': extended_ids, 'heavy': len(checks_for_robustness('heavy')), 'standard_ids': [check['id'] for check in checks_for_robustness('standard')], 'light': checks_for_robustness('light')})\nPY"
]
},
{
"task_id": "T2",
"status": "done",
"executor_notes": "Updated the critique prompt rendering path to use checks_for_robustness() as the single source of active checks. Verified with a targeted prompt build that standard mode renders only the 4 core checks, light mode emits general-review-only guidance with explicit checks: [], and the prompt no longer contains Fill in ALL 0 checks.",
"files_changed": [
"megaplan/prompts/critique.py"
],
"commands_run": [
"python - <<'PY' ... targeted critique prompt verification ... PY"
]
},
{
"task_id": "T3",
"status": "done",
"executor_notes": "Updated handle_critique() to derive filtered expected_ids before validation and removed the duplicate robustness lookup. Updated _default_mock_critique_payload() to build checks from checks_for_robustness(configured_robustness(state)); verified that light robustness now produces checks: [] and standard robustness produces only the filtered core IDs.",
"files_changed": [
"megaplan/handlers.py",
"megaplan/workers.py"
],
"commands_run": [
"python - <<'PY' ... handler source and mock payload verification ... PY"
]
},
{
"task_id": "T4",
"status": "blocked",
"executor_notes": "Updated the critique-related tests for the new validate_critique_checks(..., expected_ids=...) signature and added direct coverage for robustness filtering, filtered templates, and light-mode stray-check rejection. Manual execution of the new tests/test_checks.py cases, direct critique-handler checks, and py_compile all passed, but the required full pytest suite could not run because pytest is not installed in the available interpreters and external installs are blocked in this environment.",
"files_changed": [
"tests/test_megaplan.py",
"tests/test_checks.py"
],
"commands_run": [
"python -m pytest tests/ -x",
"python - <<'PY' ... manual test_checks execution ... PY",
"python - <<'PY' ... manual critique handler checks ... PY",
"python -m py_compile tests/test_megaplan.py tests/test_checks.py megaplan/checks.py megaplan/prompts/critique.py megaplan/handlers.py megaplan/workers.py"
]
}
],
"sense_check_acknowledgments": [
{
"sense_check_id": "SC1",
"executor_note": "Confirmed CritiqueCheckSpec now includes tier, exactly 4 checks are tagged core (issue_hints, correctness, scope, verification), 4 are tagged extended, and checks_for_robustness() returns all 8 for heavy, the 4 core checks for standard, and an empty tuple for light."
},
{
"sense_check_id": "SC2",
"executor_note": "Verified create_claude_prompt('critique', ...) now renders only the 4 core check IDs in standard mode, omits extended check IDs, includes explicit checks: [] guidance in light mode, and does not emit Fill in ALL 0 checks."
},
{
"sense_check_id": "SC3",
"executor_note": "Verified _default_mock_critique_payload() returns checks: [] for light robustness and the filtered standard check IDs for standard robustness. Also confirmed handle_critique() derives expected_ids from checks_for_robustness() and passes them into validate_critique_checks()."
},
{
"sense_check_id": "SC4",
"executor_note": "New light-mode and standard-mode validation coverage was added and passed in direct offline execution (tests/test_checks.py), and the adjusted critique-handler scenarios also passed under manual execution. I could not verify that the entire existing test suite passes because python -m pytest tests/ -x is blocked here: pytest is unavailable in the local interpreters and network-restricted installs fail."
}
]
}
M megaplan/_core/io.py
M megaplan/_core/registries.py
M megaplan/_core/state.py
M megaplan/checks.py
M megaplan/cli.py
M megaplan/evaluation.py
M megaplan/execution.py
M megaplan/handlers.py
M megaplan/hermes_worker.py
M megaplan/prompts/critique.py
M megaplan/prompts/planning.py
M megaplan/schemas.py
M megaplan/workers.py
M tests/test_megaplan.py
?? evals/
?? tests/test_checks.py
?? uv.lock
code
Requirements:
- Verify each success criterion explicitly.
- Trust executor evidence by default. Dig deeper only where the git diff, `execution_audit.json`, or vague notes make the claim ambiguous.
- Each criterion has a `priority` (`must`, `should`, or `info`). Apply these rules:
- `must` criteria are hard gates. A `must` criterion that fails means `needs_rework`.
- `should` criteria are quality targets. If the spirit is met but the letter is not, mark `pass` with evidence explaining the gap. Only mark `fail` if the intent was clearly missed. A `should` failure alone does NOT require `needs_rework`.
- `info` criteria are for human reference. Mark them `waived` with a note — do not evaluate them.
- If a criterion (any priority) cannot be verified in this context (e.g., requires manual testing or runtime observation), mark it `waived` with an explanation.
- Set `review_verdict` to `needs_rework` only when at least one `must` criterion fails or actual implementation work is incomplete. Use `approved` when all `must` criteria pass, even if some `should` criteria are flagged.
- The decisions listed above were settled at the gate stage. Verify that the executor implemented each settled decision correctly. Flag deviations from these decisions, but do not question the decisions themselves.
- Cross-reference each task's `files_changed` and `commands_run` against the git diff and any audit findings.
- Review every `sense_check` explicitly and treat perfunctory acknowledgments as a reason to dig deeper.
- Follow this JSON shape exactly:
```json
{
"review_verdict": "approved",
"criteria": [
{
"name": "All existing tests pass",
"priority": "must",
"pass": "pass",
"evidence": "Test suite ran green — 42 passed, 0 failed."
},
{
"name": "File under ~300 lines",
"priority": "should",
"pass": "pass",
"evidence": "File is 375 lines — above the target but reasonable given the component's responsibilities. Spirit met."
},
{
"name": "Manual smoke tests pass",
"priority": "info",
"pass": "waived",
"evidence": "Cannot be verified in automated review. Noted for manual QA."
}
],
"issues": [],
"rework_items": [],
"summary": "Approved. All must criteria pass. The should criterion on line count is close enough given the component scope.",
"task_verdicts": [
{
"task_id": "T6",
"reviewer_verdict": "Pass. Claimed handler changes and command evidence match the repo state.",
"evidence_files": ["megaplan/handlers.py", "megaplan/evaluation.py"]
}
],
"sense_check_verdicts": [
{
"sense_check_id": "SC6",
"verdict": "Confirmed. The execute blocker only fires when both evidence arrays are empty."
}
]
}
```
- `rework_items` must be an array of structured rework directives. When `review_verdict` is `needs_rework`, populate one entry per issue with:
- `task_id`: which finalize task this issue relates to
- `issue`: what is wrong
- `expected`: what correct behavior looks like
- `actual`: what was observed
- `evidence_file` (optional): file path supporting the finding
- `issues` must still be populated as a flat one-line-per-item summary derived from `rework_items` (for backward compatibility). When approved, both `issues` and `rework_items` should be empty arrays.
- When the work needs another execute pass, keep the same shape and change only `review_verdict` to `needs_rework`; make `issues`, `rework_items`, `summary`, and task verdicts specific enough for the executor to act on directly.
{"review_verdict":"needs_rework","criteria":[{"name":"CritiqueCheckSpec TypedDict includes a 'tier' field and all 8 checks are tagged as 'core' or 'extended'","priority":"must","pass":"pass","evidence":"CritiqueCheckSpec now includes tier at megaplan/checks.py:11-17, and all 8 CRITIQUE_CHECKS entries are tagged across megaplan/checks.py:20-117 with the settled 4 core / 4 extended split."},{"name":"checks_for_robustness('heavy') returns all 8 checks","priority":"must","pass":"pass","evidence":"checks_for_robustness() returns CRITIQUE_CHECKS for heavy at megaplan/checks.py:138-143. Direct verification returned length 8."},{"name":"checks_for_robustness('standard') returns exactly 4 core checks: issue_hints, correctness, scope, verification","priority":"must","pass":"pass","evidence":"checks_for_robustness() returns the derived core tuple for non-heavy/non-light at megaplan/checks.py:121-143. Direct verification and tests/test_checks.py:23-35 confirm the IDs are issue_hints, correctness, scope, verification."},{"name":"checks_for_robustness('light') returns empty tuple","priority":"must","pass":"pass","evidence":"checks_for_robustness() returns () for light at megaplan/checks.py:141-142. Direct verification returned an empty tuple."},{"name":"_critique_prompt() for light mode instructs model to return checks: [] and use flags array for general review","priority":"must","pass":"pass","evidence":"Light-mode prompt text now says Return checks: [] and put concerns in `flags` at `megaplan/prompts/critique.py:100-111` and `megaplan/prompts/critique.py:225-229`. Generated prompt output contains that text and no structured-check block."},{"name":"_critique_prompt() for standard mode renders only the 4 core checks","priority":"must","pass":"pass","evidence":"`_critique_prompt()` computes `active_checks = checks_for_robustness(robustness)` and renders only those via `_render_critique_checks(active_checks)` at `megaplan/prompts/critique.py:202-220` and `megaplan/prompts/critique.py:260-262`. Generated standard prompt included `issue_hints` and excluded `all_locations`."},{"name":"validate_critique_checks() with empty expected_ids rejects payloads that contain stray checks","priority":"must","pass":"pass","evidence":"`validate_critique_checks()` treats any check ID outside `expected_ids` as invalid at `megaplan/checks.py:183-218`; with `expected_ids=[]`, direct verification returned `['issue_hints']` for a stray check. Coverage exists at `tests/test_checks.py:64-67`."},{"name":"validate_critique_checks() with empty expected_ids returns [] for payloads with checks: []","priority":"must","pass":"pass","evidence":"With `expected_ids=[]` and `checks=[]`, direct verification returned `[]`. Coverage exists at `tests/test_checks.py:60-61`."},{"name":"_default_mock_critique_payload() uses filtered checks matching the plan's robustness level","priority":"must","pass":"pass","evidence":"Mock critique payloads now derive `active_checks = checks_for_robustness(configured_robustness(state))` and build from that at `megaplan/workers.py:348-352`. Direct verification returned `[]` for light mode and the 4 core IDs for standard mode."},{"name":"Test monkeypatch lambdas at test_megaplan.py:693,704 updated to accept keyword args","priority":"must","pass":"pass","evidence":"The critique-handler monkeypatches now accept `**kwargs` at `tests/test_megaplan.py:693-697` and `tests/test_megaplan.py:708-712`."},{"name":"All tests pass after all changes are applied (existing tests updated where needed)","priority":"must","pass":"fail","evidence":"`python -m pytest tests/ -q` is not green in the current tree: 411 passed, 1 failed. The failing test is `tests/test_schemas.py::test_review_schema_requires_task_and_sense_check_verdicts`, where `tests/test_schemas.py:183` still expects `evidence_file` to be optional but `megaplan/schemas.py:389` now requires it."},{"name":"Single code path: CRITIQUE_CHECKS remains the sole source of truth, checks_for_robustness just filters","priority":"must","pass":"pass","evidence":"The robustness logic is centralized in `checks_for_robustness()` at `megaplan/checks.py:138-143`, and prompt/handler/mock callers all consume filtered checks from that path (`megaplan/prompts/critique.py:202-262`, `megaplan/handlers.py:648-653`, `megaplan/workers.py:351-352`). `_CORE_CRITIQUE_CHECKS` is derived from `CRITIQUE_CHECKS`, not a second manual registry."},{"name":"Unit tests cover checks_for_robustness, filtered validate_critique_checks (including light-mode enforcement), and filtered build_empty_template","priority":"should","pass":"pass","evidence":"`tests/test_checks.py:23-67` covers heavy/standard/light filtering, filtered template generation, filtered validation, and light-mode stray-check rejection."},{"name":"Prompt text for each robustness level reads naturally","priority":"should","pass":"pass","evidence":"Generated prompts read naturally: standard says `Fill in ALL 4 checks below`, while light says `General review only for this robustness level. Return `checks: []. No Fill in ALL 0 checks text remains."},{"name":"No new files created — all changes in existing modules","priority":"should","pass":"fail","evidence":"This target was missed. tests/test_checks.py is a new file in the diff/worktree."}],"issues":["T4: full-suite verification is still red in the current tree; python -m pytest tests/ -q fails in tests/test_schemas.py::test_review_schema_requires_task_and_sense_check_verdicts because the review schema and schema test disagree on whether evidence_file is required."],"rework_items":[{"task_id":"T4","issue":"The required full-suite verification is not passing in the current tree.","expected":"python -m pytest tests/ -q should complete green after the critique-filtering changes are applied.","actual":"The suite stops with 1 failure in tests/test_schemas.py::test_review_schema_requires_task_and_sense_check_verdicts; tests/test_schemas.py:183 expects evidence_file to remain optional, but megaplan/schemas.py:389 requires it.","evidence_file":"tests/test_schemas.py"}],"summary":"Needs rework. The critique-filtering implementation itself meets the functional criteria, the settled decisions were implemented correctly, and the targeted changed-module tests pass. Approval is blocked by one unmet must criterion: the full tests/ suite is still red in the current tree. There is also a should-level miss because the change introduced a new tests/test_checks.py file despite the no-new-files target.","task_verdicts":[{"task_id":"T1","reviewer_verdict":"Pass. The registry change matches the plan: tier was added, the 4 core and 4 extended tags match the settled decision, and robustness filtering is implemented from the shared check registry.","evidence_files":["megaplan/checks.py"]},{"task_id":"T2","reviewer_verdict":"Pass. Prompt rendering now accepts a filtered check list, standard mode renders only core checks, and light mode explicitly instructs checks: [] with general-review-only guidance.","evidence_files":["megaplan/prompts/critique.py"]},{"task_id":"T3","reviewer_verdict":"Pass. handle_critique() derives expected_ids from robustness before validation, and mock critique payloads use the same filtered check set, including checks: [] for light mode.","evidence_files":["megaplan/handlers.py","megaplan/workers.py"]},{"task_id":"T4","reviewer_verdict":"Needs follow-up. The monkeypatch signatures and new coverage are in place, and python -m pytest tests/test_checks.py tests/test_megaplan.py -q passed (175 passed), but the task requirement to run the full suite until all pass is not met because python -m pytest tests/ -q still fails once elsewhere in the tree.","evidence_files":["tests/test_megaplan.py","tests/test_checks.py","tests/test_schemas.py","megaplan/schemas.py"]}],"sense_check_verdicts":[{"sense_check_id":"SC1","verdict":"Confirmed. Code and direct verification show the 4 core / 4 extended split and correct heavy/standard/light outputs."},{"sense_check_id":"SC2","verdict":"Confirmed. Generated prompts show only the 4 core checks in standard mode and explicit checks: [] guidance in light mode, with no Fill in ALL 0 checks text."},{"sense_check_id":"SC3","verdict":"Confirmed. handle_critique() passes filtered expected_ids, and _default_mock_critique_payload() returns [] for light and the 4 core IDs for standard."},{"sense_check_id":"SC4","verdict":"Not confirmed. The new robustness/validation coverage exists and targeted tests pass, but the full tests/ suite is not green because tests/test_schemas.py::test_review_schema_requires_task_and_sense_check_verdicts still fails."}]}
“Review the implementation against the success criteria. Project directory:….” Conversation with gpt-5.4, from the Peter O’Mallet DataClaw Conversations dataset. The Chat Archive, 2026. https://thechatarchive.com/c/01m80eq0w7d9qw00rsav06mnme