{ "body": "[Codex #2] Stage 2 simulation-plan verification - IMP-47A\n\n=== IMPLEMENTATION_UNITS ===\n- id: u1\n summary: Add allow-scripts to the SlideCanvas iframe sandbox while preserving allow-same-origin and adding no other sandbox capabilities.\n files:\n - Front/client/src/components/SlideCanvas.tsx\n tests:\n - tests/manual/imp47a_e2e.md\n - pytest -q tests\n estimate_lines: 1\n- id: u2\n summary: Keep TOP_N_FRAMES at 6 and merge candidate_evidence, v4_all_judgments, and v4_candidates through deterministic template_id/id/frame_id dedup, LABEL_PRIORITY ordering, confidence tie-break, and the existing cap.\n files:\n - Front/client/src/services/designAgentApi.ts\n tests:\n - tests/manual/imp47a_e2e.md\n - pytest -q tests\n estimate_lines: 17\n- id: u3\n summary: Fix handleGenerate stale closure by using the exact dependency set state.uploadedFile, state.slidePlan, state.userSelection, pendingZones, pendingLayout.\n files:\n - Front/client/src/pages/Home.tsx\n tests:\n - tests/manual/imp47a_e2e.md\n - pytest -q tests\n estimate_lines: 1\n- id: u4\n summary: Add the manual mdx03 end-to-end verification doc covering iframe rendering, multi-source frame candidates, frame/layout override regeneration, pending overlay enter/cancel/clear behavior, and final.html iframe display.\n files:\n - tests/manual/imp47a_e2e.md\n tests:\n - tests/manual/imp47a_e2e.md\n - pytest -q tests\n estimate_lines: 50\n\nPer-unit rationale:\n- u1: Complete for issue axis 1. SlideCanvas already appends embedded=1, but sandbox currently blocks the slide_base.html embedded-mode script; the single-token sandbox change is the minimum scope.\n- u2: Complete for issue axis 2. Current working tree already has the required three-source Map merge, source priority, label/confidence sort, and TOP_N_FRAMES cap with no sample-specific logic.\n- u3: Complete for issue axis 3. Current working tree already has the locked five-dependency callback list and does not broaden to a full state dependency.\n- u4: Complete for issue axes 4 and 5. Existing UI has pending change signaling in LeftMdxPanel and amber pending overlay/cancel/clear paths in Home and SlideCanvas; the manual doc is the right Stage 3 artifact to lock the mdx03 scenario.\n\nOut-of-scope notes:\n- Backend src changes are not part of this plan. The existing dirty backend/test files must remain untouched by IMP-47A.\n- No LLM, AI fallback activation, template edits, frame catalog edits, or mdx-specific hardcoding are included.\n- No change to TOP_N_FRAMES value, LABEL_PRIORITY order, or candidate source deletion is planned.\n\nRollback strategy:\n- Revert only the four planned paths for this issue: Front/client/src/components/SlideCanvas.tsx, Front/client/src/services/designAgentApi.ts, Front/client/src/pages/Home.tsx, and tests/manual/imp47a_e2e.md.\n- Leave unrelated pre-existing worktree changes intact.\n\n=== EVIDENCE ===\nCommands run:\n- git status --short\n- rg -n sandbox=|TOP_N_FRAMES|candidate_evidence|v4_all_judgments|v4_candidates|handleGenerate|pendingLayout|pendingZones Front/client/src/components/SlideCanvas.tsx Front/client/src/services/designAgentApi.ts Front/client/src/pages/Home.tsx\n- git diff -- Front/client/src/components/SlideCanvas.tsx Front/client/src/services/designAgentApi.ts Front/client/src/pages/Home.tsx\n- Get-Content Front/client/src/components/SlideCanvas.tsx selected ranges\n- Get-Content Front/client/src/pages/Home.tsx selected ranges\n- Get-Content Front/client/src/services/designAgentApi.ts selected ranges\n- Get-Content Front/client/src/components/LeftMdxPanel.tsx selected matches\n- pytest -q tests\nFiles checked:\n- Front/client/src/components/SlideCanvas.tsx\n- Front/client/src/services/designAgentApi.ts\n- Front/client/src/pages/Home.tsx\n- Front/client/src/components/LeftMdxPanel.tsx\n- tests directory existence\nTest results:\n- pytest -q tests: 623 passed in 55.90s\nVerified facts:\n- Implementation_units block exists and each unit is within the limits: one file per unit and estimate_lines are 1, 17, 1, and 50.\n- All five issue axes are covered: iframe sandbox u1, candidate merge u2, override delivery u3, pending overlay/signal u4, mdx03 e2e doc u4.\n- Current working tree already contains the u2 and u3 frontend diffs; u1 and u4 remain planned.\n- SlideCanvas still has sandbox allow-same-origin only, so u1 is still required.\n- LeftMdxPanel already exposes Pending Changes amber state and regeneration action; SlideCanvas has pending overlay/cancel rendering and Home clears pendingLayout on Generate.\n- Dirty worktree includes unrelated backend/test changes, so Stage 3 must add only the planned frontend/manual-test files.\nFINAL_CONSENSUS: YES\n" }