Lift Standard Review Quality via Mechanical Pre-checks, Flag Re-verification, and Critique Re-tiering
Context
Megaplan has three robustness modes: light, standard, heavy. Heavy mode just shipped a new parallel run_parallel_review with 4 focused LLM checks + mechanical pre-checks. Standard mode still runs a single _review_prompt() call that anchors to finalize.json (what the plan said to do), not the original issue. We've validated that the questions standard mode SHOULD be asking are already present in the critique phase (megaplan/checks.py) but are gated to extended tier or run only against the plan, not the post-execute diff.
This plan is a targeted, cheap lift of standard mode quality. No new LLM calls in standard mode. Light mode stays exactly as today. Heavy mode mechanical pre-checks are preserved.
Goal
Three changes that make standard-mode critique and review materially more thorough without adding API cost:
Run mechanical pre-checks in both standard and heavy review, not only heavy. Attach as context in standard; auto-block clear failures.
Add a "re-verify critique flags against the final diff" section to the standard _review_prompt() so the single review call re-checks whether pre-execute concerns were actually resolved by the post-execute code.
Re-tier critique checks: promote all_locations and callers from extended to core, demote criteria_quality from extended-core ordering (or remove from core if it's there). Standard-mode critique becomes substantially more thorough at zero extra cost per check since it's a swap, not an addition.
What exists today (don't break)
megaplan/handlers.py::handle_review — branches on robustness. Standard path runs the legacy single-call worker. Heavy path calls run_pre_checks then run_parallel_review. The heavy branch at ~line 1251 calls run_pre_checks(plan_dir, state, Path(state["config"]["project_dir"])).
megaplan/review_mechanical.py::run_pre_checks — returns a list of advisory flag dicts. Runs instantly (no LLM). Safe to call multiple times.
— the single-call standard review prompt. Produces criteria/task_verdicts/sense_check_verdicts/review_verdict/rework_items. Must stay byte-identical in light mode but can gain new sections in standard mode.
Assistant
megaplan/prompts/review.py::_review_prompt
megaplan/checks.py::CRITIQUE_CHECKS — 8 critique checks with tier in {"core", "extended"}. Standard robustness runs core only via checks_for_robustness("standard"). Heavy runs all 8.
megaplan/_core/flags.py (or wherever flag registry lives) — the flag registry with open/verified/disputed status per flag. Already accessible from review.
.megaplan/schemas/review.json and megaplan/schemas.py — review schema. Already widened in the previous robust-review megaplan to accept pre_check_flags. The standard review payload must remain backward compatible.
What needs to exist
1. Run mechanical pre-checks in standard mode too
In megaplan/handlers.py::handle_review, move the run_pre_checks(plan_dir, state, Path(state["config"]["project_dir"])) call out of the heavy branch and run it unconditionally before both the standard and heavy review paths.
For heavy: keep the existing flow — pre_check_flags becomes the input to run_parallel_review, gets merged into merged_payload["pre_check_flags"].
For standard: after run_pre_checks returns, filter for blocking flags (clear failures like source_touch reporting a test-only diff, or dead_guard_static reporting an unreachable guard in a new source branch). If any blocking flag exists, short-circuit: write a minimal review.json with review_verdict="needs_rework", populate rework_items with one entry per blocking mechanical flag, set pre_check_flags to the full list, and skip the LLM review call entirely. This is a free auto-block.
For standard with no blocking mechanical flags: attach pre_check_flags to the existing review payload as context for the single review call. Pass them into _review_prompt as an extra block so the LLM can see them when scoring criteria. Populate payload["pre_check_flags"] from the returned worker result.
Light mode: do NOT run mechanical pre-checks. Light mode stays exactly as today.
Decide which pre-check findings are "blocking" via a helper:
source_touch with severity significant and "only touches test-like files" detail → blocking
dead_guard_static with UNREACHABLE in the id → blocking (requires a new severity tier or id marker since current implementation only reports parse failures)
diff_size_sanity → never blocking (advisory only)
If the distinction is hard to make cleanly, the simpler alternative is: in standard mode, all mechanical flags are advisory only and attached as prompt context; no auto-blocking. Auto-blocking can come in a later PR. Implementer's call — pick the simpler option if the blocking logic requires more than a single-function helper.
2. Re-verify critique flags against final diff in standard review
In megaplan/prompts/review.py::_review_prompt, add a new section between the existing requirements block and the JSON shape spec. The new section should:
Read the flag registry via load_flag_registry(plan_dir).
Filter for flags with status open, verified, or disputed (not resolved).
For each such flag, include its id, concern text, severity, and current status in the prompt.
Instruct the model: "For each flag below that was raised during critique, verify whether the final diff actually addresses the concern. A flag is resolved if the final diff contains code that directly addresses the concern. If a flag is not resolved in the final diff, add a rework_item referencing the flag id and explaining what's still missing. Do not trust pre-execute promises — check the diff itself."
The output rework_items gain a new optional field flag_id pointing to the critique flag id. Existing source field should be set to "review_flag_reverify" for any rework item synthesized this way.
Schema impact: add optional flag_id field to rework_items shape in both .megaplan/schemas/review.json and megaplan/schemas.py. Keep it optional so existing payloads still validate.
The new prompt section only runs if there are open/verified/disputed flags in the registry; if the registry is empty or all resolved, the section is omitted entirely (keeps the standard prompt byte-identical for plans without critique flags, which is important for the existing byte-identical regression test in tests/test_handle_review_robustness.py).
This must not change light mode. Light mode doesn't run critique at all and has no flag registry, so a "no flags → no section" gate handles this automatically.
3. Re-tier critique checks
In megaplan/checks.py, in CRITIQUE_CHECKS:
Promote all_locations from tier="extended" to tier="core".
Promote callers from tier="extended" to tier="core".
Demote criteria_quality from tier="core" to tier="extended" (if it's core — verify first). The reasoning: criteria_quality is about whether success criteria are well-formed, which is plan hygiene. all_locations and callers are about whether the plan actually solves the bug, which is more important for standard mode.
This is a net-zero change in number of checks per mode:
Standard robustness was running 4 core checks, will still run 4 (swap criteria_quality out, swap all_locations in). Net neutral, and if callers is also promoted, standard gains one check — verify against the brief's "no new cost per check" claim and either: (a) accept a 1-check increase in standard (minor cost bump), or (b) also demote one more current core check to keep count at 4. The simpler choice is (a) — 5 core checks in standard is fine.
Heavy robustness is unchanged in total count (still 8 checks, same set, just different tier labels).
Update megaplan/checks.py:140-144 (or wherever the checks_for_robustness() function lives) — no code change should be needed since it filters by tier; only the tier labels on the check entries change.
Update any tests that assert the specific set of core checks to match the new tiering.
4. Tests
tests/test_handle_review_robustness.py:
Add a test that standard mode calls run_pre_checks before the single review worker.
Add a test that standard mode with a blocking mechanical flag (if auto-blocking is implemented) short-circuits and writes a needs_rework review.json without calling the worker.
Add a test that standard mode with no blocking mechanical flags attaches pre_check_flags to the payload.
The existing byte-identical standard-mode fixture test should either continue passing (if no flag registry present) or be updated to expect the new pre_check_flags key in the payload. Pick whichever is less churn; document the choice in the test docstring.
tests/test_prompts.py:
Add a grep-assertion test that _review_prompt output includes the flag-reverify section when a fixture flag registry has open flags.
Add a symmetric test that the section is absent when the registry is empty (byte-identical backward compat).
tests/test_checks.py:
Update the expected core/extended tier sets to match the new tiering.
Assert all_locations and callers are in core.
Assert criteria_quality is in extended.
tests/test_schemas.py:
Add a test case for rework_items[].flag_id (optional string).
Regression: full suite should still pass. Critically: tests/test_parallel_critique.py, tests/test_parallel_review.py, tests/test_handle_review_robustness.py, tests/test_review_checks.py, tests/test_review_mechanical.py.
Out of scope
Any changes to run_parallel_review, review_checks.py, or review_mechanical.py internals.
Any changes to heavy mode behavior beyond preserving the existing pre-check plumbing.
Any changes to light mode.
New LLM-based checks.
Changes to critique check guidance text.
Auto-blocking in standard mode based on mechanical flags — implement if easy, skip if not.
Success criteria
Standard mode runs run_pre_checks and attaches pre_check_flags to its review payload.
Standard mode's review prompt includes a flag-reverify section when open critique flags exist.
all_locations and callers are now core-tier critique checks.
Light mode review is byte-identical to today.
Heavy mode review is unchanged in structure.
All existing tests pass; new tests for the three changes pass.
No new LLM calls are added to standard mode — the changes are: (a) mechanical pre-checks (free), (b) a prompt section (no new call), (c) check re-tiering (swap, not add).
.megaplan/schemas/review.json — optional flag_id in rework_items
megaplan/schemas.py — mirror the schema change
tests/test_handle_review_robustness.py — new tests
tests/test_prompts.py — new grep-assertions
tests/test_checks.py — updated tier assertions
tests/test_schemas.py — flag_id schema test
code
Plan:
# Implementation Plan: Lift Standard Review Quality via Pre-checks, Flag Re-verification, and Critique Re-tiering
Overview
Three cheap, additive changes to standard robustness review. No new LLM calls:
Run run_pre_checks in standard review (currently heavy-only) and attach pre_check_flags as prompt context + payload field. No auto-blocking (see assumptions — taking the simpler option the brief permits).
Extend _review_prompt() with an optional flag re-verification section that lists open/verified/disputed critique flags from the registry and instructs the model to re-check them against the post-execute diff. Gated on registry state so light mode and empty-registry plans are byte-identical.
Re-tier CRITIQUE_CHECKS in megaplan/checks.py: promote all_locations and callers to core, demote criteria_quality to extended. Net effect: standard critique swaps criteria_quality out and gains all_locations + callers (core count 4 → 5). Heavy unchanged (still all 8).
Light mode review must stay byte-identical: it doesn't run critique (checks_for_robustness("light") == ()) and has no flag registry, so the new prompt section is naturally gated off. The pre-check call is explicitly skipped for light.
Key constraint from repo: review.json schema already accepts pre_check_flags (see megaplan/schemas.py:394), so standard payloads just need to populate it. rework_items needs a new optional flag_id field.
Confirmed in megaplan/handlers.py:1161 that handle_review branches: standard/light → worker_module.run_step_with_worker("review", …) and writes review.json at :1167; heavy → runs run_pre_checks at :1251 then run_parallel_review.
Confirmed_review_prompt lives at megaplan/prompts/review.py:391 with latest_plan, finalize_data, gate, etc. blocks and a Requirements + JSON-shape section. load_flag_registry already imported at megaplan/prompts/review.py:18.
Confirmed current tier labels in megaplan/checks.py:20-119: core = issue_hints, correctness, scope, verification; extended = all_locations, callers, conventions, criteria_quality. Target end state: core = issue_hints, correctness, scope, verification, all_locations, callers (5); extended = conventions, criteria_quality (2... wait — brief says demote criteria_quality from core, but it's already extended — see assumptions).
Confirmedreview.json schema already has pre_check_flags at megaplan/schemas.py:394-407. rework_items entries at :424-438 have required: ["task_id", "issue", "expected", "actual", "evidence_file"] — add optional flag_id and source remains optional. Note source is already optional in the schema.
Editmegaplan/checks.py:67 — change "tier": "extended" → "tier": "core" on the all_locations entry.
Editmegaplan/checks.py:79 — change "tier": "extended" → "tier": "core" on the callers entry.
Verifycriteria_quality already has tier="extended" at :117 — no change needed (brief was unsure; confirmed it's already extended).
No other code changes: checks_for_robustness filters by label only, and _CORE_CRITIQUE_CHECKS is re-derived at import time from the updated entries.
Step 3: Add optional flag_id to review schema (megaplan/schemas.py, .megaplan/schemas/review.json)
Scope: Small
Editmegaplan/schemas.py:427-437 — add "flag_id": {"type": "string"} to rework_items.items.properties. Do NOT add to required; keep the existing required list untouched to preserve backward compat.
Edit.megaplan/schemas/review.json — mirror the same change (check if file exists; if so, update; otherwise note this file is generated and regenerate via whatever the repo's workflow is — verify by reading the file first).
Step 4: Thread pre-checks into standard review (megaplan/handlers.py, megaplan/workers.py if needed)
Scope: Medium
Importrun_pre_checks in megaplan/handlers.py (already imported for the heavy branch — confirm with a grep; reuse same import).
Refactorhandle_review around megaplan/handlers.py:1161:
After require_state(...) and before the robustness branching, compute:
python
pre_check_flags: list[dict[str, Any]] = []
if robustness in {"standard", "heavy"}:
pre_check_flags = run_pre_checks(plan_dir, state, Path(state["config"]["project_dir"]))
In the standard/light branch (megaplan/handlers.py:1161-1167): after worker.payload is obtained but beforeatomic_write_json(plan_dir / "review.json", worker.payload), attach worker.payload["pre_check_flags"] = pre_check_flags when robustness == "standard". Light mode stays empty-list-never-set to preserve byte-identical behavior (or, safer: don't touch worker.payload at all when robustness == "light").
In the heavy branch: replace the pre_check_flags = run_pre_checks(...) at :1251 with just using the already-computed value (or delete the top-level precompute and keep heavy's local call — pick whichever keeps the diff smaller; prefer reusing top-level).
Pass pre-check flags into the worker prompt for standard. The standard review worker uses _review_prompt via workers.py. Find where _review_prompt is called for the "review" step and thread pre_check_flags through as a new kwarg. (Step 5 adds the prompt section that consumes it.)
Expected call site: megaplan/prompts/review.py wrappers (heavy_review_prompt? or a standard wrapper) — locate via grep for _review_prompt(.
Add a new kwarg pre_check_flags: list[dict[str, Any]] | None = None to _review_prompt with a default of None so light/existing callers don't need updating.
Do not implement auto-blocking. The brief explicitly permits skipping it; keep the handler simple.
Step 5: Add flag re-verify + pre-check sections to _review_prompt (megaplan/prompts/review.py)
Scope: Medium
Add two new kwargs to _review_prompt at megaplan/prompts/review.py:391: pre_check_flags: list[dict[str, Any]] | None = None.
Inside_review_prompt, after computing finalize_data and before the return textwrap.dedent(...):
python
registry = load_flag_registry(plan_dir)
open_flags = [
f for f in registry.get("flags", [])
if f.get("status") in {"open", "verified", "disputed"}
]
flag_reverify_block = ""
if open_flags:
flag_reverify_block = textwrap.dedent(f"""
Critique flags to re-verify against the final diff:
{json_dump([{
"id": f.get("id"),
"concern": f.get("concern"),
"severity": f.get("severity") or f.get("severity_hint"),
"status": f.get("status"),
} for f in open_flags]).strip()}
For each flag above, verify whether the final diff actually addresses the concern.
A flag is resolved only if code in the diff directly addresses it. If it is not
resolved, add a `rework_items` entry with `flag_id` set to the flag id,
`source` set to `"review_flag_reverify"`, and a clear description of what is
still missing. Do not trust pre-execute promises — check the diff.
""").strip()
pre_check_block = ""
if pre_check_flags:
pre_check_block = textwrap.dedent(f"""
Advisory mechanical pre-check flags (advisory context — copy verbatim into `pre_check_flags` in the output):
{json_dump(pre_check_flags).strip()}
""").strip()
Injectflag_reverify_block and pre_check_block into the f-string between settled_decisions_block and Execution summary: (or before Requirements: — pick a stable spot). Use empty-string fallback so byte-identical behavior is preserved when both blocks are empty.
Critical: when both blocks are "", the rendered prompt must be byte-identical to today's. Use conditional concatenation rather than always inserting separator blank lines around an empty slot. Simplest: only include a \n\n{block} line if the block is non-empty. Verify by diffing the output against a fixture in tests.
Update the Requirements/JSON-shape section docs to mention the optional flag_id and source fields on rework_items — but only inline with the rework_items bullet near :504. Keep this compact.
tests/test_checks.py (find/create if missing — grep first): update any assertion on core-tier ids to include all_locations and callers; assert criteria_quality is extended.
tests/test_schemas.py: add a case that a review.json payload with rework_items[].flag_id validates; and that one without it still validates (backward compat).
tests/test_prompts.py: add two tests around _review_prompt:
With a fixture flag_registry.json containing an open flag, the rendered prompt contains "Critique flags to re-verify" and the flag id.
With an empty registry (or all resolved), the rendered prompt does NOT contain that string and is byte-identical to the current fixture (use existing fixture comparison if present; otherwise snapshot current output once and compare).
Add a test that passing pre_check_flags=[{...}] inserts the advisory block and omits it when None/[].
tests/test_handle_review_robustness.py:
Add a test that in standard mode, run_pre_checks is called (monkeypatch to a sentinel list) and the resulting review.json has pre_check_flags equal to that sentinel.
Add a test that in light mode, run_pre_checks is not called and review.json does not gain a pre_check_flags key (i.e., byte-identical to today's light behavior). Use monkeypatch with a failing stub to assert non-call.
Keep existing heavy-mode tests passing (should be unaffected; the computed-at-top-of-function refactor must still pass the same list into heavy).
"version": 1,
"timestamp": "2026-04-08T00:17:06Z",
"hash": "sha256:d4d47613a758f5c729b287a8ee5aa83a803d08cff237e0205801e53804c0fada",
"questions": [
"Should standard-mode pre_check_flags also participate in update_flags_after_review, or remain advisory-only and never become tracked flag-registry entries? (Heavy mode currently doesn't add them to the registry either \u2014 assuming advisory-only is correct for parity.)",
"For the byte-identical light-mode guarantee, is it acceptable to add pre_check_flags = [] unconditionally to the standard payload (a one-key delta) or must standard be unchanged too when no flags are present? Brief permits the added key; confirming it's fine.",
"criteria_quality is already tier="extended" in the current code (the brief was unsure). Confirming no demotion action is needed \u2014 correct?",
"The heavy branch currently calls run_pre_checks inside the try block at handlers.py:1251. Should I hoist it above both branches (my plan), or keep heavy's call in place and add a separate standard-only call? Hoisting is cleaner but slightly expands the heavy refactor surface.",
"Is there an existing standard-mode prompt fixture / snapshot test that compares byte output of _review_prompt? If yes, updating it is trivial; if no, I'll add a minimal snapshot to lock the byte-identical contract for empty-registry cases."
],
"success_criteria": [
{
"criterion": "checks_for_robustness(\"standard\") returns a tuple containing all_locations and callers and not containing criteria_quality",
"priority": "must"
},
{
"criterion": "checks_for_robustness(\"heavy\") still returns all 8 checks (unchanged set)",
"priority": "must"
},
{
"criterion": "checks_for_robustness(\"light\") returns () (unchanged)",
"priority": "must"
},
{
"criterion": "In standard-mode handle_review, run_pre_checks is invoked and the resulting flags are attached to review.json under the key pre_check_flags",
"priority": "must"
},
{
"criterion": "In light-mode handle_review, run_pre_checks is NOT invoked and the resulting review.json is byte-identical to current behavior",
"priority": "must"
},
{
"criterion": "In heavy-mode handle_review, review.json still contains merged checks, pre_check_flags, verified_flag_ids, disputed_flag_ids with the same shape as today",
"priority": "must"
},
{
"criterion": "_review_prompt output is byte-identical to the pre-change output when the flag registry has no open/verified/disputed flags AND pre_check_flags is None/empty",
"priority": "must"
},
{
"criterion": "_review_prompt output contains a "Critique flags to re-verify" section and each open flag's id when the registry has open flags",
"priority": "must"
},
{
"criterion": "review.json schema accepts rework_items[].flag_id (optional string) and payloads omitting flag_id still validate",
"priority": "must"
},
{
"criterion": "No new LLM calls are introduced in the standard-mode review path (verified by reading handler code \u2014 still exactly one worker call to the standard review prompt)",
"priority": "must"
},
{
"criterion": "All existing tests pass after the change (pytest -x)",
"priority": "must"
},
{
"criterion": "New tests added for: tier re-labeling, flag_id schema, prompt section presence/absence, and standard-mode pre-check wiring",
"priority": "must"
},
{
"criterion": "Handler diff stays proportional \u2014 no broad refactor of handle_review beyond hoisting the pre-check call and adding the standard-mode payload attachment",
"priority": "should"
},
{
"criterion": "Flag re-verify prompt block omitted entirely (no blank line artifacts) when no open flags, so byte-equality holds without whitespace tricks",
"priority": "should"
},
{
"criterion": "Auto-blocking on mechanical flags in standard mode is deliberately deferred (per brief's simpler-option permission) and noted in a short comment",
"priority": "info"
}
],
"assumptions": [
"Taking the brief's 'simpler option' \u2014 standard-mode mechanical flags are advisory only, no auto-block. This keeps the handler diff small and aligns with the 'implementer's call' guidance.",
"criteria_quality is already tier=\"extended\" in megaplan/checks.py:117 (confirmed by reading the file); no demotion action is actually needed. I'll note this in the step and skip the no-op edit.",
"Standard core critique will grow from 4 to 6 checks (issue_hints, correctness, scope, verification, all_locations, callers). This exceeds the brief's '5 is fine' stated acceptance but is the natural outcome of two promotions plus no demotion. Cost is still zero extra LLM calls beyond what each check would have cost in heavy.",
"Hoisting run_pre_checks above the branch is cleaner than duplicating the call; heavy-mode behavior remains unchanged because the same list is passed into run_parallel_review.",
"Light mode will not have any new keys added to its payload \u2014 the standard-mode pre_check_flags attachment is gated on robustness == \"standard\".",
"The flag-reverify prompt block is omitted entirely when there are no open/verified/disputed flags, so plans without critique history (e.g. first review iteration with an empty registry) keep byte-identical _review_prompt output. This is verified by an explicit test.",
"load_flag_registry in megaplan/_core/registries.py returns {\"flags\": []} when the registry file doesn't exist, so gating by open_flags list length is safe without file-existence checks.",
"The .megaplan/schemas/review.json JSON-schema file is the committed mirror of megaplan/schemas.py's review.json entry; I'll update both identically. If the JSON file is auto-generated I'll regenerate via whatever hook the repo uses (determined when editing).",
"Worker prompt wiring: _review_prompt is called via the workers.py review step; I'll locate the call site and thread pre_check_flags as a kwarg. If the worker infrastructure doesn't easily expose a way to pass extra context, I'll fall back to reading pre-check flags from a plan-dir scratch file written by the handler \u2014 but prefer the kwarg route."
],
"structure_warnings": []
}
code
Plan structure warnings from validator:
[]
Existing flags:
[]
Known accepted debt grouped by subsystem:
{
"are-the-proposed-changes-technically-correct": [
{
"id": "DEBT-009",
"concern": "are the proposed changes technically correct?: the mobile action-surface plan is technically incorrect for the current component structure. submissioncarouselcard hides footercontent below the md breakpoint (src/components/submissioncarouselcard.tsx:219), while submissionscarouselpage also hides the score panel on mobile via asidecontent={<div classname=\"hidden md:block\">... and passes hideactions to scorepanel at src/pages/submissionscarouselpage.tsx:250-263,347. reusing that pattern for entrypage would leave mobile users with no navigation controls and no scoring controls.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-010",
"concern": "are the proposed changes technically correct?: i checked the sign-in callback path again. submissionslayout already wires usescoring(..., { onrequiresignin: () => pagemachine.dispatch({ type: 'open_sign_in_modal' }) }) at src/pages/submissionslayout.tsx:38-40, and scorepanel still has its own onrequiresignin prop. the revised step 4.2 is acceptable only if it explicitly rewires that prop to pagemachine.dispatch; otherwise removing local modal state would orphan the direct ui callback. the plan hints at this, but it remains easy to misread because the scoring-context callback and the scorepanel prop are separate mechanisms.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-029",
"concern": "are the proposed changes technically correct?: checked the new diff-helper proposal against the repo's existing execution-evidence semantics. validate_execution_evidence() in megaplan/evaluation.py:109-175 uses git status --short, so untracked files count as real changed files today, but step 3 proposes collect_git_diff_patch(project_dir) via git diff head; by git behavior that will not include untracked files, so heavy review could miss exactly the newly created files that execute and review already treat as part of the patch.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
}
],
"are-the-success-criteria-well-prioritized-and-verifiable": [
{
"id": "DEBT-019",
"concern": "are the success criteria well-prioritized and verifiable?: mobile behavior is still under-prioritized relative to the actual risk in this repo. the user constraint specifically mentions the mobile bottom nav, but the only mobile-specific success criterion left is 'mobile scoring ux is coherent' at info level. given that the plan currently removes the working mobile nav, there should be at least a should or must criterion stating that mobile users retain navigation and scoring controls.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"criteria-prompt": [
{
"id": "DEBT-026",
"concern": "criteria prompt: v3 replaces _review_prompt() in heavy mode with a new heavy_criteria_review_prompt, so the plan no longer follows the brief's explicit requirement that _review_prompt() remain the heavy-mode criteria_verdict check.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
}
],
"did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements": [
{
"id": "DEBT-011",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: a new critical issue is introduced on mobile. step 4.9 says to remove entrypage's mobile sticky bottom nav and 'use the same footercontent slot in submissioncarouselcard', but src/components/submissioncarouselcard.tsx:217-221 renders footercontent inside classname=\"hidden md:block\". in the current repo, the mobile sticky nav at src/pages/entrypage.tsx:283-340 is the only mobile surface for back/next and the score toggle, so the revised plan would remove working mobile controls and replace them with a slot that is explicitly hidden on phones.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-012",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: the plan still contradicts itself on mobile behavior. assumption #3 says the browse-mode mobile score toggle will be preserved, but step 4.9 removes the entire mobile sticky nav that contains that toggle in src/pages/entrypage.tsx:314-330. the implementer cannot satisfy both instructions as written.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-028",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: checked step 7 against the brief's explicit prompt-builder requirement. the revision fixes the old context leak by introducing a brand-new heavy_criteria_review_prompt, but the brief said _review_prompt() should stay as-is and still run as the criteria_verdict check in heavy mode; v3 solves the problem by replacing that heavy-mode criteria path instead of reusing the baseline review prompt, which is still a material divergence from the requested design.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
}
],
"diff-capture": [
{
"id": "DEBT-027",
"concern": "diff capture: the proposed collect_git_diff_patch(project_dir) helper uses git diff head, which will miss untracked files even though the existing execution-evidence path already treats untracked files as real changed work.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
}
],
"does-the-change-touch-all-locations-and-supporting-infrastructure": [
{
"id": "DEBT-018",
"concern": "does the change touch all locations and supporting infrastructure?: if the implementation really wants footercontent to carry mobile actions, the plan must also include a supporting change in src/components/submissioncarouselcard.tsx or render a separate mobile control surface outside the card. right now step 4.9 removes the mobile nav but does not list submissioncarouselcard.tsx:217-221 as a place that must change, so the required glue for mobile controls is missing.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"execute-phase-contract": [
{
"id": "DEBT-003",
"concern": "early-killed baselines pass truncated output to the execute worker, which may produce lower-quality diagnosis than full output.",
"occurrence_count": 1,
"plan_ids": [
"design-and-implement-a-20260327-0512"
]
}
],
"find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them": [
{
"id": "DEBT-014",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: i checked the skip caller path against the real hook behavior and removefromqueue(entryid) looks redundant. scoring.skipentry(entryid) optimistically adds the id to skippedentryids in src/hooks/usescoring.ts:245-249, and usecarouselqueue already reactively filters skipped entries from submissions[] in src/hooks/usecarouselqueue.ts:154-165. calling removefromqueue() immediately afterward is safe, but it duplicates an existing state transition and should be justified as an explicit ux optimization rather than required logic.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-015",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: the direct ui sign-in caller is still important here. scorepanel invokes its own onrequiresignin prop when an unauthenticated user interacts with the score ui (src/components/scorepanel.tsx:499-515), which is independent of the scoring hook's internal requireauth() path. the plan should be read as requiring that caller to dispatch open_sign_in_modal; otherwise one caller remains broken even if submitscore() is correctly wired.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"handler-boilerplate": [
{
"id": "DEBT-004",
"concern": "_run_worker() pseudocode hardcodes iteration=state['iteration'] but handle_plan and handle_revise use different failure iteration values.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-005",
"concern": "same issue as correctness-1: failure iteration would be wrong for plan/revise handlers.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
}
],
"install-paths": [
{
"id": "DEBT-023",
"concern": "local setup path doesn't expose subagent mode",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
},
{
"id": "DEBT-024",
"concern": "no automated guard to keep the mirror file synchronized with source files",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
},
{
"id": "DEBT-025",
"concern": "local setup test only checks agents.md existence, not content",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
}
],
"is-there-convincing-verification-for-the-change": [
{
"id": "DEBT-016",
"concern": "is there convincing verification for the change?: the test-plan details still miss a small but real infrastructure update: the current locationdisplay helper in src/pages/submissionscarouselpage.test.tsx:289-291 only renders location.pathname, so the step 7 requirement to assert { state: { carousel: true, navdirection: 'forward' } } cannot be implemented unless that helper is extended to expose location.state. the same pattern exists in the related page tests.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-017",
"concern": "is there convincing verification for the change?: there is still no explicit mobile regression test in the plan, even though the revised implementation proposal removes the only current mobile nav/score surface. given the repository's actual component structure, a mobile-focused test or visual verification step is needed to prove controls remain accessible below md.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"mobile-ui": [
{
"id": "DEBT-020",
"concern": "mobile ui: removing entrypage's mobile sticky nav and relying on submissioncarouselcard.footercontent would break mobile navigation and scoring because that footer slot is hidden below the md breakpoint.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader": [
{
"id": "DEBT-013",
"concern": "search for related code that handles the same concept. is the reported issue a symptom of something broader?: the mobile problem is broader than entrypage. submissionscarouselpage already has a pre-existing mobile gap because its score panel is desktop-only and its footer actions are also hidden on mobile (src/pages/submissionscarouselpage.tsx:250-263,347-354 plus src/components/submissioncarouselcard.tsx:219). the revised plan says entrypage should 'match the carouselpage pattern', which would spread that existing gap into the one page that currently has working mobile controls.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"subagent-safeguards": [
{
"id": "DEBT-021",
"concern": "hermes reference safeguard numbers not validated against actual implementation",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
},
{
"id": "DEBT-022",
"concern": "plan's retry caps (1 phase, 3 execute) may differ from hermes-agent's actual policy",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
}
],
"worker-permissions": [
{
"id": "DEBT-001",
"concern": "codex --full-auto flag only triggers for step == 'execute', not 'loop_execute'",
"occurrence_count": 1,
"plan_ids": [
"build-megaloop-a-minimal-20260327-0250"
]
},
{
"id": "DEBT-002",
"concern": "claude --permission-mode bypasspermissions only triggers for step == 'execute', not 'loop_execute'",
"occurrence_count": 1,
"plan_ids": [
"build-megaloop-a-minimal-20260327-0250"
]
}
],
"workflow-state-machine": [
{
"id": "DEBT-006",
"concern": "_plan_prompt() does not read research.json, so replanning from state_researched would ignore research results.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-007",
"concern": "same issue as correctness-2: state_researched \u2192 plan path is only partially wired.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-008",
"concern": "_plan_prompt() is a missed location for the state_researched \u2192 plan change.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
}
]
}
code
Escalated debt subsystems:
[
{
"subsystem": "are-the-proposed-changes-technically-correct",
"total_occurrences": 3,
"plan_count": 2,
"entries": [
{
"id": "DEBT-009",
"concern": "are the proposed changes technically correct?: the mobile action-surface plan is technically incorrect for the current component structure. submissioncarouselcard hides footercontent below the md breakpoint (src/components/submissioncarouselcard.tsx:219), while submissionscarouselpage also hides the score panel on mobile via asidecontent={<div classname=\"hidden md:block\">... and passes hideactions to scorepanel at src/pages/submissionscarouselpage.tsx:250-263,347. reusing that pattern for entrypage would leave mobile users with no navigation controls and no scoring controls.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-010",
"concern": "are the proposed changes technically correct?: i checked the sign-in callback path again. submissionslayout already wires usescoring(..., { onrequiresignin: () => pagemachine.dispatch({ type: 'open_sign_in_modal' }) }) at src/pages/submissionslayout.tsx:38-40, and scorepanel still has its own onrequiresignin prop. the revised step 4.2 is acceptable only if it explicitly rewires that prop to pagemachine.dispatch; otherwise removing local modal state would orphan the direct ui callback. the plan hints at this, but it remains easy to misread because the scoring-context callback and the scorepanel prop are separate mechanisms.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-029",
"concern": "are the proposed changes technically correct?: checked the new diff-helper proposal against the repo's existing execution-evidence semantics. validate_execution_evidence() in megaplan/evaluation.py:109-175 uses git status --short, so untracked files count as real changed files today, but step 3 proposes collect_git_diff_patch(project_dir) via git diff head; by git behavior that will not include untracked files, so heavy review could miss exactly the newly created files that execute and review already treat as part of the patch.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
}
]
},
{
"subsystem": "did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements",
"total_occurrences": 3,
"plan_count": 2,
"entries": [
{
"id": "DEBT-011",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: a new critical issue is introduced on mobile. step 4.9 says to remove entrypage's mobile sticky bottom nav and 'use the same footercontent slot in submissioncarouselcard', but src/components/submissioncarouselcard.tsx:217-221 renders footercontent inside classname=\"hidden md:block\". in the current repo, the mobile sticky nav at src/pages/entrypage.tsx:283-340 is the only mobile surface for back/next and the score toggle, so the revised plan would remove working mobile controls and replace them with a slot that is explicitly hidden on phones.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-012",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: the plan still contradicts itself on mobile behavior. assumption #3 says the browse-mode mobile score toggle will be preserved, but step 4.9 removes the entire mobile sticky nav that contains that toggle in src/pages/entrypage.tsx:314-330. the implementer cannot satisfy both instructions as written.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-028",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: checked step 7 against the brief's explicit prompt-builder requirement. the revision fixes the old context leak by introducing a brand-new heavy_criteria_review_prompt, but the brief said _review_prompt() should stay as-is and still run as the criteria_verdict check in heavy mode; v3 solves the problem by replacing that heavy-mode criteria path instead of reusing the baseline review prompt, which is still a material divergence from the requested design.",
"occurrence_count": 1,
"plan_ids": [
"robust-review-v2"
]
}
]
},
{
"subsystem": "install-paths",
"total_occurrences": 3,
"plan_count": 2,
"entries": [
{
"id": "DEBT-023",
"concern": "local setup path doesn't expose subagent mode",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
},
{
"id": "DEBT-024",
"concern": "no automated guard to keep the mirror file synchronized with source files",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
},
{
"id": "DEBT-025",
"concern": "local setup test only checks agents.md existence, not content",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
}
]
},
{
"subsystem": "workflow-state-machine",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-006",
"concern": "_plan_prompt() does not read research.json, so replanning from state_researched would ignore research results.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-007",
"concern": "same issue as correctness-2: state_researched \u2192 plan path is only partially wired.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-008",
"concern": "_plan_prompt() is a missed location for the state_researched \u2192 plan change.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
}
]
}
]
code
Debt guidance:
- These are known accepted limitations. Do not re-flag them unless the current plan makes them worse, broadens them, or fails to contain them.
- Prefix every new concern with a subsystem tag followed by a colon, for example `Timeout recovery: retry backoff remains brittle`.
- When a concern is recurring debt that still needs to be flagged, prefix it with `Recurring debt:` after the subsystem tag, for example `Timeout recovery: Recurring debt: retry backoff remains brittle`.
Your output template is at: /Users/user_c042661f/Documents/megaplan/.megaplan/plans/standard-review-lift/critique_output.json
Review the plan with a broad scope. Consider whether the approach is correct, whether it covers
all the places it needs to, whether it would break callers or violate codebase conventions,
and whether its verification strategy is adequate.
Place any concrete concerns in the flags array in the template file using the standard format
(id, concern, category, severity_hint, evidence). Leave checks as an empty array.
Workflow: read the file → investigate → read file again → add findings → write file back.
code
Additional guidelines:
- Robustness level: light. Be pragmatic. Only flag issues that would cause real failures. Ignore style, minor edge cases, and issues the executor will naturally resolve.
- Over-engineering: prefer the simplest approach that fully solves the problem.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids`: list flag IDs from prior iterations that the revised plan actually resolves (e.g., if the plan was revised to fix FLAG-001, and you confirm the fix is correct, include "FLAG-001"). Only include flags you've verified — don't guess.
- Verify that the plan follows the expected structure when validator warnings or the outline suggest drift.
- Additional flags may use these categories: correctness, security, completeness, performance, maintainability, other.
- Focus on concrete issues, not structural formatting.
{"checks":[],"flags":[{"id":"FLAG-001","concern":"Flag re-verification: The proposed _review_prompt() filter only re-checks flags with status open, verified, or disputed, but this repo marks revised-yet-unverified critique flags as addressed. Omitting addressed means standard review would skip exactly the flags that revise claimed to fix, so the new diff-based re-verification would miss the main handoff state.","category":"correctness","severity_hint":"likely-significant","evidence":"update_flags_after_revise() sets matched flags to status = \"addressed\" in megaplan/flags.py:175-188, and FLAG_BLOCKING_STATUSES still treats addressed as unresolved in megaplan/types.py:248."},{"id":"FLAG-002","concern":"Flag lifecycle: The plan adds standard-mode flag re-verification prompts but does not persist the results back into faults.json. In the current repo only the heavy Hermes path calls update_flags_after_review(), so standard review would keep stale flag statuses across iterations and the new re-verification signal would not feed the registry.","category":"completeness","severity_hint":"likely-significant","evidence":"The standard/light branch of handle_review() only runs the worker and writes review.json at megaplan/handlers.py:1161-1167; only the heavy Hermes branch updates the registry via update_flags_after_review() at megaplan/handlers.py:1282-1284."},{"id":"FLAG-003","concern":"Critique cost: Promoting both all_locations and callers to core adds two standard-mode critique checks in this repo, because criteria_quality is already extended. Under Hermes, standard critique fans out one LLM run per active check, so this plan violates its own "no new LLM calls / zero extra cost" constraint.","category":"performance","severity_hint":"likely-significant","evidence":"criteria_quality is already tier = \"extended\" in megaplan/checks.py:106-117, so moving all_locations and callers from extended to core grows the standard set from 4 to 6 checks (megaplan/checks.py:20-119). Hermes critique parallelizes over active_checks in megaplan/handlers.py:710-717."},{"id":"FLAG-004","concern":"Verification: The test plan misses at least one existing regression file that will fail immediately after the tier change. Updating only tests/test_checks.py is not enough; tests/test_parallel_critique.py also hard-codes the current four-check standard set and will break when standard grows.","category":"completeness","severity_hint":"likely-significant","evidence":"tests/test_checks.py:33-39 asserts the current 4-check standard set, and tests/test_parallel_critique.py:118-120 hard-codes four verified flag ids. The proposed test changes do not mention tests/test_parallel_critique.py, even though the success criteria require the full suite to pass."}],"verified_flag_ids":[],"disputed_flag_ids":[]}