Fix the 6 remaining OpenAI strict-mode schema mismatches in megaplan/schemas.py (properties defined but missing from required arrays), then upgrade strict_schema() to recursively walk the schema and auto-reconcile every required against its properties to prevent this bug class from recurring. Work on top of the existing dirty working tree — do not stash. The 6 known spots: (1) revise.json top-level missing assumptions, success_criteria, questions; (2) gate.json top-level missing flag_resolutions, accepted_tradeoffs; (3) review.json top-level missing checks, pre_check_flags, verified_flag_ids, disputed_flag_ids; (4) review.json checks.items missing guidance, prior_findings; (5) review.json checks.items.findings.items missing status, evidence_file; (6) review.json pre_check_flags.items missing evidence_file. After the strict_schema() upgrade, re-audit schemas.py for any other properties-vs-required gaps.
The gate feedback does not point to the wrong root cause. The core problem is still in megaplan/schemas.py: the raw schema registry still has six properties-vs-required mismatches, and strict_schema():470 only fills required when it is absent instead of reconciling partial lists. The only adjustment needed is to include the direct fallout path: megaplan/workers.py:62 derives _STEP_REQUIRED_KEYS from raw SCHEMAS, so fixing those top-level required arrays also requires aligned mock payload and fixture updates.
The plan should stay narrow. The gate correctly identified that tightening review.rework_items[].flag_id would be scope creep: megaplan/handlers.py:1225 synthesizes rework items with source but no flag_id, and the user’s idea only names six missing- spots plus a recursive backstop. This revision therefore keeps the contract unchanged and limits edits to the six listed mismatches, the recursive reconciler, and the worker/test infrastructure that those raw-schema edits will immediately affect.
Assistant
required
strict_schema()
review.rework_items
Main Phase
Step 1: Reconfirm the exact root cause and immediate fallout (megaplan/schemas.py, megaplan/workers.py, megaplan/handlers.py)
Scope: Small
Re-run the cheap SCHEMAS audit to confirm the six named gaps and verify there are no additional properties-vs-required mismatches before editing megaplan/schemas.py.
Trace the direct caller path from raw SCHEMAS into _STEP_REQUIRED_KEYS in megaplan/workers.py:62 so the plan covers the mock payload builders and validate_payload() fixtures that will break as soon as the top-level required sets are fixed.
Explicitly rule out a review.rework_items redesign by checking the current producer in megaplan/handlers.py:1225 and treating its missing flag_id as preserved behavior for this iteration, not a new schema-tightening target.
Step 2: Fix the six source-schema gaps and harden recursive reconciliation (megaplan/schemas.py)
Scope: Medium
Update the six known required omissions in megaplan/schemas.py:83, megaplan/schemas.py:105, and megaplan/schemas.py:353 so the raw revise, gate, and review schemas match the user’s listed strict-mode fixes.
Upgrade strict_schema():470 so every object with properties is recursively normalized to required == list(properties.keys()), even when a partial required array already exists.
Preserve the current additionalProperties behavior while making reconciliation exact enough to prevent both missing and stale required entries from surviving future edits.
Re-run the audit immediately after the change to prove there are no remaining properties-vs-required gaps anywhere in SCHEMAS.
Step 3: Update the worker-side fallout without widening schema scope (megaplan/workers.py, tests/test_workers.py)
Scope: Medium
Update the affected mock payload builders in megaplan/workers.py:443, megaplan/workers.py:488, and megaplan/workers.py:633 so the default revise, gate, and review payloads still satisfy validate_payload() after the raw-schema fixes.
Update the corresponding validate_payload() fixtures and mock-output assertions in tests/test_workers.py:68 and tests/test_workers.py:393 so the worker tests track the new top-level required keys for revise, gate, and review.
Keep this step limited to the fallout from _STEP_REQUIRED_KEYS; do not touch megaplan/handlers.py or megaplan/prompts/review.py unless the post-fix audit uncovers a new missing-required mismatch there.
Step 4: Add focused regression coverage for the touched strict-mode paths (tests/test_schemas.py, tests/test_megaplan.py)
Scope: Medium
Add or update focused assertions in tests/test_schemas.py for the six named mismatches and for the recursive strict_schema() behavior that overwrites incomplete required arrays.
Keep the schema-test updates scoped to the touched strict-mode paths; do not use this change to redesign the longstanding review.rework_items[].flag_id expectations.
Update the duplicate strict_schema() smoke coverage in tests/test_megaplan.py:1844 only as needed to reflect the new recursive reconciliation behavior.
Step 5: Verify the narrow fix with cheap checks first (megaplan/schemas.py, tests/test_workers.py, tests/test_schemas.py, tests/test_megaplan.py)
Scope: Small
Run the schema-gap audit first; it should report zero missing or stale required entries in SCHEMAS.
Run the focused worker validation slice covering validate_payload() and the revise/gate/review mock payloads in tests/test_workers.py.
Run the focused schema/strict-schema regression slice in tests/test_schemas.py and tests/test_megaplan.py:1844.
Finish with git status --short to confirm the intended schema/worker/test files changed while the unrelated dirty worktree remains untouched.
Execution Order
Confirm the root cause and scope guardrails first so the change stays on the six listed mismatches plus their direct worker fallout.
Fix megaplan/schemas.py before updating mocks and fixtures, because the raw schema registry is the source of truth for both worker validation and generated runtime schemas.
Align worker mocks and focused regressions immediately after the schema edit so validate_payload() and test fixtures do not drift.
Only broaden beyond these files if the post-fix audit surfaces a new missing-required gap tied to the same bug class.
Validation Order
One-off SCHEMAS audit for properties vs required mismatches.
Focused tests/test_workers.py coverage for validate_payload() and mock revise/gate/review payloads.
Focused tests/test_schemas.py and tests/test_megaplan.py -k strict_schema coverage for the touched strict-mode paths.
Final dirty-tree check with git status --short.
code
Plan metadata:
{
"version": 2,
"timestamp": "2026-04-09T03:19:44Z",
"hash": "sha256:875629780b422f4ad505f152f9bd0cf788d582de82f17c6c30b7bf1579aa1726",
"changes_summary": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract.",
"flags_addressed": [
"FLAG-001",
"FLAG-002",
"issue_hints",
"correctness-1",
"correctness-2",
"scope",
"all_locations-1",
"all_locations-2",
"callers-1",
"callers-2"
],
"questions": [],
"success_criteria": [
{
"criterion": "A repository audit over SCHEMAS reports zero object schemas where a declared property is missing from required, and zero required entries that are absent from properties.",
"priority": "must"
},
{
"criterion": "strict_schema() recursively normalizes every object-with-properties so its emitted required list matches that object's property keys while preserving explicit additionalProperties values.",
"priority": "must"
},
{
"criterion": "The worker-side revise, gate, and review mock payloads and validate_payload() fixtures are updated so the raw-schema required-key changes do not break their current caller path.",
"priority": "must"
},
{
"criterion": "Focused regression tests for the touched strict-mode paths in tests/test_workers.py, tests/test_schemas.py, and tests/test_megaplan.py pass after the changes.",
"priority": "must"
},
{
"criterion": "The generated runtime schemas written through ensure_runtime_layout() stay aligned with the raw SCHEMAS contract for the touched revise, gate, and review outputs.",
"priority": "must"
},
{
"criterion": "The change does not widen scope into a review.rework_items[].flag_id redesign; handler-synthesized rework items remain supported as they are today.",
"priority": "must"
},
{
"criterion": "Only the intended schema/worker/test files are edited; the pre-existing unrelated dirty worktree remains intact.",
"priority": "must"
},
{
"criterion": "Regression coverage proves recursive reconciliation of partial required arrays directly, rather than relying only on broad end-to-end behavior.",
"priority": "should"
}
],
"assumptions": [
"The gate feedback identifies missing supporting infrastructure, not a different implementation strategy: the root cause remains the raw schema drift plus strict_schema() only filling absent required lists.",
"The current review.rework_items producer behavior in megaplan/handlers.py is intentionally preserved for this iteration, so flag_id is not being promoted into this issue\u2019s scope.",
"Focused schema/worker regression slices are sufficient validation for this targeted fix, because tests/test_schemas.py currently contains broader pre-existing failures outside the six listed mismatches.",
"Raw SCHEMAS and generated .megaplan/schemas/*.json files should stay aligned because worker-side required-key validation reads from raw SCHEMAS while Codex/Claude output schemas come from the generated copies.",
"Unrelated dirty-tree edits in other files are out of scope and must be left in place without stashing or reverting."
],
"delta_from_previous_percent": 92.47,
"structure_warnings": []
}
code
Gate summary:
{
"passed": true,
"criteria_check": {
"count": 8,
"items": [
{
"criterion": "A repository audit over SCHEMAS reports zero object schemas where a declared property is missing from required, and zero required entries that are absent from properties.",
"priority": "must"
},
{
"criterion": "strict_schema() recursively normalizes every object-with-properties so its emitted required list matches that object's property keys while preserving explicit additionalProperties values.",
"priority": "must"
},
{
"criterion": "The worker-side revise, gate, and review mock payloads and validate_payload() fixtures are updated so the raw-schema required-key changes do not break their current caller path.",
"priority": "must"
},
{
"criterion": "Focused regression tests for the touched strict-mode paths in tests/test_workers.py, tests/test_schemas.py, and tests/test_megaplan.py pass after the changes.",
"priority": "must"
},
{
"criterion": "The generated runtime schemas written through ensure_runtime_layout() stay aligned with the raw SCHEMAS contract for the touched revise, gate, and review outputs.",
"priority": "must"
},
{
"criterion": "The change does not widen scope into a review.rework_items[].flag_id redesign; handler-synthesized rework items remain supported as they are today.",
"priority": "must"
},
{
"criterion": "Only the intended schema/worker/test files are edited; the pre-existing unrelated dirty worktree remains intact.",
"priority": "must"
},
{
"criterion": "Regression coverage proves recursive reconciliation of partial required arrays directly, rather than relying only on broad end-to-end behavior.",
"priority": "should"
}
]
},
"preflight_results": {
"project_dir_exists": true,
"project_dir_writable": true,
"success_criteria_present": true,
"claude_available": true,
"codex_available": true
},
"unresolved_flags": [
{
"id": "scope",
"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.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "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.",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": true,
"addressed_in": "plan_v2.md",
"verified_in": "critique_v2.json"
},
{
"id": "FLAG-003",
"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.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "tests/test_schemas.py loads .megaplan/schemas/review.json from the repo root, tests/test_parallel_review.py loads the runtime review schema from schemas_root(REPO_ROOT), and ensure_runtime_layout() is the production writer for those generated schema files.",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "correctness",
"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.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "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.",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "all_locations",
"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.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "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.",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "callers",
"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.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "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.",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": false
}
],
"recommendation": "PROCEED",
"rationale": "Score dropped sharply (7.0 \u2192 2.5), plan delta is 92%, 9 of 10 prior flags resolved, and all 5 remaining blocking flags collapse to one concrete, mechanical concern: the checked-in .megaplan/schemas/*.json files are stale relative to the raw SCHEMAS registry, and tests/test_schemas.py::_review_disk_schema() plus tests/test_parallel_review.py read them directly. This is not a design gap \u2014 it is a single well-understood regeneration step the executor can handle inline (call ensure_runtime_layout(REPO_ROOT) once after the schema fix, or change the two tests to materialize schemas in a temp root). Iterating again would be churn on a five-faceted restatement of the same issue. Promoting the regeneration step to a settled decision keeps the loop moving while ensuring it is not forgotten. The plan is otherwise tight: source-schema fixes, recursive strict_schema(), worker mock/fixture updates, and scope-preservation of review.rework_items are all accounted for.",
"signals_assessment": "Weighted score trajectory 7.0 \u2192 2.5 (strong improvement); 9/10 significant flags resolved; plan delta 92.5%; no recurring critiques; no debt-subsystem overlap; preflight clean. The 5 remaining flags are all facets of the same on-disk generated-schema sync gap, not distinct concerns, so the effective open-flag count is 1.",
"warnings": [
"Executor MUST regenerate the on-disk .megaplan/schemas/*.json files after fixing raw SCHEMAS \u2014 either by calling ensure_runtime_layout(REPO_ROOT) once, or by updating tests/test_schemas.py::_review_disk_schema() and tests/test_parallel_review.py to materialize schemas in a temp root. Verify both tests pass before declaring done.",
"Re-run the post-fix SCHEMAS audit AFTER the recursive strict_schema() upgrade to catch any additional properties-vs-required gaps the user asked for.",
"Confirm git status --short at the end shows only schemas.py, workers.py, the two test files, and the regenerated .megaplan/schemas/*.json \u2014 unrelated dirty-worktree files must remain untouched."
],
"settled_decisions": [
{
"id": "SD-1",
"decision": "Scope stays fixed on the six user-listed mismatches plus the recursive strict_schema() backstop; review.rework_items[].flag_id contract is NOT tightened.",
"rationale": "Carried forward from v1 gate; handlers._synthesize_review_rework_items() legitimately omits flag_id for blocking findings with no associated critique flag."
},
{
"id": "SD-2",
"decision": "strict_schema() recursively normalizes required to exactly match properties.keys() on every object, overwriting partial required arrays.",
"rationale": "Directly required by the user's idea to prevent this bug class from recurring."
},
{
"id": "SD-3",
"decision": "After fixing raw SCHEMAS, the executor must regenerate the on-disk .megaplan/schemas/*.json files (via ensure_runtime_layout(REPO_ROOT) or equivalent) so tests that read the checked-in copy directly (tests/test_schemas.py::_review_disk_schema, tests/test_parallel_review.py) stay in sync with the raw registry.",
"rationale": "Five remaining blocking flags all collapse to this single missing step; promoting it to a settled decision ensures review does not re-litigate it and that the executor actually performs it."
},
{
"id": "SD-4",
"decision": "Supporting infrastructure scope is limited to megaplan/schemas.py, megaplan/workers.py mock payload builders, tests/test_workers.py validation fixtures, tests/test_schemas.py, tests/test_megaplan.py strict_schema slice, and the regenerated on-disk schema files. megaplan/handlers.py and megaplan/prompts/review.py are explicitly out of scope.",
"rationale": "Keeps the change mechanical and bounded; matches the narrowed v2 plan."
}
],
"override_forced": false,
"orchestrator_guidance": "Plan passed gate and preflight. Proceed to finalize. Verify unresolved flags against the plan and project code before accepting.",
"robustness": "standard",
"signals": {
"iteration": 2,
"idea": "Fix the 6 remaining OpenAI strict-mode schema mismatches in megaplan/schemas.py (properties defined but missing from required arrays), then upgrade strict_schema() to recursively walk the schema and auto-reconcile every required against its properties to prevent this bug class from recurring. Work on top of the existing dirty working tree \u2014 do not stash. The 6 known spots: (1) revise.json top-level missing assumptions, success_criteria, questions; (2) gate.json top-level missing flag_resolutions, accepted_tradeoffs; (3) review.json top-level missing checks, pre_check_flags, verified_flag_ids, disputed_flag_ids; (4) review.json checks.items missing guidance, prior_findings; (5) review.json checks.items.findings.items missing status, evidence_file; (6) review.json pre_check_flags.items missing evidence_file. After the strict_schema() upgrade, re-audit schemas.py for any other properties-vs-required gaps.",
"significant_flags": 5,
"unresolved_flags": [
{
"id": "scope",
"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.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "FLAG-003",
"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.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "correctness",
"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.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "all_locations",
"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.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "callers",
"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.",
"category": "correctness",
"severity": "significant",
"status": "open"
}
],
"resolved_flags": [
{
"id": "FLAG-001",
"concern": "Worker validation: raw-schema required-key changes will also require updates in megaplan/workers.py mock payloads and tests/test_workers.py, not just schemas.py and the schema tests.",
"resolution": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract."
},
{
"id": "FLAG-002",
"concern": "Review schema contract: tightening review.rework_items to full strict-mode alignment is inconsistent with current producers, because synthesized review rework items omit flag_id today.",
"resolution": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract."
},
{
"id": "issue_hints",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: The plan's Step 3 and open question about review.json.rework_items[].flag_id and source expand beyond the user's stated six mismatches. In the current repo, megaplan/handlers.py synthesizes review rework items with source but no flag_id, and tests/test_schemas.py still has a test that intentionally accepts rework items without flag_id, so tightening that contract would be extra scope unless the plan explicitly decides to redesign or preserve that behavior.",
"resolution": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract."
},
{
"id": "correctness-1",
"concern": "Are the proposed changes technically correct?: The raw-schema edits will immediately change validate_payload() behavior because megaplan/workers.py derives _STEP_REQUIRED_KEYS directly from SCHEMAS. Current accepted payload fixtures in tests/test_workers.py still pass a minimal revise payload without questions/success_criteria/assumptions, a gate payload without flag_resolutions/accepted_tradeoffs, and the mock review payload in megaplan/workers.py omits checks, pre_check_flags, verified_flag_ids, and disputed_flag_ids, so the plan is not technically complete as written.",
"resolution": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract."
},
{
"id": "correctness-2",
"concern": "Are the proposed changes technically correct?: The proposed test tightening around review.json.rework_items[].flag_id is not compatible with current producers. _synthesize_review_rework_items() in megaplan/handlers.py emits task_id, issue, expected, actual, evidence_file, and source, but never flag_id, so a stricter schema/test contract there would still fail unless the implementation also changes that producer or relaxes the schema.",
"resolution": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract."
},
{
"id": "all_locations-1",
"concern": "Does the change touch all locations AND supporting infrastructure?: Supporting infrastructure is missing from the edit list. Once the raw required arrays are fixed, megaplan/workers.py mock payload builders and tests/test_workers.py validation fixtures also need updates because they currently rely on the old top-level required sets for revise, gate, and review.",
"resolution": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract."
},
{
"id": "all_locations-2",
"concern": "Does the change touch all locations AND supporting infrastructure?: If the plan intends to make review.rework_items fully strict in tests, it also needs to touch megaplan/handlers.py and likely megaplan/prompts/review.py, because the handler-synthesized rework items omit flag_id today and the prompt still describes a more permissive base rework-item shape.",
"resolution": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract."
},
{
"id": "callers-1",
"concern": "Find the callers of the changed function. What arguments do they actually pass? Does the fix handle all of them?: The actual caller path for the raw required lists is validate_payload() in megaplan/workers.py. Its current callers and fixtures pass payloads that will become invalid after the planned source-schema edits, especially the revise, gate, and review examples in tests/test_workers.py and the mock review payload returned by _default_mock_review_payload().",
"resolution": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract."
},
{
"id": "callers-2",
"concern": "Find the callers of the changed function. What arguments do they actually pass? Does the fix handle all of them?: For the nested review-item shape, the effective producer is _synthesize_review_rework_items() in megaplan/handlers.py, and its edge case is a blocking finding with no associated critique flag. That path currently emits no flag_id, so the plan does not yet handle all existing producers if it tightens review-item required fields in tests.",
"resolution": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract."
}
],
"weighted_score": 2.5,
"weighted_history": [
7.0
],
"plan_delta_from_previous": 92.47,
"recurring_critiques": [],
"scope_creep_flags": [],
"loop_summary": "Iteration 2. Weighted score trajectory: 7.0 -> 2.5. Plan deltas: 92.5%. Recurring critiques: 0. Resolved flags: 9. Open significant flags: 5.",
"debt_overlaps": [],
"escalated_debt_subsystems": []
},
"flag_resolutions": [
{
"flag_id": "FLAG-003",
"action": "accept_tradeoff",
"evidence": "Regeneration is a mechanical one-liner via ensure_runtime_layout(REPO_ROOT) in megaplan/_core/io.py:281, which is the production writer for .megaplan/schemas/*.json. Promoted to SD-3 as a required executor step.",
"rationale": "Flag is real but trivial to execute; iterating would be churn. The other four remaining flags (scope, correctness, all_locations, callers) are all restatements of this same on-disk sync concern and are implicitly accepted under the same resolution."
}
],
"resolved_flag_ids": [],
"resolution_summary": ""
}
code
Flag registry:
[
{
"id": "FLAG-001",
"concern": "Worker validation: raw-schema required-key changes will also require updates in megaplan/workers.py mock payloads and tests/test_workers.py, not just schemas.py and the schema tests.",
"evidence": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract.",
"status": "verified",
"severity": "significant"
},
{
"id": "FLAG-002",
"concern": "Review schema contract: tightening review.rework_items to full strict-mode alignment is inconsistent with current producers, because synthesized review rework items omit flag_id today.",
"evidence": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract.",
"status": "verified",
"severity": "significant"
},
{
"id": "issue_hints",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: The plan's Step 3 and open question about review.json.rework_items[].flag_id and source expand beyond the user's stated six mismatches. In the current repo, megaplan/handlers.py synthesizes review rework items with source but no flag_id, and tests/test_schemas.py still has a test that intentionally accepts rework items without flag_id, so tightening that contract would be extra scope unless the plan explicitly decides to redesign or preserve that behavior.",
"evidence": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract.",
"status": "verified",
"severity": "significant"
},
{
"id": "correctness-1",
"concern": "Are the proposed changes technically correct?: The raw-schema edits will immediately change validate_payload() behavior because megaplan/workers.py derives _STEP_REQUIRED_KEYS directly from SCHEMAS. Current accepted payload fixtures in tests/test_workers.py still pass a minimal revise payload without questions/success_criteria/assumptions, a gate payload without flag_resolutions/accepted_tradeoffs, and the mock review payload in megaplan/workers.py omits checks, pre_check_flags, verified_flag_ids, and disputed_flag_ids, so the plan is not technically complete as written.",
"evidence": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract.",
"status": "verified",
"severity": "significant"
},
{
"id": "correctness-2",
"concern": "Are the proposed changes technically correct?: The proposed test tightening around review.json.rework_items[].flag_id is not compatible with current producers. _synthesize_review_rework_items() in megaplan/handlers.py emits task_id, issue, expected, actual, evidence_file, and source, but never flag_id, so a stricter schema/test contract there would still fail unless the implementation also changes that producer or relaxes the schema.",
"evidence": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract.",
"status": "verified",
"severity": "significant"
},
{
"id": "scope",
"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.",
"evidence": "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.",
"status": "accepted_tradeoff",
"severity": "significant"
},
{
"id": "all_locations-1",
"concern": "Does the change touch all locations AND supporting infrastructure?: Supporting infrastructure is missing from the edit list. Once the raw required arrays are fixed, megaplan/workers.py mock payload builders and tests/test_workers.py validation fixtures also need updates because they currently rely on the old top-level required sets for revise, gate, and review.",
"evidence": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract.",
"status": "verified",
"severity": "significant"
},
{
"id": "all_locations-2",
"concern": "Does the change touch all locations AND supporting infrastructure?: If the plan intends to make review.rework_items fully strict in tests, it also needs to touch megaplan/handlers.py and likely megaplan/prompts/review.py, because the handler-synthesized rework items omit flag_id today and the prompt still describes a more permissive base rework-item shape.",
"evidence": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract.",
"status": "verified",
"severity": "significant"
},
{
"id": "callers-1",
"concern": "Find the callers of the changed function. What arguments do they actually pass? Does the fix handle all of them?: The actual caller path for the raw required lists is validate_payload() in megaplan/workers.py. Its current callers and fixtures pass payloads that will become invalid after the planned source-schema edits, especially the revise, gate, and review examples in tests/test_workers.py and the mock review payload returned by _default_mock_review_payload().",
"evidence": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract.",
"status": "verified",
"severity": "significant"
},
{
"id": "callers-2",
"concern": "Find the callers of the changed function. What arguments do they actually pass? Does the fix handle all of them?: For the nested review-item shape, the effective producer is _synthesize_review_rework_items() in megaplan/handlers.py, and its edge case is a blocking finding with no associated critique flag. That path currently emits no flag_id, so the plan does not yet handle all existing producers if it tightens review-item required fields in tests.",
"evidence": "Narrowed the plan back to the user\u2019s stated six mismatches and the recursive strict_schema() fix, while adding the missing supporting-infrastructure work in megaplan/workers.py and tests/test_workers.py that the raw-schema edits will immediately break. Removed the prior scope creep around tightening review.rework_items[].flag_id and explicitly preserved the current handler-produced rework-item contract.",
"status": "verified",
"severity": "significant"
},
{
"id": "FLAG-003",
"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.",
"evidence": "tests/test_schemas.py loads .megaplan/schemas/review.json from the repo root, tests/test_parallel_review.py loads the runtime review schema from schemas_root(REPO_ROOT), and ensure_runtime_layout() is the production writer for those generated schema files.",
"status": "accepted_tradeoff",
"severity": "significant"
},
{
"id": "correctness",
"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.",
"evidence": "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.",
"status": "accepted_tradeoff",
"severity": "significant"
},
{
"id": "all_locations",
"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.",
"evidence": "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.",
"status": "accepted_tradeoff",
"severity": "significant"
},
{
"id": "callers",
"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.",
"evidence": "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.",
"status": "accepted_tradeoff",
"severity": "significant"
}
]
"[DEBT] are-the-proposed-changes-technically-correct: 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. (flagged 1 times across 1 plans)",
"[DEBT] are-the-proposed-changes-technically-correct: 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. (flagged 1 times across 1 plans)",
"[DEBT] are-the-proposed-changes-technically-correct: 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. (flagged 1 times across 1 plans)",
"[DEBT] are-the-proposed-changes-technically-correct: 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. (flagged 1 times across 1 plans)",
"[DEBT] are-the-success-criteria-well-prioritized-and-verifiable: 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. (flagged 1 times across 1 plans)",
"[DEBT] criteria-prompt: 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. (flagged 1 times across 1 plans)",
"[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: 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. (flagged 1 times across 1 plans)",
"[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: 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. (flagged 1 times across 1 plans)",
"[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: 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. (flagged 1 times across 1 plans)",
"[DEBT] diff-capture: 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. (flagged 1 times across 1 plans)",
"[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: 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. (flagged 1 times across 1 plans)",
"[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: 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. (flagged 1 times across 1 plans)",
"[DEBT] execute-phase-contract: early-killed baselines pass truncated output to the execute worker, which may produce lower-quality diagnosis than full output. (flagged 1 times across 1 plans)",
"[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: 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. (flagged 1 times across 1 plans)",
"[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: 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. (flagged 1 times across 1 plans)",
"[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: 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. (flagged 1 times across 1 plans)",
"[DEBT] handler-boilerplate: _run_worker() pseudocode hardcodes iteration=state['iteration'] but handle_plan and handle_revise use different failure iteration values. (flagged 1 times across 1 plans)",
"[DEBT] handler-boilerplate: same issue as correctness-1: failure iteration would be wrong for plan/revise handlers. (flagged 1 times across 1 plans)",
"[DEBT] install-paths: local setup path doesn't expose subagent mode (flagged 1 times across 1 plans)",
"[DEBT] install-paths: no automated guard to keep the mirror file synchronized with source files (flagged 1 times across 1 plans)",
"[DEBT] install-paths: local setup test only checks agents.md existence, not content (flagged 1 times across 1 plans)",
"[DEBT] is-there-convincing-verification-for-the-change: 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. (flagged 1 times across 1 plans)",
"[DEBT] is-there-convincing-verification-for-the-change: 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. (flagged 1 times across 1 plans)",
"[DEBT] mobile-ui: 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. (flagged 1 times across 1 plans)",
"[DEBT] runtime-schema-sync: 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. (flagged 1 times across 1 plans)",
"[DEBT] search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader: 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. (flagged 1 times across 1 plans)",
"[DEBT] search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader: 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. (flagged 1 times across 1 plans)",
"[DEBT] subagent-safeguards: hermes reference safeguard numbers not validated against actual implementation (flagged 1 times across 1 plans)",
"[DEBT] subagent-safeguards: plan's retry caps (1 phase, 3 execute) may differ from hermes-agent's actual policy (flagged 1 times across 1 plans)",
"[DEBT] worker-permissions: codex --full-auto flag only triggers for step == 'execute', not 'loop_execute' (flagged 1 times across 1 plans)",
"[DEBT] worker-permissions: claude --permission-mode bypasspermissions only triggers for step == 'execute', not 'loop_execute' (flagged 1 times across 1 plans)",
"[DEBT] workflow-state-machine: _plan_prompt() does not read research.json, so replanning from state_researched would ignore research results. (flagged 1 times across 1 plans)",
"[DEBT] workflow-state-machine: same issue as correctness-2: state_researched \u2192 plan path is only partially wired. (flagged 1 times across 1 plans)",
"[DEBT] workflow-state-machine: _plan_prompt() is a missed location for the state_researched \u2192 plan change. (flagged 1 times across 1 plans)"
]
code
Requirements:
- Produce structured JSON only.
- `tasks` must be an ordered array of task objects. Every task object must include:
- `id`: short stable task ID like `T1`
- `description`: concrete work item
- `depends_on`: array of earlier task IDs or `[]`
- `status`: always `"pending"` at finalize time
- `executor_notes`: always `""` at finalize time
- `reviewer_verdict`: always `""` at finalize time
- `watch_items` must be an array of strings covering runtime risks, critique concerns, and assumptions to keep visible during execution.
- `sense_checks` must be an array with one verification question per task. Every sense-check object must include:
- `id`: short stable ID like `SC1`
- `task_id`: the related task ID
- `question`: reviewer verification question
- `verdict`: always `""` at finalize time
- `meta_commentary` must be a single string with execution guidance, gotchas, or judgment calls that help the executor succeed.
- `validation` must be an object that self-checks plan coverage:
- `plan_steps_covered`: enumerate EVERY step from the approved plan. For each step, provide a short `plan_step_summary` (the step's intent in one phrase) and `finalize_task_ids` (array of task IDs that implement it — a single plan step may map to multiple tasks).
- `orphan_tasks`: task IDs that do not correspond to any plan step. Normally empty. If non-empty, explain in `completeness_notes`.
- `completeness_notes`: free-text explanation of any gaps, deviations, or deliberate omissions.
- `coverage_complete`: set to `true` only if every plan step has at least one finalize task AND you have verified the mapping by reviewing each entry. Set to `false` if any plan step is missing coverage.
- Example:
```json
"validation": {
"plan_steps_covered": [
{"plan_step_summary": "Add retry logic to API client", "finalize_task_ids": ["T1", "T2"]},
{"plan_step_summary": "Update configuration schema", "finalize_task_ids": ["T3"]}
],
"orphan_tasks": [],
"completeness_notes": "All plan steps mapped to tasks.",
"coverage_complete": true
}
```
- Preserve information that strong existing artifacts already capture well: execution ordering, watch-outs, reviewer checkpoints, and practical context.
- The structured output should be self-contained: an executor reading only `finalize.json` should have everything needed to work.
- Keep the task count proportional to the work. A simple 1-2 file fix should be 2 tasks: (1) apply the fix, (2) run tests. Do NOT create separate "inspect" or "read" tasks for simple changes — the executor can read and fix in one step. Only create more tasks when the work has genuinely independent stages.
- The FINAL task MUST always be to run tests and verify the changes work. If specific test IDs or commands are mentioned in the original task, include them. Otherwise, the executor should find and run the tests most relevant to the files changed. If any test fails, read the error, fix the code, and re-run until they pass. Do NOT create new test files — run the project's existing test suite. Additionally, the executor should write a short throwaway script that reproduces the specific bug described in the task, run it to confirm the fix works, then delete the script.
{"tasks":[{"id":"T1","description":"Update megaplan/schemas.py to fix the six known raw-schema properties vs required mismatches for revise, gate, and review, and upgrade strict_schema() so it recursively normalizes every object-with-properties to required == list(properties.keys()) while preserving explicit additionalProperties values and leaving review.rework_items behavior unchanged.","depends_on":[],"status":"pending","executor_notes":"","files_changed":[[REDACTED]],"commands_run":[],"evidence_files":[],"reviewer_verdict":""},{"id":"T2","description":"Re-audit raw SCHEMAS for any remaining missing or stale required entries, then regenerate the on-disk runtime schemas via ensure_runtime_layout(REPO_ROOT) so .megaplan/schemas/*.json stays aligned with the updated registry, including the repo-root review.json copy consumed by tests.","depends_on":["T1"],"status":"pending","executor_notes":"","files_changed":[[REDACTED],[REDACTED],[REDACTED]],"commands_run":[],"evidence_files":[],"reviewer_verdict":""},{"id":"T3","description":"Update worker-side fallout in megaplan/workers.py and tests/test_workers.py so _STEP_REQUIRED_KEYS, mock payload builders, and validate_payload() fixtures for revise, gate, and review satisfy the tightened raw schemas without widening scope into handler or prompt changes.","depends_on":["T2"],"status":"pending","executor_notes":"","files_changed":[[REDACTED],[REDACTED]],"commands_run":[],"evidence_files":[],"reviewer_verdict":""},{"id":"T4","description":"Adjust existing regression coverage in tests/test_schemas.py and tests/test_megaplan.py so it directly proves the six named schema fixes, verifies recursive reconciliation of partial required arrays, and keeps review.rework_items[].flag_id intentionally out of scope.","depends_on":["T3"],"status":"pending","executor_notes":"","files_changed":[[REDACTED],[REDACTED]],"commands_run":[],"evidence_files":[],"reviewer_verdict":""},{"id":"T5","description":"Verify the change end-to-end: write a short throwaway reproduction script for the strict-mode mismatch bug, run it before/after as needed to confirm the fix, delete the script, run the focused schema audit plus the most relevant existing test slices for tests/test_workers.py, tests/test_schemas.py, tests/test_megaplan.py, and any runtime-schema consumer coverage needed to prove the regenerated on-disk schemas are in sync, then check git status --short to confirm only intended files changed and unrelated dirty-tree edits remain untouched.","depends_on":["T4"],"status":"pending","executor_notes":"","files_changed":[],"commands_run":[],"evidence_files":[],"reviewer_verdict":""}],"watch_items":["Do not stash, reset, or revert unrelated dirty-worktree changes; work on top of the existing tree and leave unrelated edits intact.","Keep scope fixed to the six listed schema mismatches plus the recursive strict_schema() backstop and direct worker/test/runtime-schema fallout.","Do not tighten review.rework_items[].flag_id; current handler-synthesized rework items may omit flag_id, and that contract is explicitly preserved for this iteration.","strict_schema() must overwrite partial required arrays, not only fill missing ones, and it must remove stale required keys that are no longer present in properties.","Preserve explicit additionalProperties values during recursive normalization; do not accidentally force or clear them.","Runtime-schema sync is a real caller path: regenerate .megaplan/schemas/*.json after raw-schema edits because tests read the on-disk schema copies directly.","Re-run the post-fix schema-gap audit after the recursive upgrade to catch any additional properties vs required gaps beyond the six known spots.","Worker fallout is expected because _STEP_REQUIRED_KEYS is derived from raw SCHEMAS; mock payload builders and fixtures must be updated in lockstep.","Do not touch megaplan/handlers.py or megaplan/prompts/review.py unless the post-fix audit uncovers a new mismatch from the same bug class that truly requires it.","Final verification must use existing project tests only; do not add new permanent test files."],"sense_checks":[{"id":"SC1","task_id":"T1","question":"Does megaplan/schemas.py now contain the six named required fixes and a recursive strict_schema() implementation that normalizes every object-with-properties exactly to its property keys while preserving explicit additionalProperties and leaving review.rework_items untouched?","executor_note":"","verdict":""},{"id":"SC2","task_id":"T2","question":"After the schema edit, does the audit report zero missing or stale required entries in raw SCHEMAS, and were the repo-root runtime schema files regenerated so on-disk review.json matches the source registry?","executor_note":"","verdict":""},{"id":"SC3","task_id":"T3","question":"Do the updated worker mock payloads and validate_payload() fixtures for revise, gate, and review satisfy the tightened required-key sets without introducing unrelated schema-contract changes?","executor_note":"","verdict":""},{"id":"SC4","task_id":"T4","question":"Do the existing schema-focused tests now directly cover the six named mismatch locations and the recursive overwrite behavior for partial required arrays, while still accepting the current review.rework_items contract?","executor_note":"","verdict":""},{"id":"SC5","task_id":"T5","question":"Was the bug reproduced with a throwaway script and then shown fixed, were the relevant existing tests and runtime-schema consumer checks rerun until passing, was the script deleted afterward, and does git status --short show only intended schema/worker/test/runtime-schema changes plus unrelated pre-existing dirt?","executor_note":"","verdict":""}],"meta_commentary":"Execute this as a narrow mechanical repair. The highest-risk omission from prior iterations was runtime-schema drift, so treat regeneration of .megaplan/schemas/*.json as mandatory immediately after the raw SCHEMAS fix. Keep the sequence tight: source schema repair first, regenerate and audit second, worker/fixture fallout third, regression assertions fourth, verification last. When implementing strict_schema(), recurse through nested objects and object-bearing array items, reconcile required exactly to current properties, and do not silently preserve stale keys. Validation should stay focused on existing tests that exercise raw-schema validation and on-disk runtime-schema consumers; if a failure points at unrelated pre-existing issues, isolate the relevant slices rather than broadening scope. The final dirty-tree check matters because the repository is already dirty and unrelated files must remain untouched.","validation":{"plan_steps_covered":[{"plan_step_summary":"Reconfirm the six raw-schema gaps and check for any others before editing","finalize_task_ids":["T1","T2"]},{"plan_step_summary":"Trace raw SCHEMAS into _STEP_REQUIRED_KEYS worker fallout","finalize_task_ids":["T3"]},{"plan_step_summary":"Rule out review.rework_items redesign and preserve current handler contract","finalize_task_ids":["T1","T4"]},{"plan_step_summary":"Fix the six known required omissions in megaplan/schemas.py","finalize_task_ids":["T1"]},{"plan_step_summary":"Upgrade strict_schema() to recursively normalize partial required arrays","finalize_task_ids":["T1"]},{"plan_step_summary":"Preserve existing additionalProperties behavior while reconciling exactly","finalize_task_ids":["T1"]},{"plan_step_summary":"Re-run schema audit after the fix to prove no remaining gaps","finalize_task_ids":["T2","T5"]},{"plan_step_summary":"Update worker mock payload builders for revise, gate, and review","finalize_task_ids":["T3"]},{"plan_step_summary":"Update tests/test_workers.py validation fixtures and assertions","finalize_task_ids":["T3"]},{"plan_step_summary":"Keep worker fallout changes limited and avoid handler/prompt scope creep","finalize_task_ids":["T3"]},{"plan_step_summary":"Add focused schema assertions for the six named mismatches","finalize_task_ids":["T4"]},{"plan_step_summary":"Add direct regression coverage for recursive overwrite of incomplete required arrays","finalize_task_ids":["T4"]},{"plan_step_summary":"Keep schema-test updates out of review.rework_items[].flag_id redesign territory","finalize_task_ids":["T4"]},{"plan_step_summary":"Update duplicate strict_schema() smoke coverage in tests/test_megaplan.py as needed","finalize_task_ids":["T4"]},{"plan_step_summary":"Run the schema-gap audit as the first cheap verification check","finalize_task_ids":["T5"]},{"plan_step_summary":"Run focused worker validation coverage for validate_payload() and mock payloads","finalize_task_ids":["T5"]},{"plan_step_summary":"Run focused schema and strict-schema regression slices in existing tests","finalize_task_ids":["T5"]},{"plan_step_summary":"Finish with git status --short to confirm intended files only","finalize_task_ids":["T5"]},{"plan_step_summary":"Fix megaplan/schemas.py before updating dependent mocks and fixtures","finalize_task_ids":["T1","T3"]},{"plan_step_summary":"Align worker mocks and regressions immediately after schema edits","finalize_task_ids":["T3","T4"]},{"plan_step_summary":"Only broaden beyond planned files if post-fix audit finds another same-class gap","finalize_task_ids":["T2"]},{"plan_step_summary":"Regenerate on-disk .megaplan/schemas/*.json after raw-schema changes","finalize_task_ids":["T2"]},{"plan_step_summary":"Verify runtime-schema consumer paths that read generated schema copies directly","finalize_task_ids":["T2","T5"]},{"plan_step_summary":"Maintain scope on the six mismatches plus recursive backstop","finalize_task_ids":["T1","T3","T4"]}],"orphan_tasks":[],"completeness_notes":"All approved-plan implementation steps are covered by ordered execution tasks. Runtime-schema regeneration and direct on-disk consumer verification were promoted into explicit task coverage to address the settled decision and remaining critique concerns. Execution-order and validation-order instructions are reflected by task ordering and by the final verification task.","coverage_complete":true}}