You are already running inside the megaplan harness for this step. Do the requested planning/review/execution work directly. Do NOT invoke the megaplan CLI, do NOT read or activate the megaplan skill, do NOT start nested megaplan plans, and do NOT recurse into another planning harness. Treat mentions of megaplan in the repository or environment as implementation context only.
You are an independent reviewer. Critique the plan against the actual repository.
Megaplan currently has no model of what an executor or reviewer can actually do. Specs with human-only criteria (browser observation, runtime counts) are handed to container agents, which fail at review — wasting a full execute pass. The M0 incident is the canonical example.
This release adds capability matching: workers declare what they can verify, criteria declare what they require, and the harness rejects mismatches at plan time. Four guardrails (closed registry, mandatory requires on must criteria, worker discovery, complementary pre-critique audit) address the failure modes identified in the critique and losses analysis.
Current state: v0.16.0. Success criteria in plan.json/revise.json/finalize.json are {criterion, priority} objects. Review verdict enum is pass | fail | waived. State machine has 9 states, no awaiting_human_verify. No capability concept exists anywhere.
Key files:
megaplan/schemas.py — JSON schemas for all step outputs
— states, TypedDicts, constants
Assistant
I'll review the plan against the actual codebase. Let me check the key files referenced.
Assistant
Now let me check the handlers and CLI for the specific lines referenced in the plan.
Assistant
Now let me check the chain driver and CLI for awaiting_human_verify handling.
Assistant
Now let me check the auto driver to understand how it determines terminal states.
Assistant
Let me check the auto driver's dispatch logic more carefully.
Assistant
Now I have the full picture. Let me write my findings.
Assistant
Three flags filed. The critical one is FLAG-001: the auto driver and chain driver have no code path to handle awaiting_human_verify — the plan adds the state and workflow transition but never touches auto.py, so automated runs will stall instead of cleanly stopping. The other two are minor completeness gaps in stub/light-mode paths.
megaplan/types.py
megaplan/_core/workflow.py — state machine transitions
Add"requires" to the finalize.json success_criteria pass-through (criteria flow from plan meta into finalize — trace through handlers.py:810).
Add"deferred_human" to the review.json criteria pass enum (megaplan/schemas.py:438): "enum": ["pass", "fail", "waived", "deferred_human"].
Step 3: Add awaiting_human_verify state (megaplan/types.py, megaplan/_core/workflow.py)
Scope: Small
AddSTATE_AWAITING_HUMAN = "awaiting_human_verify" to megaplan/types.py:21 and add it to TERMINAL_STATES conceptually — but it is NOT terminal. It blocks STATE_DONE until cleared.
UpdateTERMINAL_STATES to remain {STATE_DONE, STATE_ABORTED} — awaiting_human_verify is explicitly not terminal.
Update workflow in megaplan/_core/workflow.py:60-67: the STATE_EXECUTED review transition can now land in either STATE_DONE or STATE_AWAITING_HUMAN depending on review payload. Add a new entry:
Addworkers field to PlanConfig TypedDict (megaplan/types.py:28-33):
python
workers: NotRequired[dict[str, Any]]
Define worker config shape: each worker entry has verifies: list[str] (capability strings from the registry).
Implementget_worker_capabilities(state: PlanState) -> dict[str, set[str]] in megaplan/capabilities.py that reads state["config"].get("workers", {}) and falls back to DEFAULT_CONTAINER_CAPABILITIES for any agent in DEFAULT_AGENT_ROUTING and empty set for human_reviewer if not configured.
Implementunion_verifies(state: PlanState) -> set[str] that returns the union of all configured workers' verifies sets — this is what the plan-time assert checks against.
audit_criteria(criteria: list[dict], worker_caps: dict[str, set[str]]) -> list[CriterionAudit] — pure-Python check: for each criterion, verify set(criterion.get("requires", [])) ⊆ union_verifies. Return list of audit results with {criterion_idx, verdict, rationale, missing_caps}.
classify_criteria(criteria: list[dict], worker_caps: dict[str, set[str]]) -> tuple[list[dict], list[dict]] — split into machine-verifiable and human-deferred based on requires vs available capabilities.
Verdict enum: machine_verifiable, human_only, unverifiable_no_worker (requires caps no configured worker has, including human).
Implement plan-time validation: validate_requires(criteria, registry) checks all requires entries are known capability strings, and that must criteria have non-empty requires (empty only allowed with explicit opt-out — but for migration, empty is allowed with a deprecation warning).
Step 6: Wire audit into critique phase (megaplan/handlers.py, megaplan/checks.py)
Scope: Medium
Add a new critique check verifiability to megaplan/checks.py (tier: core, category: verifiability, severity: likely-significant).
Hook into handle_critique (megaplan/handlers.py:861): before the worker call, run audit_criteria from Step 5. Inject results as synthetic critique flags with category verifiability:
requires references unknown capability → blocking flag
must criterion with empty requires → advisory flag (deprecation notice)
requires not satisfiable by any configured worker AND no human_reviewer configured → blocking flag ("criterion unreachable: no worker can verify")
requires satisfiable only by human_reviewer → noted flag (informational, routes to pending-human at review)
These flags enter the existing gate→revise loop: blocking verifiability flags must be resolved (rewrite criterion, add requires, configure a worker) before PROCEED.
Step 7: Update review to handle deferred_human (megaplan/prompts/review.py, megaplan/handlers.py)
Scope: Medium
Update review prompt (megaplan/prompts/review.py:499-504): add instruction that criteria with requires not satisfiable by the reviewer's capabilities MUST be marked deferred_human, not fail or waived. The reviewer must NOT count deferred_human toward needs_rework.
Update_resolve_review_outcome (megaplan/handlers.py:1469-1512): if review verdict is approved but any must criterion has pass: "deferred_human", set next_state to STATE_AWAITING_HUMAN instead of STATE_DONE.
Update_merge_review_verdicts (megaplan/handlers.py:1421) and the criteria counting logic (handlers.py:1667) to recognize deferred_human as neither pass nor fail.
Update the review stub for tiny/light robustness (handlers.py:1395-1410): criteria with human-only requires get pass: "deferred_human" in the stub. If any exist, state goes to STATE_AWAITING_HUMAN.
Step 8: Add verify-human and audit-verifiability CLI commands (megaplan/cli.py, megaplan/handlers.py)
Scope: Medium
Addverify-human subcommand to CLI (megaplan/cli.py):
Args: --plan, --criterion (criterion name or index), --pass/--fail, --evidence (required string)
Handler: reads plan state, validates state is awaiting_human_verify, writes verification to plan_dir/human_verifications.json, transitions to STATE_DONE when all deferred must criteria are verified.
Addaudit-verifiability subcommand:
Args: --plan
Handler: runs audit_criteria on the plan's current criteria and prints results. No state change.
Addstatus --pending-human flag to list all plans in awaiting_human_verify state across the workspace (uses existing active_plan_dirs infrastructure).
Register both handlers in the dispatch table (megaplan/cli.py:966).
Update planning prompt (megaplan/prompts/planning.py:120): add instruction that success criteria should include requires: [cap1, cap2] listing the capabilities needed to verify them. Reference the capability registry. must criteria must have non-empty requires.
Update revise prompt (megaplan/prompts/critique.py:74-79): same instruction for criteria in revised plans.
Add one-line example in the prompt showing requires usage:
code
{"criterion": "All tests pass", "priority": "must", "requires": ["run_tests"]}
Phase 3: Migration, Tests, Release
Step 10: Migration path
Scope: Small
Defaultrequires: [] for existing plans — this is backward compatible (empty set ⊆ anything, so all existing criteria pass the subset check).
Add deprecation warning: when audit_criteria encounters a must criterion with requires: [], emit a noted flag: "Missing requires on must criterion — will become blocking in v0.18.0."
Schema validation is lenient: requires is optional with default []. No existing plan breaks.
Step 11: Tests (tests/test_verifiability.py, updates to existing tests)
Scope: Medium
Createtests/test_verifiability.py:
Capability registry: unknown capability rejected, known accepted
audit_criteria: criterion with requires: ["run_tests"] + container worker → machine_verifiable
audit_criteria: criterion with requires: ["drive_browser"] + container-only worker → human_only
audit_criteria: criterion with requires: ["drive_browser"] + no human_reviewer configured → unverifiable_no_worker
validate_requires: must criterion with empty requires → deprecation warning
classify_criteria: correct split into machine/human lists
Updatetests/test_schemas.py: round-trip test for requires field on success_criteria (present → preserved, absent → defaults to []).
Updatetests/test_megaplan.py: add fixture where review returns deferred_human on a criterion → state transitions to awaiting_human_verify instead of done.
Add verify-human test: plan in awaiting_human_verify, run verify-human with evidence → state transitions to done.
Verify all existing tests pass unchanged (migration default requires: [] means no behavioral change for legacy plans).
Step 12: Version bump and CHANGELOG (pyproject.toml, CHANGELOG.md)
Scope: Small
Bumppyproject.toml version from 0.16.0 to 0.17.0.
Add CHANGELOG entry:
code
## v0.17.0 — 2026-04-15
### Verifiability contracts
Success criteria now declare what capabilities are needed to verify them
(`requires: [cap1, cap2]`), and workers declare what they can verify
(`verifies: [cap1, cap2]`). The harness rejects plan-time mismatches —
no more burning a container run on specs that require a browser.
- **Capability registry**: closed set of mechanism-shaped primitives
in `megaplan/capabilities.py`. Unknown strings rejected at plan time.
- **Pre-critique verifiability audit**: `requires ⊆ union(verifies)`
check runs before critique. Failures become blocking critique flags
resolved through the existing gate→revise loop.
- **`deferred_human` review verdict**: criteria requiring human
verification are marked `deferred_human` by the reviewer, not
`fail`. Plans with deferred `must` criteria land in
`awaiting_human_verify` state instead of `done`.
- **`megaplan verify-human`**: CLI command to record human verification
evidence and transition plans from `awaiting_human_verify` to `done`.
- **`megaplan audit-verifiability`**: on-demand audit of plan criteria.
- **`megaplan status --pending-human`**: list plans awaiting human
verification across the workspace.
- **Migration**: existing plans default to `requires: []` (no
behavioral change). `must` criteria with empty `requires` emit a
deprecation notice — will become blocking in v0.18.0.
Steps 5–6 (audit): the core validation logic and its critique integration.
Steps 7–9 (review + prompts): downstream handling of human-deferred criteria.
Step 8 (CLI): can be done in parallel with 7 since it's a new command.
Steps 10–12 (migration, tests, release): after all logic is wired.
Validation Order
Run existing test suite after Step 2 (schema changes) to verify no regressions.
Run test_verifiability.py after Step 5.
Run full suite after Step 7 (review changes are highest-risk for regression).
Final full suite + manual megaplan audit-verifiability on a sample plan after Step 12.
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-04-15T10:34:37Z",
"hash": "sha256:c64ac96cc11283710c8228ce33439e0ea784828de5c5c757204d9f96dcea3940",
"questions": [
"The idea says 'branch verifiability-contracts off main' but the spec file says 'gate-verifiability' \u2014 which branch name?",
"Should requires be mandatory on must criteria immediately in v0.17.0 (blocking), or start as a deprecation warning that becomes blocking in v0.18.0? The losses doc recommends mandatory, but that breaks every existing plan's must criteria on first critique run.",
"The losses doc recommends worker discovery via config/workers.yml with a last_seen liveness policy. Should v0.17.0 include the liveness check, or is static config (workers in megaplan config) sufficient for now?",
"Should the chain driver (megaplan chain) be taught about awaiting_human_verify in v0.17.0? Currently loops skip non-terminal states. A plan stuck in awaiting_human_verify would stall the chain unless the driver treats it like a terminal-for-chain-purposes state."
],
"success_criteria": [
{
"criterion": "All existing tests pass unchanged \u2014 legacy plans with no requires field default to [] and behave identically to v0.16.0.",
"priority": "must"
},
{
"criterion": "megaplan/capabilities.py exists with a closed registry. validate_capabilities(['run_tests']) returns [] (no unknowns). validate_capabilities(['made_up_cap']) returns ['made_up_cap'].",
"priority": "must"
},
{
"criterion": "Schema round-trip: plan.json success_criteria items accept requires: ['run_tests'] and preserve it. Missing requires defaults to [].",
"priority": "must"
},
{
"criterion": "Verifiability audit: a must criterion with requires: ['drive_browser'] and only container workers configured produces a blocking critique flag.",
"priority": "must"
},
{
"criterion": "Verifiability audit: a must criterion with requires: [] produces an advisory deprecation flag, not a blocking one.",
"priority": "must"
},
{
"criterion": "Review: a criterion with requires: ['drive_browser'] and container-only reviewer receives pass: 'deferred_human' \u2014 not fail, not waived.",
"priority": "must"
},
{
"criterion": "State transition: review returns approved with a must criterion marked deferred_human \u2192 state becomes awaiting_human_verify, not done.",
"priority": "must"
},
{
"criterion": "State transition: review returns approved with all criteria pass (no deferrals) \u2192 state becomes done as before.",
"priority": "must"
},
{
"criterion": "megaplan verify-human --plan X --criterion C --pass --evidence E transitions plan from awaiting_human_verify to done and writes human_verifications.json.",
"priority": "must"
},
{
"criterion": "megaplan audit-verifiability --plan X prints verifiability results and exits 0.",
"priority": "must"
},
{
"criterion": "pyproject.toml version is 0.17.0 and CHANGELOG has the v0.17.0 entry.",
"priority": "must"
},
{
"criterion": "New module megaplan/verifiability.py is under ~200 lines.",
"priority": "should"
},
{
"criterion": "Total new+modified lines across all files is under ~800 (excluding tests).",
"priority": "should"
},
{
"criterion": "Capability registry uses plain Python (frozenset of strings), not YAML or external config files.",
"priority": "should"
},
{
"criterion": "Chain driver handles awaiting_human_verify gracefully (treats as chain-terminal with a warning).",
"priority": "should"
},
{
"criterion": "Manual smoke test: megaplan init with a plan containing requires: ['drive_browser'] on a must criterion, run through critique, and verify the blocking flag appears.",
"priority": "info"
}
],
"assumptions": [
"Branch name: verifiability-contracts as specified in the idea (overrides the spec file's gate-verifiability).",
"Empty requires on must criteria emits a deprecation warning (advisory flag) in v0.17.0, becomes blocking in v0.18.0. This avoids breaking every existing plan immediately while signaling the migration path.",
"Worker discovery is static config in state['config']['workers'] for v0.17.0 \u2014 no liveness tracking. The human_reviewer is either configured or not. Liveness (last_seen) deferred to v0.18.0 with capability profiles.",
"Chain driver treats awaiting_human_verify as terminal-for-chain-purposes (same as done for chain progression) since the machine work is complete. A logged warning is emitted.",
"The capability registry starts small (11 capabilities) and can be extended without schema migration \u2014 adding a new string to the registry is additive.",
"No approved_with_deferrals label \u2014 awaiting_human_verify is the real state, and megaplan status shows it directly.",
"The pre-critique audit is a pure-Python set operation (not a worker call). The losses doc and critique both flagged NL-audit unreliability. Capability matching is structural, not prompt-based."
],
"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"
]
},
{
"id": "DEBT-032",
"concern": "are the proposed changes technically correct?: a generated-schema gap remains. tests/test_schemas.py reads the repo-root .megaplan/schemas/review.json directly via _review_disk_schema(), the checked-in local file is currently stale relative to schemas, and ensure_runtime_layout() in megaplan/_core/io.py is the production writer for that file class. the plan says generated schemas must stay aligned, but it never names a regeneration step or a test adjustment for that disk-schema path, so the validation story is still incomplete.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
],
"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"
]
}
],
"completeness": [
{
"id": "DEBT-036",
"concern": "handle_init() and override flows also emit next_step but aren't listed for next_step_runtime enrichment.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-037",
"concern": "handle_execute() at handlers.py:1152-1175 can clear next_step to none but leave stale next_step_runtime.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-040",
"concern": "next_step_runtime fires on previous step completion, not literally when the next phase starts.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-043",
"concern": "test_command config override unreachable via normal init/cli flow",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
}
],
"correctness": [
{
"id": "DEBT-038",
"concern": "status-progress gating excludes finalized plans with finalize.json in between-batch and blocked states.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-039",
"concern": "resolve_phase_runtime called on non-phase next_step values would fail.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-041",
"concern": "non-phase next_step values from workflow_next() not filtered.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-042",
"concern": "baseline_test_command schema says string-only but fallback returns none",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
},
{
"id": "DEBT-044",
"concern": "fallback uses null+baseline_test_note instead of brief's empty-array+meta_commentary",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
}
],
"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"
]
},
{
"id": "DEBT-033",
"concern": "does the change touch all locations and supporting infrastructure?: the prior missing locations in megaplan/workers.py and tests/test_workers.py are now covered, but one supporting-infrastructure path is still absent from the steps: the repo-root generated schema copy under .megaplan/schemas/review.json and the tests that read it directly. without either explicitly regenerating that file or changing those tests to materialize schemas in a temp root, the plan can still leave the runtime-schema copy out of sync with the raw registry.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
},
{
"id": "DEBT-035",
"concern": "does the change touch all locations and supporting infrastructure?: the plan adds _set_active_step and _clear_active_step helpers to handlers.py. _run_worker (handlers.py:135) is modified to accept a resolved parameter. but _run_worker is also called directly by handle_critique's sequential fallback at line 801 and 803. these calls currently don't pass resolved. the plan's step 2.6 for handle_critique says to set active_step after resolution at line 794 \u2014 but the _run_worker calls at 801/803 would re-resolve the agent internally (since resolved isn't passed). this means the agent is resolved twice on the critique sequential path. the double-resolution is wasteful but correct (same result). however, to match the plan's goal of 'resolve_agent_mode() is called once per handler invocation', the resolved tuple should be passed to these _run_worker calls too.",
"occurrence_count": 1,
"plan_ids": [
"fix-megaplan-s-planning-20260409-2103"
]
}
],
"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"
]
},
{
"id": "DEBT-034",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: i rechecked the caller paths after the revision. the raw-schema caller path through validate_payload() is now accounted for, but the runtime-schema caller path still is not: strict_schema() only reaches the on-disk runtime schemas through ensure_runtime_layout(), while current tests like tests/test_schemas.py and tests/test_parallel_review.py consume the already-written repo copy directly. the plan does not yet say how that caller path gets refreshed or asserted after the code change.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
],
"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"
]
}
],
"runtime-schema-sync": [
{
"id": "DEBT-031",
"concern": "runtime schema sync: the plan still does not include an explicit refresh or validation step for the generated .megaplan/schemas/review.json copy that repository tests read directly.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
],
"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"
]
},
{
"id": "DEBT-030",
"concern": "search for related code that handles the same concept. is the reported issue a symptom of something broader?: the revised plan correctly narrows the schema-shape problem itself back to the six audited mismatches, but the generated runtime-schema consumer path is broader than the plan acknowledges: tests/test_parallel_review.py also reads the runtime review.json schema from schemas_root(repo_root), so stale generated schema copies can affect more than the direct schema tests.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
],
"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": "correctness",
"total_occurrences": 5,
"plan_count": 2,
"entries": [
{
"id": "DEBT-038",
"concern": "status-progress gating excludes finalized plans with finalize.json in between-batch and blocked states.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-039",
"concern": "resolve_phase_runtime called on non-phase next_step values would fail.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-041",
"concern": "non-phase next_step values from workflow_next() not filtered.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-042",
"concern": "baseline_test_command schema says string-only but fallback returns none",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
},
{
"id": "DEBT-044",
"concern": "fallback uses null+baseline_test_note instead of brief's empty-array+meta_commentary",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
}
]
},
{
"subsystem": "are-the-proposed-changes-technically-correct",
"total_occurrences": 4,
"plan_count": 3,
"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"
]
},
{
"id": "DEBT-032",
"concern": "are the proposed changes technically correct?: a generated-schema gap remains. tests/test_schemas.py reads the repo-root .megaplan/schemas/review.json directly via _review_disk_schema(), the checked-in local file is currently stale relative to schemas, and ensure_runtime_layout() in megaplan/_core/io.py is the production writer for that file class. the plan says generated schemas must stay aligned, but it never names a regeneration step or a test adjustment for that disk-schema path, so the validation story is still incomplete.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
]
},
{
"subsystem": "completeness",
"total_occurrences": 4,
"plan_count": 2,
"entries": [
{
"id": "DEBT-036",
"concern": "handle_init() and override flows also emit next_step but aren't listed for next_step_runtime enrichment.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-037",
"concern": "handle_execute() at handlers.py:1152-1175 can clear next_step to none but leave stale next_step_runtime.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-040",
"concern": "next_step_runtime fires on previous step completion, not literally when the next phase starts.",
"occurrence_count": 1,
"plan_ids": [
"design-and-plan-calibrated-20260410-1430"
]
},
{
"id": "DEBT-043",
"concern": "test_command config override unreachable via normal init/cli flow",
"occurrence_count": 1,
"plan_ids": [
"add-test-baselining-to-the-20260410-2240"
]
}
]
},
{
"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": "does-the-change-touch-all-locations-and-supporting-infrastructure",
"total_occurrences": 3,
"plan_count": 3,
"entries": [
{
"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"
]
},
{
"id": "DEBT-033",
"concern": "does the change touch all locations and supporting infrastructure?: the prior missing locations in megaplan/workers.py and tests/test_workers.py are now covered, but one supporting-infrastructure path is still absent from the steps: the repo-root generated schema copy under .megaplan/schemas/review.json and the tests that read it directly. without either explicitly regenerating that file or changing those tests to materialize schemas in a temp root, the plan can still leave the runtime-schema copy out of sync with the raw registry.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
},
{
"id": "DEBT-035",
"concern": "does the change touch all locations and supporting infrastructure?: the plan adds _set_active_step and _clear_active_step helpers to handlers.py. _run_worker (handlers.py:135) is modified to accept a resolved parameter. but _run_worker is also called directly by handle_critique's sequential fallback at line 801 and 803. these calls currently don't pass resolved. the plan's step 2.6 for handle_critique says to set active_step after resolution at line 794 \u2014 but the _run_worker calls at 801/803 would re-resolve the agent internally (since resolved isn't passed). this means the agent is resolved twice on the critique sequential path. the double-resolution is wasteful but correct (same result). however, to match the plan's goal of 'resolve_agent_mode() is called once per handler invocation', the resolved tuple should be passed to these _run_worker calls too.",
"occurrence_count": 1,
"plan_ids": [
"fix-megaplan-s-planning-20260409-2103"
]
}
]
},
{
"subsystem": "find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them",
"total_occurrences": 3,
"plan_count": 2,
"entries": [
{
"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"
]
},
{
"id": "DEBT-034",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: i rechecked the caller paths after the revision. the raw-schema caller path through validate_payload() is now accounted for, but the runtime-schema caller path still is not: strict_schema() only reaches the on-disk runtime schemas through ensure_runtime_layout(), while current tests like tests/test_schemas.py and tests/test_parallel_review.py consume the already-written repo copy directly. the plan does not yet say how that caller path gets refreshed or asserted after the code change.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-6-remaining-openai-20260409-0502"
]
}
]
},
{
"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/implement-megaplan-v0-17-0-20260415-1229/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.