Redesign the orchestrator subagent prompt (currently in megaplan/data/claude_subagent_appendix.md) to be clear, well-structured, and reliable. The current prompt is ~140 lines and tries to encode the full state machine, all phase rules, safeguards, breakpoints, and resume protocol in one block. The goal is NOT to make it programmatic — LLM judgment is intentionally part of orchestration. The goal is to make the prompt so clear that the LLM reliably follows it. Key areas to improve: (1) The LLM must know exactly what all the steps are for each robustness level and how to traverse them. (2) It must know how and when to escalate to the outer conversation (breakpoint types, what triggers each). (3) The prompt shouldn't be so dense that important instructions get lost — use clear sections, priorities, and formatting. (4) It should know how to handle edge cases (stuck phases, repeated failures, notes injection) without the prompt being overloaded. Think about prompt engineering best practices: clear role, explicit decision trees, examples of breakpoint format, separation of 'always do' vs 'conditionally do' rules. Produce a redesigned prompt that is well-organized and tested against the actual workflow in megaplan/_core/workflow.py.
code
Batch framing:
- Execute batch 1 of 3.
- Actionable task IDs for this batch: ['T1']
- Already completed task IDs available as dependency context: []
Actionable tasks for this batch:
[
{
"id": "T1",
"description": "Audit the current megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py (WORKFLOW dict lines 31-67, _ROBUSTNESS_OVERRIDES lines 73-86), megaplan/handlers.py (review rework loop lines 1089-1101, _MAX_REVIEW_REWORK_CYCLES), and megaplan/evaluation.py (orchestrator_guidance values lines 620-679). Then redesign the appendix file per the plan's structure: outer-skill sections (Activation, Launch, Outer Skill Handling) outside the template fence, and 11 sections inside the template fence (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference). Key accuracy fixes: (1) gate decision tree must cover all 5 conditions from workflow.py:42-50 including PROCEED+preflight-blocked, (2) review rework loop (needs_rework \u2192 finalized \u2192 execute, capped), (3) light robustness skips gate and review. Template variables {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, {ROBUSTNESS} must be preserved. The template must be self-contained \u2014 the subagent does NOT see instructions.md.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
}
]
Assistant
{"output":"Executed batch 1 task T1. Rewrote megaplan/data/claude_subagent_appendix.md into a self-contained subagent prompt with outer Activation/Launch/Outer Skill Handling sections and 11 in-template sections, aligned to the live workflow, gate branches, and review rework loop. Verified the required structure and checkpointed progress to . No tests were run in this batch because T3 is not in scope yet.","files_changed":[[REDACTED],[REDACTED]],"commands_run":["sed -n '1,240p' megaplan/data/claude_subagent_appendix.md","sed -n '1,180p' megaplan/_core/workflow.py","sed -n '1060,1135p' megaplan/handlers.py","sed -n '600,710p' megaplan/evaluation.py","python - <<'PY' ... verify required sections, preserved variables, gate conditions, and review loop ... PY","nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'","test -w .megaplan/plans/redesign-the-orchestrator-20260406-1943 && echo writable || echo not_writable"],"deviations":[],"task_updates":[{"task_id":"T1","status":"done","executor_notes":"Audited against , , and , then rewrote the appendix into a self-contained subagent prompt with outer Activation/Launch/Outer Skill Handling sections and 11 in-template sections. Verified that the template preserves , , , , and , covers all five gate branches including plus preflight-blocked, documents the loop with the 3-cycle cap, and states that light robustness skips gate and review.","files_changed":["megaplan/data/claude_subagent_appendix.md"],"commands_run":["sed -n '1,240p' megaplan/data/claude_subagent_appendix.md","sed -n '1,180p' megaplan/_core/workflow.py","sed -n '1060,1135p' megaplan/handlers.py","sed -n '600,710p' megaplan/evaluation.py","python - <<'PY' ... verify required sections, preserved variables, gate conditions, and review loop ... PY","nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"]}],"sense_check_acknowledgments":[{"sense_check_id":"SC1","executor_note":"Confirmed by direct file inspection and a verification script that the appendix keeps , , and outside the template fence and includes all 11 required in-template sections."}]}
User
Assistant
Cross-checking the current appendix against workflow.py, handlers.py, and evaluation.py again. I’m focusing on exact routing language, the five gate branches, the review rework loop, and whether the prompt mirrors the real orchestrator_guidance strings rather than paraphrasing them.
Assistant
I found two real mismatches in the current appendix: it drifted back into an extra in-template 7A outer-skill section, and it still paraphrases gate guidance instead of grounding the subagent on the exact orchestrator_guidance strings from evaluation.py. I’m fixing both now and tightening the blocked-gate / blocked-review wording to match the handler behavior.
Assistant
There was one more behavioral mismatch: on iteration 1, evaluation.py deliberately overrides the specific proceed/escalate wording with the generic First iteration; follow gate recommendation: ... string. I’m adjusting the blocked-gate instruction so it doesn’t incorrectly assume the guidance text will always list failing preflight checks on the first pass.
Assistant
User
Assistant
I’m verifying the final batch by checking the Claude-only appendix path first, then I’ll run the full tests/test_megaplan.py suite. Because this is the final verification task, I’ll also create a short repro script for the appendix-loading risk, run it, and remove it before finishing.
Assistant
I confirmed the code path the task calls out: only claude_skill.md appends claude_subagent_appendix.md, while skill.md does not. Next I’m running a small repro script around that setup path, then the full tests/test_megaplan.py file.
Assistant
The repro script passed, so the Claude-only appendix behavior is intact. The full tests/test_megaplan.py run is still in progress; I’m waiting for the complete result before I close the batch.
Assistant
The suite is green: tests/test_megaplan.py finished with all 175 tests passing. I’m deleting the temporary repro script now and then I’ll checkpoint the batch result with the test evidence and the SC3 acknowledgment.
Assistant
{
"task_updates": [
{
"task_id": "T3",
"status": "done",
"executor_notes": "Ran a temporary repro script against megaplan.handle_setup_global() to verify the Claude-specific appendix still installs only into Claude's skill file and not Codex's, then ran the full pytest tests/test_megaplan.py suite. The repro script passed, and the full suite completed successfully with 175 passed in 6.85s, including test_global_setup_codex_no_subagent_appendix.",
"files_changed": [],
"commands_run": [
"python /tmp/verify_codex_appendix.py",
"pytest tests/test_megaplan.py"
]
}
],
"sense_check_acknowledgments": [
{
"sense_check_id": "SC3",
"executor_note": "Confirmed by the full tests/test_megaplan.py run that all 175 tests pass, including the Claude/Codex setup coverage around test_global_setup_codex_no_subagent_appendix."
}
]
}
User
Assistant
I already completed the T3 verification path in the prior step, so this turn is about synchronizing the authoritative structured summary the harness asked for. I’m reading the checkpoint file now and then I’ll write the full read-modify-write checkpoint with T1/T2/T3 and SC1/SC2/SC3 preserved.
Assistant
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[]
Prior batch deviations (address if applicable):
None
Batch-scoped sense checks:
[
{
"id": "SC1",
"task_id": "T1",
"question": "Does the redesigned template contain all 11 planned sections (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference) and is the outer-skill handling section outside the template fence?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Audit the current megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py (WORKFLOW dict lines 31-67, _ROBUSTNESS_OVERRIDES lines 73-86), megaplan/handlers.py (review rework loop lines 1089-1101, _MAX_REVIEW_REWORK_CYCLES), and megaplan/evaluation.py (orchestrator_guidance values lines 620-679). Then redesign the appendix file per the plan's structure: outer-skill sections (Activation, Launch, Outer Skill Handling) outside the template fence, and 11 sections inside the template fence (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference). Key accuracy fixes: (1) gate decision tree must cover all 5 conditions from workflow.py:42-50 including PROCEED+preflight-blocked, (2) review rework loop (needs_rework \u2192 finalized \u2192 execute, capped), (3) light robustness skips gate and review. Template variables {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, {ROBUSTNESS} must be preserved. The template must be self-contained \u2014 the subagent does NOT see instructions.md.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Cross-check every routing claim in the redesigned template against source code. Specifically: (1) Verify all state transitions for light/standard/heavy against WORKFLOW dict and _ROBUSTNESS_OVERRIDES in workflow.py. (2) Verify all 5 gate conditions (gate_unset, gate_iterate, gate_escalate, gate_proceed_blocked, gate_proceed) from workflow.py:42-50 are accurately described. (3) Verify review rework loop matches handlers.py:1089-1101. (4) Verify all orchestrator_guidance string values match evaluation.py:620-679. (5) Verify breakpoint trigger conditions match actual code behavior. Fix any discrepancies found directly in the appendix file.",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Run pytest tests/test_megaplan.py and verify all tests pass. The appendix is loaded as a static file, so content changes should not break tests \u2014 but check that no test references specific line content. Pay particular attention to test_global_setup_codex_no_subagent_appendix (line 1655) which verifies non-Claude agents don't get the appendix. If any test fails, read the error, fix the code, and re-run until green.",
"depends_on": [
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [
"pytest tests/test_megaplan.py"
],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"[DEBT] subagent-safeguards: plan's retry caps (1 phase, 3 execute) may differ from hermes-agent's actual policy \u2014 verify actual safeguard numbers before encoding them in the prompt",
"[DEBT] worker-permissions: codex/claude --full-auto and --permission-mode flags only trigger for step == 'execute', not 'loop_execute' \u2014 don't inadvertently document loop_execute handling that doesn't exist",
"Template must be self-contained: the subagent does NOT see instructions.md, so do not cross-reference or deduplicate against it within the template fence",
"The outer-skill handling section moves outside the template fence \u2014 verify the subagent's own resume protocol section covers everything it needs without that content",
"gate_unset is a real 5th condition (first gate call) \u2014 don't collapse it into gate_iterate or omit it",
"orchestrator_guidance values in evaluation.py are the source of truth \u2014 the prompt must not invent guidance strings that don't exist in the code",
"Line count target is ~180 lines for the template \u2014 watch for bloat but don't sacrifice accuracy for brevity"
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does the redesigned template contain all 11 planned sections (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference) and is the outer-skill handling section outside the template fence?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Do the three robustness-level flowcharts (light, standard, heavy) exactly match the transitions in workflow.py's WORKFLOW dict and _ROBUSTNESS_OVERRIDES, and does the gate decision tree cover all 5 conditions from workflow.py:42-50?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Do all existing tests pass, including test_global_setup_codex_no_subagent_appendix?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "The core challenge is accuracy: the prompt must describe the actual state machine, not an idealized version. The executor should read workflow.py's WORKFLOW dict and _ROBUSTNESS_OVERRIDES thoroughly before writing any routing content \u2014 the current prompt already has inaccuracies (missing preflight-blocked gate case, missing review rework loop) that this rewrite must fix. The two-audience structure (outer skill vs subagent) is the key architectural constraint: everything inside the template fence must be self-contained since the subagent never sees instructions.md. The outer-skill handling section currently lives inside the template but should move outside \u2014 however, the subagent's resume protocol section must independently cover what the subagent needs to know about resumption. When writing breakpoint trigger conditions, check the actual code behavior rather than just the plan's description \u2014 the plan is a guide, not gospel.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Audit current prompt structure, map two-audience structure, document routing inaccuracies, list concerns to separate",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Redesign the appendix with outer-skill sections and 11-section self-contained agent prompt template",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Cross-check routing accuracy against workflow.py, evaluation.py, handlers.py",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Run tests to confirm no regressions",
"finalize_task_ids": [
"T3"
]
}
],
"orphan_tasks": [],
"completeness_notes": "Steps 1 and 2 are merged into T1 because the audit directly feeds into the rewrite \u2014 creating a separate read-only task would be wasteful. The executor reads source files and writes the redesigned prompt in one pass.",
"coverage_complete": true
}
}
code
Debt watch items (do not make these worse):
[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-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] 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] 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] 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] 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] 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] 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 → 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 → plan change. (flagged 1 times across 1 plans)
code
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T1]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC1]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/megaplan/.megaplan/plans/redesign-the-orchestrator-20260406-1943/execution_batch_1.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- If a test fails and you determine the failure is pre-existing (fails without your changes too), you MUST still re-run the FULL test suite with your changes applied. Pre-existing failures do not excuse you from verifying all other tests still pass. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
Redesign the orchestrator subagent prompt (currently in megaplan/data/claude_subagent_appendix.md) to be clear, well-structured, and reliable. The current prompt is ~140 lines and tries to encode the full state machine, all phase rules, safeguards, breakpoints, and resume protocol in one block. The goal is NOT to make it programmatic — LLM judgment is intentionally part of orchestration. The goal is to make the prompt so clear that the LLM reliably follows it. Key areas to improve: (1) The LLM must know exactly what all the steps are for each robustness level and how to traverse them. (2) It must know how and when to escalate to the outer conversation (breakpoint types, what triggers each). (3) The prompt shouldn't be so dense that important instructions get lost — use clear sections, priorities, and formatting. (4) It should know how to handle edge cases (stuck phases, repeated failures, notes injection) without the prompt being overloaded. Think about prompt engineering best practices: clear role, explicit decision trees, examples of breakpoint format, separation of 'always do' vs 'conditionally do' rules. Produce a redesigned prompt that is well-organized and tested against the actual workflow in megaplan/_core/workflow.py.
code
Batch framing:
- Execute batch 2 of 3.
- Actionable task IDs for this batch: ['T2']
- Already completed task IDs available as dependency context: ['T1']
Actionable tasks for this batch:
[
{
"id": "T2",
"description": "Cross-check every routing claim in the redesigned template against source code. Specifically: (1) Verify all state transitions for light/standard/heavy against WORKFLOW dict and _ROBUSTNESS_OVERRIDES in workflow.py. (2) Verify all 5 gate conditions (gate_unset, gate_iterate, gate_escalate, gate_proceed_blocked, gate_proceed) from workflow.py:42-50 are accurately described. (3) Verify review rework loop matches handlers.py:1089-1101. (4) Verify all orchestrator_guidance string values match evaluation.py:620-679. (5) Verify breakpoint trigger conditions match actual code behavior. Fix any discrepancies found directly in the appendix file.",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Audit the current megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py (WORKFLOW dict lines 31-67, _ROBUSTNESS_OVERRIDES lines 73-86), megaplan/handlers.py (review rework loop lines 1089-1101, _MAX_REVIEW_REWORK_CYCLES), and megaplan/evaluation.py (orchestrator_guidance values lines 620-679). Then redesign the appendix file per the plan's structure: outer-skill sections (Activation, Launch, Outer Skill Handling) outside the template fence, and 11 sections inside the template fence (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference). Key accuracy fixes: (1) gate decision tree must cover all 5 conditions from workflow.py:42-50 including PROCEED+preflight-blocked, (2) review rework loop (needs_rework \u2192 finalized \u2192 execute, capped), (3) light robustness skips gate and review. Template variables {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, {ROBUSTNESS} must be preserved. The template must be self-contained \u2014 the subagent does NOT see instructions.md.",
"depends_on": [],
"status": "done",
"executor_notes": "Audited megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py, megaplan/handlers.py, and megaplan/evaluation.py, then rewrote the appendix into a self-contained subagent prompt with outer Activation/Launch/Outer Skill Handling sections and 11 in-template sections. Verified that the template preserves {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, and {ROBUSTNESS}, covers all five gate branches including PROCEED plus preflight-blocked, documents the review -> needs_rework -> finalized -> execute loop with the 3-cycle cap, and states that light robustness skips gate and review.",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [
"sed -n '1,240p' megaplan/data/claude_subagent_appendix.md",
"sed -n '1,180p' megaplan/_core/workflow.py",
"sed -n '1060,1135p' megaplan/handlers.py",
"sed -n '600,710p' megaplan/evaluation.py",
"python - <<'PY' ... verify required sections, preserved variables, gate conditions, and review loop ... PY",
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"
],
"evidence_files": [],
"reviewer_verdict": ""
}
]
code
Prior batch deviations (address if applicable):
[
"Advisory observation mismatch: executor claimed files not observed in git status/content hash delta: .megaplan/plans/redesign-the-orchestrator-20260406-1943/execution_batch_1.json",
"Advisory audit finding: Git status shows changed files not claimed by any task: README.md, megaplan/cli.py, megaplan/data/instructions.md, tests/test_megaplan.py",
"Advisory audit finding: Sense check SC2 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC3 is missing an executor acknowledgment."
]
code
Batch-scoped sense checks:
[
{
"id": "SC2",
"task_id": "T2",
"question": "Do the three robustness-level flowcharts (light, standard, heavy) exactly match the transitions in workflow.py's WORKFLOW dict and _ROBUSTNESS_OVERRIDES, and does the gate decision tree cover all 5 conditions from workflow.py:42-50?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Audit the current megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py (WORKFLOW dict lines 31-67, _ROBUSTNESS_OVERRIDES lines 73-86), megaplan/handlers.py (review rework loop lines 1089-1101, _MAX_REVIEW_REWORK_CYCLES), and megaplan/evaluation.py (orchestrator_guidance values lines 620-679). Then redesign the appendix file per the plan's structure: outer-skill sections (Activation, Launch, Outer Skill Handling) outside the template fence, and 11 sections inside the template fence (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference). Key accuracy fixes: (1) gate decision tree must cover all 5 conditions from workflow.py:42-50 including PROCEED+preflight-blocked, (2) review rework loop (needs_rework \u2192 finalized \u2192 execute, capped), (3) light robustness skips gate and review. Template variables {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, {ROBUSTNESS} must be preserved. The template must be self-contained \u2014 the subagent does NOT see instructions.md.",
"depends_on": [],
"status": "done",
"executor_notes": "Audited megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py, megaplan/handlers.py, and megaplan/evaluation.py, then rewrote the appendix into a self-contained subagent prompt with outer Activation/Launch/Outer Skill Handling sections and 11 in-template sections. Verified that the template preserves {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, and {ROBUSTNESS}, covers all five gate branches including PROCEED plus preflight-blocked, documents the review -> needs_rework -> finalized -> execute loop with the 3-cycle cap, and states that light robustness skips gate and review.",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [
"sed -n '1,240p' megaplan/data/claude_subagent_appendix.md",
"sed -n '1,180p' megaplan/_core/workflow.py",
"sed -n '1060,1135p' megaplan/handlers.py",
"sed -n '600,710p' megaplan/evaluation.py",
"python - <<'PY' ... verify required sections, preserved variables, gate conditions, and review loop ... PY",
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Cross-check every routing claim in the redesigned template against source code. Specifically: (1) Verify all state transitions for light/standard/heavy against WORKFLOW dict and _ROBUSTNESS_OVERRIDES in workflow.py. (2) Verify all 5 gate conditions (gate_unset, gate_iterate, gate_escalate, gate_proceed_blocked, gate_proceed) from workflow.py:42-50 are accurately described. (3) Verify review rework loop matches handlers.py:1089-1101. (4) Verify all orchestrator_guidance string values match evaluation.py:620-679. (5) Verify breakpoint trigger conditions match actual code behavior. Fix any discrepancies found directly in the appendix file.",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Run and verify all tests pass. The appendix is loaded as a static file, so content changes should not break tests \u2014 but check that no test references specific line content. Pay particular attention to (line 1655) which verifies non-Claude agents don't get the appendix. If any test fails, read the error, fix the code, and re-run until green.",
"depends_on": [
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [
"pytest tests/test_megaplan.py"
],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"[DEBT] subagent-safeguards: plan's retry caps (1 phase, 3 execute) may differ from hermes-agent's actual policy \u2014 verify actual safeguard numbers before encoding them in the prompt",
"[DEBT] worker-permissions: codex/claude --full-auto and --permission-mode flags only trigger for step == 'execute', not 'loop_execute' \u2014 don't inadvertently document loop_execute handling that doesn't exist",
"Template must be self-contained: the subagent does NOT see instructions.md, so do not cross-reference or deduplicate against it within the template fence",
"The outer-skill handling section moves outside the template fence \u2014 verify the subagent's own resume protocol section covers everything it needs without that content",
"gate_unset is a real 5th condition (first gate call) \u2014 don't collapse it into gate_iterate or omit it",
"orchestrator_guidance values in evaluation.py are the source of truth \u2014 the prompt must not invent guidance strings that don't exist in the code",
"Line count target is ~180 lines for the template \u2014 watch for bloat but don't sacrifice accuracy for brevity"
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does the redesigned template contain all 11 planned sections (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference) and is the outer-skill handling section outside the template fence?",
"executor_note": "Confirmed by direct file inspection and a verification script that the appendix keeps , , and outside the template fence and includes all 11 required in-template sections.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Do the three robustness-level flowcharts (light, standard, heavy) exactly match the transitions in workflow.py's WORKFLOW dict and _ROBUSTNESS_OVERRIDES, and does the gate decision tree cover all 5 conditions from workflow.py:42-50?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Do all existing tests pass, including test_global_setup_codex_no_subagent_appendix?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "The core challenge is accuracy: the prompt must describe the actual state machine, not an idealized version. The executor should read workflow.py's WORKFLOW dict and _ROBUSTNESS_OVERRIDES thoroughly before writing any routing content \u2014 the current prompt already has inaccuracies (missing preflight-blocked gate case, missing review rework loop) that this rewrite must fix. The two-audience structure (outer skill vs subagent) is the key architectural constraint: everything inside the template fence must be self-contained since the subagent never sees instructions.md. The outer-skill handling section currently lives inside the template but should move outside \u2014 however, the subagent's resume protocol section must independently cover what the subagent needs to know about resumption. When writing breakpoint trigger conditions, check the actual code behavior rather than just the plan's description \u2014 the plan is a guide, not gospel.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Audit current prompt structure, map two-audience structure, document routing inaccuracies, list concerns to separate",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Redesign the appendix with outer-skill sections and 11-section self-contained agent prompt template",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Cross-check routing accuracy against workflow.py, evaluation.py, handlers.py",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Run tests to confirm no regressions",
"finalize_task_ids": [
"T3"
]
}
],
"orphan_tasks": [],
"completeness_notes": "Steps 1 and 2 are merged into T1 because the audit directly feeds into the rewrite \u2014 creating a separate read-only task would be wasteful. The executor reads source files and writes the redesigned prompt in one pass.",
"coverage_complete": true
}
}
code
Debt watch items (do not make these worse):
[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-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] 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 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)
{"output":"Executed batch 2 task T2. Re-audited the appendix against workflow.py, handlers.py, and evaluation.py, then corrected the remaining source mismatches in megaplan/data/claude_subagent_appendix.md: removed the stray in-template outer-skill section, grounded the gate handling on the exact orchestrator_guidance lead strings, documented iteration-1 guidance precedence, and tightened the gate_proceed_blocked and blocked-review wording to match handler behavior. Verified the final prompt matches all three robustness flows, all five gate branches, and the review rework path. No tests were run in this batch because T3 is the test task.","files_changed":[[REDACTED]],"commands_run":["sed -n '1,260p' megaplan/data/claude_subagent_appendix.md","sed -n '31,86p' megaplan/_core/workflow.py","sed -n '474,557p' megaplan/handlers.py","sed -n '620,679p' megaplan/evaluation.py","sed -n '1064,1105p' megaplan/handlers.py","python - <<'PY' ... verify 11 in-template sections, all flows, all 5 gate conditions, exact guidance strings, and review blocked/rework behavior ... PY","nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '88,180p'","test -w .megaplan/plans/redesign-the-orchestrator-20260406-1943 && echo writable || echo not_writable"],"deviations":[],"task_updates":[{"task_id":"T2","status":"done","executor_notes":"Cross-checked the rewritten appendix against megaplan/_core/workflow.py, megaplan/handlers.py, and megaplan/evaluation.py, then corrected the remaining mismatches in megaplan/data/claude_subagent_appendix.md. The final template now reflects the light/standard/heavy transitions from WORKFLOW plus _ROBUSTNESS_OVERRIDES, preserves all five gate branches, documents the review -> finalized -> execute rework loop and blocked-review state from handlers.py, removes the stray in-template outer-skill 7A section, and anchors gate interpretation to the exact orchestrator_guidance lead strings from evaluation.py, including the iteration-1 precedence rule.","files_changed":["megaplan/data/claude_subagent_appendix.md"],"commands_run":["sed -n '1,260p' megaplan/data/claude_subagent_appendix.md","sed -n '31,86p' megaplan/_core/workflow.py","sed -n '474,557p' megaplan/handlers.py","sed -n '620,679p' megaplan/evaluation.py","sed -n '1064,1105p' megaplan/handlers.py","python - <<'PY' ... verify 11 in-template sections, all flows, all 5 gate conditions, exact guidance strings, and review blocked/rework behavior ... PY","nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '88,180p'"]}],"sense_check_acknowledgments":[{"sense_check_id":"SC2","executor_note":"Verified against the workflow and handler source that the prompt now matches all three robustness flows, all five gate conditions, and the review rework path; a follow-up script also confirmed the template contains exactly 11 in-template sections and no stray 7A section."}]}
Redesign the orchestrator subagent prompt (currently in megaplan/data/claude_subagent_appendix.md) to be clear, well-structured, and reliable. The current prompt is ~140 lines and tries to encode the full state machine, all phase rules, safeguards, breakpoints, and resume protocol in one block. The goal is NOT to make it programmatic — LLM judgment is intentionally part of orchestration. The goal is to make the prompt so clear that the LLM reliably follows it. Key areas to improve: (1) The LLM must know exactly what all the steps are for each robustness level and how to traverse them. (2) It must know how and when to escalate to the outer conversation (breakpoint types, what triggers each). (3) The prompt shouldn't be so dense that important instructions get lost — use clear sections, priorities, and formatting. (4) It should know how to handle edge cases (stuck phases, repeated failures, notes injection) without the prompt being overloaded. Think about prompt engineering best practices: clear role, explicit decision trees, examples of breakpoint format, separation of 'always do' vs 'conditionally do' rules. Produce a redesigned prompt that is well-organized and tested against the actual workflow in megaplan/_core/workflow.py.
code
Batch framing:
- Execute batch 3 of 3.
- Actionable task IDs for this batch: ['T3']
- Already completed task IDs available as dependency context: ['T1', 'T2']
Actionable tasks for this batch:
[
{
"id": "T3",
"description": "Run pytest tests/test_megaplan.py and verify all tests pass. The appendix is loaded as a static file, so content changes should not break tests \u2014 but check that no test references specific line content. Pay particular attention to test_global_setup_codex_no_subagent_appendix (line 1655) which verifies non-Claude agents don't get the appendix. If any test fails, read the error, fix the code, and re-run until green.",
"depends_on": [
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [
"pytest tests/test_megaplan.py"
],
"evidence_files": [],
"reviewer_verdict": ""
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Audit the current megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py (WORKFLOW dict lines 31-67, _ROBUSTNESS_OVERRIDES lines 73-86), megaplan/handlers.py (review rework loop lines 1089-1101, _MAX_REVIEW_REWORK_CYCLES), and megaplan/evaluation.py (orchestrator_guidance values lines 620-679). Then redesign the appendix file per the plan's structure: outer-skill sections (Activation, Launch, Outer Skill Handling) outside the template fence, and 11 sections inside the template fence (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference). Key accuracy fixes: (1) gate decision tree must cover all 5 conditions from workflow.py:42-50 including PROCEED+preflight-blocked, (2) review rework loop (needs_rework \u2192 finalized \u2192 execute, capped), (3) light robustness skips gate and review. Template variables {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, {ROBUSTNESS} must be preserved. The template must be self-contained \u2014 the subagent does NOT see instructions.md.",
"depends_on": [],
"status": "done",
"executor_notes": "Audited megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py, megaplan/handlers.py, and megaplan/evaluation.py, then rewrote the appendix into a self-contained subagent prompt with outer Activation/Launch/Outer Skill Handling sections and 11 in-template sections. Verified that the template preserves {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, and {ROBUSTNESS}, covers all five gate branches including PROCEED plus preflight-blocked, documents the review -> needs_rework -> finalized -> execute loop with the 3-cycle cap, and states that light robustness skips gate and review.",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [
"sed -n '1,240p' megaplan/data/claude_subagent_appendix.md",
"sed -n '1,180p' megaplan/_core/workflow.py",
"sed -n '1060,1135p' megaplan/handlers.py",
"sed -n '600,710p' megaplan/evaluation.py",
"python - <<'PY' ... verify required sections, preserved variables, gate conditions, and review loop ... PY",
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Cross-check every routing claim in the redesigned template against source code. Specifically: (1) Verify all state transitions for light/standard/heavy against WORKFLOW dict and _ROBUSTNESS_OVERRIDES in workflow.py. (2) Verify all 5 gate conditions (gate_unset, gate_iterate, gate_escalate, gate_proceed_blocked, gate_proceed) from workflow.py:42-50 are accurately described. (3) Verify review rework loop matches handlers.py:1089-1101. (4) Verify all orchestrator_guidance string values match evaluation.py:620-679. (5) Verify breakpoint trigger conditions match actual code behavior. Fix any discrepancies found directly in the appendix file.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Cross-checked the rewritten appendix against megaplan/_core/workflow.py, megaplan/handlers.py, and megaplan/evaluation.py, then corrected the remaining mismatches in megaplan/data/claude_subagent_appendix.md. The final template now reflects the light/standard/heavy transitions from WORKFLOW plus _ROBUSTNESS_OVERRIDES, preserves all five gate branches, documents the review -> finalized -> execute rework loop and blocked-review state from handlers.py, removes the stray in-template outer-skill 7A section, and anchors gate interpretation to the exact orchestrator_guidance lead strings from evaluation.py, including the iteration-1 precedence rule.",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [
"sed -n '1,260p' megaplan/data/claude_subagent_appendix.md",
"sed -n '31,86p' megaplan/_core/workflow.py",
"sed -n '474,557p' megaplan/handlers.py",
"sed -n '620,679p' megaplan/evaluation.py",
"sed -n '1064,1105p' megaplan/handlers.py",
"python - <<'PY' ... verify 11 in-template sections, all flows, all 5 gate conditions, exact guidance strings, and review blocked/rework behavior ... PY",
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '88,180p'"
],
"evidence_files": [],
"reviewer_verdict": ""
}
]
code
Prior batch deviations (address if applicable):
[
"Advisory audit finding: Git status shows changed files not claimed by any task: README.md, megaplan/cli.py, megaplan/data/instructions.md, tests/test_megaplan.py",
"Advisory audit finding: Sense check SC3 is missing an executor acknowledgment."
]
code
Batch-scoped sense checks:
[
{
"id": "SC3",
"task_id": "T3",
"question": "Do all existing tests pass, including test_global_setup_codex_no_subagent_appendix?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Audit the current megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py (WORKFLOW dict lines 31-67, _ROBUSTNESS_OVERRIDES lines 73-86), megaplan/handlers.py (review rework loop lines 1089-1101, _MAX_REVIEW_REWORK_CYCLES), and megaplan/evaluation.py (orchestrator_guidance values lines 620-679). Then redesign the appendix file per the plan's structure: outer-skill sections (Activation, Launch, Outer Skill Handling) outside the template fence, and 11 sections inside the template fence (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference). Key accuracy fixes: (1) gate decision tree must cover all 5 conditions from workflow.py:42-50 including PROCEED+preflight-blocked, (2) review rework loop (needs_rework \u2192 finalized \u2192 execute, capped), (3) light robustness skips gate and review. Template variables {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, {ROBUSTNESS} must be preserved. The template must be self-contained \u2014 the subagent does NOT see instructions.md.",
"depends_on": [],
"status": "done",
"executor_notes": "Audited megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py, megaplan/handlers.py, and megaplan/evaluation.py, then rewrote the appendix into a self-contained subagent prompt with outer Activation/Launch/Outer Skill Handling sections and 11 in-template sections. Verified that the template preserves {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, and {ROBUSTNESS}, covers all five gate branches including PROCEED plus preflight-blocked, documents the review -> needs_rework -> finalized -> execute loop with the 3-cycle cap, and states that light robustness skips gate and review.",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [
"sed -n '1,240p' megaplan/data/claude_subagent_appendix.md",
"sed -n '1,180p' megaplan/_core/workflow.py",
"sed -n '1060,1135p' megaplan/handlers.py",
"sed -n '600,710p' megaplan/evaluation.py",
"python - <<'PY' ... verify required sections, preserved variables, gate conditions, and review loop ... PY",
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Cross-check every routing claim in the redesigned template against source code. Specifically: (1) Verify all state transitions for light/standard/heavy against WORKFLOW dict and _ROBUSTNESS_OVERRIDES in workflow.py. (2) Verify all 5 gate conditions (gate_unset, gate_iterate, gate_escalate, gate_proceed_blocked, gate_proceed) from workflow.py:42-50 are accurately described. (3) Verify review rework loop matches handlers.py:1089-1101. (4) Verify all orchestrator_guidance string values match evaluation.py:620-679. (5) Verify breakpoint trigger conditions match actual code behavior. Fix any discrepancies found directly in the appendix file.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Cross-checked the rewritten appendix against , , and , then corrected the remaining mismatches in . The final template now reflects the light/standard/heavy transitions from plus , preserves all five gate branches, documents the rework loop and blocked-review state from , removes the stray in-template outer-skill section, and anchors gate interpretation to the exact lead strings from , including the iteration-1 precedence rule.",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [
"sed -n '1,260p' megaplan/data/claude_subagent_appendix.md",
"sed -n '31,86p' megaplan/_core/workflow.py",
"sed -n '474,557p' megaplan/handlers.py",
"sed -n '620,679p' megaplan/evaluation.py",
"sed -n '1064,1105p' megaplan/handlers.py",
"python - <<'PY' ... verify 11 in-template sections, all flows, all 5 gate conditions, exact guidance strings, and review blocked/rework behavior ... PY",
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '88,180p'"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Run and verify all tests pass. The appendix is loaded as a static file, so content changes should not break tests \u2014 but check that no test references specific line content. Pay particular attention to (line 1655) which verifies non-Claude agents don't get the appendix. If any test fails, read the error, fix the code, and re-run until green.",
"depends_on": [
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [
"pytest tests/test_megaplan.py"
],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"[DEBT] subagent-safeguards: plan's retry caps (1 phase, 3 execute) may differ from hermes-agent's actual policy \u2014 verify actual safeguard numbers before encoding them in the prompt",
"[DEBT] worker-permissions: codex/claude --full-auto and --permission-mode flags only trigger for step == 'execute', not 'loop_execute' \u2014 don't inadvertently document loop_execute handling that doesn't exist",
"Template must be self-contained: the subagent does NOT see instructions.md, so do not cross-reference or deduplicate against it within the template fence",
"The outer-skill handling section moves outside the template fence \u2014 verify the subagent's own resume protocol section covers everything it needs without that content",
"gate_unset is a real 5th condition (first gate call) \u2014 don't collapse it into gate_iterate or omit it",
"orchestrator_guidance values in evaluation.py are the source of truth \u2014 the prompt must not invent guidance strings that don't exist in the code",
"Line count target is ~180 lines for the template \u2014 watch for bloat but don't sacrifice accuracy for brevity"
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does the redesigned template contain all 11 planned sections (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference) and is the outer-skill handling section outside the template fence?",
"executor_note": "Confirmed by direct file inspection and a verification script that the appendix keeps , , and outside the template fence and includes all 11 required in-template sections.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Do the three robustness-level flowcharts (light, standard, heavy) exactly match the transitions in workflow.py's WORKFLOW dict and _ROBUSTNESS_OVERRIDES, and does the gate decision tree cover all 5 conditions from workflow.py:42-50?",
"executor_note": "Verified against the workflow and handler source that the prompt now matches all three robustness flows, all five gate conditions, and the review rework path; a follow-up script also confirmed the template contains exactly 11 in-template sections and no stray section.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Do all existing tests pass, including test_global_setup_codex_no_subagent_appendix?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "The core challenge is accuracy: the prompt must describe the actual state machine, not an idealized version. The executor should read workflow.py's WORKFLOW dict and _ROBUSTNESS_OVERRIDES thoroughly before writing any routing content \u2014 the current prompt already has inaccuracies (missing preflight-blocked gate case, missing review rework loop) that this rewrite must fix. The two-audience structure (outer skill vs subagent) is the key architectural constraint: everything inside the template fence must be self-contained since the subagent never sees instructions.md. The outer-skill handling section currently lives inside the template but should move outside \u2014 however, the subagent's resume protocol section must independently cover what the subagent needs to know about resumption. When writing breakpoint trigger conditions, check the actual code behavior rather than just the plan's description \u2014 the plan is a guide, not gospel.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Audit current prompt structure, map two-audience structure, document routing inaccuracies, list concerns to separate",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Redesign the appendix with outer-skill sections and 11-section self-contained agent prompt template",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Cross-check routing accuracy against workflow.py, evaluation.py, handlers.py",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Run tests to confirm no regressions",
"finalize_task_ids": [
"T3"
]
}
],
"orphan_tasks": [],
"completeness_notes": "Steps 1 and 2 are merged into T1 because the audit directly feeds into the rewrite \u2014 creating a separate read-only task would be wasteful. The executor reads source files and writes the redesigned prompt in one pass.",
"coverage_complete": true
}
}
code
Debt watch items (do not make these worse):
[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-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] 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 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)
Redesign the orchestrator subagent prompt (currently in megaplan/data/claude_subagent_appendix.md) to be clear, well-structured, and reliable. The current prompt is ~140 lines and tries to encode the full state machine, all phase rules, safeguards, breakpoints, and resume protocol in one block. The goal is NOT to make it programmatic — LLM judgment is intentionally part of orchestration. The goal is to make the prompt so clear that the LLM reliably follows it. Key areas to improve: (1) The LLM must know exactly what all the steps are for each robustness level and how to traverse them. (2) It must know how and when to escalate to the outer conversation (breakpoint types, what triggers each). (3) The prompt shouldn't be so dense that important instructions get lost — use clear sections, priorities, and formatting. (4) It should know how to handle edge cases (stuck phases, repeated failures, notes injection) without the prompt being overloaded. Think about prompt engineering best practices: clear role, explicit decision trees, examples of breakpoint format, separation of 'always do' vs 'conditionally do' rules. Produce a redesigned prompt that is well-organized and tested against the actual workflow in megaplan/_core/workflow.py.
code
Execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Audit the current megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py (WORKFLOW dict lines 31-67, _ROBUSTNESS_OVERRIDES lines 73-86), megaplan/handlers.py (review rework loop lines 1089-1101, _MAX_REVIEW_REWORK_CYCLES), and megaplan/evaluation.py (orchestrator_guidance values lines 620-679). Then redesign the appendix file per the plan's structure: outer-skill sections (Activation, Launch, Outer Skill Handling) outside the template fence, and 11 sections inside the template fence (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference). Key accuracy fixes: (1) gate decision tree must cover all 5 conditions from workflow.py:42-50 including PROCEED+preflight-blocked, (2) review rework loop (needs_rework \u2192 finalized \u2192 execute, capped), (3) light robustness skips gate and review. Template variables {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, {ROBUSTNESS} must be preserved. The template must be self-contained \u2014 the subagent does NOT see instructions.md.",
"depends_on": [],
"status": "done",
"executor_notes": "Audited megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py, megaplan/handlers.py, and megaplan/evaluation.py, then rewrote the appendix into a self-contained subagent prompt with outer Activation/Launch/Outer Skill Handling sections and 11 in-template sections. Verified that the template preserves {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, and {ROBUSTNESS}, covers all five gate branches including PROCEED plus preflight-blocked, documents the review -> needs_rework -> finalized -> execute loop with the 3-cycle cap, and states that light robustness skips gate and review.",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [
"sed -n '1,240p' megaplan/data/claude_subagent_appendix.md",
"sed -n '1,180p' megaplan/_core/workflow.py",
"sed -n '1060,1135p' megaplan/handlers.py",
"sed -n '600,710p' megaplan/evaluation.py",
"python - <<'PY' ... verify required sections, preserved variables, gate conditions, and review loop ... PY",
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Cross-check every routing claim in the redesigned template against source code. Specifically: (1) Verify all state transitions for light/standard/heavy against WORKFLOW dict and _ROBUSTNESS_OVERRIDES in workflow.py. (2) Verify all 5 gate conditions (gate_unset, gate_iterate, gate_escalate, gate_proceed_blocked, gate_proceed) from workflow.py:42-50 are accurately described. (3) Verify review rework loop matches handlers.py:1089-1101. (4) Verify all orchestrator_guidance string values match evaluation.py:620-679. (5) Verify breakpoint trigger conditions match actual code behavior. Fix any discrepancies found directly in the appendix file.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Cross-checked the rewritten appendix against megaplan/_core/workflow.py, megaplan/handlers.py, and megaplan/evaluation.py, then corrected the remaining mismatches in megaplan/data/claude_subagent_appendix.md. The final template now reflects the light/standard/heavy transitions from WORKFLOW plus _ROBUSTNESS_OVERRIDES, preserves all five gate branches, documents the review -> finalized -> execute rework loop and blocked-review state from handlers.py, removes the stray in-template outer-skill 7A section, and anchors gate interpretation to the exact orchestrator_guidance lead strings from evaluation.py, including the iteration-1 precedence rule.",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [
"sed -n '1,260p' megaplan/data/claude_subagent_appendix.md",
"sed -n '31,86p' megaplan/_core/workflow.py",
"sed -n '474,557p' megaplan/handlers.py",
"sed -n '620,679p' megaplan/evaluation.py",
"sed -n '1064,1105p' megaplan/handlers.py",
"python - <<'PY' ... verify 11 in-template sections, all flows, all 5 gate conditions, exact guidance strings, and review blocked/rework behavior ... PY",
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '88,180p'"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Run pytest tests/test_megaplan.py and verify all tests pass. The appendix is loaded as a static file, so content changes should not break tests \u2014 but check that no test references specific line content. Pay particular attention to test_global_setup_codex_no_subagent_appendix (line 1655) which verifies non-Claude agents don't get the appendix. If any test fails, read the error, fix the code, and re-run until green.",
"depends_on": [
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [
"pytest tests/test_megaplan.py"
],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"[DEBT] subagent-safeguards: plan's retry caps (1 phase, 3 execute) may differ from hermes-agent's actual policy \u2014 verify actual safeguard numbers before encoding them in the prompt",
"[DEBT] worker-permissions: codex/claude --full-auto and --permission-mode flags only trigger for step == 'execute', not 'loop_execute' \u2014 don't inadvertently document loop_execute handling that doesn't exist",
"Template must be self-contained: the subagent does NOT see instructions.md, so do not cross-reference or deduplicate against it within the template fence",
"The outer-skill handling section moves outside the template fence \u2014 verify the subagent's own resume protocol section covers everything it needs without that content",
"gate_unset is a real 5th condition (first gate call) \u2014 don't collapse it into gate_iterate or omit it",
"orchestrator_guidance values in evaluation.py are the source of truth \u2014 the prompt must not invent guidance strings that don't exist in the code",
"Line count target is ~180 lines for the template \u2014 watch for bloat but don't sacrifice accuracy for brevity"
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does the redesigned template contain all 11 planned sections (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference) and is the outer-skill handling section outside the template fence?",
"executor_note": "Confirmed by direct file inspection and a verification script that the appendix keeps Activation, Launch, and Outer Skill Handling outside the template fence and includes all 11 required in-template sections.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Do the three robustness-level flowcharts (light, standard, heavy) exactly match the transitions in workflow.py's WORKFLOW dict and _ROBUSTNESS_OVERRIDES, and does the gate decision tree cover all 5 conditions from workflow.py:42-50?",
"executor_note": "Verified against the workflow and handler source that the prompt now matches all three robustness flows, all five gate conditions, and the review rework path; a follow-up script also confirmed the template contains exactly 11 in-template sections and no stray 7A section.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Do all existing tests pass, including test_global_setup_codex_no_subagent_appendix?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "The core challenge is accuracy: the prompt must describe the actual state machine, not an idealized version. The executor should read workflow.py's WORKFLOW dict and _ROBUSTNESS_OVERRIDES thoroughly before writing any routing content \u2014 the current prompt already has inaccuracies (missing preflight-blocked gate case, missing review rework loop) that this rewrite must fix. The two-audience structure (outer skill vs subagent) is the key architectural constraint: everything inside the template fence must be self-contained since the subagent never sees instructions.md. The outer-skill handling section currently lives inside the template but should move outside \u2014 however, the subagent's resume protocol section must independently cover what the subagent needs to know about resumption. When writing breakpoint trigger conditions, check the actual code behavior rather than just the plan's description \u2014 the plan is a guide, not gospel.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Audit current prompt structure, map two-audience structure, document routing inaccuracies, list concerns to separate",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Redesign the appendix with outer-skill sections and 11-section self-contained agent prompt template",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Cross-check routing accuracy against workflow.py, evaluation.py, handlers.py",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Run tests to confirm no regressions",
"finalize_task_ids": [
"T3"
]
}
],
"orphan_tasks": [],
"completeness_notes": "Steps 1 and 2 are merged into T1 because the audit directly feeds into the rewrite \u2014 creating a separate read-only task would be wasteful. The executor reads source files and writes the redesigned prompt in one pass.",
"coverage_complete": true
}
}
code
Absolute checkpoint path for best-effort progress checkpoints (NOT `finalize.json`):
/Users/user_c042661f/Documents/megaplan/.megaplan/plans/redesign-the-orchestrator-20260406-1943/execution_checkpoint.json
Plan metadata:
{
"version": 2,
"timestamp": "2026-04-06T17:52:15Z",
"hash": "sha256:ef60499b69490ec013ab4e57527d63b52fa2c7c6b341915cbddea5289fb75aeb",
"changes_summary": "FLAG-001 (subagent prompt self-containment): Fixed the fundamental approach. V1 planned to trim the template by removing "duplicates with instructions.md," but the subagent only sees the template \u2014 not instructions.md. The revised plan keeps the template self-contained (including command reference, phase rules, override descriptions) and instead restructures for clarity within that constraint. The deduplication strategy is now limited to the outer-skill sections (Activation, Launch, Outer Skill Handling) which DO coexist with instructions.md.\n\nFLAG-002 (gate PROCEED+preflight-blocked): Added explicit handling in the gate decision tree (Section 3). The tree now has four branches: PROCEED+passed\u2192finalize, PROCEED+blocked\u2192revise or force-proceed, ITERATE\u2192revise loop, ESCALATE\u2192breakpoint. This matches all five gate_* conditions in workflow.py:42-50.\n\nFLAG-003 (review needs_rework loop): Added review rework loop description in Section 3 routing. The prompt now explains that review can return needs_rework, routing back to finalized state with next_step=execute, and that this repeats up to a cap. This matches handlers.py:1089-1101.\n\nStructural change: Moved "Outer skill handling" from inside the template fence to outside it, since it describes outer skill behavior and shouldn't be sent to the subagent.\n\nSuccess criteria updates: Added must-criterion for gate preflight-blocked routing accuracy. Added must-criterion for review rework loop coverage. Removed the "should" criterion about deduplication with instructions.md (was based on the incorrect v1 assumption). Adjusted line count target upward since the template must be self-contained.",
"flags_addressed": [
"FLAG-001",
"FLAG-002",
"FLAG-003"
],
"questions": [
"Should the redesigned prompt include a concrete example of a breakpoint output (with placeholder values filled in), or just the format template? An example would add ~5 lines but significantly improve reliability."
],
"success_criteria": [
{
"criterion": "The redesigned prompt accurately describes all three robustness-level paths (light, standard, heavy) matching the transitions in workflow.py",
"priority": "must"
},
{
"criterion": "All four breakpoint types (GATE_ESCALATE, EXECUTE_APPROVAL, PHASE_ESCALATE, EXECUTE_ESCALATE) are documented with exact trigger conditions",
"priority": "must"
},
{
"criterion": "The prompt includes the 'check status after every phase' rule prominently and early",
"priority": "must"
},
{
"criterion": "No content contradicts the actual state machine in workflow.py or the orchestrator_guidance values in evaluation.py",
"priority": "must"
},
{
"criterion": "Gate routing covers all five conditions: gate_unset, gate_iterate, gate_escalate, gate_proceed_blocked, gate_proceed \u2014 matching workflow.py:42-50",
"priority": "must"
},
{
"criterion": "Review rework loop (needs_rework \u2192 finalized \u2192 execute) is documented, matching handlers.py:1089-1101",
"priority": "must"
},
{
"criterion": "All existing tests pass (pytest tests/test_megaplan.py)",
"priority": "must"
},
{
"criterion": "The template variables {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, {ROBUSTNESS} are preserved in the agent prompt template",
"priority": "must"
},
{
"criterion": "The agent prompt template is self-contained \u2014 it does not rely on instructions.md content that the subagent never sees",
"priority": "must"
},
{
"criterion": "The prompt is organized into clearly separated sections with distinct concerns (routing, breakpoints, safeguards, resume, etc.)",
"priority": "must"
},
{
"criterion": "Outer skill handling section is outside the template fence, not sent to the subagent",
"priority": "should"
},
{
"criterion": "Critical rules use visual emphasis (bold, callouts, or caps) to avoid being lost in surrounding text",
"priority": "should"
},
{
"criterion": "Each section is self-contained enough that the LLM can reference it without reading the whole prompt",
"priority": "should"
},
{
"criterion": "The prompt includes at least one concrete breakpoint output example with placeholder values filled in",
"priority": "should"
},
{
"criterion": "The template is under ~180 lines (modest growth from ~140 to accommodate added accuracy, but not bloated)",
"priority": "should"
},
{
"criterion": "A real megaplan run (light or standard) with the redesigned prompt completes successfully",
"priority": "info"
}
],
"assumptions": [
"The appendix should complement instructions.md, not duplicate it \u2014 removing redundant content is in scope since both files are concatenated into the final skill.",
"The agent prompt template (lines 18-157) is the primary target for redesign. The activation/launch sections (lines 1-16) above the template are secondary and can be lightly restructured.",
"Template variables ({IDEA}, {PROJECT_DIR}, etc.) and their substitution mechanism are unchanged \u2014 this is a content-only rewrite.",
"The 'Outer skill handling' section should move OUTSIDE the template fence since it describes outer skill behavior \u2014 the subagent's resume protocol section already covers what the subagent needs to know.",
"Including one concrete breakpoint example is worth the extra lines for reliability.",
"The command reference MUST stay in the template since the subagent does not see instructions.md.",
"_MAX_REVIEW_REWORK_CYCLES is a fixed cap in the handler \u2014 the prompt does not need to state the exact number, just that the loop is capped and the CLI handles it."
],
"delta_from_previous_percent": 73.39,
"structure_warnings": []
}
code
Gate summary:
{
"recommendation": "ITERATE",
"rationale": "Light robustness: single revision pass to incorporate critique feedback.",
"signals_assessment": "",
"warnings": [],
"settled_decisions": []
}
code
No prior `review.json` exists. Treat this as the first execution pass.
Re-execution: 2 tasks already tracked (T1, T2). Focus on the 1 remaining tasks (T3). You must still return task_updates for ALL tasks (including already-tracked ones) — for previously done tasks, preserve their existing status and notes.
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: light.
Requirements:
Implement the intent, not just the text.
Adapt if repository reality contradicts the plan.
Report deviations explicitly.
Do not over-engineer beyond what the plan prescribes — no str() wraps, .get() fallbacks, or try/except guards unless the plan called for them or you found a concrete reason.
Do NOT fix unrelated issues you encounter (e.g., dependency compatibility, Python version workarounds). Only change files directly needed for the task. If tests need updating, only update tests that are directly related to your fix.
If you cannot build the project from source (e.g., C extension compilation failures), report the build failure explicitly. Do NOT fall back to testing against an installed or cached package — that tests the wrong codebase and produces false positives.
If you cannot verify your changes (tests missing or unrunnable), treat this as high risk — re-examine your implementation with extra scrutiny instead of accepting it on faith.
If tests fail, read the traceback carefully. Diagnose WHY — don't just retry. Common causes: wrong function/method used, missing import, incorrect type, edge case not handled. Fix the root cause, then re-run.
When verifying changes, run the entire test file or module (e.g., pytest tests/test_foo.py), not individual test functions. Individual tests miss regressions in the same module.
If a test fails and you determine the failure is pre-existing (fails without your changes too), you MUST still re-run the FULL test suite with your changes applied. Pre-existing failures do not excuse you from verifying all other tests still pass. Never narrow to individual test functions and stop.
Before declaring the work complete, write a short script (not a full test) that reproduces the exact bug or incorrect behavior described in the task. Run it to confirm the fix resolves the issue. Then delete the script so it does not appear in the final diff. If the task description is too vague to write a concrete reproduction, note this explicitly in executor_notes.
Output concrete files changed and commands run. files_changed means files you WROTE or MODIFIED — not files you read or verified. Only list files where you made actual edits.
Use the tasks in finalize.json as the execution boundary.
Best-effort progress checkpointing: if /Users/user_c042661f/Documents/megaplan/.megaplan/plans/redesign-the-orchestrator-20260406-1943/execution_checkpoint.json is writable, then after each completed task read the full file, update that task's status, executor_notes, files_changed, and commands_run, and write the full file back. Do NOT write to finalize.json directly — the harness owns that file.
Best-effort sense-check checkpointing: if is writable, then after each sense check acknowledgment read the full file again, update that sense check's , and write the full file back.
json
{
"output": "Implemented the approved plan and captured execution evidence.",
"files_changed": ["megaplan/handlers.py", "megaplan/evaluation.py"],
"commands_run": ["pytest tests/test_megaplan.py -k evidence"],
"deviations": [],
"task_updates": [
{
"task_id": "T6",
"status": "done",
"executor_notes": "Caught the empty-strings edge case while checking execution evidence: blank `commands_run` entries still leave the task uncovered, so the missing-evidence guard behaves correctly.",
"files_changed": ["megaplan/handlers.py"],
"commands_run": ["pytest tests/test_megaplan.py -k execute"]
},
{
"task_id": "T7",
"status": "done",
"executor_notes": "Confirmed the happy path still records task evidence after the prompt updates by rerunning focused tests and checking the tracked task summary stayed intact.",
"files_changed": ["megaplan/prompts.py"],
"commands_run": ["pytest tests/test_prompts.py -k review"]
},
{
"task_id": "T8",
"status": "done",
"executor_notes": "Kept the rubber-stamp thresholds centralized in evaluation so sense checks and reviewer verdicts share one policy entry point while still using different strictness levels.",
"files_changed": ["megaplan/evaluation.py"],
"commands_run": ["pytest tests/test_evaluation.py -k rubber_stamp"]
},
{
"task_id": "T11",
"status": "skipped",
"executor_notes": "Skipped because upstream work is not ready yet; no repo changes were made for this task.",
"files_changed": [],
"commands_run": []
}
],
"sense_check_acknowledgments": [
{
"sense_check_id": "SC6",
"executor_note": "Confirmed execute only blocks when both files_changed and commands_run are empty for a done task."
}
]
}
code
Sense checks to keep in mind during execution (reviewer will verify these):
SC1 (T1): Does the redesigned template contain all 11 planned sections (Role & Mission, Startup, Phase Routing by Robustness, After Every Phase, Breakpoints, Safeguards, Resume Protocol, Execution Details, Overrides & Plan Editing, Completion Format, Command Reference) and is the outer-skill handling section outside the template fence?
SC2 (T2): Do the three robustness-level flowcharts (light, standard, heavy) exactly match the transitions in workflow.py's WORKFLOW dict and _ROBUSTNESS_OVERRIDES, and does the gate decision tree cover all 5 conditions from workflow.py:42-50?
SC3 (T3): Do all existing tests pass, including test_global_setup_codex_no_subagent_appendix?
Watch items to keep visible during execution:
[DEBT] subagent-safeguards: plan's retry caps (1 phase, 3 execute) may differ from hermes-agent's actual policy — verify actual safeguard numbers before encoding them in the prompt
[DEBT] worker-permissions: codex/claude --full-auto and --permission-mode flags only trigger for step == 'execute', not 'loop_execute' — don't inadvertently document loop_execute handling that doesn't exist
Template must be self-contained: the subagent does NOT see instructions.md, so do not cross-reference or deduplicate against it within the template fence
The outer-skill handling section moves outside the template fence — verify the subagent's own resume protocol section covers everything it needs without that content
gate_unset is a real 5th condition (first gate call) — don't collapse it into gate_iterate or omit it
orchestrator_guidance values in evaluation.py are the source of truth — the prompt must not invent guidance strings that don't exist in the code
Line count target is ~180 lines for the template — watch for bloat but don't sacrifice accuracy for brevity
Debt watch items (do not make these worse):
[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 , and still has its own prop. the revised step 4.2 is acceptable only if it explicitly rewires that prop to ; 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)
{
"output": "Implemented the approved plan and captured execution evidence.",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md",
".megaplan/plans/redesign-the-orchestrator-20260406-1943/execution_checkpoint.json"
],
"commands_run": [
"sed -n '1,240p' megaplan/data/claude_subagent_appendix.md",
"sed -n '1,180p' megaplan/_core/workflow.py",
"sed -n '1060,1135p' megaplan/handlers.py",
"sed -n '600,710p' megaplan/evaluation.py",
"sed -n '1,260p' megaplan/data/claude_subagent_appendix.md",
"sed -n '31,86p' megaplan/_core/workflow.py",
"sed -n '474,557p' megaplan/handlers.py",
"sed -n '620,679p' megaplan/evaluation.py",
"sed -n '1064,1105p' megaplan/handlers.py",
"python /tmp/verify_codex_appendix.py",
"pytest tests/test_megaplan.py"
],
"deviations": [],
"task_updates": [
{
"task_id": "T1",
"status": "done",
"executor_notes": "Audited megaplan/data/claude_subagent_appendix.md against megaplan/_core/workflow.py, megaplan/handlers.py, and megaplan/evaluation.py, then rewrote the appendix into a self-contained subagent prompt with outer Activation/Launch/Outer Skill Handling sections and 11 in-template sections. Verified that the template preserves {IDEA}, {PROJECT_DIR}, {AUTO_APPROVE}, {AUTO_APPROVE_FLAG}, and {ROBUSTNESS}, covers all five gate branches including PROCEED plus preflight-blocked, documents the review -> needs_rework -> finalized -> execute loop with the 3-cycle cap, and states that light robustness skips gate and review.",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [
"sed -n '1,240p' megaplan/data/claude_subagent_appendix.md",
"sed -n '1,180p' megaplan/_core/workflow.py",
"sed -n '1060,1135p' megaplan/handlers.py",
"sed -n '600,710p' megaplan/evaluation.py",
"python - <<'PY' ... verify required sections, preserved variables, gate conditions, and review loop ... PY",
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"
]
},
{
"task_id": "T2",
"status": "done",
"executor_notes": "Cross-checked the rewritten appendix against megaplan/_core/workflow.py, megaplan/handlers.py, and megaplan/evaluation.py, then corrected the remaining mismatches in megaplan/data/claude_subagent_appendix.md. The final template now reflects the light/standard/heavy transitions from WORKFLOW plus _ROBUSTNESS_OVERRIDES, preserves all five gate branches, documents the review -> finalized -> execute rework loop and blocked-review state from handlers.py, removes the stray in-template outer-skill 7A section, and anchors gate interpretation to the exact orchestrator_guidance lead strings from evaluation.py, including the iteration-1 precedence rule.",
"files_changed": [
"megaplan/data/claude_subagent_appendix.md"
],
"commands_run": [
"sed -n '1,260p' megaplan/data/claude_subagent_appendix.md",
"sed -n '31,86p' megaplan/_core/workflow.py",
"sed -n '474,557p' megaplan/handlers.py",
"sed -n '620,679p' megaplan/evaluation.py",
"sed -n '1064,1105p' megaplan/handlers.py",
"python - <<'PY' ... verify 11 in-template sections, all flows, all 5 gate conditions, exact guidance strings, and review blocked/rework behavior ... PY",
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '88,180p'"
]
},
{
"task_id": "T3",
"status": "done",
"executor_notes": "Ran a temporary repro script against megaplan.handle_setup_global() to verify the Claude-specific appendix still installs only into Claude's skill file and not Codex's, then ran the full pytest tests/test_megaplan.py suite. The repro script passed, and the full suite completed successfully with 175 passed in 6.85s, including test_global_setup_codex_no_subagent_appendix.",
"files_changed": [],
"commands_run": [
"python /tmp/verify_codex_appendix.py",
"pytest tests/test_megaplan.py"
]
}
],
"sense_check_acknowledgments": [
{
"sense_check_id": "SC1",
"executor_note": "Confirmed by direct file inspection and a verification script that the appendix keeps Activation, Launch, and Outer Skill Handling outside the template fence and includes all 11 required in-template sections."
},
{
"sense_check_id": "SC2",
"executor_note": "Verified against the workflow and handler source that the prompt now matches all three robustness flows, all five gate conditions, and the review rework path; a follow-up script also confirmed the template contains exactly 11 in-template sections and no stray 7A section."
},
{
"sense_check_id": "SC3",
"executor_note": "Confirmed by the full tests/test_megaplan.py run that all 175 tests pass, including the Claude/Codex setup coverage around test_global_setup_codex_no_subagent_appendix."
}
]
}
Not yet included in a published release.
pytest tests/test_megaplan.py
test_global_setup_codex_no_subagent_appendix
Activation
Launch
Outer Skill Handling
src/pages/entrypage.tsx:283-340
[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] 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] 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] 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] 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] 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 → 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 → plan change. (flagged 1 times across 1 plans)
code
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T2]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC2]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/megaplan/.megaplan/plans/redesign-the-orchestrator-20260406-1943/execution_batch_2.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- If a test fails and you determine the failure is pre-existing (fails without your changes too), you MUST still re-run the FULL test suite with your changes applied. Pre-existing failures do not excuse you from verifying all other tests still pass. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
megaplan/_core/workflow.py
megaplan/handlers.py
megaplan/evaluation.py
megaplan/data/claude_subagent_appendix.md
WORKFLOW
_ROBUSTNESS_OVERRIDES
review -> finalized -> execute
handlers.py
7A
orchestrator_guidance
evaluation.py
pytest tests/test_megaplan.py
test_global_setup_codex_no_subagent_appendix
Activation
Launch
Outer Skill Handling
7A
src/pages/entrypage.tsx:283-340
[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] 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] 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] 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] 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] 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 → 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 → plan change. (flagged 1 times across 1 plans)
code
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T3]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC3]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/megaplan/.megaplan/plans/redesign-the-orchestrator-20260406-1943/execution_batch_3.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- If a test fails and you determine the failure is pre-existing (fails without your changes too), you MUST still re-run the FULL test suite with your changes applied. Pre-existing failures do not excuse you from verifying all other tests still pass. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
Always use full read-modify-write updates for /Users/user_c042661f/Documents/megaplan/.megaplan/plans/redesign-the-orchestrator-20260406-1943/execution_checkpoint.json instead of partial edits. If the sandbox blocks writes, continue execution and rely on the structured output below.
Structured output remains the authoritative final summary for this step. Disk writes are progress checkpoints for timeout recovery only.
Return task_updates with one object per completed or skipped task.
Return sense_check_acknowledgments with one object per sense check.
Keep executor_notes verification-focused: explain why your changes are correct. The diff already shows what changed; notes should cover edge cases caught, expected behaviors confirmed, or design choices made.
Follow this JSON shape exactly:
src/pages/submissionslayout.tsx:38-40
scorepanel
onrequiresignin
pagemachine.dispatch
[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] 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] 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] 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] 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] 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] 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 → 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 → plan change. (flagged 1 times across 1 plans)