You are already running inside the megaplan harness for this step. Do the requested planning/review/execution work directly. Do NOT invoke the megaplan CLI, do NOT read or activate the megaplan skill, do NOT start nested megaplan plans, and do NOT recurse into another planning harness. Treat mentions of megaplan in the repository or environment as implementation context only.
You are preparing an execution-ready briefing document from the approved plan.
Build a reusable Python package runpod_lifecycle that owns the full RunPod machine lifecycle: provisioning, readiness/health checks, idle detection, SSH exec, and shutdown/cleanup. Extract the implementation from /Users/user_c042661f/Documents/reigh-workspace/reigh-worker-orchestrator/gpu_orchestrator/runpod/ (api.py, lifecycle.py, client.py, storage.py, startup_script.py, ssh.py, runpod_client.py, init.py) and decouple it from the orchestrator's Supabase DatabaseClient, DerivedWorkerState, and scaling config — those are not part of this package. Provide: (1) a typed RunPodConfig dataclass with sensible defaults loadable from env (from_env()) and overridable per-call; (2) a clean async API: launch(config) -> Pod, Pod.wait_ready(timeout), Pod.status(), Pod.is_idle(threshold), Pod.exec_ssh(cmd), Pod.terminate(), plus module-level helpers find_gpu_type, get_network_volumes; (3) event hooks (on_state_change, on_error) so consumers like the orchestrator can persist state externally without the package knowing about Supabase; (4) preserve the existing RAM-tier fallback (72→60→48→32→16 GB) and storage-volume fallback behavior; (5) preserve the dual SDK + GraphQL fallback for SSH details; (6) keep storage health monitoring (df parsing + PATCH-API expansion); (7) pyproject.toml with deps (runpod>=1.6.0, paramiko>=3.0.0, requests>=2.31.0, httpx>=0.25.0); (8) unit tests with mocked RunPod SDK and HTTP — cover happy path, RAM-tier fallback, storage fallback, SSH dual-fallback, terminate; (9) README with quick-start and config table. Do NOT migrate the orchestrator to use the new package in this run — package + tests only. Project dir is empty except for .env, env.example, .gitignore. The .env already contains real RUNPOD_API_KEY and SSH keys for live testing if needed.
code
Assistant
Finalize briefing is ready. 18 tasks cover all 17 plan steps plus the validation pass, with sense-checks and watch-items pinned to the three intentional divergences from the orchestrator source (FLAG-001 snake_case status keys, FLAG-002 terminate re-raises, FLAG-004 volumeless sentinel) and the sync/async boundary fix (FLAG-003).
Extract the RunPod lifecycle implementation from reigh-worker-orchestrator/gpu_orchestrator/runpod/ into a standalone, orchestrator-agnostic Python package under /Users/user_c042661f/Documents/reigh-workspace/runpod-lifecycle/. The new package wraps RunPod's sync SDK behind an async API (launch / Pod.wait_ready / Pod.exec_ssh / Pod.terminate / Pod.is_idle), uses a typed RunPodConfig loadable from env, and emits state via on_state_change / on_error hooks so consumers (e.g. the orchestrator) can persist state without the package touching Supabase. Existing behaviors that must be preserved: RAM-tier fallback (72→60→48→32→16 GB), storage-volume fallback across a caller-supplied list, dual SDK→GraphQL fallback for SSH details, PATCH-API volume expansion, and df-based storage health parsing. Out of scope: migrating the orchestrator itself; porting startup_script.py (Supabase/Reigh-specific bash); check_worker_startup_status (it reads system_logs from Supabase — that logic belongs in the consumer). Target dir is empty except .env, env.example, .gitignore.
Portfind_gpu_type, get_network_volumes, create_pod, get_pod_ssh_details from source api.pyunchanged in signature except: all take api_key explicitly; logging uses the package logger runpod_lifecycle.api.
Portget_pod_status(pod_id, api_key) -> dict | None from client.py:95-117. Spec the normalized return shape explicitly: {"runpod_id", "desired_status", "actual_status", "ip", "ports" (list), "ssh_password", "created_at", "last_status_change", "uptime_seconds", "cost_per_hr"}. These are the keys the rest of the package (including wait_ready) must use — NOT the raw RunPod SDK keys desiredStatus/actualStatus.
Port + fixterminate_pod(pod_id, api_key) -> None from source api.py:223-229. Change from source: do not swallow exceptions. The source version logs and returns None, leaving Pod.terminate() with no failure signal. New contract: the SDK exception propagates; callers map it to TerminateError. (This addresses FLAG-002.)
Preserve the SDK→GraphQL fallback in get_pod_ssh_details (source api.py:157-220) and the SDK→REST→GraphQL fallback in get_network_volumes (source api.py:14-63).
Preserve the pod.get("data") → "podFindAndDeployOnDemand" response shape handling (api.py:137) — some SDK versions wrap in data, others return flat.
Renamecreate_pod_and_wait → create_pod (the current name is misleading: it does not actually wait, per api.py:98 del wait_timeout). Drop the unused wait_timeout param. create_pod passes network_volume_id=None through unchanged — the underlying SDK already supports volumeless pods.
Port the SSHClient class from source ssh.py:1-107 verbatim — the ed25519→RSA→ECDSA key-format fallback is the "dual SDK + GraphQL fallback for SSH details" complement and must stay.
No async here — paramiko is sync; async wrapping happens in Pod.exec_ssh via asyncio.to_thread.
Port_expand_network_volume (PATCH rest.runpod.io/v1/networkvolumes/{id}) and _check_and_expand_storage from source storage.py:18-68. Convert from mixin methods to module-level sync functions taking api_key + params. These do HTTP only (no SSH), so they stay sync; callers invoke them via asyncio.to_thread when needed.
Portget_storage_volume_id(api_key, storage_name) from source storage.py:182-214 as a module-level sync function.
Splitcheck_storage_health (source storage.py:70-180) into two pieces to resolve the sync/async boundary (FLAG-003):
Pure functionparse_df_output(raw_output: str) -> dict — takes the already-captured df stdout, returns {"total_gb", "used_gb", "free_gb", "percent_used"}. Contains the parse_size helper (T/G/M/K suffix handling) and the /workspace line parser. No I/O, no SSH, trivially unit-testable.
ConstantSTORAGE_CHECK_COMMAND: str — the exact bash block from source storage.py:89-98 (df -h / df -BG / du -sh).
Helperevaluate_storage_health(parsed: dict, api_total_gb: int | None, min_free_gb: int, max_percent_used: int) -> dict — pure evaluation of the {healthy, needs_expansion, message} fields from source storage.py:145-160. Pure.
The async orchestration (run SSH command, combine results, optionally call expand_network_volume) lives on Pod.check_storage_health in Step 7, which awaits self.exec_ssh then feeds the output into these pure helpers. This eliminates the coroutine/tuple mismatch identified in FLAG-003.
Phase 4: Pod + launch with fallbacks + hooks
Step 7: Pod class — async facade (src/runpod_lifecycle/pod.py)
Resolves GPU type via find_gpu_type (fail fast LaunchFailure if unknown).
Resolves public_key_string from config (inline > file path); warn if missing.
Builds ram_tiers list: if config.ram_tiers_enabled, filter config.ram_tiers to those >= config.min_memory_gb (fallback to [min_memory_gb] if empty); else [min_memory_gb]. Mirrors lifecycle.py:64-74.
Builds ordered list of storage targets: [config.storage_name] + list(config.storage_volumes) de-duplicated, skipping None; each resolved to volume_id via get_storage_volume_id, missing ones skipped with warning. If the resolved list is empty (no storage_name and no storage_volumes), use a single sentinel target [(None, None)] meaning "create pod with network_volume_id=None". This addresses FLAG-004 — the underlying create_pod already supports volumeless pods (api.py:117-119 only adds volume params when network_volume_id is truthy).
Outer loop: for each ram_tier; inner loop: for each (storage_name, storage_volume_id):
If storage_volume_id is not None and this is the first ram tier for this storage, call check_and_expand_storage(..., min_free_gb=50) via to_thread (preserves lifecycle.py:85-86). Skip for the volumeless sentinel.
Call create_pod via to_thread with the tier's RAM, network_volume_id=storage_volume_id (may be None), mount path, SSH key, env_vars, template.
On success: construct Pod(id=..., name=..., _ram_tier=ram_tier, _storage_volume=storage_name, ...), emit state event with detail including ram_tier/storage, return.
On "no longer any instances available" (case-insensitive substring match, preserves lifecycle.py:128) or generic exception: record last error, continue.
All combinations exhausted → emit on_error, raise LaunchFailure with tried tiers/storages.
Re-export module-level helpers find_gpu_type, get_network_volumes from api.py in lifecycle.py and the package __init__.py.
Step 9: Public package surface (src/runpod_lifecycle/__init__.py)
Define a runpod_sdk_mock fixture that monkeypatches runpod_lifecycle.api.runpod with a MagicMock, pre-wiring get_gpus, create_pod, get_pod, terminate_pod, get_network_volumes.
Define a base_config fixture returning a RunPodConfig with test-safe defaults (api_key "test", storage_volumes ("vol-a","vol-b"), ram_tiers (64, 32, 16), ssh_public_key "ssh-ed25519 AAAA test").
Define a volumeless_config fixture with storage_name=None, storage_volumes=() for the no-storage path test.
Step 11: Config tests (tests/test_config.py)
Scope: Small
TestRunPodConfig.from_env() reads each documented RUNPOD_* env var (including RUNPOD_STORAGE_VOLUMES comma-split).
Test missing RUNPOD_API_KEY raises ValueError.
Testmerge() returns a new instance with overrides applied, leaving original intact.
Test happy path: create_pod returns a pod id on first tier×first storage → launch returns Pod with matching _ram_tier and _storage_volume; on_state_change called with PROVISIONING at launch entry; a separate wait_ready test asserts READY.
Test RAM-tier fallback: create_pod raises "no longer any instances available" for tier 64 across both storages, succeeds at tier 32 first storage → pod._ram_tier == 32; assert create_pod called 3 times with decreasing min_memory_in_gb.
Test storage fallback: within a tier, first storage vol-a errors with generic exception, vol-b succeeds → pod._storage_volume == "vol-b".
Test exhausted fallback: all combinations fail → LaunchFailure raised, on_error hook called once with the last error in detail.
Testfind_gpu_type returns None → LaunchFailure raised before any create_pod call.
Test volumeless launch (FLAG-004): with volumeless_config, launch makes exactly one create_pod call per RAM tier with network_volume_id=None (assert via kwargs); check_and_expand_storage is not called.
Test SDK path: runpod.get_pod returns runtime with port 22 → returns details from SDK without HTTP call.
Test SDK returns no runtime → GraphQL fallback fires; mock requests.post returning valid GraphQL payload → details returned.
Test both paths fail → returns None and a warning is logged.
Step 14: Pod exec + idle + wait_ready tests (tests/test_pod.py)
Scope: Medium
TestPod.exec_ssh delegates to SSHClient.execute_command (patched) and updates _last_exec_at.
TestPod.is_idle(threshold=60) returns False when _last_exec_at is < 60s ago (no nvidia-smi call made).
TestPod.is_idle(threshold=60) returns True when last activity > 60s ago and patched exec_ssh returns (0, "2\n", "") (util 2%).
TestPod.is_idle returns False when nvidia-smi returns util 50%.
TestPod.wait_ready advances to READY when get_pod_status returns {"desired_status": "RUNNING", "ports": [{"privatePort": 22, ...}], ...} — asserts the normalized snake_case contract (FLAG-001).
TestPod.wait_ready raises LaunchFailure when desired_status == "FAILED".
TestPod.wait_ready raises NotReadyTimeout when status never reaches READY within a short test timeout.
Step 15: Storage health + expansion tests (tests/test_storage.py)
Scope: Small
Testparse_df_output: feed a canned multi-line output with /workspace 100G 50G 50G 50% → parsed values match.
Testparse_df_output handles T suffix (1T → 1024G).
Testexpand_network_volume PATCH: requests.patch called with bearer header and {"size": N}; 200 → True, 500 → False.
Testcheck_and_expand_storage skips expansion when volume already ≥ 100GB.
Testevaluate_storage_health returns needs_expansion=True when percent_used >= max_percent_used.
TestPod.check_storage_health integration: patch exec_ssh to return canned df output → returns the evaluated dict.
Step 16: Terminate test (tests/test_terminate.py)
Scope: Small
TestPod.terminate() happy path (emits TERMINATED, no raise).
Testrunpod.terminate_pod raising → TerminateError raised and on_error hook fired exactly once before the raise. Covers FLAG-002: if terminate_pod swallowed the exception, this test would fail.
Include a config table (field | env var | default | description) generated manually from RunPodConfig.
Document that startup_script.py, check_worker_startup_status, and orchestrator state persistence are not part of this package — consumers wire those up via on_state_change.
Note that an empty storage_volumes with no storage_name yields a volumeless pod (new behavior vs. the orchestrator source, which always required a volume).
Execution Order
Phase 1 (scaffolding, config, errors, events).
Phase 2 (api.py + ssh.py) — note the two contract changes from source: terminate_pod re-raises (FLAG-002), and get_pod_status returns normalized snake_case keys (FLAG-001).
Phase 3 (storage helpers split into pure parsers + sync HTTP, no SSH inside — FLAG-003).
Phase 4 (Pod + launch) — Pod.check_storage_health is the only place SSH meets df parsing; launch handles the volumeless sentinel (FLAG-004).
Phase 5 (tests) — each test file authored alongside the module it covers; keep all tests mocked.
Phase 6 (README) last.
Validation Order
pip install -e .[dev] then pytest -q — must pass green with mocks only.
Spot-check by importing from runpod_lifecycle import launch, RunPodConfig in a one-liner.
(Optional, info-priority) live smoke: a tests/smoke_live.py script gated on RUN_LIVE_TESTS=1 that uses the real .env to launch → wait_ready → exec_ssh "nvidia-smi -L" → terminate. Human-run only.
Out of Scope (explicit)
Porting startup_script.py / worker_startup.template.sh. Orchestrator-specific (Reigh-Worker, Supabase, Replicate placeholders); consumer builds its own startup logic.
Porting check_worker_startup_status — it reads Supabase system_logs.
"version": 2,
"timestamp": "2026-04-23T19:38:39Z",
"hash": "sha256:07044c7411e5e5ea04163e83c6fe8ab846fa99f70b3ea4b5ab275c5fe5dd34b8",
"changes_summary": "Revised plan to address all four significant flags. (1) Step 4 now specifies get_pod_status returns normalized snake_case keys (desired_status, ports) and Step 7's wait_ready uses those keys explicitly, not raw SDK desiredStatus (FLAG-001). (2) Step 4 changes the terminate_pod contract from the source: it re-raises instead of swallowing, letting Pod.terminate map to TerminateError (FLAG-002). (3) Step 6 splits storage health into pure helpers (parse_df_output, evaluate_storage_health) plus a STORAGE_CHECK_COMMAND constant, with the async SSH orchestration moved to Pod.check_storage_health in Step 7, resolving the sync/async callable mismatch (FLAG-003). (4) Step 8's launch loop now falls back to a single (None, None) sentinel target that invokes create_pod with network_volume_id=None when no storages are configured, supporting the volumeless pod case (FLAG-004). Added matching tests: volumeless launch, wait_ready normalized-key contract, and terminate_pod raising propagation. Success criteria updated to cover the new behaviors.",
"flags_addressed": [
{
"id": "FLAG-001",
"resolution": "addressed",
"reason": "Step 4.2 now explicitly defines the normalized snake_case return shape of get_pod_status (desired_status, actual_status, ports, etc.), and Step 7.2 specifies wait_ready uses those keys rather than raw SDK desiredStatus. Step 14 adds a test asserting the normalized contract."
},
{
"id": "FLAG-002",
"resolution": "addressed",
"reason": "Step 4.3 changes terminate_pod from source's swallow-and-log behavior to re-raise, so Pod.terminate in Step 7.6 can map the SDK exception to TerminateError with an on_error hook fired first. Step 16 test verifies the end-to-end raise path."
},
{
"id": "FLAG-003",
"resolution": "addressed",
"reason": "Step 6.3 splits storage health into three sync pure pieces (parse_df_output, evaluate_storage_health, STORAGE_CHECK_COMMAND constant) and moves the async SSH orchestration to Pod.check_storage_health in Step 7.7, which awaits self.exec_ssh then feeds the output into the pure parsers \u2014 no coroutine-as-sync-callable mismatch."
},
{
"id": "FLAG-004",
"resolution": "addressed",
"reason": "Step 8 now falls back to a [(None, None)] sentinel target when storage_name is unset and storage_volumes is empty, calling create_pod(network_volume_id=None) (which the ported primitive already supports). Step 12.6 adds a volumeless launch test asserting exactly one create_pod call per tier with network_volume_id=None and no storage expansion."
}
],
"questions": [
"Idle detection semantics: should Pod.is_idle(threshold) mean (a) GPU utilization < 5% via nvidia-smi AND no exec_ssh in the last threshold seconds, (b) uptime-based only, or (c) caller-supplied probe command? Planning with (a); confirm or override.",
"Should startup_script.py ship with the package? The brief lists it, but its content is orchestrator-specific (Reigh-Worker / Supabase / Replicate placeholders). Planning to exclude; confirm.",
"Should check_worker_startup_status ship? It imports Supabase DatabaseClient. Planning to exclude; the orchestrator re-implements on top of Pod.exec_ssh + its own DB. Confirm.",
"Event hooks \u2014 sync+async or async-only? Planning both.",
"Should storage_volumes default to the account-specific hardcoded list? Planning empty tuple; caller supplies names.",
"terminate_pod in source swallows exceptions; the revised plan re-raises them so Pod.terminate can signal failure via TerminateError. This is a behavior change from the orchestrator \u2014 confirm acceptable (it's required by the stated success criteria that reference TerminateError)."
],
"success_criteria": [
{
"criterion": "pip install -e .[dev] succeeds from the project root (pyproject.toml parses, hatchling builds a wheel, deps resolve).",
"priority": "must",
"requires": [
"run_shell",
"read_build_output"
]
},
{
"criterion": "pytest -q runs green with all unit tests passing (happy path launch, RAM-tier fallback, storage fallback, volumeless launch, exhausted fallback, SSH details SDK+GraphQL fallback, exec_ssh, is_idle true/false branches, wait_ready ready/failed/timeout branches, terminate happy+error, storage df parse, storage health evaluation, volume PATCH expansion).",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "Public API surface in runpod_lifecycle/__init__.py exports exactly: RunPodConfig, Pod, PodState, PodEvent, EventHooks, launch, find_gpu_type, get_network_volumes, RunPodError, LaunchFailure, NotReadyTimeout, SSHError, TerminateError.",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": "Package contains no import from gpu_orchestrator, supabase, DatabaseClient, DerivedWorkerState, or any orchestrator-specific symbol (verify via grep).",
"priority": "must",
"requires": [
"run_shell"
]
},
{
"criterion": "RAM-tier fallback order preserved: launch with ram_tiers_enabled=True tries tiers in the order (72, 60, 48, 32, 16) filtered by min_memory_gb, attempting all storages at each tier before dropping (verified by a test asserting call order of mocked create_pod).",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "SSH details dual-fallback preserved: a test where runpod.get_pod yields no ssh port forces GraphQL path, mocked HTTP client returns valid payload, and get_pod_ssh_details returns the parsed dict.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "Storage expansion preserved: a test mocking a <100GB volume triggers a PATCH https://rest.runpod.io/v1/networkvolumes/{id} with {\"size\": current+50} and a bearer header.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "RunPodConfig.from_env() raises ValueError when RUNPOD_API_KEY is unset (test).",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "on_state_change fires for PROVISIONING on entry to launch and for READY on successful wait_ready (test asserting hook invocation count and states).",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "on_error fires once with a LaunchFailure when all ram-tier \u00d7 storage combinations fail (test).",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "get_pod_status returns a dict with normalized snake_case keys desired_status, actual_status, ports; Pod.wait_ready test asserts it transitions to READY using those keys (not raw desiredStatus).",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "Pod.terminate() raises TerminateError and fires on_error exactly once when the mocked runpod.terminate_pod raises (test).",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "Volumeless launch works: with storage_name=None and storage_volumes=(), launch issues one create_pod per RAM tier with network_volume_id=None and skips check_and_expand_storage (test asserting call kwargs).",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "Storage health parsing is pure-function testable: parse_df_output and evaluate_storage_health have unit tests that do not require any SSH or HTTP mock.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "README.md exists at project root with a working quick-start snippet and a config table listing every RunPodConfig field with its env var, default, and description.",
"priority": "should",
"requires": [
"read_files",
"subjective_judgment"
]
},
{
"criterion": "No module in src/runpod_lifecycle/ exceeds ~300 lines; the package layers (config/errors/events/api/ssh/storage/pod/lifecycle) remain single-responsibility.",
"priority": "should",
"requires": [
"run_shell",
"subjective_judgment"
]
},
{
"criterion": "Live smoke test \u2014 using real .env, launch \u2192 wait_ready \u2192 exec_ssh \"nvidia-smi -L\" \u2192 terminate completes end-to-end against RunPod and returns GPU info.",
"priority": "info",
"requires": [
"verify_physical_device"
]
}
],
"assumptions": [
"Target Python 3.10+ (matches existing str | None union syntax).",
"Async API implemented by wrapping the sync runpod SDK and paramiko in asyncio.to_thread \u2014 no new async HTTP client required despite httpx being a listed dep (kept per brief; will be used for REST/GraphQL calls in api.py instead of requests to satisfy the spec).",
"PodState enum members: PROVISIONING, STARTING, READY, STOPPED, FAILED, TERMINATED.",
"is_idle: threshold in seconds; checks (activity recency) AND (nvidia-smi util < 5%).",
"startup_script.py and check_worker_startup_status are not extracted \u2014 they're orchestrator-specific.",
"storage_volumes default is empty tuple; RunPodConfig.from_env() accepts RUNPOD_STORAGE_VOLUMES as a comma-separated env var but does not hardcode account-specific names.",
"Event hooks accept both sync and async callables.",
"Layout uses src/ layout (src/runpod_lifecycle/...) with hatchling build backend; single package named runpod_lifecycle.",
"Tests use pytest + pytest-asyncio with asyncio_mode = auto; live RunPod tests are excluded from the default pytest run (opt-in via RUN_LIVE_TESTS=1).",
"find_gpu_type and get_network_volumes are re-exported as top-level module functions per the brief, in addition to being used internally by launch.",
"create_pod_and_wait is renamed to create_pod since the original ignored its wait_timeout param (api.py:98 del wait_timeout).",
"terminate_pod contract intentionally diverges from the source: it re-raises SDK exceptions instead of swallowing, so Pod.terminate can surface TerminateError. Callers that want the old swallow behavior can wrap in try/except.",
"get_pod_status returns normalized snake_case keys (desired_status, actual_status, ports), matching the source client.py:95-117 shape \u2014 wait_ready and any downstream code reads only these keys.",
"Volumeless pods are a supported configuration; when neither storage_name nor storage_volumes is set, launch attempts one create_pod(network_volume_id=None) per RAM tier. The orchestrator source always had at least one volume configured, so this is new documented behavior rather than a hazard."
],
"delta_from_previous_percent": 45.82,
"structure_warnings": []
}
code
Gate summary:
{
"recommendation": "ITERATE",
"rationale": "Light robustness: single revision pass to incorporate critique feedback.",
"signals_assessment": "",
"warnings": [],
"settled_decisions": []
}
code
Flag registry:
[
{
"id": "FLAG-001",
"concern": "Pod readiness: wait_ready() is written against raw RunPod status keys, but Step 4 says get_pod_status is ported from client.py, which normalizes the payload to desired_status/actual_status. If implemented as planned, the readiness loop can miss RUNNING/failure transitions because it checks desiredStatus instead.",
"evidence": "Revised plan to address all four significant flags. (1) Step 4 now specifies get_pod_status returns normalized snake_case keys (desired_status, ports) and Step 7's wait_ready uses those keys explicitly, not raw SDK desiredStatus (FLAG-001). (2) Step 4 changes the terminate_pod contract from the source: it re-raises instead of swallowing, letting Pod.terminate map to TerminateError (FLAG-002). (3) Step 6 splits storage health into pure helpers (parse_df_output, evaluate_storage_health) plus a STORAGE_CHECK_COMMAND constant, with the async SSH orchestration moved to Pod.check_storage_health in Step 7, resolving the sync/async callable mismatch (FLAG-003). (4) Step 8's launch loop now falls back to a single (None, None) sentinel target that invokes create_pod with network_volume_id=None when no storages are configured, supporting the volumeless pod case (FLAG-004). Added matching tests: volumeless launch, wait_ready normalized-key contract, and terminate_pod raising propagation. Success criteria updated to cover the new behaviors.",
"status": "addressed",
"severity": "significant"
},
{
"id": "FLAG-002",
"concern": "Termination: the plan expects Pod.terminate() to raise TerminateError on SDK failures and adds tests for that path, but the source terminate_pod helper swallows exceptions. Porting that helper unchanged leaves no failure signal for Pod.terminate() to act on.",
"evidence": "Revised plan to address all four significant flags. (1) Step 4 now specifies get_pod_status returns normalized snake_case keys (desired_status, ports) and Step 7's wait_ready uses those keys explicitly, not raw SDK desiredStatus (FLAG-001). (2) Step 4 changes the terminate_pod contract from the source: it re-raises instead of swallowing, letting Pod.terminate map to TerminateError (FLAG-002). (3) Step 6 splits storage health into pure helpers (parse_df_output, ) plus a constant, with the async SSH orchestration moved to in Step 7, resolving the sync/async callable mismatch (FLAG-003). (4) Step 8's launch loop now falls back to a single sentinel target that invokes with when no storages are configured, supporting the volumeless pod case (FLAG-004). Added matching tests: volumeless launch, normalized-key contract, and raising propagation. Success criteria updated to cover the new behaviors.",
"status": "addressed",
"severity": "significant"
},
{
"id": "FLAG-003",
"concern": "Storage health: the extracted helper is specified as synchronous, but the new pod API it is supposed to call is async. As written, Step 6 takes , then Step 7 passes , which is ; following that plan literally yields a coroutine/tuple mismatch in storage checks.",
"evidence": "Revised plan to address all four significant flags. (1) Step 4 now specifies returns normalized snake_case keys (, ) and Step 7's uses those keys explicitly, not raw SDK (FLAG-001). (2) Step 4 changes the contract from the source: it re-raises instead of swallowing, letting map to (FLAG-002). (3) Step 6 splits storage health into pure helpers (, ) plus a constant, with the async SSH orchestration moved to in Step 7, resolving the sync/async callable mismatch (FLAG-003). (4) Step 8's launch loop now falls back to a single sentinel target that invokes with when no storages are configured, supporting the volumeless pod case (FLAG-004). Added matching tests: volumeless launch, normalized-key contract, and raising propagation. Success criteria updated to cover the new behaviors.",
"status": "addressed",
"severity": "significant"
},
{
"id": "FLAG-004",
"concern": "Launch fallback: the new config makes storage optional, but the launch loop only iterates resolved network volumes and never falls back to a no-volume pod create. That means the default config can end up unable to launch anything unless the caller supplies a valid volume name, even though the extracted primitive already supports .",
"evidence": "Revised plan to address all four significant flags. (1) Step 4 now specifies returns normalized snake_case keys (, ) and Step 7's uses those keys explicitly, not raw SDK (FLAG-001). (2) Step 4 changes the contract from the source: it re-raises instead of swallowing, letting map to (FLAG-002). (3) Step 6 splits storage health into pure helpers (, ) plus a constant, with the async SSH orchestration moved to in Step 7, resolving the sync/async callable mismatch (FLAG-003). (4) Step 8's launch loop now falls back to a single sentinel target that invokes with when no storages are configured, supporting the volumeless pod case (FLAG-004). Added matching tests: volumeless launch, normalized-key contract, and raising propagation. Success criteria updated to cover the new behaviors.",
"status": "addressed",
"severity": "significant"
},
{
"id": "verifiability-0",
"concern": "Criterion 10: requires human verification (subjective_judgment).",
"evidence": "",
"status": "open",
"severity": "minor"
},
{
"id": "verifiability-1",
"concern": "Criterion 11: requires human verification (subjective_judgment).",
"evidence": "",
"status": "open",
"severity": "minor"
},
{
"id": "verifiability-2",
"concern": "Criterion 12: requires human verification (verify_physical_device).",
"evidence": "",
"status": "open",
"severity": "minor"
}
]
"[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: for ordinary pairs, the new diagnosis is not well-supported by the repo. the current sync effect in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts already syncs url and primaryvariantid, and the regenerate path reads exactly starturl, endurl, startgenid, endgenid, startvariantid, and endvariantid from segmentslotmode.pairdata in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/domains/media-lightbox/hooks/usevideoregeneratemode.ts. adding thumburl and generationid to the sync does not, by itself, explain why an old image url is still being used for regular pairs. (flagged 1 times across 1 plans)",
"[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the fix is incomplete for extra trailing slots. handlepairclick can populate activepairdata from trailingpairdata when pairindex === pairdatabyindex.size in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts, but the proposed sync effect only reads pairdatabyindex.get(segmentslotlightboxindex). for those trailing-slot cases fresh is undefined, so no image refresh happens. (flagged 1 times across 1 plans)",
"[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the merge pseudocode does not actually sync 'all image fields' as claimed. it omits id and position from change detection, and when fresh.startimage or fresh.endimage becomes null it preserves the stale previous object instead of syncing that null state. as written, it also needs explicit null-guards around spreads of prev.startimage / prev.endimage to be safe in strict typescript. (flagged 1 times across 1 plans)",
"[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the plan's claim that (the 30-minute startup safety net) catches abandoned pods that exited before patching is slightly imprecise. line 200-204 only runs when is true, which requires to be in per line 161. a pod that exits before its first patch has , so is false and the code falls through to the normal timeout checks (active_stale / not_claiming) at line 207+, not the 30-minute startup cap. both paths eventually reap the worker, so the end result is the same, but the overview's reasoning (naming 200-204 specifically) is wrong. worth correcting so future readers don't mis-reason about the invariant. (flagged 1 times across 1 plans)",
"[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: checked worker_state.py line 161 () against the plan's assumption that subsequent lenient writes are safe. if deps_installing succeeds but deps_verified silently fails, startup_phase stays at 'deps_installing' and the 30-minute cap from line 200-204 applies \u2014 even though the pod is actually progressing through . on a slow runpod image with cold wheel downloads, plus wan2gp deps can take 20+ minutes. there's no concrete benchmark in the plan that says the 30-minute cap is safely above the expected sync time; if legitimately takes 25 minutes and the deps_verified patch fails on a transient network blip, the orchestrator will terminate a healthy pod. plan should either bump the cap or note that deps_verified swallowing is acceptable because the cap is generously above typical sync time. (flagged 1 times across 1 plans)",
"[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the path-mapping defect from the previous iteration is fixed, but a different technical gap remains around . repository search shows is imported by , , , , , and ; the v4 plan still aligns to upstream head without any concrete runtime step that exercises those code paths after the change, so the only repo-documented behavior check for that file is still missing from the executable body. (flagged 1 times across 1 plans)",
"[DEBT] are-the-success-criteria-well-prioritized-and-verifiable: are the success criteria well-prioritized and verifiable?: the attached success criteria are stale and do not match the current plan body. they still require 'no for ', ' fully removed', 'sync effect deleted', and ' simplified to ', which are the opposite of the current targeted-sync plan. as presented, the criteria are not usable for review or execution. (flagged 1 times across 1 plans)",
"[DEBT] audio-loading: getaudiodata in useeffect removes render-readiness signal (flagged 1 times across 1 plans)",
"[DEBT] audio-loading: same as correctness-3 \u2014 preview/render parity risk (flagged 1 times across 1 plans)",
"[DEBT] audio-loading: preview/render parity partially satisfied (flagged 1 times across 1 plans)",
"[DEBT] audio-reactivity: overlapping clips use first-found, volume not scaled (flagged 1 times across 1 plans)",
"[DEBT] audio-reactivity: same as audio-reactivity-1 \u2014 overlapping/volume-adjusted clips diverge from audible mix (flagged 1 times across 1 plans)",
"[DEBT] audio-reactivity: textclip missing globalframeprovider (flagged 1 times across 1 plans)",
"[DEBT] audio-reactivity: same as audio-reactivity-2 \u2014 textclipsequence missing provider (flagged 1 times across 1 plans)",
"[DEBT] audio-reactivity: textclip effects surface not covered (flagged 1 times across 1 plans)",
"[DEBT] audio-reactivity: continuous effects shared by visual and text clips (flagged 1 times across 1 plans)",
"[DEBT] batch-generation-pipeline: enhancement in usegeneratebatch before generatevideo() could compute prompts against a stale pair snapshot if mutations are still in flight. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-cascade-paths: cascade lookup only reads params->>'orchestrator_task_id_ref', missing shared reference paths and orchestrator-self detection. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-cascade-paths: duplicate of correctness-2 + correctness-3: invalid sql syntax and narrow cascade lookup. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-cascade-paths: shared orchestrator-reference helpers not referenced. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-cascade-paths: orchestrator tasks that crash don't get orchestrator-self cascade. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-cascade-paths: hardcoded params->>'orchestrator_task_id_ref' misses other reference paths. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-retry: crash requeue sql does not increment attempts, risking infinite requeue loop. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-retry: duplicate of correctness-1: attempts never advance on crash requeue. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-retry: missing attempts increment location in heartbeat sql. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-retry: step 6 under-scoped for real retry convergence and orchestrator-self handling. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-sql-syntax: bare select inside plpgsql is invalid \u2014 needs perform. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-testing: no multi-crash convergence test exercising attempts 0\u21921\u21922\u21923. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-testing: no validation that plpgsql body executes successfully. (flagged 1 times across 1 plans)",
"[DEBT] crash-recovery-testing: criteria don't require proof of crash requeue convergence. (flagged 1 times across 1 plans)",
"[DEBT] criteria-verifiability: 'no unsafe .maybesingle()' criterion requires judgment about column uniqueness. (flagged 1 times across 1 plans)",
"[DEBT] criteria-verifiability: decision documentation location not specified. (flagged 1 times across 1 plans)",
"[DEBT] criteria-verifiability: the must criterion requiring 5 task types to exist as active db rows is not verifiable from code diff alone \u2014 it requires a live db query. (flagged 1 times across 1 plans)",
"[DEBT] db-fallback-testing: no new automated test for the db fallback dispatch path or dependant_on preservation for raw worker families. (flagged 1 times across 1 plans)",
"[DEBT] dependency-resolution: dependency resolution: the plan does not lock down the active python-version matrix even though the repo currently splits between python 3.10 local installs and a python 3.11 runpod image. (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 package is internally inconsistent. the plan body says to keep in and make phase 2 optional, but the attached metadata and success criteria still describe the previous derive-via- / remove- / simplify- plan. that means the approved-plan requirements are only partially coherent as presented. (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 linux distro note is documentation-only; the generated install command in step 7 still runs without any pre-check that the package exists. users on ubuntu 24.04+ who ignore the doc and try to copy-paste the command will hit a confusing from apt rather than a targeted error from commandutils.ts. a one-line detection pre-check (e.g., ) would convert the silent failure into an actionable error, but the plan does not add this. (flagged 1 times across 1 plans)",
"[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: checked the revised v4 body against sprint 2. the repo plan doc still lists an "ltx-2 smoke against the pre-sprint behavioral baseline" as a sprint 2 verification gate and repeats that smoke in the functionality-preservation checks, but the revised execution steps no longer schedule that smoke anywhere; it survives only as an info-level metadata criterion. because remains an explicit sprint 2 deliverable, the revised plan still only partially carries forward the verification package described in the source migration plan. (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?: phase 1 still misses a real supporting-data location: lives outside in , but the proposed sync logic only considers . if trailing slot regenerate is part of the bug surface, that location is not covered. (flagged 1 times across 1 plans)",
"[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the non-swallowing helper is a new shell function, but phase 1 step 2 introduces it only as pseudo-code. there is no concrete note that the helper must handle supabase http non-2xx responses as failures (curl returns 0 even on http 4xx/5xx by default unless or is used). if the implementer ports verbatim with only removed, a 500 from supabase would still report success because curl's exit code is 0. the plan should specify or explicit http status code checking in the strict variant. (flagged 1 times across 1 plans)",
"[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the supporting-infrastructure review still finds one missing check. in , sprint 2's verification matrix and risk register both single out as a distinct drift-upgrade surface with its own smoke and its own silent-behavior-change risk, but the revised v4 body updates the file without keeping that supporting verification step in the actual execution checklist. (flagged 1 times across 1 plans)",
"[DEBT] edge-test-config: plan's vitest commands use the wrong config entry point. (flagged 1 times across 1 plans)",
"[DEBT] edge-test-config: same as verification-3: wrong vitest config in validation commands. (flagged 1 times across 1 plans)",
"[DEBT] edge-test-config: success criterion references wrong test command. (flagged 1 times across 1 plans)",
"[DEBT] error-handling: db loader error handling convention mismatch (plan says log+null, existing loaders throw) (flagged 1 times across 1 plans)",
"[DEBT] error-propagation-logging: generation.ts and handler.ts logging endpoints are not directly tested. (flagged 1 times across 1 plans)",
"[DEBT] error-propagation-testing: no end-to-end regression test for the full symptom chain (db error \u2192 tocompletionerror metadata \u2192 handler log). (flagged 1 times across 1 plans)",
"[DEBT] error-propagation-testing: handler.ts metadata surfacing criterion lacks a concrete automated verifier. (flagged 1 times across 1 plans)",
"[DEBT] error-propagation-testing: main issue only partially validated without an integration test. (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 step 2 retry loop uses a naked between attempts, which adds up to 6 seconds of latency on the happy path when the first patch eventually succeeds on attempt 2 or 3. for pods where supabase is reachable but slow during the initial moments of a cold runpod start, the retry logic is fine. however, if the first attempt fails with a tls handshake delay and the retry loop sleeps 2s per attempt regardless of whether curl itself has been blocking for tens of seconds, the total startup latency penalty could be substantial. this is a minor tuning concern, not a correctness issue. (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?: finding callers of the changed module shows that is consumed by , , multiple ltx2 pipeline modules, and . the revised validation steps still only drive the three bridge getters in ; none of the scheduled commands execute a real caller, so the plan does not yet verify the main caller shapes for the other explicit sprint 2 file change. (flagged 1 times across 1 plans)",
"[DEBT] gpu-branching-test-matrix: linux cuda128 path under-verified (flagged 1 times across 1 plans)",
"[DEBT] gpu-branching-ui-surface: nvidia-50 option is exposed on linux in the ui but linux cuda128 smoke test is missing (flagged 1 times across 1 plans)",
"[DEBT] hook-abstraction: usepairsettingshandler becomes trivial with single caller \u2014 keeping it is extra indirection. (flagged 1 times across 1 plans)",
"[DEBT] is-the-change-in-the-right-place-and-would-it-break-any-callers: is the change in the right place, and would it break any callers?: the optional cleanup steps are not in the right place yet. does not receive today; its props are only , , , and callback/display props in . so step 4's 'pass directly' would require new prop plumbing or a different seam. (flagged 1 times across 1 plans)",
"[DEBT] is-the-scope-and-scale-of-the-change-appropriate: is the scope and scale of the change appropriate?: phase 2 is still under-specified for execution. step 4 says pairregionslayer should either pass directly or 'just pass the index + frame-only data', which are materially different designs. if phase 2 is kept in the plan, it needs a single concrete direction. (flagged 1 times across 1 plans)",
"[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: the plan still lacks an explicit automated regression test for the reported bug. step 2 is manual ('check that now gets the fresh url'), but there is no concrete test that opens a segment slot, changes the primary variant data, and asserts that the regenerate path sees the fresh , , and . (flagged 1 times across 1 plans)",
"[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: the current test remains only a smoke test in , and the plan does not add behavior coverage for the new sync effect. (flagged 1 times across 1 plans)",
"[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: no verification step covers the trailing-slot branch, even though the proposed phase 1 logic currently misses refreshes. (flagged 1 times across 1 plans)",
"[DEBT] legacy-data-backfill: the step 8 diagnostic query only detects cross-shot pair_shot_generation_id misassociations, not same-shot misassociations caused by timeline reordering within a shot. (flagged 1 times across 1 plans)",
"[DEBT] lookup-consistency: other repo call sites use unordered .limit(1).maybesingle() and will remain inconsistent. (flagged 1 times across 1 plans)",
"[DEBT] lookup-consistency: other call sites with same unsafe pattern not covered. (flagged 1 times across 1 plans)",
"[DEBT] lora-management: lora tools simplified vs full ui parity (multi-stage metadata, private loras) (flagged 1 times across 1 plans)",
"[DEBT] media-lightbox-persistence: variant switches do not clear/restore inpaintprompt, so stale prompt state can leak across variants with no cached prompt. (flagged 1 times across 1 plans)",
"[DEBT] media-lightbox-persistence: removing prompt/numgenerations from the variant-keyed localstorage cache means all variants within a generation share the same prompt. this broadens existing debt-002 (variant prompt leakage). (flagged 1 times across 1 plans)",
"[DEBT] media-lightbox-segment-slot: media lightbox / segment slot: the targeted sync rationale does not fully explain the reported stale-url bug for regular pairs, and the proposed effect still misses trailing-slot refreshes because those can come from rather than . (flagged 1 times across 1 plans)",
"[DEBT] number-input-nullable: plan doesn't explicitly state onchange must also accept null, though step 3 depends on it. (flagged 1 times across 1 plans)",
"[DEBT] number-input-nullable: disputed v1 flag \u2014 original concern about bulkclippanel being unimplementable. (flagged 1 times across 1 plans)",
"[DEBT] number-input-nullable: onchange null filtering not explicitly addressed in plan. (flagged 1 times across 1 plans)",
"[DEBT] number-input-testing: no planned tests for numberinput shared component or bulkclippanel nullable draft flow. (flagged 1 times across 1 plans)",
"[DEBT] orchestrator-completion-rollout: pre-existing individual_travel_segment children won't drive orchestrator completion through segment_type_config after deploy. (flagged 1 times across 1 plans)",
"[DEBT] orchestrator-completion-rollout: missing compatibility seam in orchestratorcore.ts:123-126 for old individual_travel_segment rows. (flagged 1 times across 1 plans)",
"[DEBT] orchestrator-completion-rollout: mixed old/new data during rollout can leave old orchestrators without completion counting. (flagged 1 times across 1 plans)",
"[DEBT] orchestrator-completion-rollout: no test or deployment guard for pre-existing individual_travel_segment children completing after worker change. (flagged 1 times across 1 plans)",
"[DEBT] orchestrator-completion-rollout: plan overstates backward compatibility for existing data. (flagged 1 times across 1 plans)",
"[DEBT] orchestrator-completion-rollout: missing rollout compatibility step for in-flight individual_travel_segment tasks. (flagged 1 times across 1 plans)",
"[DEBT] orchestrator-completion-rollout: pre-deploy individual_travel_segment child completing post-rollout won't be treated as segment task by checkorchestratorcompletion. (flagged 1 times across 1 plans)",
"[DEBT] orchestrator-completion-rollout: orchestrator.test.ts criterion too narrow to verify old individual_travel_segment compatibility. (flagged 1 times across 1 plans)",
"[DEBT] pair-settings-plumbing: handleopenpairsettings(pairindex, pairframedata) path in timelinetrackprelude, segmentoutputstrip, and usesegmentoutputstrip not explicitly named. (flagged 1 times across 1 plans)",
"[DEBT] pair-settings-plumbing: same as flag-002 \u2014 segmentoutputstrip and usesegmentoutputstrip still carry pairframedata. (flagged 1 times across 1 plans)",
"[DEBT] pair-settings-plumbing: timelinetrackprelude and segmentoutputstrip still forward (pairindex, pairframedata). (flagged 1 times across 1 plans)",
"[DEBT] plan-scope: step 3 is larger than a light megaplan warrants. (flagged 1 times across 1 plans)",
"[DEBT] planning-metadata: planning metadata: the attached metadata and success criteria still describe a different implementation than the current plan body, which risks sending execution and review down the wrong path. (flagged 1 times across 1 plans)",
"[DEBT] planning-metadata: success criteria don't cover wave 4 scope (flagged 1 times across 1 plans)",
"[DEBT] position-key-semantics: plan investigates a unique constraint on (parent_generation_id, child_order) which doesn't match repo semantics for position keys. (flagged 1 times across 1 plans)",
"[DEBT] position-key-semantics: plan weights toward child_order rather than pair_shot_generation_id as the key that matters. (flagged 1 times across 1 plans)",
"[DEBT] position-key-semantics: unique constraint on (parent_generation_id, child_order) not supported by repo semantics. (flagged 1 times across 1 plans)",
"[DEBT] prompt-composition: the plan's step 1 signature includes textbeforeprompts/textafterprompts parameters that would be applied before enhancement, double-wrapping the prompt. (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?: checked the broader runtime surface after the v4 path fix. sprint 2 is still moving two behavior-sensitive seams rather than just the import-path contract: the mount path and the runtime. step 6.2 covers only the three getters, while the 6-file travel suite and the bridge-contract tests do not mention , so dropping the dedicated self-refiner smoke from the runnable steps leaves the broader downstream surface of that changed file under-covered. (flagged 1 times across 1 plans)",
"[DEBT] self-refiner-verification: self-refiner verification: the revised plan still aligns without scheduling the sprint 2 ltx-2 smoke that defines as the behavior-preservation check for that drift upgrade. (flagged 1 times across 1 plans)",
"[DEBT] settings-defaults: workerrepopath default can go stale if user switches computertype before editing path (flagged 1 times across 1 plans)",
"[DEBT] settings-resolution: settings cascade missing \u2014 shot-only read diverges from form's defaults\u2192user\u2192project\u2192shot merge (flagged 1 times across 1 plans)",
"[DEBT] settings-resolution: settings cascade missing \u2014 shot-only read (flagged 1 times across 1 plans)",
"[DEBT] shared-component-compatibility: numberinput changes affect callers outside video-editor (billing, travel-between-images, phaseconfigselectormodal). (flagged 1 times across 1 plans)",
"[DEBT] shared-component-compatibility: shared ui component blast radius not audited in plan. (flagged 1 times across 1 plans)",
"[DEBT] shot-linking-testing: no test covers the linkgenerationtoshot error/catch branches. (flagged 1 times across 1 plans)",
"[DEBT] signature-propagation: plan doesn't explicitly name timeline/index.tsx and segmentslotcontracts.ts for updates. (flagged 1 times across 1 plans)",
"[DEBT] signature-propagation: same as flag-001 \u2014 timeline/index.tsx and segmentslotcontracts.ts not in checklist. (flagged 1 times across 1 plans)",
"[DEBT] signature-propagation: five supporting contract/plumbing sites not named in the checklist. (flagged 1 times across 1 plans)",
"[DEBT] task-types-verification: step 3 cites wrong migration file (task_cost_configs instead of task_types) as evidence for db fallback path. (flagged 1 times across 1 plans)",
"[DEBT] task-types-verification: step 3 should cite task_types source, not task_cost_configs. (flagged 1 times across 1 plans)",
"[DEBT] task-types-verification: plan doesn't verify travel_segment and travel_stitch exist as active task_types rows using the correct table. (flagged 1 times across 1 plans)",
"[DEBT] test-coverage: current generation-child.test.ts is only a smoke test. (flagged 1 times across 1 plans)",
"[DEBT] test-coverage: no plan to verify other lookup paths choose rows consistently. (flagged 1 times across 1 plans)",
"[DEBT] test-coverage: no new tests for db loader or travel param merge path (flagged 1 times across 1 plans)",
"[DEBT] test-coverage: must-level criteria depend on manual testing rather than automated assertions (flagged 1 times across 1 plans)",
"[DEBT] test-coverage: no new unit tests for wave 4 tools (flagged 1 times across 1 plans)",
"[DEBT] test-coverage: must criteria backed by manual testing only (flagged 1 times across 1 plans)",
"[DEBT] test-infrastructure: no test fixtures for resources table (flagged 1 times across 1 plans)",
"[DEBT] timeline-drag-coordination: plan keeps two hooks instead of a single coordinator (flagged 1 times across 1 plans)",
"[DEBT] timeline-drag-coordination: brief says single coordinator but plan keeps separate hooks (flagged 2 times across 1 plans)",
"[DEBT] timeline-drag-coordination: pendingopsref retained despite brief suggesting removal (flagged 1 times across 1 plans)",
"[DEBT] timeline-drag-coordination: wrapper-bound listener mount wiring under-specified (flagged 1 times across 1 plans)",
"[DEBT] timeline-persistence: read path still assembles config and registry from separate requests (flagged 1 times across 1 plans)",
"[DEBT] timeline-persistence: poll sync verification not structurally changed (flagged 1 times across 1 plans)",
"[DEBT] timeline-persistence: backend save helpers not wired to new rpc (flagged 1 times across 1 plans)",
"[DEBT] timeline-persistence: read infrastructure not updated (flagged 1 times across 1 plans)",
"[DEBT] timeline-persistence: backend tests not in validation list (flagged 1 times across 1 plans)",
"[DEBT] timeline-persistence: backend callers not migrated (flagged 1 times across 1 plans)",
"[DEBT] timeline-persistence: broader persistence-contract problem (flagged 1 times across 1 plans)",
"[DEBT] timeline-persistence: backend split-save not addressed (flagged 1 times across 1 plans)",
"[DEBT] timeline-persistence: split polling can combine config and registry from different snapshots (flagged 1 times across 1 plans)",
"[DEBT] timeline-scaling: the plan only specifies a concrete fix for the default scale(1) case; explicit-scale tracks may still break blend-mode effects. (flagged 1 times across 1 plans)",
"[DEBT] timeline-snap-threshold: threshold is generous (duration) rather than zoom-scaled (8px) (flagged 1 times across 1 plans)",
"[DEBT] timeline-snap-threshold: computedropposition does not pass a zoom-scaled threshold override (flagged 1 times across 1 plans)",
"[DEBT] travel-continuations: smooth continuations not threaded \u2014 agent tasks won't have continuation_config even when shot settings enable it (flagged 1 times across 1 plans)",
"[DEBT] travel-continuations: continuation_config omitted from form parity (flagged 1 times across 1 plans)",
"[DEBT] travel-payload-cleanup-scope: plan scope narrower than original user request (flagged 1 times across 1 plans)",
"[DEBT] travel-payload-cleanup-scope: broader create-task contract problem left untouched (flagged 1 times across 1 plans)",
"[DEBT] travel-payload-readers: phase 4 app-side reader audit incomplete (flagged 1 times across 1 plans)",
"[DEBT] travel-payload-readers: phase 4 field inventory incomplete for app-side readers (flagged 1 times across 1 plans)",
"[DEBT] travel-request-contract: image_variant_ids is in frontend request contract (flagged 1 times across 1 plans)",
"[DEBT] travel-request-contract: image_variant_ids contract change (flagged 1 times across 1 plans)",
"[DEBT] variant-update-b-fresh-takeover: spawn_worker does not internally call start_worker_process; harness must call both explicitly (flagged 1 times across 1 plans)",
"[DEBT] variant-update-b-fresh-takeover: worker_id and runpod_id must be generated and threaded distinctly; plan currently uses pod_id as both (flagged 1 times across 1 plans)",
"[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-1 \u2014 spawn_worker two-step misstatement (flagged 2 times across 1 plans)",
"[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-2 \u2014 worker_id/runpod_id propagation across takeover and restore paths (flagged 1 times across 1 plans)",
"[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-1 + correctness-2 \u2014 missing create_worker_record glue and start_worker_process integration (flagged 1 times across 1 plans)",
"[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-2 \u2014 caller contract for spawn_worker requires worker_id, not pod_id (flagged 1 times across 1 plans)",
"[DEBT] verification: no end-to-end render test for audio analysis timing (flagged 1 times across 1 plans)",
"[DEBT] verification: no automated coverage for text clips or overlapping clips with audio effects (flagged 1 times across 1 plans)",
"[DEBT] verification-coverage: no automated test exercises the full segment-slot opening path after cleanup. (flagged 1 times across 1 plans)",
"[DEBT] verification-coverage: no automated coverage that clicking a pair opens the correct modal after cleanup. (flagged 1 times across 1 plans)",
"[DEBT] verification-coverage: zero behavioral change criterion is not verifiable from tsc + existing tests alone. (flagged 1 times across 1 plans)",
"[DEBT] verification-workflow: tsconfig.app.json excludes test files, so tsc won't catch test breakage. (flagged 1 times across 1 plans)",
"[DEBT] worker-test-staleness: worker test in test_additional_coverage_modules.py:37 may assert stale payload structure (task_type vs family). (flagged 1 times across 1 plans)"
]
Requirements:
- Produce structured JSON only.
- `tasks` must be an ordered array of task objects. Every task object must include:
- `id`: short stable task ID like `T1`
- `description`: concrete work item
- `depends_on`: array of earlier task IDs or `[]`
- `status`: always `"pending"` at finalize time
- `executor_notes`: always `""` at finalize time
- `reviewer_verdict`: always `""` at finalize time
- `watch_items` must be an array of strings covering runtime risks, critique concerns, and assumptions to keep visible during execution.
- `sense_checks` must be an array with one verification question per task. Every sense-check object must include:
- `id`: short stable ID like `SC1`
- `task_id`: the related task ID
- `question`: reviewer verification question
- `verdict`: always `""` at finalize time
- `meta_commentary` must be a single string with execution guidance, gotchas, or judgment calls that help the executor succeed.
- `validation` must be an object that self-checks plan coverage:
- `plan_steps_covered`: enumerate EVERY step from the approved plan. For each step, provide a short `plan_step_summary` (the step's intent in one phrase) and `finalize_task_ids` (array of task IDs that implement it — a single plan step may map to multiple tasks).
- `orphan_tasks`: task IDs that do not correspond to any plan step. Normally empty. If non-empty, explain in `completeness_notes`.
- `completeness_notes`: free-text explanation of any gaps, deviations, or deliberate omissions.
- `coverage_complete`: set to `true` only if every plan step has at least one finalize task AND you have verified the mapping by reviewing each entry. Set to `false` if any plan step is missing coverage.
- Example:
```json
"validation": {
"plan_steps_covered": [
{"plan_step_summary": "Add retry logic to API client", "finalize_task_ids": ["T1", "T2"]},
{"plan_step_summary": "Update configuration schema", "finalize_task_ids": ["T3"]}
],
"orphan_tasks": [],
"completeness_notes": "All plan steps mapped to tasks.",
"coverage_complete": true
}
```
- Preserve information that strong existing artifacts already capture well: execution ordering, watch-outs, reviewer checkpoints, and practical context.
- The structured output should be self-contained: an executor reading only `finalize.json` should have everything needed to work.
- Keep the task count proportional to the work. A simple 1-2 file fix should be 2 tasks: (1) apply the fix, (2) run tests. Do NOT create separate "inspect" or "read" tasks for simple changes — the executor can read and fix in one step. Only create more tasks when the work has genuinely independent stages.
- - The FINAL task MUST always be to run tests and verify the changes work. If specific test IDs or commands are mentioned in the original task, include them. Otherwise, the executor should find and run the tests most relevant to the files changed. If any test fails, read the error, fix the code, and re-run until they pass. Do NOT create new test files — run the project's existing test suite. Additionally, the executor should write a short throwaway script that reproduces the specific bug described in the task, run it to confirm the fix works, then delete the script.