Add simple observability for running subagent megaplan sessions. The problem: when a megaplan runs inside a background subagent, the user has no easy way to see what's happening. The agent output file exists but is raw JSON conversation logs — unreadable. We need a minimal, low-complexity solution. Approach: (1) Add a megaplan watch --plan CLI command that reads the plan's state.json and any execution artifacts to show: current state, last completed phase + timestamp, pending notes count, and execution progress (if in execute). This is just reading existing on-disk state — no new data needed. (2) Optionally, have the subagent prompt include an instruction to run megaplan status before each phase (it may already do this), which means state.json always reflects the latest completed phase. Keep this SIMPLE — no new artifact files, no breadcrumbs, no file watchers. Just a read-only CLI command that summarizes existing on-disk state in a human-friendly format. This should be maybe 30-50 lines of Python in the handler.
code
Batch framing:
- Execute batch 1 of 3.
- Actionable task IDs for this batch: ['T1', 'T3']
- Already completed task IDs available as dependency context: []
Actionable tasks for this batch:
[
{
"id": "T1",
"description": "Add handle_watch() handler and wire it into the CLI.\n\n1. Add handle_watch() at cli.py:~99 (after handle_status). It should:\n - Call load_plan(root, args.plan) to get plan_dir and state\n - Call infer_next_steps(state) for next valid step\n - Extract: name, current_state, iteration, notes count from state['meta']['notes']\n - Find last successful phase: iterate state['history'] in REVERSE, find first entry with result == 'success'. Extract its step and timestamp. Skip partial/blocked/timeout/error entries.\n - If finalize.json exists in plan_dir: call read_json(finalize_path), compute_global_batches(), count done/skipped/pending tasks and completed batches (reuse handle_progress logic)\n - Format as multi-line plain text:\n \n Plan: my-plan-name\n State: finalized (iteration 2)\n Last completed: gate \u2014 2026-04-06T14:23:00\n Notes: 2 pending\n Execution: 5/12 tasks done, 2/4 batches complete\n Next: execute\n \n - Return StepResponse with step='watch' and 'display' containing the formatted text\n\n2. Add 'watch' to the parser list at cli.py:465: change [\"status\", \"audit\", \"progress\"] to \n\n3. Add 'watch': handle_watch to COMMAND_HANDLERS dict at cli.py:579\n\n4. Add plain-text rendering in main() at cli.py:632. BEFORE the final , add:\n \n This bypasses render_response for watch only.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [
"megaplan/cli.py"
],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Verify subagent appendix already instructs status updates between phases.\n\nRead megaplan/data/claude_subagent_appendix.md and confirm it already contains an instruction like 'After every phase command, immediately run: megaplan status --plan '. If present, no changes needed. If missing, add a one-line instruction in the appropriate section. This is expected to be read-only \u2014 just confirm and note the line number.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [
"megaplan/data/claude_subagent_appendix.md"
],
"reviewer_verdict": ""
}
]
Assistant
{"output":"Executed batch 1 tasks T1 and T3. Added the new watch CLI path in megaplan/cli.py, verified the plain-text bypass and success-only history filtering with a temporary smoke run, confirmed the Claude subagent appendix already requires between phases at lines 114-116, and checkpointed batch progress to .","files_changed":["megaplan/cli.py"],"commands_run":["nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'","python - <<'PY' (temporary handle_watch/main smoke verification with synthetic plan state/finalize data)","python -m pytest tests/test_megaplan.py -q"],"deviations":[],"task_updates":[{"task_id":"T1","status":"done","executor_notes":"Added plus parser/handler/main wiring in . Verified with a temporary synthetic-plan smoke run and the full module. The smoke run confirmed walks history in reverse but only reports entries with , and prints plain text for rather than JSON.","files_changed":["megaplan/cli.py"],"commands_run":["python - <<'PY' (temporary handle_watch/main smoke verification with synthetic plan state/finalize data)","python -m pytest tests/test_megaplan.py -q"]},{"task_id":"T3","status":"done","executor_notes":"Read and confirmed no edit was needed. The file already instructs subagents to run after every phase command at lines 114-116.","files_changed":[],"commands_run":["nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"]}],"sense_check_acknowledgments":[{"sense_check_id":"SC1","executor_note":"Confirmed. filters reverse history to entries only, and the plain-text path in prints directly. The smoke verification used trailing error/blocked history entries and confirmed the output stayed plain text rather than JSON."},{"sense_check_id":"SC3","executor_note":"Confirmed. already contains the between-phase status refresh instruction at lines 114-116: after every phase command, run , which keeps current."}]}
User
Assistant
Batch 2 is scoped to the megaplan/__init__.py export surface. I’ve confirmed the file is still clean, and I’m adding handle_watch to both the import list and __all__, then I’ll verify it is importable as megaplan.handle_watch and rerun the full tests/test_megaplan.py module.
Assistant
The export change is in place. I’m verifying the public import surface directly and letting the full tests/test_megaplan.py module finish so the batch closes with both the targeted import check and a broader regression pass.
Assistant
{"output":"Executed batch 2 task T2. Added handle_watch to the package export surface in megaplan/__init__.py, verified megaplan.handle_watch resolves to the CLI handler, reran the full tests/test_megaplan.py module, and checkpointed batch progress to .megaplan/plans/add-simple-observability-for-20260406-2015/execution_batch_2.json.","files_changed":["megaplan/init.py"],"commands_run":["python - <<'PY' (assert megaplan.handle_watch is importable and matches megaplan.cli.handle_watch)","python -m pytest tests/test_megaplan.py -q"],"deviations":[],"task_updates":[{"task_id":"T2","status":"done","executor_notes":"Added handle_watch to the package-level import surface and __all__ in megaplan/__init__.py at lines 43 and 59. Verified directly that megaplan.handle_watch resolves to megaplan.cli.handle_watch, then reran the full tests/test_megaplan.py module with the export change in place.","files_changed":["megaplan/.py"],"commands_run":["python - <<'PY' (assert megaplan.handle_watch is importable and matches megaplan.cli.handle_watch)","python -m pytest tests/test_megaplan.py -q"]}],"sense_check_acknowledgments":[{"sense_check_id":"SC2","executor_note":"Confirmed. After the changes, importing exposes , and direct verification showed ."}]}
User
Assistant
Batch 3 is the test and verification pass. I’m reading the existing tests/test_megaplan.py helpers and watch-related fixtures first, then I’ll add the new watch tests, run the full tests/ suite, and finish with a throwaway smoke script that reproduces the plain-text watch behavior before deleting it.
Assistant
I have enough context from the current test file. I’m adding one text-output helper, one direct handler test that covers both the no-finalize and with-finalize cases, and one CLI integration test for the plain-text watch path before I run the full suite and the throwaway smoke script.
Assistant
The focused megaplan module pass is green with the new watch tests in place. I’m running the full tests/ suite now, since this batch is the verification gate for the whole change rather than just the new test cases.
Assistant
The full suite is still running. Once that finishes, I’ll do the required throwaway smoke script against python -m megaplan watch --plan ..., capture the plain-text output, and then remove the script so the batch closes with both automated and manual verification.
Assistant
The full suite passed. I’m doing the last required manual proof now with a one-off script that creates a minimal plan, runs python -m megaplan watch --plan watch-smoke, asserts the output is human-readable rather than JSON, and then deletes the script.
Assistant
{"output":"Executed batch 3 task T4. Added watch-specific tests to tests/test_megaplan.py, including the plain-text CLI path, success-only history filtering, and execution-progress rendering; the focused module run passed (177 passed), the full tests/ suite passed (425 passed), the required throwaway smoke script reproduced python -m megaplan watch --plan watch-smoke with human-readable output, and the batch checkpoint was written to .megaplan/plans/add-simple-observability-for-20260406-2015/execution_batch_3.json.","files_changed":["tests/test_megaplan.py"],"commands_run":["python -m pytest tests/test_megaplan.py -q","python -m pytest tests/ -x -q","python /tmp/megaplan_watch_smoke.py","rm /tmp/megaplan_watch_smoke.py"],"deviations":[],"task_updates":[{"task_id":"T4","status":"done","executor_notes":"Added at , a direct coverage test at , and a CLI integration test for plain-text watch output at . Verification passed in both the focused module run ( -> ) and the full suite ( -> ). The required throwaway smoke script exercised , confirmed the output was human-readable rather than JSON, and was deleted afterward.","files_changed":["tests/test_megaplan.py"],"commands_run":["python -m pytest tests/test_megaplan.py -q","python -m pytest tests/ -x -q","python /tmp/megaplan_watch_smoke.py","rm /tmp/megaplan_watch_smoke.py"]}],"sense_check_acknowledgments":[{"sense_check_id":"SC4","executor_note":"Confirmed. The new direct watch test verifies success-only history filtering and execution progress rendering, the CLI integration test confirms prints plain text instead of JSON, passed with 177 tests, and the full suite passed with 425 tests."}]}
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 handle_watch filter history to only result=='success' entries, and does the main() bypass correctly print plain text (not JSON) for the watch command?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does the subagent appendix already instruct running megaplan status between phases, ensuring state.json stays current?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"meta_commentary": "Straightforward 4-task plan matching the 4 plan steps. T1 adds the handler + wiring in cli.py (Steps 1-2 are in the same file and tightly coupled). T2 verifies the subagent appendix (read-only). T3 adds init.py export (FLAG-003). T4 adds tests + runs them. The handler is ~30-40 lines; the main gotcha is bypassing render_response for plain-text output in main() and ensuring the history filter skips non-success entries. FLAG-003 (open) requires adding handle_watch to the init.py import and all list.",
"tasks": [
{
"id": "T1",
"description": "Add handle_watch() handler and wire it into the CLI.\n\n1. Add handle_watch() at cli.py:~99 (after handle_status). It should:\n - Call load_plan(root, args.plan) to get plan_dir and state\n - Call infer_next_steps(state) for next valid step\n - Extract: name, current_state, iteration, notes count from state['meta']['notes']\n - Find last successful phase: iterate state['history'] in REVERSE, find first entry with result == 'success'. Extract its step and timestamp. Skip partial/blocked/timeout/error entries.\n - If finalize.json exists in plan_dir: call read_json(finalize_path), compute_global_batches(), count done/skipped/pending tasks and completed batches (reuse handle_progress logic)\n - Format as multi-line plain text:\n \n Plan: my-plan-name\n State: finalized (iteration 2)\n Last completed: gate \u2014 2026-04-06T14:23:00\n Notes: 2 pending\n Execution: 5/12 tasks done, 2/4 batches complete\n Next: execute\n \n - Return StepResponse with step='watch' and 'display' containing the formatted text\n\n2. Add 'watch' to the parser list at cli.py:465: change [\"status\", \"audit\", \"progress\"] to [\"status\", \"audit\", \"progress\", \"watch\"]\n\n3. Add 'watch': handle_watch to COMMAND_HANDLERS dict at cli.py:579\n\n4. Add plain-text rendering in main() at cli.py:632. BEFORE the final return render_response(handler(root, args)), add:\n python\n if args.command == \"watch\":\n response = handler(root, args)\n print(response.get(\"display\", \"\"), end=\"\")\n return 0\n \n This bypasses render_response for watch only.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [
"megaplan/cli.py"
],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Add handle_watch to megaplan/init.py exports (addresses FLAG-003).\n\n1. Add handle_watch to the import line at init.py:43:\n Change: from megaplan.cli import handle_status, handle_audit, handle_progress, handle_list, main, cli_entry\n To: from megaplan.cli import handle_status, handle_audit, handle_progress, handle_watch, handle_list, main, cli_entry\n\n2. Add handle_watch to all at init.py:59:\n Change: \"handle_review\", \"handle_step\", \"handle_status\", \"handle_audit\", \"handle_progress\", \"handle_list\",\n To: \"handle_review\", \"handle_step\", \"handle_status\", \"handle_audit\", \"handle_progress\", \"handle_watch\", \"handle_list\",",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [
"megaplan/init.py"
],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Verify subagent appendix already instructs status updates between phases.\n\nRead megaplan/data/claude_subagent_appendix.md and confirm it already contains an instruction like 'After every phase command, immediately run: megaplan status --plan '. If present, no changes needed. If missing, add a one-line instruction in the appropriate section. This is expected to be read-only \u2014 just confirm and note the line number.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [
"megaplan/data/claude_subagent_appendix.md"
],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Add tests and run the full suite.\n\nAdd to tests/test_megaplan.py:\n\n1. run_main_text helper (parallel to existing run_main_json):\n python\n def run_main_text(argv, *, cwd, capsys, monkeypatch):\n monkeypatch.chdir(cwd)\n exit_code = megaplan.main(argv)\n return exit_code, capsys.readouterr().out\n \n\n2. Unit test for handle_watch \u2014 call handle_watch directly with a fixture state. Assert:\n - Response has 'display' key containing plan name, state, iteration\n - When no finalize.json exists, no 'Execution:' line in display\n - When finalize.json exists with tasks, 'Execution:' line shows correct counts\n - When history has a trailing error/blocked entry, 'Last completed:' shows the preceding success entry (FLAG-002 verification)\n\n3. CLI integration test \u2014 use run_main_text helper. Assert:\n - run_main_text(['watch', '--plan', name]) returns exit code 0\n - stdout contains expected text fragments (plan name, 'State:', 'Last completed:')\n - stdout does NOT start with '{' (confirms plain text, not JSON \u2014 FLAG-001 verification)\n\n4. Run full test suite: python -m pytest tests/ -x -q. Fix any failures and re-run until green.\n\n5. Manual smoke test: write a short throwaway script that creates a minimal plan directory with state.json containing history entries (including a trailing error), runs megaplan watch --plan <name>, prints output, and asserts it's human-readable. Run it, confirm it works, then delete the script.",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [
"tests/test_megaplan.py"
],
"commands_run": [
"python -m pytest tests/ -x -q"
],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"FLAG-003 (open): handle_watch must be added to megaplan/init.py imports and all \u2014 otherwise tests calling megaplan.handle_watch will fail",
"FLAG-001 (addressed in plan): the main() plain-text bypass must be tested end-to-end via run_main_text to ensure watch output doesn't regress to JSON",
"FLAG-002 (addressed in plan): history filtering must skip non-success entries \u2014 test with trailing error/blocked/partial entries",
"Assumption: watch is one-shot, not a polling loop \u2014 despite the name, it reads and exits",
"Assumption: plain text output only, no ANSI colors or box-drawing",
"Debt items: none of the existing debt watch items are in cli.py or init.py \u2014 this change should not interact with them",
"Keep handler under 50 lines \u2014 it reuses load_plan, infer_next_steps, read_json, compute_global_batches"
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does handle_watch filter history to only result=='success' entries, and does the main() bypass correctly print plain text (not JSON) for the watch command?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Is handle_watch importable as megaplan.handle_watch after the init.py changes?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does the subagent appendix already instruct running megaplan status between phases, ensuring state.json stays current?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Do all tests pass (both new watch tests and existing suite), and does the CLI integration test confirm plain-text output (not JSON)?",
"executor_note": "",
"verdict": ""
}
],
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Add handle_watch() handler in cli.py",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Register parser, handler mapping, and plain-text rendering in cli.py",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Verify subagent appendix has status instruction between phases",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Add unit and CLI integration tests for watch command",
"finalize_task_ids": [
"T4"
]
}
],
"orphan_tasks": [
"T2"
],
"completeness_notes": "T2 addresses open FLAG-003 (adding handle_watch to init.py exports) which was not an explicit plan step but is required for tests to work and for API consistency. All 4 plan steps are covered.",
"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, T3]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC1, 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/add-simple-observability-for-20260406-2015/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.
Add simple observability for running subagent megaplan sessions. The problem: when a megaplan runs inside a background subagent, the user has no easy way to see what's happening. The agent output file exists but is raw JSON conversation logs — unreadable. We need a minimal, low-complexity solution. Approach: (1) Add a megaplan watch --plan CLI command that reads the plan's state.json and any execution artifacts to show: current state, last completed phase + timestamp, pending notes count, and execution progress (if in execute). This is just reading existing on-disk state — no new data needed. (2) Optionally, have the subagent prompt include an instruction to run megaplan status before each phase (it may already do this), which means state.json always reflects the latest completed phase. Keep this SIMPLE — no new artifact files, no breadcrumbs, no file watchers. Just a read-only CLI command that summarizes existing on-disk state in a human-friendly format. This should be maybe 30-50 lines of Python in the handler.
code
Batch framing:
- Execute batch 2 of 3.
- Actionable task IDs for this batch: ['T2']
- Already completed task IDs available as dependency context: ['T1', 'T3']
Actionable tasks for this batch:
[
{
"id": "T2",
"description": "Add handle_watch to megaplan/init.py exports (addresses FLAG-003).\n\n1. Add handle_watch to the import line at init.py:43:\n Change: from megaplan.cli import handle_status, handle_audit, handle_progress, handle_list, main, cli_entry\n To: from megaplan.cli import handle_status, handle_audit, handle_progress, handle_watch, handle_list, main, cli_entry\n\n2. Add handle_watch to all at init.py:59:\n Change: \"handle_review\", \"handle_step\", \"handle_status\", \"handle_audit\", \"handle_progress\", \"handle_list\",\n To: \"handle_review\", \"handle_step\", \"handle_status\", \"handle_audit\", \"handle_progress\", \"handle_watch\", \"handle_list\",",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [
"megaplan/init.py"
],
"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": "Add handle_watch() handler and wire it into the CLI.\n\n1. Add handle_watch() at cli.py:~99 (after handle_status). It should:\n - Call load_plan(root, args.plan) to get plan_dir and state\n - Call infer_next_steps(state) for next valid step\n - Extract: name, current_state, iteration, notes count from state['meta']['notes']\n - Find last successful phase: iterate state['history'] in REVERSE, find first entry with result == 'success'. Extract its step and timestamp. Skip partial/blocked/timeout/error entries.\n - If finalize.json exists in plan_dir: call read_json(finalize_path), compute_global_batches(), count done/skipped/pending tasks and completed batches (reuse handle_progress logic)\n - Format as multi-line plain text:\n \n Plan: my-plan-name\n State: finalized (iteration 2)\n Last completed: gate \u2014 2026-04-06T14:23:00\n Notes: 2 pending\n Execution: 5/12 tasks done, 2/4 batches complete\n Next: execute\n \n - Return StepResponse with step='watch' and 'display' containing the formatted text\n\n2. Add 'watch' to the parser list at cli.py:465: change [\"status\", \"audit\", \"progress\"] to [\"status\", \"audit\", \"progress\", \"watch\"]\n\n3. Add 'watch': handle_watch to COMMAND_HANDLERS dict at cli.py:579\n\n4. Add plain-text rendering in main() at cli.py:632. BEFORE the final return render_response(handler(root, args)), add:\n python\n if args.command == \"watch\":\n response = handler(root, args)\n print(response.get(\"display\", \"\"), end=\"\")\n return 0\n \n This bypasses render_response for watch only.",
"depends_on": [],
"status": "done",
"executor_notes": "Added handle_watch() plus parser/handler/main wiring in megaplan/cli.py. Verified with a temporary synthetic-plan smoke run and the full tests/test_megaplan.py module. The smoke run confirmed handle_watch walks history in reverse but only reports entries with result == 'success', and main() prints plain text for watch rather than JSON.",
"files_changed": [
"megaplan/cli.py"
],
"commands_run": [
"python - <<'PY' (temporary handle_watch/main smoke verification with synthetic plan state/finalize data)",
"python -m pytest tests/test_megaplan.py -q"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Verify subagent appendix already instructs status updates between phases.\n\nRead megaplan/data/claude_subagent_appendix.md and confirm it already contains an instruction like 'After every phase command, immediately run: megaplan status --plan '. If present, no changes needed. If missing, add a one-line instruction in the appropriate section. This is expected to be read-only \u2014 just confirm and note the line number.",
"depends_on": [],
"status": "done",
"executor_notes": "Read and confirmed no edit was needed. The file already instructs subagents to run after every phase command at lines 114-116.",
"files_changed": [],
"commands_run": [
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"
],
"evidence_files": [
"megaplan/data/claude_subagent_appendix.md"
],
"reviewer_verdict": ""
}
]
code
Prior batch deviations (address if applicable):
[
"Advisory quality: code changes lacked test updates: megaplan/cli.py.",
"Advisory: done tasks rely on commands_run without files_changed (FLAG-006 softening): T3",
"Advisory audit finding: Executor claimed changed files not present in git status: megaplan/init.py",
"Advisory audit finding: Git status shows changed files not claimed by any task: README.md, megaplan/data/claude_subagent_appendix.md, megaplan/data/instructions.md",
"Advisory audit finding: Sense check SC2 is missing an executor acknowledgment.",
"Advisory audit finding: Sense check SC4 is missing an executor acknowledgment."
]
code
Batch-scoped sense checks:
[
{
"id": "SC2",
"task_id": "T2",
"question": "Is handle_watch importable as megaplan.handle_watch after the init.py changes?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"meta_commentary": "Straightforward 4-task plan matching the 4 plan steps. T1 adds the handler + wiring in cli.py (Steps 1-2 are in the same file and tightly coupled). T2 verifies the subagent appendix (read-only). T3 adds init.py export (FLAG-003). T4 adds tests + runs them. The handler is ~30-40 lines; the main gotcha is bypassing render_response for plain-text output in main() and ensuring the history filter skips non-success entries. FLAG-003 (open) requires adding handle_watch to the init.py import and all list.",
"tasks": [
{
"id": "T1",
"description": "Add handle_watch() handler and wire it into the CLI.\n\n1. Add handle_watch() at cli.py:~99 (after handle_status). It should:\n - Call load_plan(root, args.plan) to get plan_dir and state\n - Call infer_next_steps(state) for next valid step\n - Extract: name, current_state, iteration, notes count from state['meta']['notes']\n - Find last successful phase: iterate state['history'] in REVERSE, find first entry with result == 'success'. Extract its step and timestamp. Skip partial/blocked/timeout/error entries.\n - If finalize.json exists in plan_dir: call read_json(finalize_path), compute_global_batches(), count done/skipped/pending tasks and completed batches (reuse handle_progress logic)\n - Format as multi-line plain text:\n \n Plan: my-plan-name\n State: finalized (iteration 2)\n Last completed: gate \u2014 2026-04-06T14:23:00\n Notes: 2 pending\n Execution: 5/12 tasks done, 2/4 batches complete\n Next: execute\n \n - Return StepResponse with step='watch' and 'display' containing the formatted text\n\n2. Add 'watch' to the parser list at cli.py:465: change [\"status\", \"audit\", \"progress\"] to [\"status\", \"audit\", \"progress\", \"watch\"]\n\n3. Add 'watch': handle_watch to COMMAND_HANDLERS dict at cli.py:579\n\n4. Add plain-text rendering in main() at cli.py:632. BEFORE the final return render_response(handler(root, args)), add:\n python\n if args.command == \"watch\":\n response = handler(root, args)\n print(response.get(\"display\", \"\"), end=\"\")\n return 0\n \n This bypasses render_response for watch only.",
"depends_on": [],
"status": "done",
"executor_notes": "Added handle_watch() plus parser/handler/main wiring in megaplan/cli.py. Verified with a temporary synthetic-plan smoke run and the full tests/test_megaplan.py module. The smoke run confirmed handle_watch walks history in reverse but only reports entries with result == 'success', and main() prints plain text for watch rather than JSON.",
"files_changed": [
"megaplan/cli.py"
],
"commands_run": [
"python - <<'PY' (temporary handle_watch/main smoke verification with synthetic plan state/finalize data)",
"python -m pytest tests/test_megaplan.py -q"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Add handle_watch to megaplan/.py exports (addresses FLAG-003).\n\n1. Add to the import line at .py:43:\n Change: \n To: \n\n2. Add to at .py:59:\n Change: \n To: ",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [
"megaplan/.py"
],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Verify subagent appendix already instructs status updates between phases.\n\nRead megaplan/data/claude_subagent_appendix.md and confirm it already contains an instruction like 'After every phase command, immediately run: megaplan status --plan '. If present, no changes needed. If missing, add a one-line instruction in the appropriate section. This is expected to be read-only \u2014 just confirm and note the line number.",
"depends_on": [],
"status": "done",
"executor_notes": "Read and confirmed no edit was needed. The file already instructs subagents to run after every phase command at lines 114-116.",
"files_changed": [],
"commands_run": [
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"
],
"evidence_files": [
"megaplan/data/claude_subagent_appendix.md"
],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Add tests and run the full suite.\n\nAdd to tests/test_megaplan.py:\n\n1. (parallel to existing run_main_json):\n \n\n2. \u2014 call handle_watch directly with a fixture state. Assert:\n - Response has 'display' key containing plan name, state, iteration\n - When no finalize.json exists, no 'Execution:' line in display\n - When finalize.json exists with tasks, 'Execution:' line shows correct counts\n - When history has a trailing error/blocked entry, 'Last completed:' shows the preceding success entry (FLAG-002 verification)\n\n3. \u2014 use run_main_text helper. Assert:\n - returns exit code 0\n - stdout contains expected text fragments (plan name, 'State:', 'Last completed:')\n - stdout does NOT start with '{' (confirms plain text, not JSON \u2014 FLAG-001 verification)\n\n4. : . Fix any failures and re-run until green.\n\n5. : write a short throwaway script that creates a minimal plan directory with state.json containing history entries (including a trailing error), runs , prints output, and asserts it's human-readable. Run it, confirm it works, then delete the script.",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [
"tests/test_megaplan.py"
],
"commands_run": [
"python -m pytest tests/ -x -q"
],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"FLAG-003 (open): handle_watch must be added to megaplan/.py imports and \u2014 otherwise tests calling megaplan.handle_watch will fail",
"FLAG-001 (addressed in plan): the main() plain-text bypass must be tested end-to-end via run_main_text to ensure watch output doesn't regress to JSON",
"FLAG-002 (addressed in plan): history filtering must skip non-success entries \u2014 test with trailing error/blocked/partial entries",
"Assumption: watch is one-shot, not a polling loop \u2014 despite the name, it reads and exits",
"Assumption: plain text output only, no ANSI colors or box-drawing",
"Debt items: none of the existing debt watch items are in cli.py or .py \u2014 this change should not interact with them",
"Keep handler under 50 lines \u2014 it reuses load_plan, infer_next_steps, read_json, compute_global_batches"
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does handle_watch filter history to only result=='success' entries, and does the main() bypass correctly print plain text (not JSON) for the watch command?",
"executor_note": "Confirmed. filters reverse history to entries only, and the plain-text path in prints directly. The smoke verification used trailing error/blocked history entries and confirmed the output stayed plain text rather than JSON.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Is handle_watch importable as megaplan.handle_watch after the .py changes?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does the subagent appendix already instruct running megaplan status between phases, ensuring state.json stays current?",
"executor_note": "Confirmed. already contains the between-phase status refresh instruction at lines 114-116: after every phase command, run , which keeps current.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Do all tests pass (both new watch tests and existing suite), and does the CLI integration test confirm plain-text output (not JSON)?",
"executor_note": "",
"verdict": ""
}
],
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Add handle_watch() handler in cli.py",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Register parser, handler mapping, and plain-text rendering in cli.py",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Verify subagent appendix has status instruction between phases",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Add unit and CLI integration tests for watch command",
"finalize_task_ids": [
"T4"
]
}
],
"orphan_tasks": [
"T2"
],
"completeness_notes": "T2 addresses open FLAG-003 (adding handle_watch to .py exports) which was not an explicit plan step but is required for tests to work and for API consistency. All 4 plan steps are covered.",
"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)
init
megaplan/__init__.py
megaplan
handle_watch
megaplan.handle_watch is megaplan.cli.handle_watch
Add simple observability for running subagent megaplan sessions. The problem: when a megaplan runs inside a background subagent, the user has no easy way to see what's happening. The agent output file exists but is raw JSON conversation logs — unreadable. We need a minimal, low-complexity solution. Approach: (1) Add a megaplan watch --plan CLI command that reads the plan's state.json and any execution artifacts to show: current state, last completed phase + timestamp, pending notes count, and execution progress (if in execute). This is just reading existing on-disk state — no new data needed. (2) Optionally, have the subagent prompt include an instruction to run megaplan status before each phase (it may already do this), which means state.json always reflects the latest completed phase. Keep this SIMPLE — no new artifact files, no breadcrumbs, no file watchers. Just a read-only CLI command that summarizes existing on-disk state in a human-friendly format. This should be maybe 30-50 lines of Python in the handler.
code
Batch framing:
- Execute batch 3 of 3.
- Actionable task IDs for this batch: ['T4']
- Already completed task IDs available as dependency context: ['T1', 'T2', 'T3']
Actionable tasks for this batch:
[
{
"id": "T4",
"description": "Add tests and run the full suite.\n\nAdd to tests/test_megaplan.py:\n\n1. run_main_text helper (parallel to existing run_main_json):\n python\n def run_main_text(argv, *, cwd, capsys, monkeypatch):\n monkeypatch.chdir(cwd)\n exit_code = megaplan.main(argv)\n return exit_code, capsys.readouterr().out\n \n\n2. Unit test for handle_watch \u2014 call handle_watch directly with a fixture state. Assert:\n - Response has 'display' key containing plan name, state, iteration\n - When no finalize.json exists, no 'Execution:' line in display\n - When finalize.json exists with tasks, 'Execution:' line shows correct counts\n - When history has a trailing error/blocked entry, 'Last completed:' shows the preceding success entry (FLAG-002 verification)\n\n3. CLI integration test \u2014 use run_main_text helper. Assert:\n - run_main_text(['watch', '--plan', name]) returns exit code 0\n - stdout contains expected text fragments (plan name, 'State:', 'Last completed:')\n - stdout does NOT start with '{' (confirms plain text, not JSON \u2014 FLAG-001 verification)\n\n4. Run full test suite: python -m pytest tests/ -x -q. Fix any failures and re-run until green.\n\n5. Manual smoke test: write a short throwaway script that creates a minimal plan directory with state.json containing history entries (including a trailing error), runs megaplan watch --plan <name>, prints output, and asserts it's human-readable. Run it, confirm it works, then delete the script.",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [
"tests/test_megaplan.py"
],
"commands_run": [
"python -m pytest tests/ -x -q"
],
"evidence_files": [],
"reviewer_verdict": ""
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Add handle_watch() handler and wire it into the CLI.\n\n1. Add handle_watch() at cli.py:~99 (after handle_status). It should:\n - Call load_plan(root, args.plan) to get plan_dir and state\n - Call infer_next_steps(state) for next valid step\n - Extract: name, current_state, iteration, notes count from state['meta']['notes']\n - Find last successful phase: iterate state['history'] in REVERSE, find first entry with result == 'success'. Extract its step and timestamp. Skip partial/blocked/timeout/error entries.\n - If finalize.json exists in plan_dir: call read_json(finalize_path), compute_global_batches(), count done/skipped/pending tasks and completed batches (reuse handle_progress logic)\n - Format as multi-line plain text:\n \n Plan: my-plan-name\n State: finalized (iteration 2)\n Last completed: gate \u2014 2026-04-06T14:23:00\n Notes: 2 pending\n Execution: 5/12 tasks done, 2/4 batches complete\n Next: execute\n \n - Return StepResponse with step='watch' and 'display' containing the formatted text\n\n2. Add 'watch' to the parser list at cli.py:465: change [\"status\", \"audit\", \"progress\"] to [\"status\", \"audit\", \"progress\", \"watch\"]\n\n3. Add 'watch': handle_watch to COMMAND_HANDLERS dict at cli.py:579\n\n4. Add plain-text rendering in main() at cli.py:632. BEFORE the final return render_response(handler(root, args)), add:\n python\n if args.command == \"watch\":\n response = handler(root, args)\n print(response.get(\"display\", \"\"), end=\"\")\n return 0\n \n This bypasses render_response for watch only.",
"depends_on": [],
"status": "done",
"executor_notes": "Added handle_watch() plus parser/handler/main wiring in megaplan/cli.py. Verified with a temporary synthetic-plan smoke run and the full tests/test_megaplan.py module. The smoke run confirmed handle_watch walks history in reverse but only reports entries with result == 'success', and main() prints plain text for watch rather than JSON.",
"files_changed": [
"megaplan/cli.py"
],
"commands_run": [
"python - <<'PY' (temporary handle_watch/main smoke verification with synthetic plan state/finalize data)",
"python -m pytest tests/test_megaplan.py -q"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Add handle_watch to megaplan/init.py exports (addresses FLAG-003).\n\n1. Add handle_watch to the import line at init.py:43:\n Change: from megaplan.cli import handle_status, handle_audit, handle_progress, handle_list, main, cli_entry\n To: from megaplan.cli import handle_status, handle_audit, handle_progress, handle_watch, handle_list, main, cli_entry\n\n2. Add to at .py:59:\n Change: \n To: ",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Added to the package-level import surface and in at lines 43 and 59. Verified directly that resolves to , then reran the full module with the export change in place.",
"files_changed": [
"megaplan/.py"
],
"commands_run": [
"python - <<'PY' (assert megaplan.handle_watch is importable and matches megaplan.cli.handle_watch)",
"python -m pytest tests/test_megaplan.py -q"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Verify subagent appendix already instructs status updates between phases.\n\nRead megaplan/data/claude_subagent_appendix.md and confirm it already contains an instruction like 'After every phase command, immediately run: megaplan status --plan '. If present, no changes needed. If missing, add a one-line instruction in the appropriate section. This is expected to be read-only \u2014 just confirm and note the line number.",
"depends_on": [],
"status": "done",
"executor_notes": "Read and confirmed no edit was needed. The file already instructs subagents to run after every phase command at lines 114-116.",
"files_changed": [],
"commands_run": [
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"
],
"evidence_files": [
"megaplan/data/claude_subagent_appendix.md"
],
"reviewer_verdict": ""
}
]
code
Prior batch deviations (address if applicable):
[
"Advisory quality: code changes lacked test updates: megaplan/init.py.",
"Advisory audit finding: Git status shows changed files not claimed by any task: README.md, megaplan/data/claude_subagent_appendix.md, megaplan/data/instructions.md",
"Advisory audit finding: Sense check SC4 is missing an executor acknowledgment."
]
code
Batch-scoped sense checks:
[
{
"id": "SC4",
"task_id": "T4",
"question": "Do all tests pass (both new watch tests and existing suite), and does the CLI integration test confirm plain-text output (not JSON)?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"meta_commentary": "Straightforward 4-task plan matching the 4 plan steps. T1 adds the handler + wiring in cli.py (Steps 1-2 are in the same file and tightly coupled). T2 verifies the subagent appendix (read-only). T3 adds init.py export (FLAG-003). T4 adds tests + runs them. The handler is ~30-40 lines; the main gotcha is bypassing render_response for plain-text output in main() and ensuring the history filter skips non-success entries. FLAG-003 (open) requires adding handle_watch to the init.py import and all list.",
"tasks": [
{
"id": "T1",
"description": "Add handle_watch() handler and wire it into the CLI.\n\n1. Add handle_watch() at cli.py:~99 (after handle_status). It should:\n - Call load_plan(root, args.plan) to get plan_dir and state\n - Call infer_next_steps(state) for next valid step\n - Extract: name, current_state, iteration, notes count from state['meta']['notes']\n - Find last successful phase: iterate state['history'] in REVERSE, find first entry with result == 'success'. Extract its step and timestamp. Skip partial/blocked/timeout/error entries.\n - If finalize.json exists in plan_dir: call read_json(finalize_path), compute_global_batches(), count done/skipped/pending tasks and completed batches (reuse handle_progress logic)\n - Format as multi-line plain text:\n \n Plan: my-plan-name\n State: finalized (iteration 2)\n Last completed: gate \u2014 2026-04-06T14:23:00\n Notes: 2 pending\n Execution: 5/12 tasks done, 2/4 batches complete\n Next: execute\n \n - Return StepResponse with step='watch' and 'display' containing the formatted text\n\n2. Add 'watch' to the parser list at cli.py:465: change [\"status\", \"audit\", \"progress\"] to [\"status\", \"audit\", \"progress\", \"watch\"]\n\n3. Add 'watch': handle_watch to COMMAND_HANDLERS dict at cli.py:579\n\n4. Add plain-text rendering in main() at cli.py:632. BEFORE the final return render_response(handler(root, args)), add:\n python\n if args.command == \"watch\":\n response = handler(root, args)\n print(response.get(\"display\", \"\"), end=\"\")\n return 0\n \n This bypasses render_response for watch only.",
"depends_on": [],
"status": "done",
"executor_notes": "Added handle_watch() plus parser/handler/main wiring in megaplan/cli.py. Verified with a temporary synthetic-plan smoke run and the full tests/test_megaplan.py module. The smoke run confirmed handle_watch walks history in reverse but only reports entries with result == 'success', and main() prints plain text for watch rather than JSON.",
"files_changed": [
"megaplan/cli.py"
],
"commands_run": [
"python - <<'PY' (temporary handle_watch/main smoke verification with synthetic plan state/finalize data)",
"python -m pytest tests/test_megaplan.py -q"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Add handle_watch to megaplan/.py exports (addresses FLAG-003).\n\n1. Add to the import line at .py:43:\n Change: \n To: \n\n2. Add to at .py:59:\n Change: \n To: ",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Added to the package-level import surface and in at lines 43 and 59. Verified directly that resolves to , then reran the full module with the export change in place.",
"files_changed": [
"megaplan/.py"
],
"commands_run": [
"python - <<'PY' (assert megaplan.handle_watch is importable and matches megaplan.cli.handle_watch)",
"python -m pytest tests/test_megaplan.py -q"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Verify subagent appendix already instructs status updates between phases.\n\nRead megaplan/data/claude_subagent_appendix.md and confirm it already contains an instruction like 'After every phase command, immediately run: megaplan status --plan '. If present, no changes needed. If missing, add a one-line instruction in the appropriate section. This is expected to be read-only \u2014 just confirm and note the line number.",
"depends_on": [],
"status": "done",
"executor_notes": "Read and confirmed no edit was needed. The file already instructs subagents to run after every phase command at lines 114-116.",
"files_changed": [],
"commands_run": [
"nl -ba megaplan/data/claude_subagent_appendix.md | sed -n '1,240p'"
],
"evidence_files": [
"megaplan/data/claude_subagent_appendix.md"
],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Add tests and run the full suite.\n\nAdd to tests/test_megaplan.py:\n\n1. (parallel to existing run_main_json):\n \n\n2. \u2014 call handle_watch directly with a fixture state. Assert:\n - Response has 'display' key containing plan name, state, iteration\n - When no finalize.json exists, no 'Execution:' line in display\n - When finalize.json exists with tasks, 'Execution:' line shows correct counts\n - When history has a trailing error/blocked entry, 'Last completed:' shows the preceding success entry (FLAG-002 verification)\n\n3. \u2014 use run_main_text helper. Assert:\n - returns exit code 0\n - stdout contains expected text fragments (plan name, 'State:', 'Last completed:')\n - stdout does NOT start with '{' (confirms plain text, not JSON \u2014 FLAG-001 verification)\n\n4. : . Fix any failures and re-run until green.\n\n5. : write a short throwaway script that creates a minimal plan directory with state.json containing history entries (including a trailing error), runs , prints output, and asserts it's human-readable. Run it, confirm it works, then delete the script.",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [
"tests/test_megaplan.py"
],
"commands_run": [
"python -m pytest tests/ -x -q"
],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"FLAG-003 (open): handle_watch must be added to megaplan/.py imports and \u2014 otherwise tests calling megaplan.handle_watch will fail",
"FLAG-001 (addressed in plan): the main() plain-text bypass must be tested end-to-end via run_main_text to ensure watch output doesn't regress to JSON",
"FLAG-002 (addressed in plan): history filtering must skip non-success entries \u2014 test with trailing error/blocked/partial entries",
"Assumption: watch is one-shot, not a polling loop \u2014 despite the name, it reads and exits",
"Assumption: plain text output only, no ANSI colors or box-drawing",
"Debt items: none of the existing debt watch items are in cli.py or .py \u2014 this change should not interact with them",
"Keep handler under 50 lines \u2014 it reuses load_plan, infer_next_steps, read_json, compute_global_batches"
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does handle_watch filter history to only result=='success' entries, and does the main() bypass correctly print plain text (not JSON) for the watch command?",
"executor_note": "Confirmed. filters reverse history to entries only, and the plain-text path in prints directly. The smoke verification used trailing error/blocked history entries and confirmed the output stayed plain text rather than JSON.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Is handle_watch importable as megaplan.handle_watch after the .py changes?",
"executor_note": "Confirmed. After the changes, importing exposes , and direct verification showed .",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Does the subagent appendix already instruct running megaplan status between phases, ensuring state.json stays current?",
"executor_note": "Confirmed. already contains the between-phase status refresh instruction at lines 114-116: after every phase command, run , which keeps current.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Do all tests pass (both new watch tests and existing suite), and does the CLI integration test confirm plain-text output (not JSON)?",
"executor_note": "",
"verdict": ""
}
],
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Add handle_watch() handler in cli.py",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Register parser, handler mapping, and plain-text rendering in cli.py",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Verify subagent appendix has status instruction between phases",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Add unit and CLI integration tests for watch command",
"finalize_task_ids": [
"T4"
]
}
],
"orphan_tasks": [
"T2"
],
"completeness_notes": "T2 addresses open FLAG-003 (adding handle_watch to .py exports) which was not an explicit plan step but is required for tests to work and for API consistency. All 4 plan steps are covered.",
"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)
run_main_text
tests/test_megaplan.py:42
handle_watch
tests/test_megaplan.py:2174
tests/test_megaplan.py:2222
python -m pytest tests/test_megaplan.py -q
177 passed
python -m pytest tests/ -x -q
425 passed
python -m megaplan watch --plan watch-smoke
watch
python -m pytest tests/test_megaplan.py -q
python -m pytest tests/ -x -q
Not yet included in a published release.
megaplan/data/claude_subagent_appendix.md
megaplan status --plan <name>
init
handle_watch
init
from megaplan.cli import handle_status, handle_audit, handle_progress, handle_list, main, cli_entry
from megaplan.cli import handle_status, handle_audit, handle_progress, handle_watch, handle_list, main, cli_entry
[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/add-simple-observability-for-20260406-2015/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.handle_watch is megaplan.cli.handle_watch
megaplan/data/claude_subagent_appendix.md
megaplan status --plan <name>
state.json
init
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: [T4]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC4]
- 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/add-simple-observability-for-20260406-2015/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.