"tasks": [
{
"id": "T1",
"description": "In source/core/log/core.py, add a StdoutFilter class plus module-level install_stdout_filter()/uninstall_stdout_filter() near set_log_interceptor (~line 365). The class wraps the original sys.stdout, buffers writes per line, drops any line whose text contains a substring from a registered set, and proxies the file-like surface (write, writelines, flush, isatty, fileno, encoding property, getattr fallback) mirroring TeeWriter at source/models/wgp/generators/capture.py:76-119. Partial trailing writes without a newline are released unmodified on flush() (cannot decide yet). Seed DEFAULT_NOISE_SUBSTRINGS with: 'Incorrect version of mmgp', '[UNI3C]', '[GGUF]', 'GGUF qtypes:'. Both install/uninstall must be idempotent and safe to call in any order. Add the new symbols to all at source/core/log/core.py:18 and re-export through source/core/log/api.py if other low-level helpers go through it.",
"depends_on": [],
"status": "done",
"executor_notes": "Added StdoutFilter, install_stdout_filter(), uninstall_stdout_filter(), and exact DEFAULT_NOISE_SUBSTRINGS seeding in source/core/log/core.py, then re-exported the new public symbols from source/core/log/api.py. Verified buffered line dropping, flush passthrough for trailing partial writes, isatty()/fileno()/encoding/__getattr__ proxying, and repeat-safe install/uninstall with a direct Python script; compiled the changed modules; and ran PYTHONPATH=. pytest tests/test_log_blocks.py tests/test_log_context_scoping.py -x successfully.",
"files_changed": [
"source/core/log/core.py",
"source/core/log/api.py"
],
"commands_run": [
"python -m compileall source/core/log/core.py source/core/log/api.py",
"python - <<'PY' ... PY",
"PYTHONPATH=. pytest tests/test_log_blocks.py tests/test_log_context_scoping.py -x"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Create tests/core/log/test_stdout_filter.py (create the directory if needed) with direct unit tests for StdoutFilter. Cover: matching lines dropped (install with {'[UNI3C]'}, print '[UNI3C] foo', confirm captured stream payload is empty); non-matching lines pass through unchanged (print 'hello world', confirm captured stream got 'hello world\n'); partial writes across multiple .write calls assembled before matching ('[UNI' then '3C] foo\n' drops; 'keep' then .flush() releases 'keep' unmodified); isatty/fileno/encoding/arbitrary attribute forwarded to wrapped stream (use a StringIO subclass stubbing isatty() True); install_stdout_filter() idempotent (second install no-op); uninstall_stdout_filter() restores sys.stdout exactly and a second uninstall is no-op. Use monkeypatch/capsys to restore sys.stdout between tests so pytest capture is not corrupted.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Created tests/core/log/test_stdout_filter.py with six direct unit tests covering matching-line drop, non-match passthrough, buffered partial-write assembly plus flush passthrough, isatty()/fileno()/encoding/__getattr__ forwarding, install idempotency, and uninstall restoration plus idempotency. The module uses an autouse capsys + monkeypatch fixture to uninstall the filter and restore sys.stdout between tests so pytest capture is not corrupted. Verified with PYTHONPATH=. pytest tests/core/log/test_stdout_filter.py -x and the broader logging regression pass PYTHONPATH=. pytest tests/core/log/test_stdout_filter.py tests/test_log_blocks.py tests/test_log_context_scoping.py -x; both passed.",
"files_changed": [
"tests/core/log/test_stdout_filter.py"
],
"commands_run": [
"python -m compileall tests/core/log/test_stdout_filter.py",
"PYTHONPATH=. pytest tests/core/log/test_stdout_filter.py -x",
"PYTHONPATH=. pytest tests/core/log/test_stdout_filter.py tests/test_log_blocks.py tests/test_log_context_scoping.py -x"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Wire the stdout filter into server + preview with teardown. (a) source/runtime/worker/server.py: install install_stdout_filter() immediately after suppress_library_logging() at server.py:354, only in the non-debug branch (the else after disable_debug_mode()). Do NOT install in the debug_mode branch above it. No teardown in server.py \u2014 process exit handles it. (b) scripts/preview/run_preview.py: install install_stdout_filter() next to the existing suppress_library_logging() call at run_preview.py:458, gated on the existing debug_mode = args.debug or _is_env_debug() boolean (skip when debug_mode). (c) Add uninstall_stdout_filter() inside a try/except in the finally block at scripts/preview/run_preview.py:594-595, before/after _restore_patches(patch_log) \u2014 required so the in-process normal+debug reruns in tests/test_preview_harness.py:43-81 do not leak filter state across runs.",
"depends_on": [
"T1",
"T2"
],
"status": "done",
"executor_notes": "Added install_stdout_filter() immediately after suppress_library_logging() in the existing non-debug branches of source/runtime/worker/server.py and scripts/preview/run_preview.py, without touching the debug-mode branches. Added uninstall_stdout_filter() inside a guarded try/except in the preview harness finally block before _restore_patches(patch_log) so in-process normal/debug reruns do not leak stdout-filter state. Verified by compiling both changed modules and running PYTHONPATH=. pytest tests/core/log/test_stdout_filter.py tests/test_preview_harness.py -x, which passed.",
"files_changed": [
"source/runtime/worker/server.py",
"scripts/preview/run_preview.py"
],
"commands_run": [
"python -m compileall source/runtime/worker/server.py scripts/preview/run_preview.py",
"PYTHONPATH=. pytest tests/core/log/test_stdout_filter.py tests/test_preview_harness.py -x"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Convert [WORKER] bootstrap prints in source/runtime/worker/server.py to headless_logger.essential. Hoist from source.core.log import headless_logger to module scope (currently imported inside main() at server.py:334 \u2014 singleton with no DB/network side-effects, so safe). Replace each print('[WORKER] \u2026', flush=True) with headless_logger.essential('<message>') at lines: 255, 309, 313, 315, 318, 360, 364, 366, 428, 431, 452, 510. Drop the literal '[WORKER]' prefix \u2014 the formatter already emits the component column. Keep the existing print(..., file=sys.stderr) at server.py:323 (fatal credential error before logger setup) untouched. Fallback: if module-scope hoist triggers a circular import, revert ONLY lines 255/309/313 to print(..., file=sys.stderr, flush=True) so the stdout filter cannot swallow them; all other lines still flow through headless_logger.essential.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T5",
"description": "Flatten Run Summary dict rows in source/core/log/lifecycle.py. RunSummary.render() at lifecycle.py:139-161 currently passes raw dicts to card.row(...), and DebugCard._wrap_value (debug_card.py:70-84) renders them via reprlib then textwrap.wrap with break_long_words=True, chopping mid-token. Add a local helper _fmt_summary_row(pairs: dict[str, Any]) -> str that joins f'{k}={v}' pairs with two spaces, skipping None/empty values. Use it for both the 'Overall' row (tasks/successes/failures/total_wall_clock_s/sparkline) and the per-task-type row at lifecycle.py:152-161. Do NOT modify DebugCard \u2014 its contract is to render whatever value it is handed.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T6",
"description": "Demote the WgpIntegration warning in source/task_handlers/queue/wgp_init.py:212. Change self.logger.warning('Skipping wgp integration - orchestrator not initialized yet') to self.logger.debug_anomaly('WGP_INIT', 'Skipping wgp integration - orchestrator not initialized yet'). This is an expected lazy-init pre-condition. Do NOT expand source/core/log/core.py:93-98 suppress_library_logging() speculatively \u2014 only edit if a real worker log surfaces a warning from a logger not already covered (mmgp is already there).",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T7",
"description": "Gate the dandelion TUI on TTY stdout in source/runtime/worker/status_display.py. In WorkerStatusDisplay.init (status_display.py:70-85), set self._tty = sys.stdout.isatty() AFTER any stdout wrappers are installed (T3 runs before the display is built in server.py:469-471, and the StdoutFilter from T1 forwards isatty() to the real stdout). Also honor WORKER_STATUS_DISPLAY=off as an env override (force non-TTY behavior). Make show_banner, show_idle, and on_task_start no-op when not self._tty. on_task_done should still increment self._tasks_done so totals stay accurate, but skip the animation redraw and the '\u00b7\u00b7\u00b7 idle \u00b7\u00b7\u00b7' marker. Leave quiet_idle=True plumbing untouched.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T8",
"description": "Thread-safe nested-task guard in source/core/log/lifecycle.py:180-205. The current _active_anchor = ContextVar(...) is thread-local: when HeadlessTaskQueue dispatches into a GenerationWorker-N thread (source/task_handlers/queue/queue_lifecycle.py:43-49), the inner lifecycle.task(...) call in source/task_handlers/queue/task_processor.py:134 sees the contextvar as None and opens a SECOND anchor for the same task_id, producing duplicate \u2740/\u273f pairs. Fix in TaskLifecycleEmitter: add self._active_task_ids: set[str] = set() and self._active_lock = threading.Lock() alongside the existing contextvar. In task() entry: if the contextvar is None and task_id is set, take the lock and check whether task_id is already in the set; if so, treat as nested-on-another-thread, yield a fresh local _TaskHandle (so .set() is a no-op-safe), and do NOT print start/done lines or append to run_summary. The outer-anchor branch (where the contextvar was None and task_id was NOT in the set) registers task_id under the lock at start and discards under the lock in the finally block. Keep the task_id is None case behaving exactly as today (no registration, no dedup, ad-hoc anchors still stack).",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T9",
"description": "Add a bounded retry loop around PNG conversion in source/task_handlers/queue/task_queue.py:449-485 (_convert_single_frame_video_to_png). 3 attempts with 0.25s backoff between attempts; on success, return the str(png_path). Each attempt opens cv2.VideoCapture(str(video_path_obj)) inside a try/finally that releases the cap; checks cap.isOpened(); reads frame; calls cv2.imwrite; verifies png_path.exists(); on full success unlinks the original (preserve the existing 'Could not remove original video' warning). Track last_error string ('cap-not-opened' / 'frame-read-or-write'). On exhaustion, log self.logger.error(f'[PNG_CONVERSION] Task {task.id}: conversion failed after 3 attempts ({last_error})') and fall through to the existing return-original-video-path fallback at task_queue.py:485. Preserve the existing ImportError / catch-all branches at task_queue.py:479-485 unchanged.",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T10",
"description": "Add a KeyboardInterrupt branch to run_preview in scripts/preview/run_preview.py:591, between the existing FatalWorkerError except and the finally. Body: log headless_logger.essential('[PREVIEW] Interrupted; rendering run summary...'), import run_summary from source.core.log.lifecycle, call run_summary.render_to(headless_logger), and return 130. The existing finally (with the uninstall_stdout_filter() call added in T3) fires on BaseException and handles teardown + _restore_patches(patch_log). Do NOT modify source/runtime/worker/server.py:660-694 \u2014 its KI path is already correct. Verify tests/test_preview_harness.py does not rely on run_preview raising KeyboardInterrupt (it does not; it only runs normal + --debug to completion).",
"depends_on": [
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T11",
"description": "Extend tests/test_preview_harness.py with minimal regression assertions: (a) normal_run.clean_output contains none of '[UNI3C]', '[GGUF]', 'GGUF qtypes:', 'Incorrect version of mmgp' (regression guard, since the preview spoofs Wan2GP and these only appear if some other start-up path prints them); (b) both normal_run and debug_run exit 0 and the filter state does not leak across them (the preview harness finally now calls uninstall_stdout_filter()); (c) grep tests/ for '[WORKER]' first; if any existing assertions check the literal '[WORKER] \u2026' bootstrap strings, update them to match the new 'INFO WORKER \u2026' format produced by headless_logger.essential. Do NOT add any test that imports real Wan2GP/wgp.py \u2014 that module has heavy import-time side effects.",
"depends_on": [
"T4",
"T5",
"T6",
"T7",
"T8",
"T9",
"T10"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T12",
"description": "Run the full validation sequence and fix any regressions. (1) pytest tests/core/log/test_stdout_filter.py -x (cheapest gate for T1/T2). (2) pytest tests/test_preview_harness.py -x (verifies normal+debug back-to-back, teardown). (3) Manual: python scripts/preview/run_preview.py --normal --output-log /tmp/preview_clean.log and python scripts/preview/run_preview.py --debug --output-log /tmp/preview_debug.log. Inspect both: clean log must NOT contain VT100 escapes, '[WORKER]' prefixes, or wrap-broken Run Summary rows; debug log MUST still contain raw Wan2GP prints. (4) Threading check: grep the clean log for '\u2740 .* started' and confirm exactly one match per task_id (T8 fix). (5) Ctrl-C check: manually interrupt the preview harness, confirm exit 130, rendered Run Summary, no dangling monkeypatches. (6) Broader sweep: pytest -x on tests/ to catch any test that asserted on old bootstrap strings or dict-wrapped Run Summary rows; update them rather than skip/delete. (7) Throwaway repro: write a tiny script that imports source.core.log.core, installs the filter, prints '[UNI3C] hello' / 'keep me', captures the result to confirm the bug is fixed; delete the script after. If anything fails, read the error, fix the code, and re-run until green.",
"depends_on": [
"T11"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"StdoutFilter MUST proxy isatty()/fileno()/encoding/getattr exactly like TeeWriter at source/models/wgp/generators/capture.py:76-119 \u2014 WorkerStatusDisplay (T7) calls sys.stdout.isatty() AFTER the filter is installed and the heartbeat guardian inspects fileno().",
"install_stdout_filter() and uninstall_stdout_filter() MUST be idempotent and safe to call in any order \u2014 tests/test_preview_harness.py:43-81 reloads run_preview and runs normal+debug back-to-back in the same Python process, so any state leak invalidates the 'debug mode shows raw prints' requirement.",
"Debug mode (--debug / REIGH_DEBUG=1) MUST NOT install the stdout filter \u2014 developers want every raw print visible. Verify the debug branch in both server.py:354 and run_preview.py:458 is untouched.",
"Partial trailing writes without a newline: release them unmodified on flush() since we cannot decide yet whether the line matches; otherwise interactive prompts get swallowed. Document this carry-through behavior in the StdoutFilter and cover it in the unit tests.",
"Lifecycle threading fix is the highest-risk change \u2014 land it AFTER the wiring step so any duplicated anchors are the only remaining noise in a before/after diff. The dedup must use task_id only (not (task_id, task_type)); confirm the inner _TaskHandle yielded for nested-on-another-thread accepts .set() calls without blowing up.",
"task_id is None case in lifecycle.task() must continue to behave exactly as today \u2014 no registration, no dedup. Ad-hoc anchors should still stack normally.",
"Module-scope hoist of headless_logger in server.py is the suspected risk for T4. If a circular import surfaces, the documented fallback is to revert ONLY lines 255/309/313 to stderr prints \u2014 all other 9 lines must still flow through headless_logger.essential.",
"Keep server.py:323 (fatal credential error to stderr) untouched \u2014 it precedes logger setup.",
"Vendored Wan2GP/ tree must NOT be edited \u2014 [GGUF]/[UNI3C]/mmgp suppression happens at the StdoutFilter layer only.",
"DebugCard contract: T5 (Run Summary flattening) belongs at the lifecycle.py site, NOT in DebugCard. DebugCard renders whatever it is handed and is used elsewhere.",
"WORKER_STATUS_DISPLAY=off env override should force non-TTY behavior in T7 even if isatty() returns True (e.g. for log-only runs in a real terminal).",
"PNG retry: 3 attempts \u00d7 0.25s backoff is plan-default; flag in executor notes if real failure mode looks NFS-flush-related (~1-2s) so the user can tune.",
"Preview harness finally block runs on BaseException, so the new KeyboardInterrupt branch in run_preview.py only needs return 130 \u2014 uninstall_stdout_filter() still fires via the finally added in T3.",
"[DEBT-watch] Worker startup-window SIGTERM/Ctrl-C is a known pre-existing gap (cleanup try/finally only begins mid-main()) \u2014 do NOT widen it but also do NOT try to fix it in this plan. T10 only adds a clean KI path inside run_preview, not server.py.",
"[DEBT-watch] Do not introduce supervisor-invocation churn or rewrite shutdown sequencing \u2014 this plan is strictly log-hygiene. Stay scoped.",
"Idle marker '\u00b7\u00b7\u00b7 idle \u00b7\u00b7\u00b7' should be skipped in non-TTY mode (T7) to avoid log clutter, but tasks_done counter must still increment so Run Summary totals stay accurate."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does StdoutFilter forward isatty(), fileno(), encoding (as a property), and arbitrary attribute access via getattr to the wrapped stream \u2014 matching the TeeWriter pattern at source/models/wgp/generators/capture.py:76-119? Are install/uninstall idempotent and safe to call in any order? Are all four DEFAULT_NOISE_SUBSTRINGS seeded as exact substrings (not regex)?",
"executor_note": "Confirmed StdoutFilter forwards isatty(), fileno(), encoding, and __getattr__ to the wrapped stream, install/uninstall are idempotent and safe to call repeatedly, and DEFAULT_NOISE_SUBSTRINGS contains the four required exact substrings: Incorrect version of mmgp, [UNI3C], [GGUF], and GGUF qtypes:.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Do the unit tests cover all six required cases (match drop, non-match passthrough, partial-write assembly across .write calls, isatty/fileno/encoding/getattr proxying, install idempotency, uninstall restoration + idempotency)? Do they restore sys.stdout via monkeypatch so pytest capture is not corrupted across tests?",
"executor_note": "Confirmed the new unit module covers all six required cases and uses an autouse capsys + monkeypatch fixture to uninstall the filter and restore sys.stdout between tests so pytest capture remains intact.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Is the install gated on the non-debug branch in BOTH server.py:354 and run_preview.py:458? Does the preview finally at run_preview.py:594-595 call uninstall_stdout_filter() inside try/except? Is the debug_mode branch in server.py left untouched?",
"executor_note": "Confirmed install_stdout_filter() is gated to the non-debug branches in both server.py and run_preview.py, run_preview.py now calls uninstall_stdout_filter() inside a try/except in finally, and the debug branch in server.py remains unchanged.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Are all 12 print('[WORKER] \u2026') lines (server.py:255, 309, 313, 315, 318, 360, 364, 366, 428, 431, 452, 510) replaced, with the literal '[WORKER]' prefix dropped? Is server.py:323 (stderr fatal credential error) preserved? Was the headless_logger import successfully hoisted to module scope without a circular import (or, if not, were ONLY lines 255/309/313 reverted to stderr)?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Does RunSummary.render() now flatten BOTH the Overall row and the per-task-type row via _fmt_summary_row, joining key=value pairs with two spaces and skipping None/empty values? Was DebugCard left untouched?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "Was wgp_init.py:212 changed from logger.warning to logger.debug_anomaly('WGP_INIT', ...) without expanding source/core/log/core.py:93-98 suppress_library_logging() speculatively?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC7",
"task_id": "T7",
"question": "Does WorkerStatusDisplay.init compute self._tty AFTER stdout wrappers are installed, honor WORKER_STATUS_DISPLAY=off, and make show_banner/show_idle/on_task_start no-op when not self._tty? Does on_task_done still increment self._tasks_done while skipping the redraw + idle marker?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC8",
"task_id": "T8",
"question": "Does TaskLifecycleEmitter now hold _active_task_ids + _active_lock alongside the contextvar? When the contextvar is None but task_id is already in the set, does task() yield a fresh local _TaskHandle WITHOUT printing start/done or appending to run_summary? Does the outer-anchor branch register/unregister under the lock and the task_id-is-None path still stack normally?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC9",
"task_id": "T9",
"question": "Does _convert_single_frame_video_to_png retry up to 3 times with 0.25s backoff, release the cap in a try/finally each attempt, log [PNG_CONVERSION] error with last_error after exhaustion, and fall through to the original-video fallback while preserving the existing ImportError / catch-all branches?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC10",
"task_id": "T10",
"question": "Does run_preview.py now have a KeyboardInterrupt except branch between FatalWorkerError and finally that logs an essential message, calls run_summary.render_to(headless_logger), and returns 130 \u2014 relying on the existing finally to call uninstall_stdout_filter() and _restore_patches?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC11",
"task_id": "T11",
"question": "Were minimal regression assertions added without importing real Wan2GP? Do the assertions check normal_run.clean_output for absence of all four target substrings, both runs exit 0, and any pre-existing tests asserting on '[WORKER] \u2026' literal strings were updated (not skipped/deleted)?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC12",
"task_id": "T12",
"question": "Did all six validation steps pass (unit, in-process preview, manual normal log clean, manual debug log shows raw prints, threading shows one \u2740 per task_id, broader pytest -x green)? Was the throwaway repro script created, run, and deleted? Were any failing tests fixed at the source rather than skipped?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "Execution order is locked: T1 \u2192 T2 \u2192 T3, then T4\u2013T10 can land in close succession (T8 last among them since it is the riskiest), then T11, then T12. Do NOT change the order \u2014 the gate explicitly requires StdoutFilter unit tests (T2) to land BEFORE wiring (T3) so the class is proven in isolation first.\n\nThree things will trip you up if you are not careful:\n1. Stream proxying. If StdoutFilter forgets isatty()/fileno()/encoding/getattr, T7 will silently mis-detect the TTY and the heartbeat guardian's stdin/stdout plumbing will break. Mirror TeeWriter line-for-line at source/models/wgp/generators/capture.py:76-119, do not improvise.\n2. Teardown across in-process reruns. tests/test_preview_harness.py:43-81 reloads run_preview and runs normal + debug back-to-back. If uninstall_stdout_filter() is not in the run_preview finally, the normal install leaks into the debug run and the debug-mode-shows-raw-prints contract breaks. T3 is where this is enforced.\n3. Lifecycle dedup must be by task_id only. Do not key on (task_id, task_type) \u2014 the duplication is on the same task_id from a different thread. The inner branch for nested-on-another-thread must yield a local _TaskHandle so the caller's .set(...) calls do not raise; the emitter just must not print start/done or append to run_summary for that branch.\n\nOther gotchas:\n- Module-scope hoist (T4). headless_logger is a singleton, but if you hit a circular import, the documented fallback is to revert ONLY lines 255/309/313 to stderr. Do not let that fallback creep wider than those three lines.\n- server.py:323 fatal credential error stays as stderr \u2014 it precedes logger setup; if you replace it the user loses the only signal they get when auth is missing.\n- Vendored Wan2GP/ is off-limits. All [GGUF]/[UNI3C]/mmgp suppression happens at the filter layer, not at the source.\n- DebugCard is shared. T5 must flatten at the lifecycle.py site, not in DebugCard. DebugCard's contract is "render whatever you hand me" and other callers depend on that.\n- Worker startup SIGTERM gap is a known DEBT-watch item. Do not try to fix it in this plan and do not widen it. T10 only adds a clean KI path inside run_preview, NOT in server.py \u2014 server.py:660-694 is already correct for steady-state.\n- Idle marker suppression in T7 still increments tasks_done so Run Summary totals stay accurate; only the redraw and the '\u00b7\u00b7\u00b7 idle \u00b7\u00b7\u00b7' line are skipped.\n- PNG retry tuning (T9). Default is 3\u00d70.25s. If field evidence later suggests NFS-flush-related failures (~1-2s), flag it in executor_notes for the user to retune; do NOT change the default without confirmation.\n- WORKER_STATUS_DISPLAY=off env override (T7) must force non-TTY behavior even when isatty() returns True \u2014 useful for log-only runs in a real terminal.\n\nOpen questions from the plan that the executor should flag rather than guess:\n- tests/core/log/ as the path for the new unit test file (vs tests/unit/core/log/ or flat). The plan assumed nested; if the existing tests/ layout disagrees, mirror the existing convention and note it.\n- (task_id, task_type) vs task_id only for lifecycle dedup. Plan uses task_id only \u2014 confirmed in this finalize. Do not change without going back to the user.\n- PNG retry count/backoff (3 \u00d7 0.25s). Tunable if real failures look slower.\n\nFinal-task discipline: T12 ends with a throwaway repro script that exercises StdoutFilter against the four substrings + a passthrough line. Run it, confirm it reproduces and the fix holds, then delete it. Do not commit the script.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1 \u2014 Add stream-proxying StdoutFilter class + install/uninstall in source/core/log/core.py",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Step 2 \u2014 Wire filter into server.py + run_preview.py with debug-mode gate and preview-finally teardown",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 3 \u2014 Thread-safe nested-task guard in lifecycle.task() via _active_task_ids set + lock",
"finalize_task_ids": [
"T8"
]
},
{
"plan_step_summary": "Step 4 \u2014 Gate WorkerStatusDisplay (dandelion TUI) on TTY stdout + WORKER_STATUS_DISPLAY env override",
"finalize_task_ids": [
"T7"
]
},
{
"plan_step_summary": "Step 5 \u2014 Convert 12 [WORKER] bootstrap prints in server.py to headless_logger.essential",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 6 \u2014 Demote WgpIntegration warning at wgp_init.py:212 to debug_anomaly",
"finalize_task_ids": [
"T6"
]
},
{
"plan_step_summary": "Step 7 \u2014 Add 3-attempt \u00d7 0.25s retry loop around _convert_single_frame_video_to_png",
"finalize_task_ids": [
"T9"
]
},
{
"plan_step_summary": "Step 8 \u2014 Add KeyboardInterrupt branch to run_preview that renders summary and returns 130",
"finalize_task_ids": [
"T10"
]
},
{
"plan_step_summary": "Step 9 \u2014 Flatten Run Summary dict rows in lifecycle.py via _fmt_summary_row helper",
"finalize_task_ids": [
"T5"
]
},
{
"plan_step_summary": "Step 10 \u2014 Direct StdoutFilter unit tests + minimal preview harness regression assertions",
"finalize_task_ids": [
"T2",
"T11"
]
},
{
"plan_step_summary": "Step 11 \u2014 Final validation: unit + in-process preview + manual normal/debug logs + threading + Ctrl-C + broader pytest sweep",
"finalize_task_ids": [
"T12"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All 11 plan steps map to at least one task. Step 10 splits across T2 (the StdoutFilter unit tests, which the execution order requires before T3 wiring) and T11 (the minimal preview harness assertion updates, which depend on the implementation tasks T4\u2013T10 having landed first). Execution order in tasks matches the plan's documented Execution Order: T1 \u2192 T2 \u2192 T3 \u2192 T4 \u2192 T5 \u2192 T6 \u2192 T7 \u2192 T8 \u2192 T9 \u2192 T10 \u2192 T11 \u2192 T12. No scope additions, no orphan tasks.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Baseline tests not run during finalize \u2014 this is a planning-only step. Executor must run pytest tests/core/log/test_stdout_filter.py -x and pytest tests/test_preview_harness.py -x as the first two validation gates in T12, then pytest -x on the full tests/ tree as the final regression sweep. If any pre-existing test was already failing before these changes (e.g. asserting on the literal '[WORKER] \u2026' bootstrap strings or the old dict-wrapped Run Summary format), update it to the new format rather than deleting/skipping it."
}