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.
WRITE ACCESS CONTRACT: You are running with auto-approved writes inside a writable workspace. Treat the working directory as fully writable. Do NOT preemptively skip or block tasks on permission, sandbox, or read-only grounds. Attempt every required edit; only report failure AFTER a real OS-level rejection from a specific shell command. Do not infer 'read-only' from absence of activity; absence is not denial. If a single shell command unexpectedly fails, retry with a different invocation before concluding the environment is restricted.
You are creating an implementation plan for the following idea.
code
Idea:
Build a holistic VibeComfy template porting workbench/toolset, based on the failures seen while porting production Reigh workflows to VibeComfy. The toolset should make it easy to find/import source Comfy workflows, convert them into proper Python ready-template/scratchpad format, preserve provenance, infer and validate custom node packs, infer and HEAD-check model asset URLs, resolve UI-only/helper nodes like Note/MarkdownNote/SetNode/GetNode and similar reroute/broadcast helpers, detect positional widget aliases by comparing compiled API prompts with Comfy object_info/schema, surface missing required inputs before a RunPod burn, emit actionable reports and tests, and support battle-testing against both a simple template and the current WanAnimate production-parity template. It should be pragmatic: build the first useful slice now, use it immediately on the current failures, and document the remaining roadmap. Avoid raw JSON execution as the steady-state path; workflows should land as Python-esque VibeComfy ready templates/scratchpads. Include a strategy for integrating this into the live validation loop so future users avoid the same URL/model/custom-node/schema failures.
code
Assistant
{"plan":"I’ll inspect the current VibeComfy conversion, template, validation, node/model registry, and test surfaces enough to identify concrete touch points. I’ll avoid prior planning artifacts and keep this to a plan artifact rather than making code changes.","questions":[],"success_criteria":[],"assumptions":[]}
Assistant
{"plan":"The quick scan shows existing generated ready templates, schema validation, node pack install logic, and workflow helper-node handling. I’m narrowing to the actual converter/normalizer and CLI surfaces so the plan can name concrete modules and tests.","questions":[],"success_criteria":[],"assumptions":[]}
Assistant
{"plan":"I found the existing first slice already partly exists as convert, validate, doctor, schema checks, model asset extraction, node-pack planning, and helper-node compile rewriting. I’m checking the representative tests now so the implementation plan can extend the current shape instead of inventing a parallel tool.","questions":[],"success_criteria":[],"assumptions":[]}
Assistant
User
Assistant
User
Assistant
User
Assistant
Project directory:
/Users/user_c042661f/Documents/reigh-workspace/vibecomfy
No prior clarification artifact exists. Identify ambiguities, ask clarifying questions, and state your assumptions inside the plan output.
Requirements:
- If the engineering brief suggests an approach, use it as your starting hypothesis — but before committing, consider if there's a simpler or more fundamental fix. The brief is well-researched input, not a final answer.
- If the brief is absent, incomplete, or says "skip", inspect the repository yourself before planning.
- Stay focused on the requested idea. If repo exploration surfaces unrelated issues or docs, ignore them and return to the task.
- Prefer source code, tests, and directly relevant config files. Avoid `.megaplan/`, prior plan artifacts, and unrelated `docs/` or ops/deployment material unless the task explicitly depends on them.
- Stop exploring once you have enough evidence to name the concrete touch points and validation path. Do not keep browsing after you can write the plan.
- Produce a concrete implementation plan in markdown.
- Define observable success criteria as objects with `criterion` (string) and `priority` (`must`, `should`, or `info`):
- `must` — hard gate. The reviewer will block on failure. Use for correctness, functional requirements, and verifiable outcomes (e.g., "all existing tests pass", "API returns 200 for valid input"). Every `must` criterion must have a clear yes/no answer.
- `should` — quality target. The reviewer flags but does not block. Use for subjective goals, numeric guidelines, and best-effort improvements (e.g., "file under ~300 lines", "no deeply nested conditionals", "each function has a single responsibility").
- `info` — documented for humans, reviewer skips. Use for criteria that cannot be verified in this pipeline (e.g., "13 manual smoke tests pass", "stakeholder sign-off obtained").
- Each success criterion should include a `requires` field listing the capabilities needed for verification. Valid capability strings: `run_shell`, `read_files`, `run_tests`, `parse_diff`, `read_build_output`, `run_linter` (container), `drive_browser`, `inspect_runtime_ui`, `observe_runtime_logs`, `subjective_judgment`, `verify_physical_device` (human). `must` criteria MUST have non-empty `requires`. Example: `{"criterion": "All tests pass", "priority": "must", "requires": ["run_tests"]}`.
- Use the `questions` field for ambiguities that would materially change implementation.
- Use the `assumptions` field for defaults you are making so planning can proceed now.
- Prefer cheap validation steps early.
- Keep the plan proportional to the task. A 1-line fix needs a 2-step plan (apply fix + run tests), not a 5-step investigation.
- If user notes answer earlier questions, incorporate them into the draft plan instead of re-asking them.
- Fix the problem fully. Do not limit scope just to avoid breaking existing tests — update the tests too if needed.
- Prefer the simplest, most direct fix. No fallbacks, type conversions, or defensive wrappers without concrete evidence they are needed.
- If the task or issue hints suggest a specific approach, follow it. Only deviate with concrete counter-evidence.
Plan template — simple format (adapt to the actual repo and scope):
md
# Implementation Plan: [Title]
## Overview
Summarize the goal, current repository shape, and the constraints that matter.
## Main Phase
### Step 1: Audit the current behavior (`megaplan/prompts.py`)
**Scope:** Small
1. **Inspect** the current implementation and call out the exact insertion points (`megaplan/prompts.py:29`).
### Step 2: Add the first change (`megaplan/evaluation.py`)
**Scope:** Medium
1. **Implement** the smallest viable change with exact file references (`megaplan/evaluation.py:1`).
2. **Capture** any tricky behavior with a short example.
```python
issues = validate_plan_structure(plan_text)
```
### Step 3: Wire downstream behavior (`megaplan/handlers.py`, `megaplan/workers.py`)
**Scope:** Medium
1. **Update** the runtime flow in the touched files (`megaplan/handlers.py:400`, `megaplan/workers.py:199`).
### Step 4: Prove the change (`tests/test_evaluation.py`, `tests/test_megaplan.py`)
**Scope:** Small
1. **Run** the cheapest targeted checks first (`tests/test_evaluation.py:1`).
2. **Finish** with broader verification once the wiring is in place (`tests/test_megaplan.py:1`).
## Execution Order
1. Update prompts and mocks before enforcing stricter validation.
2. Land higher-risk wiring after the validator and tests are ready.
## Validation Order
1. Start with focused unit tests.
2. Run the broader suite after the flow changes are in place.
For complex plans, use multiple phases:
md
## Phase 1: Foundation — Dependencies, DB, Types
### Step 1: Install dependencies (`package.json`)
...
### Step 2: Create database migration (`supabase/migrations/`)
...
## Phase 2: Core Integration
### Step 3: Port the main component (`src/components/`)
...
Template guidance:
Simple plans: use ## Main Phase with ### Step N: sections underneath.
Complex plans: use multiple ## Phase N: sections, each containing ### Step N: steps. Step numbers are global (not per-phase).
The flat ## Step N: format (without phases) also works for backwards compatibility.
Key invariants: one H1 title, one ## Overview, numbered step sections (### Step N: or ## Step N:), and at least one ordering section.
{"plan":"# Implementation Plan: VibeComfy Template Porting Workbench\n\n## Overview\nVibeComfy already has the raw pieces of a template-porting workflow: convert, validate, doctor, schema-backed validation, model asset extraction, node pack install planning, generated ready-template rendering in tools/format_as_python.py, and WanAnimate-specific regression tests. The first useful slice should not be a separate app or a raw JSON runner. It should promote these scattered checks into a first-class CLI/tooling path that imports a Comfy workflow, emits a Python VibeWorkflow scratchpad/ready-template, preserves provenance, and reports the failures that currently cost RunPod time: missing node packs, bad/missing model URLs, unresolved helper nodes, positional widget alias drift, and missing required schema inputs.\n\nThe simplest approach is to build a package-level vibecomfy.porting workbench and a vibecomfy port ... CLI command that reuses existing code rather than inventing a second converter. tools/format_as_python.py is the current best emitter, but because it lives under tools/, the reusable core should move into package modules while the old tool remains as a thin compatibility driver.\n\n## Phase 1: Foundation — Shared Port Report and Python Emission\n\n### Step 1: Add a porting report model (vibecomfy/porting/report.py)\nScope: Medium\n1. Define small dataclasses for PortReport, PortIssue, PortArtifact, and AssetCheckResult with stable JSON serialization.\n2. Include fields for source path/id, detected workflow shape, source hash, normalized API node count, emitted Python path, custom-node pack suggestions, unresolved class types, model assets, schema issues, helper-node rewrites, and widget alias observations.\n3. Keep issue severities aligned with existing validation semantics: error, warning, info.\n\n### Step 2: Move reusable emitter logic into package code (vibecomfy/porting/emitter.py, tools/format_as_python.py)\nScope: Medium\n1. Extract the reusable portions of tools/format_as_python.py into package code, preserving deterministic output, explicit node IDs, _node(...) helper behavior, _extras for non-identifier inputs, and READY_METADATA / READY_REQUIREMENTS emission.\n2. Keep tools/format_as_python.py and tools/convert_ready_templates.py as wrappers around the package API so existing workflows still work.\n3. Reuse tools/_widget_schema.py by moving it to vibecomfy/porting/widget_schema.py or exposing a package import path, then update old tool imports.\n\n### Step 3: Add a workbench orchestrator (vibecomfy/porting/workbench.py)\nScope: Medium\n1. Implement analyze_source(...) to load a workflow via load_workflow_json, normalize_to_api, and convert_to_vibe_format, using get_schema_provider(\"auto\") when available.\n2. Implement emit_python_scratchpad(...) that writes a Python-esque VibeWorkflow scratchpad, not a wrapper that re-loads the original JSON at runtime.\n3. Preserve provenance in READY_METADATA: source path/id, source hash, original shape, conversion timestamp or converter version, source workflow id when known, and whether schema was available.\n4. Populate READY_REQUIREMENTS from inferred requirements plus extracted structured model assets.\n\n## Phase 2: Diagnostics — Catch Current Failure Classes Before RunPod\n\n### Step 4: Custom node pack inference (vibecomfy/porting/workbench.py, vibecomfy/node_packs_install.py)\nScope: Small\n1. Reuse missing_class_types_for_workflow(...) and missing_packs_for_workflow(...) to report installable packs and unresolved class types.\n2. Include pack repo, pip packages, and matched classes in the port report.\n3. Surface unresolved classes as hard errors for port check and warnings for port convert --allow-unresolved.\n\n### Step 5: Model asset inference and HEAD checks (vibecomfy/model_assets.py, vibecomfy/porting/assets.py)\nScope: Medium\n1. Reuse extract_from_raw_workflow(...) and entries_from_scratchpad_path(...) to collect structured model assets.\n2. Add an opt-in URL checker using httpx.Client().head(..., follow_redirects=True) with deterministic timeout and no download body.\n3. Report status codes, redirected final URL, missing URL fields, duplicate asset targets, and license-gated/404 cases as actionable report entries.\n4. Keep HEAD checks disabled in normal unit tests and local conversion unless --head-check-models is passed.\n\n### Step 6: Helper-node resolution diagnostics (vibecomfy/workflow.py, vibecomfy/porting/workbench.py)\nScope: Medium\n1. Keep existing compile-time stripping/rewriting for Note, MarkdownNote, SetNode, and GetNode.\n2. Add a report pass that counts removed UI-only nodes and lists unresolved GetNode / SetNode references whose broadcast source cannot be resolved.\n3. Treat dangling helper rewrites as error because they create links to absent runtime nodes.\n4. Add a narrow helper classification extension point for future reroute/broadcast nodes without changing runtime compile behavior for unknown classes.\n\n### Step 7: Positional widget alias detection (vibecomfy/porting/widget_aliases.py, vibecomfy/ingest/normalize.py, vibecomfy/workflow.py)\nScope: Large\n1. Centralize positional widget alias logic so normalize_to_api, VibeWorkflow.compile, and the Python emitter use the same mapping source.\n2. Prefer schema-derived input order from object_info when available; fall back to the committed static widget schema for offline operation.\n3. Add a diagnostic pass that compiles the workflow, compares emitted input names against schema inputs, and reports unresolved widget_N inputs where a required named input is missing.\n4. Move the existing Wan/WanAnimate aliases out of the private _POSITIONAL_WIDGET_ALIASES map in workflow.py into the shared module, preserving current behavior.\n\n### Step 8: Schema preflight integration (vibecomfy/schema/validate.py, vibecomfy/commands/validate.py, vibecomfy/commands/doctor.py)\nScope: Medium\n1. Reuse existing missing_required_input, unknown_input, unknown_class_type, invalid_link_shape, and type mismatch checks in the port report.\n2. Add optional --port-report or shared formatter support so validate / doctor can show the same actionable categories without duplicating logic.\n3. Keep validate focused and cheap; make the fuller workbench report the new port check path.\n\n## Phase 3: CLI and Live Validation Loop\n\n### Step 9: Add explicit CLI entry points (vibecomfy/commands/port.py, vibecomfy/commands/__init__.py)\nScope: Medium\n1. Register a new explicit command module in COMMANDS.\n2. Add python -m vibecomfy.cli port check <workflow> [--json] [--head-check-models] to analyze without writing.\n3. Add python -m vibecomfy.cli port convert <workflow> --out out/scratchpads/name.py [--json] [--head-check-models] to emit Python and include the report.\n4. Add --ready-id kind/name for users intentionally creating a ready-template-shaped module under ready_templates/.\n5. Return nonzero for hard errors: unresolved class types, unresolved helper broadcasts, schema-required missing inputs, failed Python build, or failed emitted scratchpad validation.\n\n### Step 10: Wire into the run/RunPod preflight (vibecomfy/commands/run.py, scripts/runpod_corpus_matrix.py)\nScope: Medium\n1. Before queueing a workflow, keep existing workflow.validate(schema_provider=...) as the hard gate.\n2. Add a cheap port-report summary to doctor and RunPod matrix logs so future failures show whether they are model URL, custom-node, schema, or helper-node problems.\n3. Do not make network HEAD checks mandatory for run; keep them opt-in via port check --head-check-models and in targeted preflight jobs.\n4. In RunPod corpus matrix logs, copy the emitted scratchpad and port report next to the existing convert/validate logs.\n\n## Phase 4: Battle Tests and Documentation\n\n### Step 11: Add focused unit and CLI tests (tests/test_porting_workbench.py, tests/test_cli.py, tests/test_workflow_core.py, tests/test_schema.py)\nScope: Medium\n1. Test a simple fixture based on image/z_image or a tiny synthetic workflow: check report shape, provenance, Python emission, import/build, compile, and validate.\n2. Test the current WanAnimate production-parity template id video/wanvideo_wrapper_22_wan_animate_preprocess_kijai: helper nodes must not survive compiled API, no dangling links to removed nodes, node packs include WanAnimate/SAM/KJ/VHS requirements, and model assets include detection assets.\n3. Test positional widget alias diagnostics with a fake schema provider so no Comfy runtime is required.\n4. Test model HEAD checks with httpx.MockTransport or injected client behavior, not real network.\n5. Add CLI smoke tests for port check --json and port convert --out ... --json.\n\n### Step 12: Document the first slice and roadmap (docs/template_porting_workbench.md, docs/adding_templates_models.md)\nScope: Small\n1. Document the new import → convert → check → validate loop.\n2. Show the recommended commands for a source workflow, a generated scratchpad, a ready-template candidate, and the WanAnimate battle test.\n3. Record the remaining roadmap: richer source discovery, broader helper-node catalog, schema snapshots per node-pack version, automatic PR-ready manifest edits, and optional CI job for URL HEAD checks.\n\n## Execution Order\n1. Create the report model and package emitter first so the CLI can be thin.\n2. Add workbench analysis before adding writes, because port check is the cheapest validation path.\n3. Add port convert after emitted Python can import/build/validate in tests.\n4. Add optional network HEAD checks only after offline report behavior is stable.\n5. Wire doctor / RunPod logs after the report shape is settled.\n6. Finish with docs and the WanAnimate regression path.\n\n## Validation Order\n1. Run focused tests first: pytest -q tests/test_porting_workbench.py tests/test_workflow_core.py tests/test_schema.py.\n2. Run CLI tests: pytest -q tests/test_cli.py.\n3. Run ready-template regressions: pytest -q tests/test_ready_templates.py.\n4. Run node/model checks: pytest -q tests/test_nodes_install.py tests/test_model_assets.py tests/test_models_registry.py.\n5. Run the full local suite with pytest once the command and report wiring are in place.\n6. Optional/manual: python -m vibecomfy.cli port check video/wanvideo_wrapper_22_wan_animate_preprocess_kijai --json and, when network is acceptable, repeat with --head-check-models.\n", "questions": ["Should the public UX be vibecomfy port ..., vibecomfy workbench ..., or an extension of the existing convert / doctor commands? The plan assumes a new explicit port command to avoid destabilizing existing command output.", "What is the canonical source path or id for the “current WanAnimate production-parity template” beyond the existing ready id video/wanvideo_wrapper_22_wan_animate_preprocess_kijai? The plan uses that id as the battle-test target.", "Should model URL HEAD checks run in CI, or remain opt-in/manual because they depend on network and upstream availability? The plan keeps them opt-in by default.", "Should port convert --ready-id be allowed to write directly under ready_templates/, or should it always emit to out/scratchpads/ and require a separate manual promotion step? The plan supports both but treats scratchpads as the safer default."], "success_criteria": [{"criterion": "python -m vibecomfy.cli port check <workflow> --json returns a structured report with source provenance, schema issues, custom-node suggestions, model assets, helper-node diagnostics, and widget alias diagnostics.", "priority": "must", "requires": ["run_shell", "read_build_output"]}, {"criterion": "python -m vibecomfy.cli port convert <workflow> --out <path> --json emits a Python scratchpad/ready-template module whose build() returns a VibeWorkflow without re-loading the original JSON at runtime.", "priority": "must", "requires": ["run_shell", "read_files", "read_build_output"]}, {"criterion": "The emitted Python module preserves provenance fields including original source path or id, source hash, detected shape, and ready id when supplied.", "priority": "must", "requires": ["read_files", "run_tests"]}, {"criterion": "The porting report flags unresolved custom node class types and suggests known node packs with repo URL, pip packages, and matched classes when available.", "priority": "must", "requires": ["run_tests", "read_build_output"]}, {"criterion": "The porting report flags missing required schema inputs before runtime queueing for workflows validated with an available schema provider.", "priority": "must", "requires": ["run_tests"]}, {"criterion": "WanAnimate helper nodes (Note, MarkdownNote, SetNode, GetNode) do not survive compiled API output, and no compiled API link points to a removed helper node.", "priority": "must", "requires": ["run_tests", "parse_diff"]}, {"criterion": "Positional widget_N alias handling is centralized and covered by tests using a fake schema provider plus the existing Wan/WanAnimate alias cases.", "priority": "must", "requires": ["run_tests", "parse_diff"]}, {"criterion": "Model asset HEAD checks are opt-in, use injectable/mocked HTTP behavior in tests, and report status without downloading model bodies.", "priority": "must", "requires": ["run_tests", "parse_diff"]}, {"criterion": "Focused tests for the simple template path and the WanAnimate production-parity path pass.", "priority": "must", "requires": ["run_tests"]}, {"criterion": "Existing local test suite passes with pytest.", "priority": "must", "requires": ["run_tests"]}, {"criterion": "The new porting modules keep CLI formatting separate from analysis logic and avoid duplicating node/model/schema inference code already present in the package.", "priority": "should", "requires": ["parse_diff", "subjective_judgment"]}, {"criterion": "The docs give future users a short live validation loop that starts with port check, proceeds to Python scratchpad conversion, and only then spends RunPod time.", "priority": "should", "requires": ["read_files", "subjective_judgment"]}, {"criterion": "Optional real network HEAD checks pass for the current model asset URLs.", "priority": "info", "requires": ["run_shell", "observe_runtime_logs"]}], "assumptions": ["The first useful slice should be a CLI/tooling workbench inside VibeComfy, not a GUI.", "Normal tests must remain deterministic and must not require ComfyUI, RunPod, network access, model files, or installed custom nodes.", "Existing tools/format_as_python.py is the right starting point for Python-esque emission, but reusable logic should move into vibecomfy/porting/.", "Raw external JSON may be accepted as an input source, but the steady-state output should be a Python scratchpad or ready-template module.", "The current WanAnimate battle-test target is video/wanvideo_wrapper_22_wan_animate_preprocess_kijai unless the user supplies a different production-parity source.", "Network URL HEAD checks should be opt-in because upstream model hosts and license gates can make them flaky in routine local validation."]}
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.
WRITE ACCESS CONTRACT: You are running with auto-approved writes inside a writable workspace. Treat the working directory as fully writable. Do NOT preemptively skip or block tasks on permission, sandbox, or read-only grounds. Attempt every required edit; only report failure AFTER a real OS-level rejection from a specific shell command. Do not infer 'read-only' from absence of activity; absence is not denial. If a single shell command unexpectedly fails, retry with a different invocation before concluding the environment is restricted.
You are revising an implementation plan after critique and gate feedback.
Build a holistic VibeComfy template porting workbench/toolset, based on the failures seen while porting production Reigh workflows to VibeComfy. The toolset should make it easy to find/import source Comfy workflows, convert them into proper Python ready-template/scratchpad format, preserve provenance, infer and validate custom node packs, infer and HEAD-check model asset URLs, resolve UI-only/helper nodes like Note/MarkdownNote/SetNode/GetNode and similar reroute/broadcast helpers, detect positional widget aliases by comparing compiled API prompts with Comfy object_info/schema, surface missing required inputs before a RunPod burn, emit actionable reports and tests, and support battle-testing against both a simple template and the current WanAnimate production-parity template. It should be pragmatic: build the first useful slice now, use it immediately on the current failures, and document the remaining roadmap. Avoid raw JSON execution as the steady-state path; workflows should land as Python-esque VibeComfy ready templates/scratchpads. Include a strategy for integrating this into the live validation loop so future users avoid the same URL/model/custom-node/schema failures.
User notes and answers:
User added: discoverability is a first-class requirement. The VibeComfy porting toolset must make it obvious to humans and agents when to use it: command names/help, README/authoring docs, AGENTS.md or skill guidance, and failure/live-validation docs should all point to port check before manual template editing or expensive RunPod validation. The tool should document when to use check, convert, doctor/validate, model URL checks, custom-node pack discovery, and Python-template conversion.
code
Current plan (markdown):
# Implementation Plan: VibeComfy Template Porting Workbench
Overview
VibeComfy already has the raw pieces of a template-porting workflow: convert, validate, doctor, schema-backed validation, model asset extraction, node pack install planning, generated ready-template rendering in tools/format_as_python.py, and WanAnimate-specific regression tests. The first useful slice should not be a separate app or a raw JSON runner. It should promote these scattered checks into a first-class CLI/tooling path that imports a Comfy workflow, emits a Python VibeWorkflow scratchpad/ready-template, preserves provenance, and reports the failures that currently cost RunPod time: missing node packs, bad/missing model URLs, unresolved helper nodes, positional widget alias drift, and missing required schema inputs.
The simplest approach is to build a package-level vibecomfy.porting workbench and a vibecomfy port ... CLI command that reuses existing code rather than inventing a second converter. tools/format_as_python.py is the current best emitter, but because it lives under tools/, the reusable core should move into package modules while the old tool remains as a thin compatibility driver.
Phase 1: Foundation — Shared Port Report and Python Emission
Step 1: Add a porting report model (vibecomfy/porting/report.py)
Scope: Medium
Define small dataclasses for PortReport, PortIssue, PortArtifact, and AssetCheckResult with stable JSON serialization.
Include fields for source path/id, detected workflow shape, source hash, normalized API node count, emitted Python path, custom-node pack suggestions, unresolved class types, model assets, schema issues, helper-node rewrites, and widget alias observations.
Extract the reusable portions of tools/format_as_python.py into package code, preserving deterministic output, explicit node IDs, _node(...) helper behavior, _extras for non-identifier inputs, and READY_METADATA / READY_REQUIREMENTS emission.
Keep tools/format_as_python.py and tools/convert_ready_templates.py as wrappers around the package API so existing workflows still work.
Reuse tools/_widget_schema.py by moving it to vibecomfy/porting/widget_schema.py or exposing a package import path, then update old tool imports.
Step 3: Add a workbench orchestrator (vibecomfy/porting/workbench.py)
Scope: Medium
Implement analyze_source(...) to load a workflow via load_workflow_json, normalize_to_api, and convert_to_vibe_format, using get_schema_provider("auto") when available.
Implement emit_python_scratchpad(...) that writes a Python-esque VibeWorkflow scratchpad, not a wrapper that re-loads the original JSON at runtime.
Preserve provenance in READY_METADATA: source path/id, source hash, original shape, conversion timestamp or converter version, source workflow id when known, and whether schema was available.
Populate READY_REQUIREMENTS from inferred requirements plus extracted structured model assets.
Phase 2: Diagnostics — Catch Current Failure Classes Before RunPod
Keep existing compile-time stripping/rewriting for Note, MarkdownNote, SetNode, and GetNode.
Add a report pass that counts removed UI-only nodes and lists unresolved GetNode / SetNode references whose broadcast source cannot be resolved.
Treat dangling helper rewrites as error because they create links to absent runtime nodes.
Add a narrow helper classification extension point for future reroute/broadcast nodes without changing runtime compile behavior for unknown classes.
Step 7: Positional widget alias detection (vibecomfy/porting/widget_aliases.py, vibecomfy/ingest/normalize.py, vibecomfy/workflow.py)
Scope: Large
Centralize positional widget alias logic so normalize_to_api, VibeWorkflow.compile, and the Python emitter use the same mapping source.
Prefer schema-derived input order from object_info when available; fall back to the committed static widget schema for offline operation.
Add a diagnostic pass that compiles the workflow, compares emitted input names against schema inputs, and reports unresolved widget_N inputs where a required named input is missing.
Move the existing Wan/WanAnimate aliases out of the private _POSITIONAL_WIDGET_ALIASES map in workflow.py into the shared module, preserving current behavior.
Register a new explicit command module in COMMANDS.
Add python -m vibecomfy.cli port check <workflow> [--json] [--head-check-models] to analyze without writing.
Add python -m vibecomfy.cli port convert <workflow> --out out/scratchpads/name.py [--json] [--head-check-models] to emit Python and include the report.
Add --ready-id kind/name for users intentionally creating a ready-template-shaped module under ready_templates/.
Return nonzero for hard errors: unresolved class types, unresolved helper broadcasts, schema-required missing inputs, failed Python build, or failed emitted scratchpad validation.
Step 10: Wire into the run/RunPod preflight (vibecomfy/commands/run.py, scripts/runpod_corpus_matrix.py)
Scope: Medium
Before queueing a workflow, keep existing workflow.validate(schema_provider=...) as the hard gate.
Add a cheap port-report summary to doctor and RunPod matrix logs so future failures show whether they are model URL, custom-node, schema, or helper-node problems.
Do not make network HEAD checks mandatory for run; keep them opt-in via port check --head-check-models and in targeted preflight jobs.
In RunPod corpus matrix logs, copy the emitted scratchpad and port report next to the existing convert/validate logs.
Phase 4: Battle Tests and Documentation
Step 11: Add focused unit and CLI tests (tests/test_porting_workbench.py, tests/test_cli.py, tests/test_workflow_core.py, tests/test_schema.py)
Scope: Medium
Test a simple fixture based on image/z_image or a tiny synthetic workflow: check report shape, provenance, Python emission, import/build, compile, and validate.
Test the current WanAnimate production-parity template id video/wanvideo_wrapper_22_wan_animate_preprocess_kijai: helper nodes must not survive compiled API, no dangling links to removed nodes, node packs include WanAnimate/SAM/KJ/VHS requirements, and model assets include detection assets.
Test positional widget alias diagnostics with a fake schema provider so no Comfy runtime is required.
Test model HEAD checks with httpx.MockTransport or injected client behavior, not real network.
Add CLI smoke tests for port check --json and port convert --out ... --json.
Step 12: Document the first slice and roadmap (docs/template_porting_workbench.md, docs/adding_templates_models.md)
Scope: Small
Document the new import → convert → check → validate loop.
Show the recommended commands for a source workflow, a generated scratchpad, a ready-template candidate, and the WanAnimate battle test.
Record the remaining roadmap: richer source discovery, broader helper-node catalog, schema snapshots per node-pack version, automatic PR-ready manifest edits, and optional CI job for URL HEAD checks.
Execution Order
Create the report model and package emitter first so the CLI can be thin.
Add workbench analysis before adding writes, because port check is the cheapest validation path.
Add port convert after emitted Python can import/build/validate in tests.
Add optional network HEAD checks only after offline report behavior is stable.
Wire doctor / RunPod logs after the report shape is settled.
Finish with docs and the WanAnimate regression path.
Validation Order
Run focused tests first: pytest -q tests/test_porting_workbench.py tests/test_workflow_core.py tests/test_schema.py.
Run CLI tests: pytest -q tests/test_cli.py.
Run ready-template regressions: pytest -q tests/test_ready_templates.py.
Run node/model checks: pytest -q tests/test_nodes_install.py tests/test_model_assets.py tests/test_models_registry.py.
Run the full local suite with pytest once the command and report wiring are in place.
Optional/manual: python -m vibecomfy.cli port check video/wanvideo_wrapper_22_wan_animate_preprocess_kijai --json and, when network is acceptable, repeat with --head-check-models.
code
Current plan metadata:
{
"version": 1,
"timestamp": "2026-05-08T12:56:41Z",
"hash": "sha256:1b1920b56d76832f954a5f2780b929f9f0920c0ec289b67d31e638f7da2c55bd",
"questions": [
"Should the public UX be vibecomfy port ..., vibecomfy workbench ..., or an extension of the existing convert / doctor commands? The plan assumes a new explicit port command to avoid destabilizing existing command output.",
"What is the canonical source path or id for the \u201ccurrent WanAnimate production-parity template\u201d beyond the existing ready id video/wanvideo_wrapper_22_wan_animate_preprocess_kijai? The plan uses that id as the battle-test target.",
"Should model URL HEAD checks run in CI, or remain opt-in/manual because they depend on network and upstream availability? The plan keeps them opt-in by default.",
"Should port convert --ready-id be allowed to write directly under ready_templates/, or should it always emit to out/scratchpads/ and require a separate manual promotion step? The plan supports both but treats scratchpads as the safer default."
],
"success_criteria": [
{
"criterion": "python -m vibecomfy.cli port check <workflow> --json returns a structured report with source provenance, schema issues, custom-node suggestions, model assets, helper-node diagnostics, and widget alias diagnostics.",
"priority": "must",
"requires": [
"run_shell",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --out <path> --json emits a Python scratchpad/ready-template module whose build() returns a VibeWorkflow without re-loading the original JSON at runtime.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "The emitted Python module preserves provenance fields including original source path or id, source hash, detected shape, and ready id when supplied.",
"priority": "must",
"requires": [
"read_files",
"run_tests"
]
},
{
"criterion": "The porting report flags unresolved custom node class types and suggests known node packs with repo URL, pip packages, and matched classes when available.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags missing required schema inputs before runtime queueing for workflows validated with an available schema provider.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "WanAnimate helper nodes (Note, MarkdownNote, SetNode, GetNode) do not survive compiled API output, and no compiled API link points to a removed helper node.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Positional widget_N alias handling is centralized and covered by tests using a fake schema provider plus the existing Wan/WanAnimate alias cases.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Model asset HEAD checks are opt-in, use injectable/mocked HTTP behavior in tests, and report status without downloading model bodies.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Focused tests for the simple template path and the WanAnimate production-parity path pass.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "Existing local test suite passes with .",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The new porting modules keep CLI formatting separate from analysis logic and avoid duplicating node/model/schema inference code already present in the package.",
"priority": "should",
"requires": [
"parse_diff",
"subjective_judgment"
]
},
{
"criterion": "The docs give future users a short live validation loop that starts with , proceeds to Python scratchpad conversion, and only then spends RunPod time.",
"priority": "should",
"requires": [
"read_files",
"subjective_judgment"
]
},
{
"criterion": "Optional real network HEAD checks pass for the current model asset URLs.",
"priority": "info",
"requires": [
"run_shell",
"observe_runtime_logs"
]
}
],
"assumptions": [
"The first useful slice should be a CLI/tooling workbench inside VibeComfy, not a GUI.",
"Normal tests must remain deterministic and must not require ComfyUI, RunPod, network access, model files, or installed custom nodes.",
"Existing is the right starting point for Python-esque emission, but reusable logic should move into .",
"Raw external JSON may be accepted as an input source, but the steady-state output should be a Python scratchpad or ready-template module.",
"The current WanAnimate battle-test target is unless the user supplies a different production-parity source.",
"Network URL HEAD checks should be opt-in because upstream model hosts and license gates can make them flaky in routine local validation."
],
"structure_warnings": []
}
code
Gate summary:
{
"passed": false,
"criteria_check": {
"count": 13,
"items": [
{
"criterion": "python -m vibecomfy.cli port check <workflow> --json returns a structured report with source provenance, schema issues, custom-node suggestions, model assets, helper-node diagnostics, and widget alias diagnostics.",
"priority": "must",
"requires": [
"run_shell",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --out <path> --json emits a Python scratchpad/ready-template module whose build() returns a VibeWorkflow without re-loading the original JSON at runtime.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "The emitted Python module preserves provenance fields including original source path or id, source hash, detected shape, and ready id when supplied.",
"priority": "must",
"requires": [
"read_files",
"run_tests"
]
},
{
"criterion": "The porting report flags unresolved custom node class types and suggests known node packs with repo URL, pip packages, and matched classes when available.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags missing required schema inputs before runtime queueing for workflows validated with an available schema provider.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "WanAnimate helper nodes (Note, MarkdownNote, SetNode, GetNode) do not survive compiled API output, and no compiled API link points to a removed helper node.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Positional widget_N alias handling is centralized and covered by tests using a fake schema provider plus the existing Wan/WanAnimate alias cases.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Model asset HEAD checks are opt-in, use injectable/mocked HTTP behavior in tests, and report status without downloading model bodies.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Focused tests for the simple template path and the WanAnimate production-parity path pass.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "Existing local test suite passes with pytest.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The new porting modules keep CLI formatting separate from analysis logic and avoid duplicating node/model/schema inference code already present in the package.",
"priority": "should",
"requires": [
"parse_diff",
"subjective_judgment"
]
},
{
"criterion": "The docs give future users a short live validation loop that starts with port check, proceeds to Python scratchpad conversion, and only then spends RunPod time.",
"priority": "should",
"requires": [
"read_files",
"subjective_judgment"
]
},
{
"criterion": "Optional real network HEAD checks pass for the current model asset URLs.",
"priority": "info",
"requires": [
"run_shell",
"observe_runtime_logs"
]
}
]
},
"preflight_results": {
"project_dir_exists": true,
"project_dir_writable": true,
"success_criteria_present": true,
"claude_available": true,
"codex_available": true
},
"unresolved_flags": [
{
"id": "FLAG-001",
"concern": "custom-node inference: currently treats helper/UI nodes as unresolved class types; making unresolved classes a hard error will fail the WanAnimate target unless the workbench filters helper nodes or analyzes the compiled helper-stripped graph for pack inference.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "Direct check on returned unresolved , , , and alongside real unresolved classes.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "FLAG-002",
"concern": "model asset coverage: the plan relies on , but that function returns no assets for API-shaped workflows, so API prompt sources and normalized workflows can produce incomplete model URL/provenance reports.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": " exits unless the raw mapping has UI or ; its tests explicitly assert API-shaped returns .",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "issue_hints",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: issue_hints: Checked the plan against the user's explicit steady-state requirement that workflows land as Python-esque ready templates or scratchpads, not raw JSON execution. The plan mostly honors this by adding and moving into package code, but its model asset path still depends on , which currently only extracts from UI-shaped workflows with / and returns for API-shaped workflows; this leaves imported API JSON and compiled prompt sources under-covered for provenance/model reporting.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "issue_hints: Checked the plan against the user's explicit steady-state requirement that workflows land as Python-esque ready templates or scratchpads, not raw JSON execution. The plan mostly honors this by adding and moving into package code, but its model asset path still depends on , which currently only extracts from UI-shaped workflows with / and returns for API-shaped workflows; this leaves imported API JSON and compiled prompt sources under-covered for provenance/model reporting.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "correctness-1",
"concern": "Are the proposed changes technically correct?: correctness: Ran against the current repo. It suggests the real packs, but also returns unresolved helper/UI classes including , , , and ; because Step 4 says unresolved classes are hard errors for , the planned WanAnimate battle target would fail before the helper-node resolution pass unless pack inference is run on the compiled/helper-stripped API or explicitly excludes known helper classes.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "correctness: Ran against the current repo. It suggests the real packs, but also returns unresolved helper/UI classes including , , , and ; because Step 4 says unresolved classes are hard errors for , the planned WanAnimate battle target would fail before the helper-node resolution pass unless pack inference is run on the compiled/helper-stripped API or explicitly excludes known helper classes.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "correctness-2",
"concern": "Are the proposed changes technically correct?: correctness: Checked and confirmed compile-time helper handling already drops , , , and , and rewrites resolvable Set/Get broadcasts into direct links. The plan's Step 6 is directionally consistent with existing behavior, but the diagnostic needs to inspect the unresolved cases before compile silently drops them; otherwise dangling helper references may be skipped rather than reported as errors.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "correctness: Checked and confirmed compile-time helper handling already drops , , , and , and rewrites resolvable Set/Get broadcasts into direct links. The plan's Step 6 is directionally consistent with existing behavior, but the diagnostic needs to inspect the unresolved cases before compile silently drops them; otherwise dangling helper references may be skipped rather than reported as errors.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "scope",
"concern": "Search for related code that handles the same concept. Is the reported issue a symptom of something broader?: scope: The plan says the shared alias module should feed , , and the Python emitter, but the existing parity tooling also imports and is used by . Leaving that comparison path out of the migration scope risks false parity diffs or missed widget drift after the alias source moves.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "scope: The plan says the shared alias module should feed , , and the Python emitter, but the existing parity tooling also imports and is used by . Leaving that comparison path out of the migration scope risks false parity diffs or missed widget drift after the alias source moves.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "all_locations",
"concern": "Does the change touch all locations AND supporting infrastructure?: all_locations: Checked ready-template requirements handling in and model extraction in . can contain structured dicts and appends those to metadata, so the plan's report/emitter can reuse that path; however, deliberately ignores API-shaped workflows, so the supporting infrastructure is incomplete for a path that accepts arbitrary inputs after .",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "all_locations: Checked ready-template requirements handling in and model extraction in . can contain structured dicts and appends those to metadata, so the plan's report/emitter can reuse that path; however, deliberately ignores API-shaped workflows, so the supporting infrastructure is incomplete for a path that accepts arbitrary inputs after .",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "callers",
"concern": "Find the callers of the changed function. What arguments do they actually pass? Does the fix handle all of them?: callers: Checked current conversion callers: uses for ready ids and for other inputs, while calls for generated ready templates. The plan's extraction of emitter logic is appropriate, but it must preserve both caller contracts: scratchpad conversion currently emits a lightweight module with embedded API or loader calls, whereas ready-template materialization emits explicit Python; conflating them would change existing behavior.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "callers: Checked current conversion callers: uses for ready ids and for other inputs, while calls for generated ready templates. The plan's extraction of emitter logic is appropriate, but it must preserve both caller contracts: scratchpad conversion currently emits a lightweight module with embedded API or loader calls, whereas ready-template materialization emits explicit Python; conflating them would change existing behavior.",
"raised_in": "critique_v1.json",
"status": "open",
"severity": "significant",
"verified": false
}
],
"recommendation": "ITERATE",
"rationale": "The plan is directionally strong, but execution should not proceed yet because all significant critiques are concrete implementation hazards rather than philosophical tradeoffs. The current plan would likely fail its own WanAnimate battle target due to helper/UI nodes being treated as unresolved custom node classes, would under-report model assets for API-shaped sources, and would risk breaking existing conversion/parity tooling by moving emitter and widget schema logic without covering all current callers. These are fixable plan-quality issues; no human tiebreaker is needed.",
"signals_assessment": "Weighted score is 13.0 on iteration 1 with 8 unresolved significant flags and no resolved flags. Preflight is healthy: project exists, is writable, criteria are present, and tool availability is fine. The critiques are not recurring churn yet, but they identify specific repo-backed gaps that should be folded into the plan before implementation.",
"warnings": [
"Revise the plan before execution so analyzes helper-node diagnostics separately from custom-node pack inference.",
"Do not migrate widget alias/schema logic without including and in scope.",
"Preserve both existing conversion contracts: lightweight scratchpad conversion and explicit ready-template materialization."
],
"settled_decisions": [
{
"id": "ux-port-command",
"decision": "Use a first-class CLI surface rather than hiding the workbench inside existing or output.",
"rationale": "The user explicitly made discoverability first-class, and a dedicated command gives humans and agents a clear pre-RunPod entry point without destabilizing established command formats."
},
{
"id": "head-checks-opt-in",
"decision": "Keep model URL HEAD checks opt-in, not part of ordinary validation or run.",
"rationale": "Network, host availability, redirects, and license gates can make URL checks flaky; the plan can still support targeted preflight jobs and mocked unit tests."
}
],
"override_forced": false,
"orchestrator_guidance": "First iteration; follow gate recommendation: ITERATE. Verify unresolved flags against the plan and project code before accepting.",
"robustness": "standard",
"signals": {
"iteration": 1,
"idea": "Build a holistic VibeComfy template porting workbench/toolset, based on the failures seen while porting production Reigh workflows to VibeComfy. The toolset should make it easy to find/import source Comfy workflows, convert them into proper Python ready-template/scratchpad format, preserve provenance, infer and validate custom node packs, infer and HEAD-check model asset URLs, resolve UI-only/helper nodes like Note/MarkdownNote/SetNode/GetNode and similar reroute/broadcast helpers, detect positional widget aliases by comparing compiled API prompts with Comfy object_info/schema, surface missing required inputs before a RunPod burn, emit actionable reports and tests, and support battle-testing against both a simple template and the current WanAnimate production-parity template. It should be pragmatic: build the first useful slice now, use it immediately on the current failures, and document the remaining roadmap. Avoid raw JSON execution as the steady-state path; workflows should land as Python-esque VibeComfy ready templates/scratchpads. Include a strategy for integrating this into the live validation loop so future users avoid the same URL/model/custom-node/schema failures.",
"significant_flags": 8,
"unresolved_flags": [
{
"id": "FLAG-001",
"concern": "custom-node inference: currently treats helper/UI nodes as unresolved class types; making unresolved classes a hard error will fail the WanAnimate target unless the workbench filters helper nodes or analyzes the compiled helper-stripped graph for pack inference.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "FLAG-002",
"concern": "model asset coverage: the plan relies on , but that function returns no assets for API-shaped workflows, so API prompt sources and normalized workflows can produce incomplete model URL/provenance reports.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "issue_hints",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: issue_hints: Checked the plan against the user's explicit steady-state requirement that workflows land as Python-esque ready templates or scratchpads, not raw JSON execution. The plan mostly honors this by adding and moving into package code, but its model asset path still depends on , which currently only extracts from UI-shaped workflows with / and returns for API-shaped workflows; this leaves imported API JSON and compiled prompt sources under-covered for provenance/model reporting.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "correctness-1",
"concern": "Are the proposed changes technically correct?: correctness: Ran against the current repo. It suggests the real packs, but also returns unresolved helper/UI classes including , , , and ; because Step 4 says unresolved classes are hard errors for , the planned WanAnimate battle target would fail before the helper-node resolution pass unless pack inference is run on the compiled/helper-stripped API or explicitly excludes known helper classes.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "correctness-2",
"concern": "Are the proposed changes technically correct?: correctness: Checked and confirmed compile-time helper handling already drops , , , and , and rewrites resolvable Set/Get broadcasts into direct links. The plan's Step 6 is directionally consistent with existing behavior, but the diagnostic needs to inspect the unresolved cases before compile silently drops them; otherwise dangling helper references may be skipped rather than reported as errors.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "scope",
"concern": "Search for related code that handles the same concept. Is the reported issue a symptom of something broader?: scope: The plan says the shared alias module should feed , , and the Python emitter, but the existing parity tooling also imports and is used by . Leaving that comparison path out of the migration scope risks false parity diffs or missed widget drift after the alias source moves.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "all_locations",
"concern": "Does the change touch all locations AND supporting infrastructure?: all_locations: Checked ready-template requirements handling in and model extraction in . can contain structured dicts and appends those to metadata, so the plan's report/emitter can reuse that path; however, deliberately ignores API-shaped workflows, so the supporting infrastructure is incomplete for a path that accepts arbitrary inputs after .",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "callers",
"concern": "Find the callers of the changed function. What arguments do they actually pass? Does the fix handle all of them?: callers: Checked current conversion callers: uses for ready ids and for other inputs, while calls for generated ready templates. The plan's extraction of emitter logic is appropriate, but it must preserve both caller contracts: scratchpad conversion currently emits a lightweight module with embedded API or loader calls, whereas ready-template materialization emits explicit Python; conflating them would change existing behavior.",
"category": "correctness",
"severity": "significant",
"status": "open"
}
],
"resolved_flags": [],
"weighted_score": 13.0,
"weighted_history": [],
"plan_delta_from_previous": null,
"recurring_critiques": [],
"scope_creep_flags": [],
"loop_summary": "Iteration 1. Weighted score trajectory: 13.0. Plan deltas: n/a. Recurring critiques: 0. Resolved flags: 0. Open significant flags: 8.",
"debt_overlaps": [],
"escalated_debt_subsystems": []
},
"flag_resolutions": [],
"resolved_flag_ids": [],
"resolution_summary": "",
"reprompted": false
}
code
Open significant flags:
[
{
"id": "FLAG-001",
"severity": "significant",
"status": "open",
"concern": "custom-node inference: missing_packs_for_workflow currently treats helper/UI nodes as unresolved class types; making unresolved classes a hard port check error will fail the WanAnimate target unless the workbench filters helper nodes or analyzes the compiled helper-stripped graph for pack inference.",
"evidence": "Direct check on video/wanvideo_wrapper_22_wan_animate_preprocess_kijai returned unresolved GetNode, SetNode, MarkdownNote, and Note alongside real unresolved classes."
},
{
"id": "FLAG-002",
"severity": "significant",
"status": "open",
"concern": "model asset coverage: the plan relies on extract_from_raw_workflow(...), but that function returns no assets for API-shaped workflows, so API prompt sources and normalized workflows can produce incomplete model URL/provenance reports.",
"evidence": "vibecomfy/model_assets.py exits unless the raw mapping has UI nodes or definitions.subgraphs; its tests explicitly assert API-shaped {'1': {'class_type': ...}} returns []."
},
{
"id": "issue_hints",
"severity": "significant",
"status": "open",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: issue_hints: Checked the plan against the user's explicit steady-state requirement that workflows land as Python-esque ready templates or scratchpads, not raw JSON execution. The plan mostly honors this by adding port convert and moving tools/format_as_python.py into package code, but its model asset path still depends on extract_from_raw_workflow(...), which currently only extracts from UI-shaped workflows with nodes/properties and returns [] for API-shaped workflows; this leaves imported API JSON and compiled prompt sources under-covered for provenance/model reporting.",
"evidence": "issue_hints: Checked the plan against the user's explicit steady-state requirement that workflows land as Python-esque ready templates or scratchpads, not raw JSON execution. The plan mostly honors this by adding port convert and moving tools/format_as_python.py into package code, but its model asset path still depends on extract_from_raw_workflow(...), which currently only extracts from UI-shaped workflows with nodes/properties and returns [] for API-shaped workflows; this leaves imported API JSON and compiled prompt sources under-covered for provenance/model reporting."
},
{
"id": "correctness-1",
"severity": "significant",
"status": "open",
"concern": "Are the proposed changes technically correct?: correctness: Ran against the current repo. It suggests the real packs, but also returns unresolved helper/UI classes including , , , and ; because Step 4 says unresolved classes are hard errors for , the planned WanAnimate battle target would fail before the helper-node resolution pass unless pack inference is run on the compiled/helper-stripped API or explicitly excludes known helper classes.",
"evidence": "correctness: Ran against the current repo. It suggests the real packs, but also returns unresolved helper/UI classes including , , , and ; because Step 4 says unresolved classes are hard errors for , the planned WanAnimate battle target would fail before the helper-node resolution pass unless pack inference is run on the compiled/helper-stripped API or explicitly excludes known helper classes."
},
{
"id": "correctness-2",
"severity": "significant",
"status": "open",
"concern": "Are the proposed changes technically correct?: correctness: Checked and confirmed compile-time helper handling already drops , , , and , and rewrites resolvable Set/Get broadcasts into direct links. The plan's Step 6 is directionally consistent with existing behavior, but the diagnostic needs to inspect the unresolved cases before compile silently drops them; otherwise dangling helper references may be skipped rather than reported as errors.",
"evidence": "correctness: Checked and confirmed compile-time helper handling already drops , , , and , and rewrites resolvable Set/Get broadcasts into direct links. The plan's Step 6 is directionally consistent with existing behavior, but the diagnostic needs to inspect the unresolved cases before compile silently drops them; otherwise dangling helper references may be skipped rather than reported as errors."
},
{
"id": "scope",
"severity": "significant",
"status": "open",
"concern": "Search for related code that handles the same concept. Is the reported issue a symptom of something broader?: scope: The plan says the shared alias module should feed , , and the Python emitter, but the existing parity tooling also imports and is used by . Leaving that comparison path out of the migration scope risks false parity diffs or missed widget drift after the alias source moves.",
"evidence": "scope: The plan says the shared alias module should feed , , and the Python emitter, but the existing parity tooling also imports and is used by . Leaving that comparison path out of the migration scope risks false parity diffs or missed widget drift after the alias source moves."
},
{
"id": "all_locations",
"severity": "significant",
"status": "open",
"concern": "Does the change touch all locations AND supporting infrastructure?: all_locations: Checked ready-template requirements handling in and model extraction in . can contain structured dicts and appends those to metadata, so the plan's report/emitter can reuse that path; however, deliberately ignores API-shaped workflows, so the supporting infrastructure is incomplete for a path that accepts arbitrary inputs after .",
"evidence": "all_locations: Checked ready-template requirements handling in and model extraction in . can contain structured dicts and appends those to metadata, so the plan's report/emitter can reuse that path; however, deliberately ignores API-shaped workflows, so the supporting infrastructure is incomplete for a path that accepts arbitrary inputs after ."
},
{
"id": "callers",
"severity": "significant",
"status": "open",
"concern": "Find the callers of the changed function. What arguments do they actually pass? Does the fix handle all of them?: callers: Checked current conversion callers: uses for ready ids and for other inputs, while calls for generated ready templates. The plan's extraction of emitter logic is appropriate, but it must preserve both caller contracts: scratchpad conversion currently emits a lightweight module with embedded API or loader calls, whereas ready-template materialization emits explicit Python; conflating them would change existing behavior.",
"evidence": "callers: Checked current conversion callers: uses for ready ids and for other inputs, while calls for generated ready templates. The plan's extraction of emitter logic is appropriate, but it must preserve both caller contracts: scratchpad conversion currently emits a lightweight module with embedded API or loader calls, whereas ready-template materialization emits explicit Python; conflating them would change existing behavior."
}
]
code
Requirements:
- Before addressing individual flags, check: does any flag suggest the plan is targeting the wrong code or the wrong root cause? If so, consider whether the plan needs a new approach rather than adjustments. Explain your reasoning.
- Update the plan to address the significant issues.
- Keep the plan readable and executable.
- Return flags_addressed with the exact flag IDs you addressed.
- Include `changes_summary` as a short plain-English summary of what changed in the revision. If there were no concrete flags, say that explicitly (for example: `No critique flags were raised; refined wording and kept the plan aligned for execution.`).
- Preserve or improve success criteria quality. Each criterion must have a `priority` of `must`, `should`, or `info`. Promote or demote priorities if critique feedback reveals a criterion was over- or under-weighted.
- Each success criterion should include a `requires` field listing the capabilities needed for verification. Valid capability strings: `run_shell`, `read_files`, `run_tests`, `parse_diff`, `read_build_output`, `run_linter` (container), `drive_browser`, `inspect_runtime_ui`, `observe_runtime_logs`, `subjective_judgment`, `verify_physical_device` (human). `must` criteria MUST have non-empty `requires`. Example: `{"criterion": "All tests pass", "priority": "must", "requires": ["run_tests"]}`.
- Verify that the plan remains aligned with the user's original intent, not just internal plan quality.
- Remove unjustified scope growth. If critique raised scope creep, narrow the plan back to the original idea unless the broader work is strictly required.
- Maintain the structural template: H1 title, ## Overview, phase sections with numbered step sections, ## Execution Order or ## Validation Order.
- CRITICAL: Your entire revised plan markdown (all sections) must be output as the `plan` field in the structured output. The prose response must not contain the plan text.
- CRITICAL: Return only the structured JSON object for the schema fields `plan`, `changes_summary`, `flags_addressed`, `assumptions`, `success_criteria`, and `questions`. Do not add commentary before or after the JSON object.
Plan template — simple format (adapt to the actual repo and scope):
md
# Implementation Plan: [Title]
## Overview
Summarize the goal, current repository shape, and the constraints that matter.
## Main Phase
### Step 1: Audit the current behavior (`megaplan/prompts.py`)
**Scope:** Small
1. **Inspect** the current implementation and call out the exact insertion points (`megaplan/prompts.py:29`).
### Step 2: Add the first change (`megaplan/evaluation.py`)
**Scope:** Medium
1. **Implement** the smallest viable change with exact file references (`megaplan/evaluation.py:1`).
2. **Capture** any tricky behavior with a short example.
```python
issues = validate_plan_structure(plan_text)
```
### Step 3: Wire downstream behavior (`megaplan/handlers.py`, `megaplan/workers.py`)
**Scope:** Medium
1. **Update** the runtime flow in the touched files (`megaplan/handlers.py:400`, `megaplan/workers.py:199`).
### Step 4: Prove the change (`tests/test_evaluation.py`, `tests/test_megaplan.py`)
**Scope:** Small
1. **Run** the cheapest targeted checks first (`tests/test_evaluation.py:1`).
2. **Finish** with broader verification once the wiring is in place (`tests/test_megaplan.py:1`).
## Execution Order
1. Update prompts and mocks before enforcing stricter validation.
2. Land higher-risk wiring after the validator and tests are ready.
## Validation Order
1. Start with focused unit tests.
2. Run the broader suite after the flow changes are in place.
For complex plans, use multiple phases:
md
## Phase 1: Foundation — Dependencies, DB, Types
### Step 1: Install dependencies (`package.json`)
...
### Step 2: Create database migration (`supabase/migrations/`)
...
## Phase 2: Core Integration
### Step 3: Port the main component (`src/components/`)
...
Template guidance:
Simple plans: use ## Main Phase with ### Step N: sections underneath.
Complex plans: use multiple ## Phase N: sections, each containing ### Step N: steps. Step numbers are global (not per-phase).
The flat ## Step N: format (without phases) also works for backwards compatibility.
Key invariants: one H1 title, one ## Overview, numbered step sections (### Step N: or ## Step N:), and at least one ordering section.
{
"plan": "# Implementation Plan: VibeComfy Template Porting Workbench\n\n## Overview\nThe critique does not show that the idea is targeting the wrong subsystem. The root cause is still that VibeComfy has the needed pieces split across convert, doctor, schema validation, node-pack planning, model asset extraction, and ready-template generation. The plan should stay centered on a first-class vibecomfy port ... workflow, but the implementation order must change: helper/UI nodes must be diagnosed separately from custom-node pack inference, model asset extraction must cover API-shaped sources as well as UI workflows, widget alias migration must include the parity tools, and existing convert behavior must remain compatible.\n\nThe first useful slice is a package-level vibecomfy.porting workbench plus a discoverable CLI surface. It should make port check the obvious cheap preflight before manual Python-template editing or expensive RunPod validation, while port convert emits Python-esque VibeWorkflow scratchpads/ready-template candidates rather than relying on the original JSON as the steady-state artifact. Existing lightweight convert and ready-template materialization paths should be preserved unless explicitly routed through the new porting command.\n\n## Phase 1: Foundation — Report Shape, Source Loading, and Helper Semantics\n\n### Step 1: Add a porting report model (vibecomfy/porting/report.py)\nScope: Medium\n1. Define dataclasses for PortReport, PortIssue, PortArtifact, NodePackSuggestion, and AssetCheckResult with stable JSON serialization.\n2. Include source id/path, detected workflow shape, source hash, normalized API node count, emitted Python path, helper-node diagnostics, custom-node suggestions, unresolved runtime class types, model assets, schema issues, widget alias observations, and recommended next commands.\n3. Keep issue severities aligned with current validation concepts: error, warning, and info.\n\n### Step 2: Centralize helper/UI-node classification (vibecomfy/porting/helpers.py, vibecomfy/workflow.py)\nScope: Medium\n1. Move the helper-node class set and helper-resolution diagnostics into a reusable module that knows about Note, MarkdownNote, SetNode, and GetNode.\n2. Add a diagnostic pass that inspects the original IR before compile and reports unresolved GetNode / SetNode broadcasts instead of letting compile silently skip dangling helper references.\n3. Expose a helper-stripped runtime class view for downstream diagnostics so custom-node pack inference does not treat Note, MarkdownNote, SetNode, or GetNode as missing installable node packs.\n4. Keep VibeWorkflow.compile(\"api\") behavior compatible: resolved helper broadcasts still rewrite to direct links; helper nodes still do not survive into API prompts.\n\n### Step 3: Expand model asset extraction coverage (vibecomfy/model_assets.py, vibecomfy/porting/assets.py)\nScope: Medium\n1. Keep existing UI-workflow extraction from node properties.models.\n2. Add API-shaped extraction from node class types and input fields using the same subdir rules already used for structured requirements.\n3. Merge assets from raw UI JSON, normalized API prompts, loaded scratchpad/ready-template metadata, and READY_REQUIREMENTS without duplicates.\n4. Mark assets inferred from filenames without URLs as actionable warnings so API prompt sources are not falsely reported as having complete URL provenance.\n\n## Phase 2: Python Emission and Compatibility Boundaries\n\n### Step 4: Move reusable ready-template emitter logic without breaking current callers (vibecomfy/porting/emitter.py, tools/format_as_python.py, tools/convert_ready_templates.py)\nScope: Large\n1. Extract reusable _node(...)-style Python emission from tools/format_as_python.py into package code.\n2. Preserve explicit node IDs, deterministic ordering, _extras for non-identifier inputs, READY_METADATA, READY_REQUIREMENTS, registered input handling, and current override behavior.\n3. Keep tools/format_as_python.py and tools/convert_ready_templates.py as compatibility wrappers around the package emitter.\n4. Do not change the established vibecomfy convert contract in vibecomfy/commands/convert.py; the new explicit Python materialization behavior belongs to vibecomfy port convert first.\n\n### Step 5: Preserve both conversion contracts (vibecomfy/scratchpad_loader.py, vibecomfy/commands/convert.py, vibecomfy/commands/port.py)\nScope: Medium\n1. Leave existing lightweight scratchpad rendering available for compatibility.\n2. Implement port convert as the path that emits explicit Python VibeWorkflow construction from a loaded source workflow.\n3. Support ready-template-shaped output with --ready-id kind/name, but default examples and docs to out/scratchpads/... so promotion to ready_templates/ remains intentional.\n4. Validate emitted Python by importing it, calling build(), compiling API, and running schema validation when available.\n\n## Phase 3: Diagnostics — Catch Current Failure Classes Before RunPod\n\n### Step 6: Add the workbench orchestrator (vibecomfy/porting/workbench.py)\nScope: Large\n1. Implement analyze_source(...) to load ready ids, scratchpads, raw JSON paths, and indexed workflow references through existing loader/normalizer paths.\n2. Preserve provenance in READY_METADATA: source path/id, source hash, original shape, source workflow id when known, converter version, and whether schema was available.\n3. Run helper diagnostics before custom-node inference.\n4. Run custom-node pack inference against the helper-stripped runtime class view, while reporting unresolved helper broadcasts separately as helper errors.\n5. Reuse workflow.validate(schema_provider=...) for schema issues and include formatted missing_required_input, unknown_input, unknown_class_type, invalid_link_shape, and type mismatch results in the report.\n\n### Step 7: Custom node pack inference (vibecomfy/porting/workbench.py, vibecomfy/node_packs_install.py)\nScope: Small\n1. Reuse resolve_node_packs(...) / missing_packs_for_workflow(...) concepts, but pass only runtime-relevant class types after helper filtering.\n2. Include pack name, repo, pip packages, and matched classes in the port report.\n3. Treat unresolved runtime class types as hard port check errors.\n4. Treat known helper/UI classes as helper diagnostics, never as missing custom-node packs.\n\n### Step 8: Model URL HEAD checks (vibecomfy/porting/assets.py)\nScope: Medium\n1. Add opt-in URL checking with httpx.Client().head(..., follow_redirects=True) and a deterministic timeout.\n2. Report status code, final redirected URL, missing URL fields, duplicate asset targets, and license-gated/404 cases.\n3. Do not download model bodies.\n4. Keep HEAD checks disabled in ordinary tests, validate, doctor, and run unless --head-check-models is explicitly passed.\n\n### Step 9: Positional widget alias detection and shared schema source (vibecomfy/porting/widget_schema.py, vibecomfy/porting/widget_aliases.py, vibecomfy/ingest/normalize.py, vibecomfy/workflow.py, tools/_compile_equivalence.py)\nScope: Large\n1. Move the committed widget schema and resolve_widget_name(...) into package code.\n2. Update normalize_to_api, VibeWorkflow.compile, the package emitter, tools/format_as_python.py, tools/convert_ready_templates.py, and tools/_compile_equivalence.py to use the same package-level widget schema/alias source.\n3. Prefer schema-derived input order from object_info when available; fall back to the committed static widget schema when offline.\n4. Add a diagnostic pass that compares compiled API inputs against schema inputs and reports unresolved widget_N inputs where a required named input is missing or where parity tooling would otherwise see false drift.\n5. Move existing Wan/WanAnimate positional aliases out of private workflow-only state while preserving current behavior.\n\n## Phase 4: CLI, Discoverability, and Live Validation Loop\n\n### Step 10: Add explicit CLI entry points (vibecomfy/commands/port.py, vibecomfy/commands/__init__.py)\nScope: Medium\n1. Register port as an explicit command in COMMANDS.\n2. Add python -m vibecomfy.cli port check <workflow> [--json] [--head-check-models] for no-write preflight.\n3. Add python -m vibecomfy.cli port convert <workflow> --out out/scratchpads/name.py [--json] [--head-check-models] [--ready-id kind/name] for explicit Python output.\n4. Make command help explain when to use port check, port convert, doctor, validate, nodes install-plan, and --head-check-models.\n5. Return nonzero for hard errors: unresolved runtime class types, unresolved helper broadcasts, schema-required missing inputs, failed Python build, failed emitted scratchpad validation, or failed model HEAD checks when the user requested them.\n\n### Step 11: Wire the live validation loop without making network checks mandatory (vibecomfy/commands/doctor.py, vibecomfy/commands/run.py, scripts/runpod_corpus_matrix.py)\nScope: Medium\n1. Keep existing workflow.validate(schema_provider=...) as the hard gate before queueing runtime prompts.\n2. Add doctor guidance that points users to port check when failures involve unknown classes, missing required inputs, helper-node issues, or model assets.\n3. Add a cheap port-report summary to RunPod corpus matrix logs and copy the emitted scratchpad/report next to existing convert/validate logs.\n4. Keep model URL HEAD checks opt-in and out of normal run behavior.\n\n### Step 12: Make discoverability first-class (README.md, docs/authoring.md, docs/adding_templates_models.md, docs/errors_and_doctor.md, docs/template_porting_workbench.md, AGENTS.md)\nScope: Medium\n1. Add a new docs page for the porting workbench with a direct import -> port check -> port convert -> validate / doctor -> optional RunPod loop.\n2. Update authoring and template docs so humans and agents start with port check before manual template editing or RunPod validation.\n3. Update failure/live-validation docs to map common failures to commands: schema issues to port check/validate, custom nodes to nodes install-plan, model URLs to port check --head-check-models, and Python materialization to port convert.\n4. Update AGENTS.md or the synced skill guidance so agents know when to use the porting workbench.\n5. Ensure command help text mirrors the docs so discoverability is present in both CLI and repository guidance.\n\n## Phase 5: Tests and Battle Targets\n\n### Step 13: Add focused unit and CLI tests (tests/test_porting_workbench.py, tests/test_cli.py, tests/test_workflow_core.py, tests/test_schema.py, tests/test_model_assets.py)\nScope: Large\n1. Test a simple fixture based on image/z_image or a tiny synthetic workflow: report shape, provenance, Python emission, import/build, compile, and validate.\n2. Test video/wanvideo_wrapper_22_wan_animate_preprocess_kijai: helper nodes are diagnosed separately, helper nodes do not survive compiled API, no compiled API link points to a removed helper node, required real node packs are suggested, and detection model assets are reported.\n3. Test custom-node inference ignores known helper/UI nodes but still fails unresolved runtime classes.\n4. Test API-shaped workflow model asset extraction, including filename-only assets with missing URL warnings.\n5. Test widget alias diagnostics with a fake schema provider and keep existing Wan/WanAnimate alias expectations passing.\n6. Test HEAD checks with injected/mocked HTTP behavior, not real network.\n7. Add CLI smoke tests for port check --json, port convert --out ... --json, and command help discoverability.\n\n### Step 14: Update parity and conversion tests (tests/test_ready_templates.py, tools/_compile_equivalence.py, tools/convert_ready_templates.py)\nScope: Medium\n1. Keep ready-template parity tests passing after widget schema migration.\n2. Verify tools/convert_ready_templates.py --template ... --dry-run still uses the moved emitter and reports equivalent diffs.\n3. Add regression coverage that vibecomfy convert keeps its existing lightweight contract while vibecomfy port convert emits explicit Python.\n\n## Execution Order\n1. Add report and helper diagnostics first, because helper filtering changes the correctness of every downstream diagnostic.\n2. Expand model asset extraction before wiring URL checks, so reports are complete for UI-shaped and API-shaped sources.\n3. Move emitter/widget schema code with compatibility wrappers and parity tests in the same change set.\n4. Add the workbench orchestrator and port check before adding port convert writes.\n5. Add opt-in HEAD checks after offline report behavior is covered.\n6. Wire doctor / RunPod summaries after the report shape is stable.\n7. Finish with discoverability docs, AGENTS/skill guidance, and battle-target tests.\n\n## Validation Order\n1. Run focused porting tests first: pytest -q tests/test_porting_workbench.py tests/test_model_assets.py tests/test_workflow_core.py tests/test_schema.py.\n2. Run CLI tests: pytest -q tests/test_cli.py.\n3. Run ready-template and parity regressions: pytest -q tests/test_ready_templates.py plus python -m tools.convert_ready_templates --template image/qwen_image_2512 --dry-run.\n4. Run node/model checks: pytest -q tests/test_nodes_install.py tests/test_models_registry.py.\n5. Run the full local suite with pytest.\n6. Manual/optional network check: python -m vibecomfy.cli port check video/wanvideo_wrapper_22_wan_animate_preprocess_kijai --json --head-check-models.\n",
"changes_summary": "Revised the plan to separate helper-node diagnostics from custom-node pack inference, cover API-shaped model asset extraction, preserve existing conversion caller contracts, include parity tooling in widget-schema migration, and add discoverability as a first-class CLI/docs/AGENTS requirement.",
"flags_addressed": [
"FLAG-001",
"FLAG-002",
"issue_hints",
"correctness-1",
"correctness-2",
"scope",
"all_locations",
"callers"
],
"assumptions": [
"The dedicated public UX is settled as vibecomfy port ....",
"The first useful slice should be a CLI/tooling workbench inside VibeComfy, not a GUI.",
"Normal tests must remain deterministic and must not require ComfyUI, RunPod, network access, model files, or installed custom nodes.",
"Existing vibecomfy convert behavior should remain compatible; explicit Python materialization belongs to vibecomfy port convert first.",
"Raw external JSON may be accepted as input, but the steady-state output should be a Python scratchpad or ready-template module.",
"The current WanAnimate battle-test target is video/wanvideo_wrapper_22_wan_animate_preprocess_kijai unless the user supplies a different production-parity source.",
"Network URL HEAD checks should stay opt-in because upstream hosts and license gates can make them flaky in routine validation."
],
"success_criteria": [
{
"criterion": "python -m vibecomfy.cli port check <workflow> --json returns a structured report with source provenance, schema issues, custom-node suggestions, model assets, helper-node diagnostics, widget alias diagnostics, and recommended next commands.",
"priority": "must",
"requires": [
"run_shell",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --out <path> --json emits a Python scratchpad/ready-template module whose build() returns a VibeWorkflow without re-loading the original JSON at runtime.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "The emitted Python module preserves provenance fields including original source path or id, source hash, detected shape, and ready id when supplied.",
"priority": "must",
"requires": [
"read_files",
"run_tests"
]
},
{
"criterion": "Custom-node pack inference ignores known helper/UI nodes and still reports unresolved runtime class types as hard errors.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags unresolved SetNode / GetNode helper broadcasts before compile can silently drop them.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The porting report extracts model asset candidates from UI-shaped workflows, API-shaped prompts, scratchpad metadata, and ready-template requirements, warning when URLs are missing.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags missing required schema inputs before runtime queueing for workflows validated with an available schema provider.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "WanAnimate helper nodes (Note, MarkdownNote, SetNode, GetNode) do not survive compiled API output, no compiled API link points to a removed helper node, and helper classes are not reported as unresolved custom-node packs.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Positional widget_N alias handling is centralized and all callers, including normalize_to_api, VibeWorkflow.compile, the Python emitter, tools/convert_ready_templates.py, and tools/_compile_equivalence.py, use the shared source.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Model asset HEAD checks are opt-in, use injectable/mocked HTTP behavior in tests, and report status without downloading model bodies.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Existing vibecomfy convert tests still pass, while new vibecomfy port convert tests prove explicit Python materialization.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Focused tests for the simple template path and the WanAnimate production-parity path pass.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "CLI help and repository docs make port check discoverable as the recommended first preflight before manual template editing or RunPod validation.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "Existing local test suite passes with pytest.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The new porting modules keep CLI formatting separate from analysis logic and avoid duplicating node/model/schema inference code already present in the package.",
"priority": "should",
"requires": [
"parse_diff",
"subjective_judgment"
]
},
{
"criterion": "The docs give future users and agents a short live validation loop that starts with port check, proceeds to Python scratchpad conversion, and only then spends RunPod time.",
"priority": "should",
"requires": [
"read_files",
"subjective_judgment"
]
},
{
"criterion": "Optional real network HEAD checks pass for the current model asset URLs.",
"priority": "info",
"requires": [
"run_shell",
"observe_runtime_logs"
]
}
],
"questions": [
"What is the canonical source path or id for the current Reigh WanAnimate production-parity workflow if it is not video/wanvideo_wrapper_22_wan_animate_preprocess_kijai?",
"Should direct writes under ready_templates/ be allowed by port convert --ready-id, or should ready-template promotion always be a separate manual step after emitting to out/scratchpads/?",
"Should AGENTS.md be edited directly for discoverability, or should the synced skill source be updated first and AGENTS.md regenerated through the existing sync path?"
]
}
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.
WRITE ACCESS CONTRACT: You are running with auto-approved writes inside a writable workspace. Treat the working directory as fully writable. Do NOT preemptively skip or block tasks on permission, sandbox, or read-only grounds. Attempt every required edit; only report failure AFTER a real OS-level rejection from a specific shell command. Do not infer 'read-only' from absence of activity; absence is not denial. If a single shell command unexpectedly fails, retry with a different invocation before concluding the environment is restricted.
You are revising an implementation plan after critique and gate feedback.
Build a holistic VibeComfy template porting workbench/toolset, based on the failures seen while porting production Reigh workflows to VibeComfy. The toolset should make it easy to find/import source Comfy workflows, convert them into proper Python ready-template/scratchpad format, preserve provenance, infer and validate custom node packs, infer and HEAD-check model asset URLs, resolve UI-only/helper nodes like Note/MarkdownNote/SetNode/GetNode and similar reroute/broadcast helpers, detect positional widget aliases by comparing compiled API prompts with Comfy object_info/schema, surface missing required inputs before a RunPod burn, emit actionable reports and tests, and support battle-testing against both a simple template and the current WanAnimate production-parity template. It should be pragmatic: build the first useful slice now, use it immediately on the current failures, and document the remaining roadmap. Avoid raw JSON execution as the steady-state path; workflows should land as Python-esque VibeComfy ready templates/scratchpads. Include a strategy for integrating this into the live validation loop so future users avoid the same URL/model/custom-node/schema failures.
User notes and answers:
User added: discoverability is a first-class requirement. The VibeComfy porting toolset must make it obvious to humans and agents when to use it: command names/help, README/authoring docs, AGENTS.md or skill guidance, and failure/live-validation docs should all point to port check before manual template editing or expensive RunPod validation. The tool should document when to use check, convert, doctor/validate, model URL checks, custom-node pack discovery, and Python-template conversion.
code
Current plan (markdown):
# Implementation Plan: VibeComfy Template Porting Workbench
Overview
The critique does not show that the idea is targeting the wrong subsystem. The root cause is still that VibeComfy has the needed pieces split across convert, doctor, schema validation, node-pack planning, model asset extraction, and ready-template generation. The plan should stay centered on a first-class vibecomfy port ... workflow, but the implementation order must change: helper/UI nodes must be diagnosed separately from custom-node pack inference, model asset extraction must cover API-shaped sources as well as UI workflows, widget alias migration must include the parity tools, and existing convert behavior must remain compatible.
The first useful slice is a package-level vibecomfy.porting workbench plus a discoverable CLI surface. It should make port check the obvious cheap preflight before manual Python-template editing or expensive RunPod validation, while port convert emits Python-esque VibeWorkflow scratchpads/ready-template candidates rather than relying on the original JSON as the steady-state artifact. Existing lightweight convert and ready-template materialization paths should be preserved unless explicitly routed through the new porting command.
Phase 1: Foundation — Report Shape, Source Loading, and Helper Semantics
Step 1: Add a porting report model (vibecomfy/porting/report.py)
Scope: Medium
Define dataclasses for PortReport, PortIssue, PortArtifact, NodePackSuggestion, and AssetCheckResult with stable JSON serialization.
Include source id/path, detected workflow shape, source hash, normalized API node count, emitted Python path, helper-node diagnostics, custom-node suggestions, unresolved runtime class types, model assets, schema issues, widget alias observations, and recommended next commands.
Keep issue severities aligned with current validation concepts: error, warning, and info.
Move the helper-node class set and helper-resolution diagnostics into a reusable module that knows about Note, MarkdownNote, SetNode, and GetNode.
Add a diagnostic pass that inspects the original IR before compile and reports unresolved GetNode / SetNode broadcasts instead of letting compile silently skip dangling helper references.
Expose a helper-stripped runtime class view for downstream diagnostics so custom-node pack inference does not treat Note, MarkdownNote, SetNode, or GetNode as missing installable node packs.
Keep VibeWorkflow.compile("api") behavior compatible: resolved helper broadcasts still rewrite to direct links; helper nodes still do not survive into API prompts.
Step 3: Expand model asset extraction coverage (vibecomfy/model_assets.py, vibecomfy/porting/assets.py)
Scope: Medium
Keep existing UI-workflow extraction from node properties.models.
Add API-shaped extraction from node class types and input fields using the same subdir rules already used for structured requirements.
Merge assets from raw UI JSON, normalized API prompts, loaded scratchpad/ready-template metadata, and READY_REQUIREMENTS without duplicates.
Mark assets inferred from filenames without URLs as actionable warnings so API prompt sources are not falsely reported as having complete URL provenance.
Phase 2: Python Emission and Compatibility Boundaries
Step 4: Move reusable ready-template emitter logic without breaking current callers (vibecomfy/porting/emitter.py, tools/format_as_python.py, tools/convert_ready_templates.py)
Scope: Large
Extract reusable _node(...)-style Python emission from tools/format_as_python.py into package code.
Preserve explicit node IDs, deterministic ordering, _extras for non-identifier inputs, READY_METADATA, READY_REQUIREMENTS, registered input handling, and current override behavior.
Keep tools/format_as_python.py and tools/convert_ready_templates.py as compatibility wrappers around the package emitter.
Do not change the established vibecomfy convert contract in vibecomfy/commands/convert.py; the new explicit Python materialization behavior belongs to vibecomfy port convert first.
Step 5: Preserve both conversion contracts (vibecomfy/scratchpad_loader.py, vibecomfy/commands/convert.py, vibecomfy/commands/port.py)
Scope: Medium
Leave existing lightweight scratchpad rendering available for compatibility.
Implement port convert as the path that emits explicit Python VibeWorkflow construction from a loaded source workflow.
Support ready-template-shaped output with --ready-id kind/name, but default examples and docs to out/scratchpads/... so promotion to ready_templates/ remains intentional.
Validate emitted Python by importing it, calling build(), compiling API, and running schema validation when available.
Phase 3: Diagnostics — Catch Current Failure Classes Before RunPod
Step 6: Add the workbench orchestrator (vibecomfy/porting/workbench.py)
Scope: Large
Implement analyze_source(...) to load ready ids, scratchpads, raw JSON paths, and indexed workflow references through existing loader/normalizer paths.
Preserve provenance in READY_METADATA: source path/id, source hash, original shape, source workflow id when known, converter version, and whether schema was available.
Run helper diagnostics before custom-node inference.
Run custom-node pack inference against the helper-stripped runtime class view, while reporting unresolved helper broadcasts separately as helper errors.
Reuse workflow.validate(schema_provider=...) for schema issues and include formatted missing_required_input, unknown_input, unknown_class_type, invalid_link_shape, and type mismatch results in the report.
Reuse resolve_node_packs(...) / missing_packs_for_workflow(...) concepts, but pass only runtime-relevant class types after helper filtering.
Include pack name, repo, pip packages, and matched classes in the port report.
Treat unresolved runtime class types as hard port check errors.
Treat known helper/UI classes as helper diagnostics, never as missing custom-node packs.
Step 8: Model URL HEAD checks (vibecomfy/porting/assets.py)
Scope: Medium
Add opt-in URL checking with httpx.Client().head(..., follow_redirects=True) and a deterministic timeout.
Report status code, final redirected URL, missing URL fields, duplicate asset targets, and license-gated/404 cases.
Do not download model bodies.
Keep HEAD checks disabled in ordinary tests, validate, doctor, and run unless --head-check-models is explicitly passed.
Step 9: Positional widget alias detection and shared schema source (vibecomfy/porting/widget_schema.py, vibecomfy/porting/widget_aliases.py, vibecomfy/ingest/normalize.py, vibecomfy/workflow.py, tools/_compile_equivalence.py)
Scope: Large
Move the committed widget schema and resolve_widget_name(...) into package code.
Update normalize_to_api, VibeWorkflow.compile, the package emitter, tools/format_as_python.py, tools/convert_ready_templates.py, and tools/_compile_equivalence.py to use the same package-level widget schema/alias source.
Prefer schema-derived input order from object_info when available; fall back to the committed static widget schema when offline.
Add a diagnostic pass that compares compiled API inputs against schema inputs and reports unresolved widget_N inputs where a required named input is missing or where parity tooling would otherwise see false drift.
Move existing Wan/WanAnimate positional aliases out of private workflow-only state while preserving current behavior.
Phase 4: CLI, Discoverability, and Live Validation Loop
Add python -m vibecomfy.cli port check <workflow> [--json] [--head-check-models] for no-write preflight.
Add python -m vibecomfy.cli port convert <workflow> --out out/scratchpads/name.py [--json] [--head-check-models] [--ready-id kind/name] for explicit Python output.
Make command help explain when to use port check, port convert, doctor, validate, nodes install-plan, and --head-check-models.
Return nonzero for hard errors: unresolved runtime class types, unresolved helper broadcasts, schema-required missing inputs, failed Python build, failed emitted scratchpad validation, or failed model HEAD checks when the user requested them.
Step 11: Wire the live validation loop without making network checks mandatory (vibecomfy/commands/doctor.py, vibecomfy/commands/run.py, scripts/runpod_corpus_matrix.py)
Scope: Medium
Keep existing workflow.validate(schema_provider=...) as the hard gate before queueing runtime prompts.
Add doctor guidance that points users to port check when failures involve unknown classes, missing required inputs, helper-node issues, or model assets.
Add a cheap port-report summary to RunPod corpus matrix logs and copy the emitted scratchpad/report next to existing convert/validate logs.
Keep model URL HEAD checks opt-in and out of normal run behavior.
Add a new docs page for the porting workbench with a direct import -> port check -> port convert -> validate / doctor -> optional RunPod loop.
Update authoring and template docs so humans and agents start with port check before manual template editing or RunPod validation.
Update failure/live-validation docs to map common failures to commands: schema issues to port check/validate, custom nodes to nodes install-plan, model URLs to port check --head-check-models, and Python materialization to port convert.
Update AGENTS.md or the synced skill guidance so agents know when to use the porting workbench.
Ensure command help text mirrors the docs so discoverability is present in both CLI and repository guidance.
Phase 5: Tests and Battle Targets
Step 13: Add focused unit and CLI tests (tests/test_porting_workbench.py, tests/test_cli.py, tests/test_workflow_core.py, tests/test_schema.py, tests/test_model_assets.py)
Scope: Large
Test a simple fixture based on image/z_image or a tiny synthetic workflow: report shape, provenance, Python emission, import/build, compile, and validate.
Test video/wanvideo_wrapper_22_wan_animate_preprocess_kijai: helper nodes are diagnosed separately, helper nodes do not survive compiled API, no compiled API link points to a removed helper node, required real node packs are suggested, and detection model assets are reported.
Test custom-node inference ignores known helper/UI nodes but still fails unresolved runtime classes.
Test API-shaped workflow model asset extraction, including filename-only assets with missing URL warnings.
Test widget alias diagnostics with a fake schema provider and keep existing Wan/WanAnimate alias expectations passing.
Test HEAD checks with injected/mocked HTTP behavior, not real network.
Add CLI smoke tests for port check --json, port convert --out ... --json, and command help discoverability.
Step 14: Update parity and conversion tests (tests/test_ready_templates.py, tools/_compile_equivalence.py, tools/convert_ready_templates.py)
Scope: Medium
Keep ready-template parity tests passing after widget schema migration.
Verify tools/convert_ready_templates.py --template ... --dry-run still uses the moved emitter and reports equivalent diffs.
Add regression coverage that vibecomfy convert keeps its existing lightweight contract while vibecomfy port convert emits explicit Python.
Execution Order
Add report and helper diagnostics first, because helper filtering changes the correctness of every downstream diagnostic.
Expand model asset extraction before wiring URL checks, so reports are complete for UI-shaped and API-shaped sources.
Move emitter/widget schema code with compatibility wrappers and parity tests in the same change set.
Add the workbench orchestrator and port check before adding port convert writes.
Add opt-in HEAD checks after offline report behavior is covered.
Wire doctor / RunPod summaries after the report shape is stable.
Finish with discoverability docs, AGENTS/skill guidance, and battle-target tests.
Run ready-template and parity regressions: pytest -q tests/test_ready_templates.py plus python -m tools.convert_ready_templates --template image/qwen_image_2512 --dry-run.
Run node/model checks: pytest -q tests/test_nodes_install.py tests/test_models_registry.py.
"version": 2,
"timestamp": "2026-05-08T13:05:14Z",
"hash": "sha256:3f1bf0d650fdcf747d3f4edef790885b2acc126cea89d415aeb4ae2439c5cd76",
"changes_summary": "Revised the plan to separate helper-node diagnostics from custom-node pack inference, cover API-shaped model asset extraction, preserve existing conversion caller contracts, include parity tooling in widget-schema migration, and add discoverability as a first-class CLI/docs/AGENTS requirement.",
"flags_addressed": [
"FLAG-001",
"FLAG-002",
"issue_hints",
"correctness-1",
"correctness-2",
"scope",
"all_locations",
"callers"
],
"questions": [
"What is the canonical source path or id for the current Reigh WanAnimate production-parity workflow if it is not video/wanvideo_wrapper_22_wan_animate_preprocess_kijai?",
"Should direct writes under ready_templates/ be allowed by port convert --ready-id, or should ready-template promotion always be a separate manual step after emitting to out/scratchpads/?",
"Should AGENTS.md be edited directly for discoverability, or should the synced skill source be updated first and AGENTS.md regenerated through the existing sync path?"
],
"success_criteria": [
{
"criterion": "python -m vibecomfy.cli port check <workflow> --json returns a structured report with source provenance, schema issues, custom-node suggestions, model assets, helper-node diagnostics, widget alias diagnostics, and recommended next commands.",
"priority": "must",
"requires": [
"run_shell",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --out <path> --json emits a Python scratchpad/ready-template module whose build() returns a VibeWorkflow without re-loading the original JSON at runtime.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "The emitted Python module preserves provenance fields including original source path or id, source hash, detected shape, and ready id when supplied.",
"priority": "must",
"requires": [
"read_files",
"run_tests"
]
},
{
"criterion": "Custom-node pack inference ignores known helper/UI nodes and still reports unresolved runtime class types as hard errors.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags unresolved SetNode / GetNode helper broadcasts before compile can silently drop them.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The porting report extracts model asset candidates from UI-shaped workflows, API-shaped prompts, scratchpad metadata, and ready-template requirements, warning when URLs are missing.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags missing required schema inputs before runtime queueing for workflows validated with an available schema provider.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "WanAnimate helper nodes (, , , ) do not survive compiled API output, no compiled API link points to a removed helper node, and helper classes are not reported as unresolved custom-node packs.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Positional alias handling is centralized and all callers, including , , the Python emitter, , and , use the shared source.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Model asset HEAD checks are opt-in, use injectable/mocked HTTP behavior in tests, and report status without downloading model bodies.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Existing tests still pass, while new tests prove explicit Python materialization.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Focused tests for the simple template path and the WanAnimate production-parity path pass.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "CLI help and repository docs make discoverable as the recommended first preflight before manual template editing or RunPod validation.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "Existing local test suite passes with .",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The new porting modules keep CLI formatting separate from analysis logic and avoid duplicating node/model/schema inference code already present in the package.",
"priority": "should",
"requires": [
"parse_diff",
"subjective_judgment"
]
},
{
"criterion": "The docs give future users and agents a short live validation loop that starts with , proceeds to Python scratchpad conversion, and only then spends RunPod time.",
"priority": "should",
"requires": [
"read_files",
"subjective_judgment"
]
},
{
"criterion": "Optional real network HEAD checks pass for the current model asset URLs.",
"priority": "info",
"requires": [
"run_shell",
"observe_runtime_logs"
]
}
],
"assumptions": [
"The dedicated public UX is settled as .",
"The first useful slice should be a CLI/tooling workbench inside VibeComfy, not a GUI.",
"Normal tests must remain deterministic and must not require ComfyUI, RunPod, network access, model files, or installed custom nodes.",
"Existing behavior should remain compatible; explicit Python materialization belongs to first.",
"Raw external JSON may be accepted as input, but the steady-state output should be a Python scratchpad or ready-template module.",
"The current WanAnimate battle-test target is unless the user supplies a different production-parity source.",
"Network URL HEAD checks should stay opt-in because upstream hosts and license gates can make them flaky in routine validation."
],
"delta_from_previous_percent": 76.5,
"structure_warnings": []
}
code
Gate summary:
{
"passed": false,
"criteria_check": {
"count": 17,
"items": [
{
"criterion": "python -m vibecomfy.cli port check <workflow> --json returns a structured report with source provenance, schema issues, custom-node suggestions, model assets, helper-node diagnostics, widget alias diagnostics, and recommended next commands.",
"priority": "must",
"requires": [
"run_shell",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --out <path> --json emits a Python scratchpad/ready-template module whose build() returns a VibeWorkflow without re-loading the original JSON at runtime.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "The emitted Python module preserves provenance fields including original source path or id, source hash, detected shape, and ready id when supplied.",
"priority": "must",
"requires": [
"read_files",
"run_tests"
]
},
{
"criterion": "Custom-node pack inference ignores known helper/UI nodes and still reports unresolved runtime class types as hard errors.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags unresolved SetNode / GetNode helper broadcasts before compile can silently drop them.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The porting report extracts model asset candidates from UI-shaped workflows, API-shaped prompts, scratchpad metadata, and ready-template requirements, warning when URLs are missing.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags missing required schema inputs before runtime queueing for workflows validated with an available schema provider.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "WanAnimate helper nodes (Note, MarkdownNote, SetNode, GetNode) do not survive compiled API output, no compiled API link points to a removed helper node, and helper classes are not reported as unresolved custom-node packs.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Positional widget_N alias handling is centralized and all callers, including normalize_to_api, VibeWorkflow.compile, the Python emitter, tools/convert_ready_templates.py, and tools/_compile_equivalence.py, use the shared source.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Model asset HEAD checks are opt-in, use injectable/mocked HTTP behavior in tests, and report status without downloading model bodies.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Existing vibecomfy convert tests still pass, while new vibecomfy port convert tests prove explicit Python materialization.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Focused tests for the simple template path and the WanAnimate production-parity path pass.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "CLI help and repository docs make discoverable as the recommended first preflight before manual template editing or RunPod validation.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "Existing local test suite passes with .",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The new porting modules keep CLI formatting separate from analysis logic and avoid duplicating node/model/schema inference code already present in the package.",
"priority": "should",
"requires": [
"parse_diff",
"subjective_judgment"
]
},
{
"criterion": "The docs give future users and agents a short live validation loop that starts with , proceeds to Python scratchpad conversion, and only then spends RunPod time.",
"priority": "should",
"requires": [
"read_files",
"subjective_judgment"
]
},
{
"criterion": "Optional real network HEAD checks pass for the current model asset URLs.",
"priority": "info",
"requires": [
"run_shell",
"observe_runtime_logs"
]
}
]
},
"preflight_results": {
"project_dir_exists": true,
"project_dir_writable": true,
"success_criteria_present": true,
"claude_available": true,
"codex_available": true
},
"unresolved_flags": [
{
"id": "issue_hints",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: issue_hints: Checked the current agent guidance surfaces and sync script. README tells agents to read , while only checks AGENTS.md, CLAUDE.md, and ; its entry for is written by but not checked by normal sync tests. The plan's wording of "AGENTS.md or the synced skill guidance" can therefore leave the README-directed skill stale unless the implementation explicitly updates or syncs that local copy.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "issue_hints: Checked the current agent guidance surfaces and sync script. README tells agents to read , while only checks AGENTS.md, CLAUDE.md, and ; its entry for is written by but not checked by normal sync tests. The plan's wording of "AGENTS.md or the synced skill guidance" can therefore leave the README-directed skill stale unless the implementation explicitly updates or syncs that local copy.",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": true,
"addressed_in": "plan_v2.md",
"verified_in": "critique_v2.json"
},
{
"id": "scope",
"concern": "Search for related code that handles the same concept. Is the reported issue a symptom of something broader?: scope: Checked model asset callers beyond the planned workbench. and both fall back to , and their warning/fetch paths assume every returned entry has a usable . The revised plan expands to infer API-shaped filename-only assets and mark missing URLs as warnings, but unless those warning-only candidates are kept out of the legacy extractor's return shape or all callers are updated, existing doctor/fetch behavior can break.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "scope: Checked model asset callers beyond the planned workbench. and both fall back to , and their warning/fetch paths assume every returned entry has a usable . The revised plan expands to infer API-shaped filename-only assets and mark missing URLs as warnings, but unless those warning-only candidates are kept out of the legacy extractor's return shape or all callers are updated, existing doctor/fetch behavior can break.",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": true,
"addressed_in": "plan_v2.md",
"verified_in": "critique_v2.json"
},
{
"id": "all_locations",
"concern": "Does the change touch all locations AND supporting infrastructure?: all_locations: Checked agent-skill supporting infrastructure. validates , the symlink, OpenAI metadata, and check mode, but it does not validate freshness even though README directs agents there. Step 12 should explicitly include running or adding a freshness check for that local copy if discoverability for agents is a must-have.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "all_locations: Checked agent-skill supporting infrastructure. validates , the symlink, OpenAI metadata, and check mode, but it does not validate freshness even though README directs agents there. Step 12 should explicitly include running or adding a freshness check for that local copy if discoverability for agents is a must-have.",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": true,
"addressed_in": "plan_v2.md",
"verified_in": "critique_v2.json"
},
{
"id": "callers",
"concern": "Find the callers of the changed function. What arguments do they actually pass? Does the fix handle all of them?: callers: Checked callers. is currently used for structured ready-template requirements, while returns only dicts with , , and ; and index . If Step 3 changes itself to return filename-only API candidates without URLs, those existing callers will need defensive handling or the new filename-only candidates should be emitted only through .",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "callers: Checked callers. is currently used for structured ready-template requirements, while returns only dicts with , , and ; and index . If Step 3 changes itself to return filename-only API candidates without URLs, those existing callers will need defensive handling or the new filename-only candidates should be emitted only through .",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": true,
"addressed_in": "plan_v2.md",
"verified_in": "critique_v2.json"
},
{
"id": "FLAG-004",
"concern": "port-convert output mode: the plan extracts the current ready-template emitter for default scratchpad output, but the existing emitter assumes and ; needs an explicit scratchpad emission mode when is absent.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": " always emits , , , and references , while the revised plan defaults examples to and treats as optional.",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "FLAG-005",
"concern": "agent discoverability sync: updating only AGENTS.md or OpenAI metadata may leave stale even though README tells agents to read that local skill file.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": " writes only in via , but and do not validate that local copy; README points setup step 4 to .",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "FLAG-006",
"concern": "model asset API extraction: adding filename-only API asset candidates to can break existing doctor/fetch callers that assume every returned asset has a URL.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": " and both call and then use ; the revised plan says API-shaped assets inferred from filenames without URLs should be warnings.",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": false
},
{
"id": "correctness",
"concern": "Are the proposed changes technically correct?: correctness: Checked ; the current reusable emitter always emits , , , and reads . The revised plan says default examples should emit to and only use for ready-template-shaped output, but it does not explicitly require a scratchpad emission mode distinct from the ready-template emitter, so a naive extraction can mislabel scratchpads as ready templates or fail when no ready id is supplied.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "correctness: Checked ; the current reusable emitter always emits , , , and reads . The revised plan says default examples should emit to and only use for ready-template-shaped output, but it does not explicitly require a scratchpad emission mode distinct from the ready-template emitter, so a naive extraction can mislabel scratchpads as ready templates or fail when no ready id is supplied.",
"raised_in": "critique_v2.json",
"status": "open",
"severity": "significant",
"verified": false
}
],
"recommendation": "ITERATE",
"rationale": "The revised plan fixed the first wave of substantive issues, but the new critiques are still concrete correctness gaps that should be folded into the plan before implementation. In particular, needs an explicitly separate scratchpad emission mode from the existing ready-template emitter, API-shaped filename-only asset discovery must not change the legacy contract used by and , and agent discoverability must update or validate the README-directed copy. These are not human-choice tensions; they are implementable plan refinements.",
"signals_assessment": "Weighted score moved from 13.0 to 14.0 despite a large 76.5% plan delta, with 5 prior flags resolved and 8 significant flags still open. There are no recurring reopened critiques and preflight remains healthy: project exists, writable workspace is available, criteria are present, and required agents are available. The unresolved flags are repo-backed and specific, so the next move is another targeted plan iteration rather than escalation or execution.",
"warnings": [
"Add a distinct scratchpad-emission mode that does not assume or when is absent.",
"Keep legacy URL-bearing behavior stable for and , or update those callers defensively; put filename-only API candidates behind if that is cleaner.",
"Make the discoverability step explicitly update and test , since README directs agents there and current sync checks do not cover it."
],
"settled_decisions": [
{
"id": "dedicated-port-command",
"decision": "Keep as the public UX for the workbench.",
"rationale": "This remains the clearest answer to the user\u2019s discoverability requirement and avoids changing existing , , and output contracts."
},
{
"id": "preserve-existing-convert",
"decision": "Existing behavior must remain compatible; explicit Python materialization belongs to .",
"rationale": "Current callers depend on the lightweight conversion contract, while the new workbench has different provenance and validation responsibilities."
},
{
"id": "head-checks-opt-in",
"decision": "Model URL HEAD checks stay opt-in and test via mocked/injected HTTP behavior.",
"rationale": "Network availability, redirects, and gated model hosts are not deterministic enough for normal validation or test runs."
}
],
"override_forced": false,
"orchestrator_guidance": "Score worsening (13.0 -> 14.0). Investigate; the loop may be diverging. Verify unresolved flags against the plan and project code before accepting.",
"robustness": "standard",
"signals": {
"iteration": 2,
"idea": "Build a holistic VibeComfy template porting workbench/toolset, based on the failures seen while porting production Reigh workflows to VibeComfy. The toolset should make it easy to find/import source Comfy workflows, convert them into proper Python ready-template/scratchpad format, preserve provenance, infer and validate custom node packs, infer and HEAD-check model asset URLs, resolve UI-only/helper nodes like Note/MarkdownNote/SetNode/GetNode and similar reroute/broadcast helpers, detect positional widget aliases by comparing compiled API prompts with Comfy object_info/schema, surface missing required inputs before a RunPod burn, emit actionable reports and tests, and support battle-testing against both a simple template and the current WanAnimate production-parity template. It should be pragmatic: build the first useful slice now, use it immediately on the current failures, and document the remaining roadmap. Avoid raw JSON execution as the steady-state path; workflows should land as Python-esque VibeComfy ready templates/scratchpads. Include a strategy for integrating this into the live validation loop so future users avoid the same URL/model/custom-node/schema failures.",
"significant_flags": 8,
"unresolved_flags": [
{
"id": "issue_hints",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: issue_hints: Checked the current agent guidance surfaces and sync script. README tells agents to read , while only checks AGENTS.md, CLAUDE.md, and ; its entry for is written by but not checked by normal sync tests. The plan's wording of "AGENTS.md or the synced skill guidance" can therefore leave the README-directed skill stale unless the implementation explicitly updates or syncs that local copy.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "scope",
"concern": "Search for related code that handles the same concept. Is the reported issue a symptom of something broader?: scope: Checked model asset callers beyond the planned workbench. and both fall back to , and their warning/fetch paths assume every returned entry has a usable . The revised plan expands to infer API-shaped filename-only assets and mark missing URLs as warnings, but unless those warning-only candidates are kept out of the legacy extractor's return shape or all callers are updated, existing doctor/fetch behavior can break.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "all_locations",
"concern": "Does the change touch all locations AND supporting infrastructure?: all_locations: Checked agent-skill supporting infrastructure. validates , the symlink, OpenAI metadata, and check mode, but it does not validate freshness even though README directs agents there. Step 12 should explicitly include running or adding a freshness check for that local copy if discoverability for agents is a must-have.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "callers",
"concern": "Find the callers of the changed function. What arguments do they actually pass? Does the fix handle all of them?: callers: Checked callers. is currently used for structured ready-template requirements, while returns only dicts with , , and ; and index . If Step 3 changes itself to return filename-only API candidates without URLs, those existing callers will need defensive handling or the new filename-only candidates should be emitted only through .",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "FLAG-004",
"concern": "port-convert output mode: the plan extracts the current ready-template emitter for default scratchpad output, but the existing emitter assumes and ; needs an explicit scratchpad emission mode when is absent.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "FLAG-005",
"concern": "agent discoverability sync: updating only AGENTS.md or OpenAI metadata may leave stale even though README tells agents to read that local skill file.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "FLAG-006",
"concern": "model asset API extraction: adding filename-only API asset candidates to can break existing doctor/fetch callers that assume every returned asset has a URL.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "correctness",
"concern": "Are the proposed changes technically correct?: correctness: Checked ; the current reusable emitter always emits , , , and reads . The revised plan says default examples should emit to and only use for ready-template-shaped output, but it does not explicitly require a scratchpad emission mode distinct from the ready-template emitter, so a naive extraction can mislabel scratchpads as ready templates or fail when no ready id is supplied.",
"category": "correctness",
"severity": "significant",
"status": "open"
}
],
"resolved_flags": [
{
"id": "FLAG-001",
"concern": "custom-node inference: currently treats helper/UI nodes as unresolved class types; making unresolved classes a hard error will fail the WanAnimate target unless the workbench filters helper nodes or analyzes the compiled helper-stripped graph for pack inference.",
"resolution": "Revised the plan to separate helper-node diagnostics from custom-node pack inference, cover API-shaped model asset extraction, preserve existing conversion caller contracts, include parity tooling in widget-schema migration, and add discoverability as a first-class CLI/docs/AGENTS requirement."
},
{
"id": "FLAG-002",
"concern": "model asset coverage: the plan relies on , but that function returns no assets for API-shaped workflows, so API prompt sources and normalized workflows can produce incomplete model URL/provenance reports.",
"resolution": "Revised the plan to separate helper-node diagnostics from custom-node pack inference, cover API-shaped model asset extraction, preserve existing conversion caller contracts, include parity tooling in widget-schema migration, and add discoverability as a first-class CLI/docs/AGENTS requirement."
},
{
"id": "FLAG-003",
"concern": "widget alias migration: the plan omits from the centralization list even though ready-template conversion uses it to compare compiled output and it imports .",
"resolution": " imports from , and imports from that equivalence module."
},
{
"id": "correctness-1",
"concern": "Are the proposed changes technically correct?: correctness: Ran against the current repo. It suggests the real packs, but also returns unresolved helper/UI classes including , , , and ; because Step 4 says unresolved classes are hard errors for , the planned WanAnimate battle target would fail before the helper-node resolution pass unless pack inference is run on the compiled/helper-stripped API or explicitly excludes known helper classes.",
"resolution": "Revised the plan to separate helper-node diagnostics from custom-node pack inference, cover API-shaped model asset extraction, preserve existing conversion caller contracts, include parity tooling in widget-schema migration, and add discoverability as a first-class CLI/docs/AGENTS requirement."
},
{
"id": "correctness-2",
"concern": "Are the proposed changes technically correct?: correctness: Checked and confirmed compile-time helper handling already drops , , , and , and rewrites resolvable Set/Get broadcasts into direct links. The plan's Step 6 is directionally consistent with existing behavior, but the diagnostic needs to inspect the unresolved cases before compile silently drops them; otherwise dangling helper references may be skipped rather than reported as errors.",
"resolution": "Revised the plan to separate helper-node diagnostics from custom-node pack inference, cover API-shaped model asset extraction, preserve existing conversion caller contracts, include parity tooling in widget-schema migration, and add discoverability as a first-class CLI/docs/AGENTS requirement."
}
],
"weighted_score": 14.0,
"weighted_history": [
13.0
],
"plan_delta_from_previous": 76.5,
"recurring_critiques": [],
"scope_creep_flags": [],
"loop_summary": "Iteration 2. Weighted score trajectory: 13.0 -> 14.0. Plan deltas: 76.5%. Recurring critiques: 0. Resolved flags: 5. Open significant flags: 8.",
"debt_overlaps": [],
"escalated_debt_subsystems": []
},
"flag_resolutions": [],
"resolved_flag_ids": [],
"resolution_summary": "",
"reprompted": false
}
code
Open significant flags:
[
{
"id": "issue_hints",
"severity": "significant",
"status": "open",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: issue_hints: Checked the current agent guidance surfaces and sync script. README tells agents to read .claude/skills/vibecomfy/SKILL.md, while scripts/sync_agent_skill.py only checks AGENTS.md, CLAUDE.md, and agents/openai.yaml; its LOCAL_COPY_TARGETS entry for .claude/skills/vibecomfy/SKILL.md is written by --apply but not checked by normal sync tests. The plan's wording of "AGENTS.md or the synced skill guidance" can therefore leave the README-directed skill stale unless the implementation explicitly updates or syncs that local copy.",
"evidence": "issue_hints: Checked the current agent guidance surfaces and sync script. README tells agents to read .claude/skills/vibecomfy/SKILL.md, while scripts/sync_agent_skill.py only checks AGENTS.md, CLAUDE.md, and agents/openai.yaml; its LOCAL_COPY_TARGETS entry for .claude/skills/vibecomfy/SKILL.md is written by --apply but not checked by normal sync tests. The plan's wording of "AGENTS.md or the synced skill guidance" can therefore leave the README-directed skill stale unless the implementation explicitly updates or syncs that local copy."
},
{
"id": "scope",
"severity": "significant",
"status": "open",
"concern": "Search for related code that handles the same concept. Is the reported issue a symptom of something broader?: scope: Checked model asset callers beyond the planned workbench. vibecomfy/commands/doctor.py and vibecomfy/commands/fetch.py both fall back to extract_from_raw_workflow(load_workflow_json(path)), and their warning/fetch paths assume every returned entry has a usable url. The revised plan expands vibecomfy/model_assets.py to infer API-shaped filename-only assets and mark missing URLs as warnings, but unless those warning-only candidates are kept out of the legacy extractor's return shape or all callers are updated, existing doctor/fetch behavior can break.",
"evidence": "scope: Checked model asset callers beyond the planned workbench. vibecomfy/commands/doctor.py and vibecomfy/commands/fetch.py both fall back to extract_from_raw_workflow(load_workflow_json(path)), and their warning/fetch paths assume every returned entry has a usable url. The revised plan expands vibecomfy/model_assets.py to infer API-shaped filename-only assets and mark missing URLs as warnings, but unless those warning-only candidates are kept out of the legacy extractor's return shape or all callers are updated, existing doctor/fetch behavior can break."
},
{
"id": "all_locations",
"severity": "significant",
"status": "open",
"concern": "Does the change touch all locations AND supporting infrastructure?: all_locations: Checked agent-skill supporting infrastructure. validates , the symlink, OpenAI metadata, and check mode, but it does not validate freshness even though README directs agents there. Step 12 should explicitly include running or adding a freshness check for that local copy if discoverability for agents is a must-have.",
"evidence": "all_locations: Checked agent-skill supporting infrastructure. validates , the symlink, OpenAI metadata, and check mode, but it does not validate freshness even though README directs agents there. Step 12 should explicitly include running or adding a freshness check for that local copy if discoverability for agents is a must-have."
},
{
"id": "callers",
"severity": "significant",
"status": "open",
"concern": "Find the callers of the changed function. What arguments do they actually pass? Does the fix handle all of them?: callers: Checked callers. is currently used for structured ready-template requirements, while returns only dicts with , , and ; and index . If Step 3 changes itself to return filename-only API candidates without URLs, those existing callers will need defensive handling or the new filename-only candidates should be emitted only through .",
"evidence": "callers: Checked callers. is currently used for structured ready-template requirements, while returns only dicts with , , and ; and index . If Step 3 changes itself to return filename-only API candidates without URLs, those existing callers will need defensive handling or the new filename-only candidates should be emitted only through ."
},
{
"id": "FLAG-004",
"severity": "significant",
"status": "open",
"concern": "port-convert output mode: the plan extracts the current ready-template emitter for default scratchpad output, but the existing emitter assumes and ; needs an explicit scratchpad emission mode when is absent.",
"evidence": " always emits , , , and references , while the revised plan defaults examples to and treats as optional."
},
{
"id": "FLAG-005",
"severity": "significant",
"status": "open",
"concern": "agent discoverability sync: updating only AGENTS.md or OpenAI metadata may leave stale even though README tells agents to read that local skill file.",
"evidence": " writes only in via , but and do not validate that local copy; README points setup step 4 to ."
},
{
"id": "FLAG-006",
"severity": "significant",
"status": "open",
"concern": "model asset API extraction: adding filename-only API asset candidates to can break existing doctor/fetch callers that assume every returned asset has a URL.",
"evidence": " and both call and then use ; the revised plan says API-shaped assets inferred from filenames without URLs should be warnings."
},
{
"id": "correctness",
"severity": "significant",
"status": "open",
"concern": "Are the proposed changes technically correct?: correctness: Checked ; the current reusable emitter always emits , , , and reads . The revised plan says default examples should emit to and only use for ready-template-shaped output, but it does not explicitly require a scratchpad emission mode distinct from the ready-template emitter, so a naive extraction can mislabel scratchpads as ready templates or fail when no ready id is supplied.",
"evidence": "correctness: Checked ; the current reusable emitter always emits , , , and reads . The revised plan says default examples should emit to and only use for ready-template-shaped output, but it does not explicitly require a scratchpad emission mode distinct from the ready-template emitter, so a naive extraction can mislabel scratchpads as ready templates or fail when no ready id is supplied."
}
]
code
Requirements:
- Before addressing individual flags, check: does any flag suggest the plan is targeting the wrong code or the wrong root cause? If so, consider whether the plan needs a new approach rather than adjustments. Explain your reasoning.
- Update the plan to address the significant issues.
- Keep the plan readable and executable.
- Return flags_addressed with the exact flag IDs you addressed.
- Include `changes_summary` as a short plain-English summary of what changed in the revision. If there were no concrete flags, say that explicitly (for example: `No critique flags were raised; refined wording and kept the plan aligned for execution.`).
- Preserve or improve success criteria quality. Each criterion must have a `priority` of `must`, `should`, or `info`. Promote or demote priorities if critique feedback reveals a criterion was over- or under-weighted.
- Each success criterion should include a `requires` field listing the capabilities needed for verification. Valid capability strings: `run_shell`, `read_files`, `run_tests`, `parse_diff`, `read_build_output`, `run_linter` (container), `drive_browser`, `inspect_runtime_ui`, `observe_runtime_logs`, `subjective_judgment`, `verify_physical_device` (human). `must` criteria MUST have non-empty `requires`. Example: `{"criterion": "All tests pass", "priority": "must", "requires": ["run_tests"]}`.
- Verify that the plan remains aligned with the user's original intent, not just internal plan quality.
- Remove unjustified scope growth. If critique raised scope creep, narrow the plan back to the original idea unless the broader work is strictly required.
- Maintain the structural template: H1 title, ## Overview, phase sections with numbered step sections, ## Execution Order or ## Validation Order.
- CRITICAL: Your entire revised plan markdown (all sections) must be output as the `plan` field in the structured output. The prose response must not contain the plan text.
- CRITICAL: Return only the structured JSON object for the schema fields `plan`, `changes_summary`, `flags_addressed`, `assumptions`, `success_criteria`, and `questions`. Do not add commentary before or after the JSON object.
Plan template — simple format (adapt to the actual repo and scope):
md
# Implementation Plan: [Title]
## Overview
Summarize the goal, current repository shape, and the constraints that matter.
## Main Phase
### Step 1: Audit the current behavior (`megaplan/prompts.py`)
**Scope:** Small
1. **Inspect** the current implementation and call out the exact insertion points (`megaplan/prompts.py:29`).
### Step 2: Add the first change (`megaplan/evaluation.py`)
**Scope:** Medium
1. **Implement** the smallest viable change with exact file references (`megaplan/evaluation.py:1`).
2. **Capture** any tricky behavior with a short example.
```python
issues = validate_plan_structure(plan_text)
```
### Step 3: Wire downstream behavior (`megaplan/handlers.py`, `megaplan/workers.py`)
**Scope:** Medium
1. **Update** the runtime flow in the touched files (`megaplan/handlers.py:400`, `megaplan/workers.py:199`).
### Step 4: Prove the change (`tests/test_evaluation.py`, `tests/test_megaplan.py`)
**Scope:** Small
1. **Run** the cheapest targeted checks first (`tests/test_evaluation.py:1`).
2. **Finish** with broader verification once the wiring is in place (`tests/test_megaplan.py:1`).
## Execution Order
1. Update prompts and mocks before enforcing stricter validation.
2. Land higher-risk wiring after the validator and tests are ready.
## Validation Order
1. Start with focused unit tests.
2. Run the broader suite after the flow changes are in place.
For complex plans, use multiple phases:
md
## Phase 1: Foundation — Dependencies, DB, Types
### Step 1: Install dependencies (`package.json`)
...
### Step 2: Create database migration (`supabase/migrations/`)
...
## Phase 2: Core Integration
### Step 3: Port the main component (`src/components/`)
...
Template guidance:
Simple plans: use ## Main Phase with ### Step N: sections underneath.
Complex plans: use multiple ## Phase N: sections, each containing ### Step N: steps. Step numbers are global (not per-phase).
The flat ## Step N: format (without phases) also works for backwards compatibility.
Key invariants: one H1 title, one ## Overview, numbered step sections (### Step N: or ## Step N:), and at least one ordering section.
{
"plan": "# Implementation Plan: VibeComfy Template Porting Workbench\n\n## Overview\nThe new critique still does not show that the workbench is aimed at the wrong subsystem or root cause. The correct target remains a first-class vibecomfy port ... workflow over the existing conversion, schema, node-pack, model-asset, and ready-template machinery. The refinements are about preserving contracts at the edges: port convert needs a true scratchpad output mode distinct from ready-template output, filename-only API asset discovery must not change the legacy URL-bearing extract_from_raw_workflow(...) contract used by doctor and fetch, and agent discoverability must update the README-directed local skill copy as well as AGENTS/OpenAI guidance.\n\nThe first useful slice is a package-level vibecomfy.porting workbench plus a discoverable CLI surface. port check should be the obvious cheap preflight before manual Python-template editing or expensive RunPod validation. port convert should emit Python-esque VibeWorkflow scratchpads by default, and ready-template-shaped modules only when --ready-id is supplied. Existing vibecomfy convert, doctor, fetch, and ready-template materialization contracts should remain compatible unless they explicitly opt into the new workbench APIs.\n\n## Phase 1: Foundation - Report Shape, Source Loading, and Helper Semantics\n\n### Step 1: Add a porting report model (vibecomfy/porting/report.py)\nScope: Medium\n1. Define dataclasses for PortReport, PortIssue, PortArtifact, NodePackSuggestion, AssetCandidate, and AssetCheckResult with stable JSON serialization.\n2. Include source id/path, detected workflow shape, source hash, normalized API node count, emitted Python path, output mode (scratchpad or ready_template), helper-node diagnostics, custom-node suggestions, unresolved runtime class types, model asset candidates, schema issues, widget alias observations, and recommended next commands.\n3. Keep issue severities aligned with current validation concepts: error, warning, and info.\n\n### Step 2: Centralize helper/UI-node classification (vibecomfy/porting/helpers.py, vibecomfy/workflow.py)\nScope: Medium\n1. Move the helper-node class set and helper-resolution diagnostics into a reusable module that knows about Note, MarkdownNote, SetNode, and GetNode.\n2. Add a diagnostic pass that inspects the original IR before compile and reports unresolved GetNode / SetNode broadcasts instead of letting compile silently skip dangling helper references.\n3. Expose a helper-stripped runtime class view for downstream diagnostics so custom-node pack inference does not treat Note, MarkdownNote, SetNode, or GetNode as missing installable node packs.\n4. Keep VibeWorkflow.compile(\"api\") behavior compatible: resolved helper broadcasts still rewrite to direct links; helper nodes still do not survive into API prompts.\n\n### Step 3: Add porting-only model asset analysis without changing legacy extractor contracts (vibecomfy/porting/assets.py, vibecomfy/model_assets.py)\nScope: Medium\n1. Keep extract_from_raw_workflow(...) returning only URL-bearing dictionaries with name, url, and subdir, so existing doctor and fetch callers remain safe.\n2. Add a new porting-only analyzer that merges URL-bearing assets from UI workflow properties.models, normalized API prompts, loaded scratchpad/ready-template metadata, and READY_REQUIREMENTS.\n3. Add API-shaped filename discovery in the porting analyzer as AssetCandidate records with optional url, not as return values from extract_from_raw_workflow(...).\n4. Mark filename-only candidates without URLs as actionable warnings in the port report rather than passing them to legacy fetch/download code.\n5. Factor shared subdir/name normalization helpers only if useful, while preserving the public behavior of extract_from_raw_workflow(...) and entries_from_scratchpad_path(...).\n\n## Phase 2: Python Emission and Compatibility Boundaries\n\n### Step 4: Move reusable emission primitives without forcing ready-template semantics (vibecomfy/porting/emitter.py, tools/format_as_python.py, tools/convert_ready_templates.py)\nScope: Large\n1. Extract reusable _node(...)-style emission primitives from tools/format_as_python.py into package code.\n2. Preserve explicit node IDs, deterministic ordering, _extras for non-identifier inputs, registered input handling, and current override behavior.\n3. Split package emission into two explicit modes:\n - emit_scratchpad_python(...): default for port convert, emits PORT_METADATA or equivalent provenance, uses WorkflowSource(... source_type=\"scratchpad\"), and does not require READY_METADATA[\"ready_template\"].\n - emit_ready_template_python(...): used only when --ready-id is supplied or by ready-template tooling, emits READY_METADATA, READY_REQUIREMENTS, and WorkflowSource(... source_type=\"ready_template\").\n4. Keep tools/format_as_python.py and tools/convert_ready_templates.py as compatibility wrappers around the ready-template emission mode.\n5. Do not change the established vibecomfy convert contract in vibecomfy/commands/convert.py; the new explicit Python materialization behavior belongs to vibecomfy port convert first.\n\n### Step 5: Preserve both conversion contracts (vibecomfy/scratchpad_loader.py, vibecomfy/commands/convert.py, vibecomfy/commands/port.py)\nScope: Medium\n1. Leave existing lightweight scratchpad rendering available for compatibility.\n2. Implement port convert without --ready-id as true scratchpad emission: build() returns a VibeWorkflow with scratchpad provenance and no ready-template metadata requirement.\n3. Implement port convert --ready-id kind/name as ready-template candidate emission: build() returns a VibeWorkflow with ready-template metadata and structured requirements.\n4. Default examples and docs to out/scratchpads/... so promotion to ready_templates/ remains intentional.\n5. Validate emitted Python by importing it, calling build(), compiling API, and running schema validation when available.\n\n## Phase 3: Diagnostics - Catch Current Failure Classes Before RunPod\n\n### Step 6: Add the workbench orchestrator (vibecomfy/porting/workbench.py)\nScope: Large\n1. Implement analyze_source(...) to load ready ids, scratchpads, raw JSON paths, and indexed workflow references through existing loader/normalizer paths.\n2. Preserve provenance in the report and emitted metadata: source path/id, source hash, original shape, source workflow id when known, converter version, output mode, and whether schema was available.\n3. Run helper diagnostics before custom-node inference.\n4. Run custom-node pack inference against the helper-stripped runtime class view, while reporting unresolved helper broadcasts separately as helper errors.\n5. Run the porting-only model asset analyzer so filename-only API candidates become warnings without breaking legacy model asset callers.\n6. Reuse workflow.validate(schema_provider=...) for schema issues and include formatted missing_required_input, unknown_input, unknown_class_type, invalid_link_shape, and type mismatch results in the report.\n\n### Step 7: Custom node pack inference (vibecomfy/porting/workbench.py, vibecomfy/node_packs_install.py)\nScope: Small\n1. Reuse resolve_node_packs(...) / missing_packs_for_workflow(...) concepts, but pass only runtime-relevant class types after helper filtering.\n2. Include pack name, repo, pip packages, and matched classes in the port report.\n3. Treat unresolved runtime class types as hard port check errors.\n4. Treat known helper/UI classes as helper diagnostics, never as missing custom-node packs.\n\n### Step 8: Model URL HEAD checks (vibecomfy/porting/assets.py)\nScope: Medium\n1. Add opt-in URL checking for asset candidates that have URLs, using httpx.Client().head(..., follow_redirects=True) and a deterministic timeout.\n2. Report status code, final redirected URL, missing URL fields, duplicate asset targets, and license-gated/404 cases.\n3. Do not download model bodies.\n4. Keep HEAD checks disabled in ordinary tests, validate, doctor, fetch, and run unless --head-check-models is explicitly passed through port check or port convert.\n\n### Step 9: Positional widget alias detection and shared schema source (vibecomfy/porting/widget_schema.py, vibecomfy/porting/widget_aliases.py, vibecomfy/ingest/normalize.py, vibecomfy/workflow.py, tools/_compile_equivalence.py)\nScope: Large\n1. Move the committed widget schema and resolve_widget_name(...) into package code.\n2. Update normalize_to_api, VibeWorkflow.compile, the package emitter, tools/format_as_python.py, tools/convert_ready_templates.py, and tools/_compile_equivalence.py to use the same package-level widget schema/alias source.\n3. Prefer schema-derived input order from object_info when available; fall back to the committed static widget schema when offline.\n4. Add a diagnostic pass that compares compiled API inputs against schema inputs and reports unresolved widget_N inputs where a required named input is missing or where parity tooling would otherwise see false drift.\n5. Move existing Wan/WanAnimate positional aliases out of private workflow-only state while preserving current behavior.\n\n## Phase 4: CLI, Discoverability, and Live Validation Loop\n\n### Step 10: Add explicit CLI entry points (vibecomfy/commands/port.py, vibecomfy/commands/__init__.py)\nScope: Medium\n1. Register port as an explicit command in COMMANDS.\n2. Add python -m vibecomfy.cli port check <workflow> [--json] [--head-check-models] for no-write preflight.\n3. Add python -m vibecomfy.cli port convert <workflow> --out out/scratchpads/name.py [--json] [--head-check-models] for scratchpad Python output.\n4. Add python -m vibecomfy.cli port convert <workflow> --out ready_templates/kind/name.py --ready-id kind/name [--json] for ready-template candidate output.\n5. Make command help explain when to use port check, port convert, doctor, validate, nodes install-plan, fetch, and --head-check-models.\n6. Return nonzero for hard errors: unresolved runtime class types, unresolved helper broadcasts, schema-required missing inputs, failed Python build, failed emitted scratchpad/template validation, or failed model HEAD checks when the user requested them.\n\n### Step 11: Wire the live validation loop without making network checks mandatory (vibecomfy/commands/doctor.py, vibecomfy/commands/run.py, scripts/runpod_corpus_matrix.py)\nScope: Medium\n1. Keep existing workflow.validate(schema_provider=...) as the hard gate before queueing runtime prompts.\n2. Add doctor guidance that points users to port check when failures involve unknown classes, missing required inputs, helper-node issues, or model assets.\n3. Add a cheap port-report summary to RunPod corpus matrix logs and copy the emitted scratchpad/report next to existing convert/validate logs.\n4. Keep model URL HEAD checks opt-in and out of normal run, doctor, and fetch behavior.\n\n### Step 12: Make discoverability first-class and sync every agent guidance surface (README.md, docs/authoring.md, docs/adding_templates_models.md, docs/errors_and_doctor.md, docs/template_porting_workbench.md, AGENTS.md, .claude/skills/vibecomfy/SKILL.md, scripts/sync_agent_skill.py, tests/test_agent_skill_sync.py)\nScope: Medium\n1. Add a new docs page for the porting workbench with a direct import -> port check -> port convert -> validate / doctor -> optional RunPod loop.\n2. Update authoring and template docs so humans and agents start with port check before manual template editing or RunPod validation.\n3. Update failure/live-validation docs to map common failures to commands: schema issues to port check/validate, custom nodes to nodes install-plan, model URLs to port check --head-check-models, Python materialization to port convert, and downloads to fetch only when URL-bearing assets are available.\n4. Update the source agent guidance that feeds AGENTS/OpenAI/Claude-facing copies, then run python scripts/sync_agent_skill.py --apply so .claude/skills/vibecomfy/SKILL.md is refreshed.\n5. Extend scripts/sync_agent_skill.py check mode or tests/test_agent_skill_sync.py so the README-directed .claude/skills/vibecomfy/SKILL.md local copy is checked for freshness.\n6. Ensure command help text mirrors the docs so discoverability is present in both CLI and repository guidance.\n\n## Phase 5: Tests and Battle Targets\n\n### Step 13: Add focused unit and CLI tests (tests/test_porting_workbench.py, tests/test_cli.py, tests/test_workflow_core.py, tests/test_schema.py, tests/test_model_assets.py)\nScope: Large\n1. Test a simple fixture based on image/z_image or a tiny synthetic workflow: report shape, provenance, scratchpad Python emission, import/build, compile, and validate.\n2. Test video/wanvideo_wrapper_22_wan_animate_preprocess_kijai: helper nodes are diagnosed separately, helper nodes do not survive compiled API, no compiled API link points to a removed helper node, required real node packs are suggested, and detection model assets are reported.\n3. Test custom-node inference ignores known helper/UI nodes but still fails unresolved runtime classes.\n4. Test porting-only API-shaped workflow model asset candidates, including filename-only assets with missing URL warnings, without changing extract_from_raw_workflow(...) return shape.\n5. Test widget alias diagnostics with a fake schema provider and keep existing Wan/WanAnimate alias expectations passing.\n6. Test HEAD checks with injected/mocked HTTP behavior, not real network.\n7. Add CLI smoke tests for port check --json, scratchpad-mode port convert --out ... --json, ready-template-mode port convert --ready-id ..., and command help discoverability.\n\n### Step 14: Update parity, conversion, and sync tests (tests/test_ready_templates.py, tools/_compile_equivalence.py, tools/convert_ready_templates.py, tests/test_agent_skill_sync.py)\nScope: Medium\n1. Keep ready-template parity tests passing after widget schema migration.\n2. Verify tools/convert_ready_templates.py --template ... --dry-run still uses the moved ready-template emitter and reports equivalent diffs.\n3. Add regression coverage that vibecomfy convert keeps its existing lightweight contract while vibecomfy port convert emits explicit scratchpad Python by default.\n4. Add regression coverage that ready-template emission is only used by port convert --ready-id and ready-template tooling.\n5. Add freshness coverage for .claude/skills/vibecomfy/SKILL.md or the sync path that regenerates it.\n\n## Execution Order\n1. Add report and helper diagnostics first, because helper filtering changes the correctness of every downstream diagnostic.\n2. Add porting-only model asset analysis while preserving legacy extract_from_raw_workflow(...) behavior for doctor and fetch.\n3. Split emitter code into explicit scratchpad and ready-template modes before wiring port convert.\n4. Move widget schema code with compatibility wrappers and parity tests in the same change set.\n5. Add the workbench orchestrator and port check before adding port convert writes.\n6. Add opt-in HEAD checks after offline report behavior is covered.\n7. Wire doctor / RunPod summaries after the report shape is stable.\n8. Finish with discoverability docs, synced agent guidance, and battle-target tests.\n\n## Validation Order\n1. Run focused porting tests first: pytest -q tests/test_porting_workbench.py tests/test_model_assets.py tests/test_workflow_core.py tests/test_schema.py.\n2. Run CLI tests: pytest -q tests/test_cli.py.\n3. Run ready-template and parity regressions: pytest -q tests/test_ready_templates.py plus python -m tools.convert_ready_templates --template image/qwen_image_2512 --dry-run.\n4. Run agent guidance sync tests: python scripts/sync_agent_skill.py --check and pytest -q tests/test_agent_skill_sync.py.\n5. Run node/model checks: pytest -q tests/test_nodes_install.py tests/test_models_registry.py.\n6. Run the full local suite with pytest.\n7. Manual/optional network check: python -m vibecomfy.cli port check video/wanvideo_wrapper_22_wan_animate_preprocess_kijai --json --head-check-models.\n",
"changes_summary": "Refined the plan to add an explicit scratchpad emission mode for port convert, keep legacy model asset extraction URL-bearing for doctor and fetch, move filename-only API asset discovery into porting-only analysis, and require syncing/testing the README-directed .claude/skills/vibecomfy/SKILL.md guidance surface.",
"flags_addressed": [
"issue_hints",
"scope",
"all_locations",
"callers",
"FLAG-004",
"FLAG-005",
"FLAG-006",
"correctness"
],
"assumptions": [
"The dedicated public UX is settled as vibecomfy port ....",
"The first useful slice should be a CLI/tooling workbench inside VibeComfy, not a GUI.",
"Normal tests must remain deterministic and must not require ComfyUI, RunPod, network access, model files, or installed custom nodes.",
"Existing vibecomfy convert, doctor, and fetch behavior should remain compatible.",
"Explicit Python scratchpad materialization belongs to vibecomfy port convert by default.",
"Ready-template-shaped emission requires port convert --ready-id ... or existing ready-template tooling.",
"Raw external JSON may be accepted as input, but the steady-state output should be a Python scratchpad or ready-template module.",
"The current WanAnimate battle-test target is video/wanvideo_wrapper_22_wan_animate_preprocess_kijai unless the user supplies a different production-parity source.",
"Network URL HEAD checks should stay opt-in because upstream hosts and license gates can make them flaky in routine validation."
],
"success_criteria": [
{
"criterion": "python -m vibecomfy.cli port check <workflow> --json returns a structured report with source provenance, schema issues, custom-node suggestions, model asset candidates, helper-node diagnostics, widget alias diagnostics, and recommended next commands.",
"priority": "must",
"requires": [
"run_shell",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --out <path> --json emits a scratchpad Python module whose build() returns a VibeWorkflow with source_type='scratchpad' and without requiring READY_METADATA['ready_template'].",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --ready-id kind/name --out <path> --json emits a ready-template candidate with READY_METADATA, READY_REQUIREMENTS, and source_type='ready_template'.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "The emitted Python module preserves provenance fields including original source path or id, source hash, detected shape, output mode, and ready id when supplied.",
"priority": "must",
"requires": [
"read_files",
"run_tests"
]
},
{
"criterion": "Legacy extract_from_raw_workflow(...) continues returning only URL-bearing asset dictionaries compatible with existing doctor and fetch callers.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Porting-only asset analysis reports API-shaped filename-only asset candidates as warnings without passing URL-less entries to legacy fetch/download paths.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "Custom-node pack inference ignores known helper/UI nodes and still reports unresolved runtime class types as hard errors.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags unresolved SetNode / GetNode helper broadcasts before compile can silently drop them.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The porting report flags missing required schema inputs before runtime queueing for workflows validated with an available schema provider.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "WanAnimate helper nodes (Note, MarkdownNote, SetNode, GetNode) do not survive compiled API output, no compiled API link points to a removed helper node, and helper classes are not reported as unresolved custom-node packs.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Positional widget_N alias handling is centralized and all callers, including normalize_to_api, VibeWorkflow.compile, the Python emitter, tools/convert_ready_templates.py, and tools/_compile_equivalence.py, use the shared source.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Model asset HEAD checks are opt-in, use injectable/mocked HTTP behavior in tests, and report status without downloading model bodies.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Existing vibecomfy convert tests still pass, while new vibecomfy port convert tests prove explicit scratchpad Python materialization by default and ready-template materialization only with --ready-id.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Focused tests for the simple template path and the WanAnimate production-parity path pass.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "CLI help and repository docs make port check discoverable as the recommended first preflight before manual template editing or RunPod validation.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "AGENTS/OpenAI/Claude guidance, including .claude/skills/vibecomfy/SKILL.md, is updated or regenerated and covered by sync/freshness checks.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"run_tests"
]
},
{
"criterion": "Existing local test suite passes with pytest.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The new porting modules keep CLI formatting separate from analysis logic and avoid duplicating node/model/schema inference code already present in the package.",
"priority": "should",
"requires": [
"parse_diff",
"subjective_judgment"
]
},
{
"criterion": "The docs give future users and agents a short live validation loop that starts with port check, proceeds to Python scratchpad conversion, and only then spends RunPod time.",
"priority": "should",
"requires": [
"read_files",
"subjective_judgment"
]
},
{
"criterion": "Optional real network HEAD checks pass for the current model asset URLs.",
"priority": "info",
"requires": [
"run_shell",
"observe_runtime_logs"
]
}
],
"questions": [
"What is the canonical source path or id for the current Reigh WanAnimate production-parity workflow if it is not video/wanvideo_wrapper_22_wan_animate_preprocess_kijai?",
"Should direct writes under ready_templates/ be allowed by port convert --ready-id, or should ready-template promotion always be a separate manual step after emitting to out/scratchpads/?"
]
}
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.
WRITE ACCESS CONTRACT: You are running with auto-approved writes inside a writable workspace. Treat the working directory as fully writable. Do NOT preemptively skip or block tasks on permission, sandbox, or read-only grounds. Attempt every required edit; only report failure AFTER a real OS-level rejection from a specific shell command. Do not infer 'read-only' from absence of activity; absence is not denial. If a single shell command unexpectedly fails, retry with a different invocation before concluding the environment is restricted.
You are revising an implementation plan after critique and gate feedback.
Build a holistic VibeComfy template porting workbench/toolset, based on the failures seen while porting production Reigh workflows to VibeComfy. The toolset should make it easy to find/import source Comfy workflows, convert them into proper Python ready-template/scratchpad format, preserve provenance, infer and validate custom node packs, infer and HEAD-check model asset URLs, resolve UI-only/helper nodes like Note/MarkdownNote/SetNode/GetNode and similar reroute/broadcast helpers, detect positional widget aliases by comparing compiled API prompts with Comfy object_info/schema, surface missing required inputs before a RunPod burn, emit actionable reports and tests, and support battle-testing against both a simple template and the current WanAnimate production-parity template. It should be pragmatic: build the first useful slice now, use it immediately on the current failures, and document the remaining roadmap. Avoid raw JSON execution as the steady-state path; workflows should land as Python-esque VibeComfy ready templates/scratchpads. Include a strategy for integrating this into the live validation loop so future users avoid the same URL/model/custom-node/schema failures.
User notes and answers:
User added: discoverability is a first-class requirement. The VibeComfy porting toolset must make it obvious to humans and agents when to use it: command names/help, README/authoring docs, AGENTS.md or skill guidance, and failure/live-validation docs should all point to port check before manual template editing or expensive RunPod validation. The tool should document when to use check, convert, doctor/validate, model URL checks, custom-node pack discovery, and Python-template conversion.
code
Current plan (markdown):
# Implementation Plan: VibeComfy Template Porting Workbench
Overview
The new critique still does not show that the workbench is aimed at the wrong subsystem or root cause. The correct target remains a first-class vibecomfy port ... workflow over the existing conversion, schema, node-pack, model-asset, and ready-template machinery. The refinements are about preserving contracts at the edges: port convert needs a true scratchpad output mode distinct from ready-template output, filename-only API asset discovery must not change the legacy URL-bearing extract_from_raw_workflow(...) contract used by doctor and fetch, and agent discoverability must update the README-directed local skill copy as well as AGENTS/OpenAI guidance.
The first useful slice is a package-level vibecomfy.porting workbench plus a discoverable CLI surface. port check should be the obvious cheap preflight before manual Python-template editing or expensive RunPod validation. port convert should emit Python-esque VibeWorkflow scratchpads by default, and ready-template-shaped modules only when --ready-id is supplied. Existing vibecomfy convert, doctor, fetch, and ready-template materialization contracts should remain compatible unless they explicitly opt into the new workbench APIs.
Phase 1: Foundation - Report Shape, Source Loading, and Helper Semantics
Step 1: Add a porting report model (vibecomfy/porting/report.py)
Scope: Medium
Define dataclasses for PortReport, PortIssue, PortArtifact, NodePackSuggestion, AssetCandidate, and AssetCheckResult with stable JSON serialization.
Include source id/path, detected workflow shape, source hash, normalized API node count, emitted Python path, output mode (scratchpad or ready_template), helper-node diagnostics, custom-node suggestions, unresolved runtime class types, model asset candidates, schema issues, widget alias observations, and recommended next commands.
Keep issue severities aligned with current validation concepts: error, warning, and info.
Move the helper-node class set and helper-resolution diagnostics into a reusable module that knows about Note, MarkdownNote, SetNode, and GetNode.
Add a diagnostic pass that inspects the original IR before compile and reports unresolved GetNode / SetNode broadcasts instead of letting compile silently skip dangling helper references.
Expose a helper-stripped runtime class view for downstream diagnostics so custom-node pack inference does not treat Note, MarkdownNote, SetNode, or GetNode as missing installable node packs.
Keep VibeWorkflow.compile("api") behavior compatible: resolved helper broadcasts still rewrite to direct links; helper nodes still do not survive into API prompts.
Step 3: Add porting-only model asset analysis without changing legacy extractor contracts (vibecomfy/porting/assets.py, vibecomfy/model_assets.py)
Scope: Medium
Keep extract_from_raw_workflow(...) returning only URL-bearing dictionaries with name, url, and subdir, so existing doctor and fetch callers remain safe.
Add a new porting-only analyzer that merges URL-bearing assets from UI workflow properties.models, normalized API prompts, loaded scratchpad/ready-template metadata, and READY_REQUIREMENTS.
Add API-shaped filename discovery in the porting analyzer as AssetCandidate records with optional url, not as return values from extract_from_raw_workflow(...).
Mark filename-only candidates without URLs as actionable warnings in the port report rather than passing them to legacy fetch/download code.
Factor shared subdir/name normalization helpers only if useful, while preserving the public behavior of extract_from_raw_workflow(...) and entries_from_scratchpad_path(...).
Phase 2: Python Emission and Compatibility Boundaries
Extract reusable _node(...)-style emission primitives from tools/format_as_python.py into package code.
Preserve explicit node IDs, deterministic ordering, _extras for non-identifier inputs, registered input handling, and current override behavior.
Split package emission into two explicit modes:
emit_scratchpad_python(...): default for port convert, emits PORT_METADATA or equivalent provenance, uses WorkflowSource(... source_type="scratchpad"), and does not require READY_METADATA["ready_template"].
emit_ready_template_python(...): used only when --ready-id is supplied or by ready-template tooling, emits READY_METADATA, READY_REQUIREMENTS, and WorkflowSource(... source_type="ready_template").
Keep tools/format_as_python.py and tools/convert_ready_templates.py as compatibility wrappers around the ready-template emission mode.
Do not change the established vibecomfy convert contract in vibecomfy/commands/convert.py; the new explicit Python materialization behavior belongs to vibecomfy port convert first.
Step 5: Preserve both conversion contracts (vibecomfy/scratchpad_loader.py, vibecomfy/commands/convert.py, vibecomfy/commands/port.py)
Scope: Medium
Leave existing lightweight scratchpad rendering available for compatibility.
Implement port convert without --ready-id as true scratchpad emission: build() returns a VibeWorkflow with scratchpad provenance and no ready-template metadata requirement.
Implement port convert --ready-id kind/name as ready-template candidate emission: build() returns a VibeWorkflow with ready-template metadata and structured requirements.
Default examples and docs to out/scratchpads/... so promotion to ready_templates/ remains intentional.
Validate emitted Python by importing it, calling build(), compiling API, and running schema validation when available.
Phase 3: Diagnostics - Catch Current Failure Classes Before RunPod
Step 6: Add the workbench orchestrator (vibecomfy/porting/workbench.py)
Scope: Large
Implement analyze_source(...) to load ready ids, scratchpads, raw JSON paths, and indexed workflow references through existing loader/normalizer paths.
Preserve provenance in the report and emitted metadata: source path/id, source hash, original shape, source workflow id when known, converter version, output mode, and whether schema was available.
Run helper diagnostics before custom-node inference.
Run custom-node pack inference against the helper-stripped runtime class view, while reporting unresolved helper broadcasts separately as helper errors.
Run the porting-only model asset analyzer so filename-only API candidates become warnings without breaking legacy model asset callers.
Reuse workflow.validate(schema_provider=...) for schema issues and include formatted missing_required_input, unknown_input, unknown_class_type, invalid_link_shape, and type mismatch results in the report.
Reuse resolve_node_packs(...) / missing_packs_for_workflow(...) concepts, but pass only runtime-relevant class types after helper filtering.
Include pack name, repo, pip packages, and matched classes in the port report.
Treat unresolved runtime class types as hard port check errors.
Treat known helper/UI classes as helper diagnostics, never as missing custom-node packs.
Step 8: Model URL HEAD checks (vibecomfy/porting/assets.py)
Scope: Medium
Add opt-in URL checking for asset candidates that have URLs, using httpx.Client().head(..., follow_redirects=True) and a deterministic timeout.
Report status code, final redirected URL, missing URL fields, duplicate asset targets, and license-gated/404 cases.
Do not download model bodies.
Keep HEAD checks disabled in ordinary tests, validate, doctor, fetch, and run unless --head-check-models is explicitly passed through port check or port convert.
Step 9: Positional widget alias detection and shared schema source (vibecomfy/porting/widget_schema.py, vibecomfy/porting/widget_aliases.py, vibecomfy/ingest/normalize.py, vibecomfy/workflow.py, tools/_compile_equivalence.py)
Scope: Large
Move the committed widget schema and resolve_widget_name(...) into package code.
Update normalize_to_api, VibeWorkflow.compile, the package emitter, tools/format_as_python.py, tools/convert_ready_templates.py, and tools/_compile_equivalence.py to use the same package-level widget schema/alias source.
Prefer schema-derived input order from object_info when available; fall back to the committed static widget schema when offline.
Add a diagnostic pass that compares compiled API inputs against schema inputs and reports unresolved widget_N inputs where a required named input is missing or where parity tooling would otherwise see false drift.
Move existing Wan/WanAnimate positional aliases out of private workflow-only state while preserving current behavior.
Phase 4: CLI, Discoverability, and Live Validation Loop
Add python -m vibecomfy.cli port check <workflow> [--json] [--head-check-models] for no-write preflight.
Add python -m vibecomfy.cli port convert <workflow> --out out/scratchpads/name.py [--json] [--head-check-models] for scratchpad Python output.
Add python -m vibecomfy.cli port convert <workflow> --out ready_templates/kind/name.py --ready-id kind/name [--json] for ready-template candidate output.
Make command help explain when to use port check, port convert, doctor, validate, nodes install-plan, fetch, and --head-check-models.
Return nonzero for hard errors: unresolved runtime class types, unresolved helper broadcasts, schema-required missing inputs, failed Python build, failed emitted scratchpad/template validation, or failed model HEAD checks when the user requested them.
Step 11: Wire the live validation loop without making network checks mandatory (vibecomfy/commands/doctor.py, vibecomfy/commands/run.py, scripts/runpod_corpus_matrix.py)
Scope: Medium
Keep existing workflow.validate(schema_provider=...) as the hard gate before queueing runtime prompts.
Add doctor guidance that points users to port check when failures involve unknown classes, missing required inputs, helper-node issues, or model assets.
Add a cheap port-report summary to RunPod corpus matrix logs and copy the emitted scratchpad/report next to existing convert/validate logs.
Keep model URL HEAD checks opt-in and out of normal run, doctor, and fetch behavior.
Step 12: Make discoverability first-class and sync every agent guidance surface (README.md, docs/authoring.md, docs/adding_templates_models.md, docs/errors_and_doctor.md, docs/template_porting_workbench.md, AGENTS.md, .claude/skills/vibecomfy/SKILL.md, scripts/sync_agent_skill.py, tests/test_agent_skill_sync.py)
Scope: Medium
Add a new docs page for the porting workbench with a direct import -> port check -> port convert -> validate / doctor -> optional RunPod loop.
Update authoring and template docs so humans and agents start with port check before manual template editing or RunPod validation.
Update failure/live-validation docs to map common failures to commands: schema issues to port check/validate, custom nodes to nodes install-plan, model URLs to port check --head-check-models, Python materialization to port convert, and downloads to fetch only when URL-bearing assets are available.
Update the source agent guidance that feeds AGENTS/OpenAI/Claude-facing copies, then run python scripts/sync_agent_skill.py --apply so .claude/skills/vibecomfy/SKILL.md is refreshed.
Extend scripts/sync_agent_skill.py check mode or tests/test_agent_skill_sync.py so the README-directed .claude/skills/vibecomfy/SKILL.md local copy is checked for freshness.
Ensure command help text mirrors the docs so discoverability is present in both CLI and repository guidance.
Phase 5: Tests and Battle Targets
Step 13: Add focused unit and CLI tests (tests/test_porting_workbench.py, tests/test_cli.py, tests/test_workflow_core.py, tests/test_schema.py, tests/test_model_assets.py)
Scope: Large
Test a simple fixture based on image/z_image or a tiny synthetic workflow: report shape, provenance, scratchpad Python emission, import/build, compile, and validate.
Test video/wanvideo_wrapper_22_wan_animate_preprocess_kijai: helper nodes are diagnosed separately, helper nodes do not survive compiled API, no compiled API link points to a removed helper node, required real node packs are suggested, and detection model assets are reported.
Test custom-node inference ignores known helper/UI nodes but still fails unresolved runtime classes.
Test porting-only API-shaped workflow model asset candidates, including filename-only assets with missing URL warnings, without changing extract_from_raw_workflow(...) return shape.
Test widget alias diagnostics with a fake schema provider and keep existing Wan/WanAnimate alias expectations passing.
Test HEAD checks with injected/mocked HTTP behavior, not real network.
Add CLI smoke tests for port check --json, scratchpad-mode port convert --out ... --json, ready-template-mode port convert --ready-id ..., and command help discoverability.
Keep ready-template parity tests passing after widget schema migration.
Verify tools/convert_ready_templates.py --template ... --dry-run still uses the moved ready-template emitter and reports equivalent diffs.
Add regression coverage that vibecomfy convert keeps its existing lightweight contract while vibecomfy port convert emits explicit scratchpad Python by default.
Add regression coverage that ready-template emission is only used by port convert --ready-id and ready-template tooling.
Add freshness coverage for .claude/skills/vibecomfy/SKILL.md or the sync path that regenerates it.
Execution Order
Add report and helper diagnostics first, because helper filtering changes the correctness of every downstream diagnostic.
Add porting-only model asset analysis while preserving legacy extract_from_raw_workflow(...) behavior for doctor and fetch.
Split emitter code into explicit scratchpad and ready-template modes before wiring port convert.
Move widget schema code with compatibility wrappers and parity tests in the same change set.
Add the workbench orchestrator and port check before adding port convert writes.
Add opt-in HEAD checks after offline report behavior is covered.
Wire doctor / RunPod summaries after the report shape is stable.
Finish with discoverability docs, synced agent guidance, and battle-target tests.
Run ready-template and parity regressions: pytest -q tests/test_ready_templates.py plus python -m tools.convert_ready_templates --template image/qwen_image_2512 --dry-run.
Run agent guidance sync tests: python scripts/sync_agent_skill.py --check and pytest -q tests/test_agent_skill_sync.py.
Run node/model checks: pytest -q tests/test_nodes_install.py tests/test_models_registry.py.
"version": 3,
"timestamp": "2026-05-08T13:09:35Z",
"hash": "sha256:b7bfa4ee58dca431b3ed06c95f0b1cff4e2c576c9a13942349a83252e3d6a5cf",
"changes_summary": "Refined the plan to add an explicit scratchpad emission mode for port convert, keep legacy model asset extraction URL-bearing for doctor and fetch, move filename-only API asset discovery into porting-only analysis, and require syncing/testing the README-directed .claude/skills/vibecomfy/SKILL.md guidance surface.",
"flags_addressed": [
"issue_hints",
"scope",
"all_locations",
"callers",
"FLAG-004",
"FLAG-005",
"FLAG-006",
"correctness"
],
"questions": [
"What is the canonical source path or id for the current Reigh WanAnimate production-parity workflow if it is not video/wanvideo_wrapper_22_wan_animate_preprocess_kijai?",
"Should direct writes under ready_templates/ be allowed by port convert --ready-id, or should ready-template promotion always be a separate manual step after emitting to out/scratchpads/?"
],
"success_criteria": [
{
"criterion": "python -m vibecomfy.cli port check <workflow> --json returns a structured report with source provenance, schema issues, custom-node suggestions, model asset candidates, helper-node diagnostics, widget alias diagnostics, and recommended next commands.",
"priority": "must",
"requires": [
"run_shell",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --out <path> --json emits a scratchpad Python module whose build() returns a VibeWorkflow with source_type='scratchpad' and without requiring READY_METADATA['ready_template'].",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --ready-id kind/name --out <path> --json emits a ready-template candidate with READY_METADATA, READY_REQUIREMENTS, and source_type='ready_template'.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "The emitted Python module preserves provenance fields including original source path or id, source hash, detected shape, output mode, and ready id when supplied.",
"priority": "must",
"requires": [
"read_files",
"run_tests"
]
},
{
"criterion": "Legacy extract_from_raw_workflow(...) continues returning only URL-bearing asset dictionaries compatible with existing doctor and fetch callers.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Porting-only asset analysis reports API-shaped filename-only asset candidates as warnings without passing URL-less entries to legacy fetch/download paths.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "Custom-node pack inference ignores known helper/UI nodes and still reports unresolved runtime class types as hard errors.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags unresolved / helper broadcasts before compile can silently drop them.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The porting report flags missing required schema inputs before runtime queueing for workflows validated with an available schema provider.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "WanAnimate helper nodes (, , , ) do not survive compiled API output, no compiled API link points to a removed helper node, and helper classes are not reported as unresolved custom-node packs.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Positional alias handling is centralized and all callers, including , , the Python emitter, , and , use the shared source.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Model asset HEAD checks are opt-in, use injectable/mocked HTTP behavior in tests, and report status without downloading model bodies.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Existing tests still pass, while new tests prove explicit scratchpad Python materialization by default and ready-template materialization only with .",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Focused tests for the simple template path and the WanAnimate production-parity path pass.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "CLI help and repository docs make discoverable as the recommended first preflight before manual template editing or RunPod validation.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "AGENTS/OpenAI/Claude guidance, including , is updated or regenerated and covered by sync/freshness checks.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"run_tests"
]
},
{
"criterion": "Existing local test suite passes with .",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The new porting modules keep CLI formatting separate from analysis logic and avoid duplicating node/model/schema inference code already present in the package.",
"priority": "should",
"requires": [
"parse_diff",
"subjective_judgment"
]
},
{
"criterion": "The docs give future users and agents a short live validation loop that starts with , proceeds to Python scratchpad conversion, and only then spends RunPod time.",
"priority": "should",
"requires": [
"read_files",
"subjective_judgment"
]
},
{
"criterion": "Optional real network HEAD checks pass for the current model asset URLs.",
"priority": "info",
"requires": [
"run_shell",
"observe_runtime_logs"
]
}
],
"assumptions": [
"The dedicated public UX is settled as .",
"The first useful slice should be a CLI/tooling workbench inside VibeComfy, not a GUI.",
"Normal tests must remain deterministic and must not require ComfyUI, RunPod, network access, model files, or installed custom nodes.",
"Existing , , and behavior should remain compatible.",
"Explicit Python scratchpad materialization belongs to by default.",
"Ready-template-shaped emission requires or existing ready-template tooling.",
"Raw external JSON may be accepted as input, but the steady-state output should be a Python scratchpad or ready-template module.",
"The current WanAnimate battle-test target is unless the user supplies a different production-parity source.",
"Network URL HEAD checks should stay opt-in because upstream hosts and license gates can make them flaky in routine validation."
],
"delta_from_previous_percent": 41.28,
"structure_warnings": []
}
code
Gate summary:
{
"passed": false,
"criteria_check": {
"count": 20,
"items": [
{
"criterion": "python -m vibecomfy.cli port check <workflow> --json returns a structured report with source provenance, schema issues, custom-node suggestions, model asset candidates, helper-node diagnostics, widget alias diagnostics, and recommended next commands.",
"priority": "must",
"requires": [
"run_shell",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --out <path> --json emits a scratchpad Python module whose build() returns a VibeWorkflow with source_type='scratchpad' and without requiring READY_METADATA['ready_template'].",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --ready-id kind/name --out <path> --json emits a ready-template candidate with READY_METADATA, READY_REQUIREMENTS, and source_type='ready_template'.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "The emitted Python module preserves provenance fields including original source path or id, source hash, detected shape, output mode, and ready id when supplied.",
"priority": "must",
"requires": [
"read_files",
"run_tests"
]
},
{
"criterion": "Legacy extract_from_raw_workflow(...) continues returning only URL-bearing asset dictionaries compatible with existing doctor and fetch callers.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Porting-only asset analysis reports API-shaped filename-only asset candidates as warnings without passing URL-less entries to legacy fetch/download paths.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "Custom-node pack inference ignores known helper/UI nodes and still reports unresolved runtime class types as hard errors.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags unresolved SetNode / GetNode helper broadcasts before compile can silently drop them.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The porting report flags missing required schema inputs before runtime queueing for workflows validated with an available schema provider.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "WanAnimate helper nodes (Note, MarkdownNote, SetNode, GetNode) do not survive compiled API output, no compiled API link points to a removed helper node, and helper classes are not reported as unresolved custom-node packs.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Positional widget_N alias handling is centralized and all callers, including , , the Python emitter, , and , use the shared source.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Model asset HEAD checks are opt-in, use injectable/mocked HTTP behavior in tests, and report status without downloading model bodies.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Existing tests still pass, while new tests prove explicit scratchpad Python materialization by default and ready-template materialization only with .",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Focused tests for the simple template path and the WanAnimate production-parity path pass.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "CLI help and repository docs make discoverable as the recommended first preflight before manual template editing or RunPod validation.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "AGENTS/OpenAI/Claude guidance, including , is updated or regenerated and covered by sync/freshness checks.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"run_tests"
]
},
{
"criterion": "Existing local test suite passes with .",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The new porting modules keep CLI formatting separate from analysis logic and avoid duplicating node/model/schema inference code already present in the package.",
"priority": "should",
"requires": [
"parse_diff",
"subjective_judgment"
]
},
{
"criterion": "The docs give future users and agents a short live validation loop that starts with , proceeds to Python scratchpad conversion, and only then spends RunPod time.",
"priority": "should",
"requires": [
"read_files",
"subjective_judgment"
]
},
{
"criterion": "Optional real network HEAD checks pass for the current model asset URLs.",
"priority": "info",
"requires": [
"run_shell",
"observe_runtime_logs"
]
}
]
},
"preflight_results": {
"project_dir_exists": true,
"project_dir_writable": true,
"success_criteria_present": true,
"claude_available": true,
"codex_available": true
},
"unresolved_flags": [
{
"id": "issue_hints",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: issue_hints: Checked the exact validation command in the revised plan against . The plan says to run , but the script currently supports only ; check mode is the default with no flag. Unless the implementation adds a alias, the validation order contains an invalid command.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "issue_hints: Checked the exact validation command in the revised plan against . The plan says to run , but the script currently supports only ; check mode is the default with no flag. Unless the implementation adds a alias, the validation order contains an invalid command.",
"raised_in": "critique_v3.json",
"status": "open",
"severity": "significant",
"verified": true,
"addressed_in": "plan_v3.md",
"verified_in": "critique_v3.json"
},
{
"id": "all_locations",
"concern": "Does the change touch all locations AND supporting infrastructure?: all_locations: Checked and found no option, only ; default execution is check mode. The revised validation order should either use or include a small script change adding , otherwise the prescribed validation command will fail before tests run.",
"category": "completeness",
"severity_hint": "likely-significant",
"evidence": "all_locations: Checked and found no option, only ; default execution is check mode. The revised validation order should either use or include a small script change adding , otherwise the prescribed validation command will fail before tests run.",
"raised_in": "critique_v3.json",
"status": "open",
"severity": "significant",
"verified": true,
"addressed_in": "plan_v3.md",
"verified_in": "critique_v3.json"
},
{
"id": "correctness",
"concern": "Are the proposed changes technically correct?: correctness: Checked the widget mapping plan against the current contract. That file explicitly says positional widget schema omits link-only inputs and includes only widget-type inputs, but the revised plan still says to prefer schema-derived input order from without spelling out filtering of link-only inputs such as MODEL/CLIP/IMAGE. Because represents all object_info inputs together and does not currently mark whether an input is a UI widget, a naive object_info order can reintroduce positional shifts instead of detecting them.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": "correctness: Checked the widget mapping plan against the current contract. That file explicitly says positional widget schema omits link-only inputs and includes only widget-type inputs, but the revised plan still says to prefer schema-derived input order from without spelling out filtering of link-only inputs such as MODEL/CLIP/IMAGE. Because represents all object_info inputs together and does not currently mark whether an input is a UI widget, a naive object_info order can reintroduce positional shifts instead of detecting them.",
"raised_in": "critique_v3.json",
"status": "open",
"severity": "significant",
"verified": true,
"addressed_in": "plan_v3.md",
"verified_in": "critique_v3.json"
},
{
"id": "FLAG-008",
"concern": "widget alias schema source: preferring raw object_info input order for is underspecified because object_info includes link-only inputs as well as UI widget inputs, while positional widget mapping must use widget-only order.",
"category": "correctness",
"severity_hint": "likely-significant",
"evidence": " documents that link-only inputs are not included because only widget-type inputs count for positional indexing; flattens object_info inputs into a single dict without an explicit widget/link-position marker.",
"raised_in": "critique_v3.json",
"status": "open",
"severity": "significant",
"verified": false
}
],
"recommendation": "ITERATE",
"rationale": "The plan is close, and the weighted score improved sharply, but the remaining significant flags are still actionable plan defects. The invalid validation command is a direct execution failure, and the widget alias plan still risks a real correctness regression by deriving positional widget order from raw without filtering out link-only inputs. These are straightforward to correct in the plan; no human tiebreaker or escalation is needed.",
"signals_assessment": "Weighted score improved from 13.0 -> 14.0 -> 4.0 with 10 flags resolved and 4 significant flags still open. The plan delta is now smaller at 41.28%, there are no recurring reopened critiques, and preflight remains healthy: project exists, workspace is writable, success criteria are present, and required agents are available. The remaining blockers are concrete and bounded, so another targeted iteration is the right continuation decision.",
"warnings": [
"Replace with the actual default check-mode command, or explicitly add a alias and test it.",
"Revise widget-schema centralization to use widget-only positional order, never raw input order that includes link-only inputs like MODEL, CLIP, IMAGE, or VAE.",
"Add a success criterion or test proving widget positional mapping excludes link-only inputs when object_info is available."
],
"settled_decisions": [
{
"id": "dedicated-port-command",
"decision": "Keep as the workbench UX.",
"rationale": "The command remains the clearest discoverability mechanism and avoids destabilizing existing , , , and behavior."
},
{
"id": "scratchpad-default-ready-template-explicit",
"decision": " defaults to scratchpad output; ready-template output requires .",
"rationale": "This preserves existing conversion contracts while giving the new workbench an explicit promotion path."
},
{
"id": "legacy-model-assets-contract",
"decision": "Do not return URL-less filename candidates from legacy .",
"rationale": "Existing and callers assume URL-bearing entries; filename-only candidates belong in porting-only asset analysis."
}
],
"override_forced": false,
"orchestrator_guidance": "Score improving (14.0 -> 4.0). Continue to revise. Verify unresolved flags against the plan and project code before accepting.",
"robustness": "standard",
"signals": {
"iteration": 3,
"idea": "Build a holistic VibeComfy template porting workbench/toolset, based on the failures seen while porting production Reigh workflows to VibeComfy. The toolset should make it easy to find/import source Comfy workflows, convert them into proper Python ready-template/scratchpad format, preserve provenance, infer and validate custom node packs, infer and HEAD-check model asset URLs, resolve UI-only/helper nodes like Note/MarkdownNote/SetNode/GetNode and similar reroute/broadcast helpers, detect positional widget aliases by comparing compiled API prompts with Comfy object_info/schema, surface missing required inputs before a RunPod burn, emit actionable reports and tests, and support battle-testing against both a simple template and the current WanAnimate production-parity template. It should be pragmatic: build the first useful slice now, use it immediately on the current failures, and document the remaining roadmap. Avoid raw JSON execution as the steady-state path; workflows should land as Python-esque VibeComfy ready templates/scratchpads. Include a strategy for integrating this into the live validation loop so future users avoid the same URL/model/custom-node/schema failures.",
"significant_flags": 4,
"unresolved_flags": [
{
"id": "issue_hints",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: issue_hints: Checked the exact validation command in the revised plan against . The plan says to run , but the script currently supports only ; check mode is the default with no flag. Unless the implementation adds a alias, the validation order contains an invalid command.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "all_locations",
"concern": "Does the change touch all locations AND supporting infrastructure?: all_locations: Checked and found no option, only ; default execution is check mode. The revised validation order should either use or include a small script change adding , otherwise the prescribed validation command will fail before tests run.",
"category": "completeness",
"severity": "significant",
"status": "open"
},
{
"id": "correctness",
"concern": "Are the proposed changes technically correct?: correctness: Checked the widget mapping plan against the current contract. That file explicitly says positional widget schema omits link-only inputs and includes only widget-type inputs, but the revised plan still says to prefer schema-derived input order from without spelling out filtering of link-only inputs such as MODEL/CLIP/IMAGE. Because represents all object_info inputs together and does not currently mark whether an input is a UI widget, a naive object_info order can reintroduce positional shifts instead of detecting them.",
"category": "correctness",
"severity": "significant",
"status": "open"
},
{
"id": "FLAG-008",
"concern": "widget alias schema source: preferring raw object_info input order for is underspecified because object_info includes link-only inputs as well as UI widget inputs, while positional widget mapping must use widget-only order.",
"category": "correctness",
"severity": "significant",
"status": "open"
}
],
"resolved_flags": [
{
"id": "FLAG-001",
"concern": "custom-node inference: currently treats helper/UI nodes as unresolved class types; making unresolved classes a hard error will fail the WanAnimate target unless the workbench filters helper nodes or analyzes the compiled helper-stripped graph for pack inference.",
"resolution": "Revised the plan to separate helper-node diagnostics from custom-node pack inference, cover API-shaped model asset extraction, preserve existing conversion caller contracts, include parity tooling in widget-schema migration, and add discoverability as a first-class CLI/docs/AGENTS requirement."
},
{
"id": "FLAG-002",
"concern": "model asset coverage: the plan relies on , but that function returns no assets for API-shaped workflows, so API prompt sources and normalized workflows can produce incomplete model URL/provenance reports.",
"resolution": "Revised the plan to separate helper-node diagnostics from custom-node pack inference, cover API-shaped model asset extraction, preserve existing conversion caller contracts, include parity tooling in widget-schema migration, and add discoverability as a first-class CLI/docs/AGENTS requirement."
},
{
"id": "FLAG-003",
"concern": "widget alias migration: the plan omits from the centralization list even though ready-template conversion uses it to compare compiled output and it imports .",
"resolution": " imports from , and imports from that equivalence module."
},
{
"id": "correctness-1",
"concern": "Are the proposed changes technically correct?: correctness: Ran against the current repo. It suggests the real packs, but also returns unresolved helper/UI classes including , , , and ; because Step 4 says unresolved classes are hard errors for , the planned WanAnimate battle target would fail before the helper-node resolution pass unless pack inference is run on the compiled/helper-stripped API or explicitly excludes known helper classes.",
"resolution": "Revised the plan to separate helper-node diagnostics from custom-node pack inference, cover API-shaped model asset extraction, preserve existing conversion caller contracts, include parity tooling in widget-schema migration, and add discoverability as a first-class CLI/docs/AGENTS requirement."
},
{
"id": "correctness-2",
"concern": "Are the proposed changes technically correct?: correctness: Checked and confirmed compile-time helper handling already drops , , , and , and rewrites resolvable Set/Get broadcasts into direct links. The plan's Step 6 is directionally consistent with existing behavior, but the diagnostic needs to inspect the unresolved cases before compile silently drops them; otherwise dangling helper references may be skipped rather than reported as errors.",
"resolution": "Revised the plan to separate helper-node diagnostics from custom-node pack inference, cover API-shaped model asset extraction, preserve existing conversion caller contracts, include parity tooling in widget-schema migration, and add discoverability as a first-class CLI/docs/AGENTS requirement."
},
{
"id": "scope",
"concern": "Search for related code that handles the same concept. Is the reported issue a symptom of something broader?: scope: Checked model asset callers beyond the planned workbench. and both fall back to , and their warning/fetch paths assume every returned entry has a usable . The revised plan expands to infer API-shaped filename-only assets and mark missing URLs as warnings, but unless those warning-only candidates are kept out of the legacy extractor's return shape or all callers are updated, existing doctor/fetch behavior can break.",
"resolution": "Refined the plan to add an explicit scratchpad emission mode for , keep legacy model asset extraction URL-bearing for and , move filename-only API asset discovery into porting-only analysis, and require syncing/testing the README-directed guidance surface."
},
{
"id": "callers",
"concern": "Find the callers of the changed function. What arguments do they actually pass? Does the fix handle all of them?: callers: Checked callers. is currently used for structured ready-template requirements, while returns only dicts with , , and ; and index . If Step 3 changes itself to return filename-only API candidates without URLs, those existing callers will need defensive handling or the new filename-only candidates should be emitted only through .",
"resolution": "Refined the plan to add an explicit scratchpad emission mode for , keep legacy model asset extraction URL-bearing for and , move filename-only API asset discovery into porting-only analysis, and require syncing/testing the README-directed guidance surface."
},
{
"id": "FLAG-004",
"concern": "port-convert output mode: the plan extracts the current ready-template emitter for default scratchpad output, but the existing emitter assumes and ; needs an explicit scratchpad emission mode when is absent.",
"resolution": "Refined the plan to add an explicit scratchpad emission mode for , keep legacy model asset extraction URL-bearing for and , move filename-only API asset discovery into porting-only analysis, and require syncing/testing the README-directed guidance surface."
},
{
"id": "FLAG-005",
"concern": "agent discoverability sync: updating only AGENTS.md or OpenAI metadata may leave stale even though README tells agents to read that local skill file.",
"resolution": "Refined the plan to add an explicit scratchpad emission mode for , keep legacy model asset extraction URL-bearing for and , move filename-only API asset discovery into porting-only analysis, and require syncing/testing the README-directed guidance surface."
},
{
"id": "FLAG-006",
"concern": "model asset API extraction: adding filename-only API asset candidates to can break existing doctor/fetch callers that assume every returned asset has a URL.",
"resolution": "Refined the plan to add an explicit scratchpad emission mode for , keep legacy model asset extraction URL-bearing for and , move filename-only API asset discovery into porting-only analysis, and require syncing/testing the README-directed guidance surface."
}
],
"weighted_score": 4.0,
"weighted_history": [
13.0,
14.0
],
"plan_delta_from_previous": 41.28,
"recurring_critiques": [],
"scope_creep_flags": [],
"loop_summary": "Iteration 3. Weighted score trajectory: 13.0 -> 14.0 -> 4.0. Plan deltas: 76.5%, 41.3%. Recurring critiques: 0. Resolved flags: 10. Open significant flags: 4.",
"debt_overlaps": [],
"escalated_debt_subsystems": []
},
"flag_resolutions": [],
"resolved_flag_ids": [],
"resolution_summary": "",
"reprompted": false
}
code
Open significant flags:
[
{
"id": "issue_hints",
"severity": "significant",
"status": "open",
"concern": "Did the work fully address the issue hints, user notes, and approved plan requirements?: issue_hints: Checked the exact validation command in the revised plan against scripts/sync_agent_skill.py. The plan says to run python scripts/sync_agent_skill.py --check, but the script currently supports only --apply; check mode is the default with no flag. Unless the implementation adds a --check alias, the validation order contains an invalid command.",
"evidence": "issue_hints: Checked the exact validation command in the revised plan against scripts/sync_agent_skill.py. The plan says to run python scripts/sync_agent_skill.py --check, but the script currently supports only --apply; check mode is the default with no flag. Unless the implementation adds a --check alias, the validation order contains an invalid command."
},
{
"id": "all_locations",
"severity": "significant",
"status": "open",
"concern": "Does the change touch all locations AND supporting infrastructure?: all_locations: Checked scripts/sync_agent_skill.py --help and found no --check option, only --apply; default execution is check mode. The revised validation order should either use python scripts/sync_agent_skill.py or include a small script change adding --check, otherwise the prescribed validation command will fail before tests run.",
"evidence": "all_locations: Checked scripts/sync_agent_skill.py --help and found no --check option, only --apply; default execution is check mode. The revised validation order should either use python scripts/sync_agent_skill.py or include a small script change adding --check, otherwise the prescribed validation command will fail before tests run."
},
{
"id": "correctness",
"severity": "significant",
"status": "open",
"concern": "Are the proposed changes technically correct?: correctness: Checked the widget mapping plan against the current tools/_widget_schema.py contract. That file explicitly says positional widget schema omits link-only inputs and includes only widget-type inputs, but the revised plan still says to prefer schema-derived input order from object_info without spelling out filtering of link-only inputs such as MODEL/CLIP/IMAGE. Because vibecomfy/schema/provider.py represents all object_info inputs together and does not currently mark whether an input is a UI widget, a naive object_info order can reintroduce positional shifts instead of detecting them.",
"evidence": "correctness: Checked the widget mapping plan against the current tools/_widget_schema.py contract. That file explicitly says positional widget schema omits link-only inputs and includes only widget-type inputs, but the revised plan still says to prefer schema-derived input order from without spelling out filtering of link-only inputs such as MODEL/CLIP/IMAGE. Because represents all object_info inputs together and does not currently mark whether an input is a UI widget, a naive object_info order can reintroduce positional shifts instead of detecting them."
},
{
"id": "FLAG-008",
"severity": "significant",
"status": "open",
"concern": "widget alias schema source: preferring raw object_info input order for is underspecified because object_info includes link-only inputs as well as UI widget inputs, while positional widget mapping must use widget-only order.",
"evidence": " documents that link-only inputs are not included because only widget-type inputs count for positional indexing; flattens object_info inputs into a single dict without an explicit widget/link-position marker."
}
]
code
Requirements:
- Before addressing individual flags, check: does any flag suggest the plan is targeting the wrong code or the wrong root cause? If so, consider whether the plan needs a new approach rather than adjustments. Explain your reasoning.
- Update the plan to address the significant issues.
- Keep the plan readable and executable.
- Return flags_addressed with the exact flag IDs you addressed.
- Include `changes_summary` as a short plain-English summary of what changed in the revision. If there were no concrete flags, say that explicitly (for example: `No critique flags were raised; refined wording and kept the plan aligned for execution.`).
- Preserve or improve success criteria quality. Each criterion must have a `priority` of `must`, `should`, or `info`. Promote or demote priorities if critique feedback reveals a criterion was over- or under-weighted.
- Each success criterion should include a `requires` field listing the capabilities needed for verification. Valid capability strings: `run_shell`, `read_files`, `run_tests`, `parse_diff`, `read_build_output`, `run_linter` (container), `drive_browser`, `inspect_runtime_ui`, `observe_runtime_logs`, `subjective_judgment`, `verify_physical_device` (human). `must` criteria MUST have non-empty `requires`. Example: `{"criterion": "All tests pass", "priority": "must", "requires": ["run_tests"]}`.
- Verify that the plan remains aligned with the user's original intent, not just internal plan quality.
- Remove unjustified scope growth. If critique raised scope creep, narrow the plan back to the original idea unless the broader work is strictly required.
- Maintain the structural template: H1 title, ## Overview, phase sections with numbered step sections, ## Execution Order or ## Validation Order.
- CRITICAL: Your entire revised plan markdown (all sections) must be output as the `plan` field in the structured output. The prose response must not contain the plan text.
- CRITICAL: Return only the structured JSON object for the schema fields `plan`, `changes_summary`, `flags_addressed`, `assumptions`, `success_criteria`, and `questions`. Do not add commentary before or after the JSON object.
Plan template — simple format (adapt to the actual repo and scope):
md
# Implementation Plan: [Title]
## Overview
Summarize the goal, current repository shape, and the constraints that matter.
## Main Phase
### Step 1: Audit the current behavior (`megaplan/prompts.py`)
**Scope:** Small
1. **Inspect** the current implementation and call out the exact insertion points (`megaplan/prompts.py:29`).
### Step 2: Add the first change (`megaplan/evaluation.py`)
**Scope:** Medium
1. **Implement** the smallest viable change with exact file references (`megaplan/evaluation.py:1`).
2. **Capture** any tricky behavior with a short example.
```python
issues = validate_plan_structure(plan_text)
```
### Step 3: Wire downstream behavior (`megaplan/handlers.py`, `megaplan/workers.py`)
**Scope:** Medium
1. **Update** the runtime flow in the touched files (`megaplan/handlers.py:400`, `megaplan/workers.py:199`).
### Step 4: Prove the change (`tests/test_evaluation.py`, `tests/test_megaplan.py`)
**Scope:** Small
1. **Run** the cheapest targeted checks first (`tests/test_evaluation.py:1`).
2. **Finish** with broader verification once the wiring is in place (`tests/test_megaplan.py:1`).
## Execution Order
1. Update prompts and mocks before enforcing stricter validation.
2. Land higher-risk wiring after the validator and tests are ready.
## Validation Order
1. Start with focused unit tests.
2. Run the broader suite after the flow changes are in place.
For complex plans, use multiple phases:
md
## Phase 1: Foundation — Dependencies, DB, Types
### Step 1: Install dependencies (`package.json`)
...
### Step 2: Create database migration (`supabase/migrations/`)
...
## Phase 2: Core Integration
### Step 3: Port the main component (`src/components/`)
...
Template guidance:
Simple plans: use ## Main Phase with ### Step N: sections underneath.
Complex plans: use multiple ## Phase N: sections, each containing ### Step N: steps. Step numbers are global (not per-phase).
The flat ## Step N: format (without phases) also works for backwards compatibility.
Key invariants: one H1 title, one ## Overview, numbered step sections (### Step N: or ## Step N:), and at least one ordering section.
{
"plan": "# Implementation Plan: VibeComfy Template Porting Workbench\n\n## Overview\nThe remaining critique still does not show that the workbench is aimed at the wrong subsystem or root cause. The correct target remains a first-class vibecomfy port ... workflow over the existing conversion, schema, node-pack, model-asset, and ready-template machinery. The final refinements are execution details: use the actual default check mode for scripts/sync_agent_skill.py, and keep positional widget mapping based on widget-only order rather than raw object_info input order, because object_info includes link-only inputs that do not correspond to widgets_values positions.\n\nThe first useful slice is a package-level vibecomfy.porting workbench plus a discoverable CLI surface. port check should be the obvious cheap preflight before manual Python-template editing or expensive RunPod validation. port convert should emit Python-esque VibeWorkflow scratchpads by default, and ready-template-shaped modules only when --ready-id is supplied. Existing vibecomfy convert, doctor, fetch, and ready-template materialization contracts should remain compatible unless they explicitly opt into the new workbench APIs.\n\n## Phase 1: Foundation - Report Shape, Source Loading, and Helper Semantics\n\n### Step 1: Add a porting report model (vibecomfy/porting/report.py)\nScope: Medium\n1. Define dataclasses for PortReport, PortIssue, PortArtifact, NodePackSuggestion, AssetCandidate, and AssetCheckResult with stable JSON serialization.\n2. Include source id/path, detected workflow shape, source hash, normalized API node count, emitted Python path, output mode (scratchpad or ready_template), helper-node diagnostics, custom-node suggestions, unresolved runtime class types, model asset candidates, schema issues, widget alias observations, and recommended next commands.\n3. Keep issue severities aligned with current validation concepts: error, warning, and info.\n\n### Step 2: Centralize helper/UI-node classification (vibecomfy/porting/helpers.py, vibecomfy/workflow.py)\nScope: Medium\n1. Move the helper-node class set and helper-resolution diagnostics into a reusable module that knows about Note, MarkdownNote, SetNode, and GetNode.\n2. Add a diagnostic pass that inspects the original IR before compile and reports unresolved GetNode / SetNode broadcasts instead of letting compile silently skip dangling helper references.\n3. Expose a helper-stripped runtime class view for downstream diagnostics so custom-node pack inference does not treat Note, MarkdownNote, SetNode, or GetNode as missing installable node packs.\n4. Keep VibeWorkflow.compile(\"api\") behavior compatible: resolved helper broadcasts still rewrite to direct links; helper nodes still do not survive into API prompts.\n\n### Step 3: Add porting-only model asset analysis without changing legacy extractor contracts (vibecomfy/porting/assets.py, vibecomfy/model_assets.py)\nScope: Medium\n1. Keep extract_from_raw_workflow(...) returning only URL-bearing dictionaries with name, url, and subdir, so existing doctor and fetch callers remain safe.\n2. Add a new porting-only analyzer that merges URL-bearing assets from UI workflow properties.models, normalized API prompts, loaded scratchpad/ready-template metadata, and READY_REQUIREMENTS.\n3. Add API-shaped filename discovery in the porting analyzer as AssetCandidate records with optional url, not as return values from extract_from_raw_workflow(...).\n4. Mark filename-only candidates without URLs as actionable warnings in the port report rather than passing them to legacy fetch/download code.\n5. Factor shared subdir/name normalization helpers only if useful, while preserving the public behavior of extract_from_raw_workflow(...) and entries_from_scratchpad_path(...).\n\n## Phase 2: Python Emission and Compatibility Boundaries\n\n### Step 4: Move reusable emission primitives without forcing ready-template semantics (vibecomfy/porting/emitter.py, tools/format_as_python.py, tools/convert_ready_templates.py)\nScope: Large\n1. Extract reusable _node(...)-style emission primitives from tools/format_as_python.py into package code.\n2. Preserve explicit node IDs, deterministic ordering, _extras for non-identifier inputs, registered input handling, and current override behavior.\n3. Split package emission into two explicit modes:\n - emit_scratchpad_python(...): default for port convert, emits PORT_METADATA or equivalent provenance, uses WorkflowSource(... source_type=\"scratchpad\"), and does not require READY_METADATA[\"ready_template\"].\n - emit_ready_template_python(...): used only when --ready-id is supplied or by ready-template tooling, emits READY_METADATA, READY_REQUIREMENTS, and WorkflowSource(... source_type=\"ready_template\").\n4. Keep tools/format_as_python.py and tools/convert_ready_templates.py as compatibility wrappers around the ready-template emission mode.\n5. Do not change the established vibecomfy convert contract in vibecomfy/commands/convert.py; the new explicit Python materialization behavior belongs to vibecomfy port convert first.\n\n### Step 5: Preserve both conversion contracts (vibecomfy/scratchpad_loader.py, vibecomfy/commands/convert.py, vibecomfy/commands/port.py)\nScope: Medium\n1. Leave existing lightweight scratchpad rendering available for compatibility.\n2. Implement port convert without --ready-id as true scratchpad emission: build() returns a VibeWorkflow with scratchpad provenance and no ready-template metadata requirement.\n3. Implement port convert --ready-id kind/name as ready-template candidate emission: build() returns a VibeWorkflow with ready-template metadata and structured requirements.\n4. Default examples and docs to out/scratchpads/... so promotion to ready_templates/ remains intentional.\n5. Validate emitted Python by importing it, calling build(), compiling API, and running schema validation when available.\n\n## Phase 3: Diagnostics - Catch Current Failure Classes Before RunPod\n\n### Step 6: Add the workbench orchestrator (vibecomfy/porting/workbench.py)\nScope: Large\n1. Implement analyze_source(...) to load ready ids, scratchpads, raw JSON paths, and indexed workflow references through existing loader/normalizer paths.\n2. Preserve provenance in the report and emitted metadata: source path/id, source hash, original shape, source workflow id when known, converter version, output mode, and whether schema was available.\n3. Run helper diagnostics before custom-node inference.\n4. Run custom-node pack inference against the helper-stripped runtime class view, while reporting unresolved helper broadcasts separately as helper errors.\n5. Run the porting-only model asset analyzer so filename-only API candidates become warnings without breaking legacy model asset callers.\n6. Reuse workflow.validate(schema_provider=...) for schema issues and include formatted missing_required_input, unknown_input, unknown_class_type, invalid_link_shape, and type mismatch results in the report.\n\n### Step 7: Custom node pack inference (vibecomfy/porting/workbench.py, vibecomfy/node_packs_install.py)\nScope: Small\n1. Reuse resolve_node_packs(...) / missing_packs_for_workflow(...) concepts, but pass only runtime-relevant class types after helper filtering.\n2. Include pack name, repo, pip packages, and matched classes in the port report.\n3. Treat unresolved runtime class types as hard port check errors.\n4. Treat known helper/UI classes as helper diagnostics, never as missing custom-node packs.\n\n### Step 8: Model URL HEAD checks (vibecomfy/porting/assets.py)\nScope: Medium\n1. Add opt-in URL checking for asset candidates that have URLs, using httpx.Client().head(..., follow_redirects=True) and a deterministic timeout.\n2. Report status code, final redirected URL, missing URL fields, duplicate asset targets, and license-gated/404 cases.\n3. Do not download model bodies.\n4. Keep HEAD checks disabled in ordinary tests, validate, doctor, fetch, and run unless --head-check-models is explicitly passed through port check or port convert.\n\n### Step 9: Positional widget alias detection and widget-only schema source (vibecomfy/porting/widget_schema.py, vibecomfy/porting/widget_aliases.py, vibecomfy/ingest/normalize.py, vibecomfy/workflow.py, tools/_compile_equivalence.py)\nScope: Large\n1. Move the committed widget-only schema and resolve_widget_name(...) into package code.\n2. Preserve the current contract that positional widget schemas omit link-only inputs such as MODEL, CLIP, IMAGE, VAE, LATENT, and other socket inputs; only UI widget inputs may participate in widgets_values positional indexing.\n3. Update normalize_to_api, VibeWorkflow.compile, the package emitter, tools/format_as_python.py, tools/convert_ready_templates.py, and tools/_compile_equivalence.py to use the same package-level widget-only schema/alias source.\n4. Do not derive positional widget order from raw object_info input order unless the provider exposes enough metadata to distinguish widget inputs from link-only socket inputs. Until then, use object_info for validation and missing-input diagnostics, not for unfiltered positional indexing.\n5. Add a diagnostic pass that compares compiled API inputs against schema inputs and reports unresolved widget_N inputs where a required named widget input is missing or where parity tooling would otherwise see false drift.\n6. Add tests proving link-only object_info inputs do not shift widget positions.\n7. Move existing Wan/WanAnimate positional aliases out of private workflow-only state while preserving current behavior.\n\n## Phase 4: CLI, Discoverability, and Live Validation Loop\n\n### Step 10: Add explicit CLI entry points (vibecomfy/commands/port.py, vibecomfy/commands/__init__.py)\nScope: Medium\n1. Register port as an explicit command in COMMANDS.\n2. Add python -m vibecomfy.cli port check <workflow> [--json] [--head-check-models] for no-write preflight.\n3. Add python -m vibecomfy.cli port convert <workflow> --out out/scratchpads/name.py [--json] [--head-check-models] for scratchpad Python output.\n4. Add python -m vibecomfy.cli port convert <workflow> --out ready_templates/kind/name.py --ready-id kind/name [--json] for ready-template candidate output.\n5. Make command help explain when to use port check, port convert, doctor, validate, nodes install-plan, fetch, and --head-check-models.\n6. Return nonzero for hard errors: unresolved runtime class types, unresolved helper broadcasts, schema-required missing inputs, failed Python build, failed emitted scratchpad/template validation, or failed model HEAD checks when the user requested them.\n\n### Step 11: Wire the live validation loop without making network checks mandatory (vibecomfy/commands/doctor.py, vibecomfy/commands/run.py, scripts/runpod_corpus_matrix.py)\nScope: Medium\n1. Keep existing workflow.validate(schema_provider=...) as the hard gate before queueing runtime prompts.\n2. Add doctor guidance that points users to port check when failures involve unknown classes, missing required inputs, helper-node issues, or model assets.\n3. Add a cheap port-report summary to RunPod corpus matrix logs and copy the emitted scratchpad/report next to existing convert/validate logs.\n4. Keep model URL HEAD checks opt-in and out of normal run, doctor, and fetch behavior.\n\n### Step 12: Make discoverability first-class and sync every agent guidance surface (README.md, docs/authoring.md, docs/adding_templates_models.md, docs/errors_and_doctor.md, docs/template_porting_workbench.md, AGENTS.md, .claude/skills/vibecomfy/SKILL.md, scripts/sync_agent_skill.py, tests/test_agent_skill_sync.py)\nScope: Medium\n1. Add a new docs page for the porting workbench with a direct import -> port check -> port convert -> validate / doctor -> optional RunPod loop.\n2. Update authoring and template docs so humans and agents start with port check before manual template editing or RunPod validation.\n3. Update failure/live-validation docs to map common failures to commands: schema issues to port check/validate, custom nodes to nodes install-plan, model URLs to port check --head-check-models, Python materialization to port convert, and downloads to fetch only when URL-bearing assets are available.\n4. Update the source agent guidance that feeds AGENTS/OpenAI/Claude-facing copies, then run python scripts/sync_agent_skill.py --apply so .claude/skills/vibecomfy/SKILL.md is refreshed.\n5. Extend scripts/sync_agent_skill.py default check mode or tests/test_agent_skill_sync.py so the README-directed .claude/skills/vibecomfy/SKILL.md local copy is checked for freshness. Do not document or rely on a nonexistent --check flag unless the implementation explicitly adds and tests that alias.\n6. Ensure command help text mirrors the docs so discoverability is present in both CLI and repository guidance.\n\n## Phase 5: Tests and Battle Targets\n\n### Step 13: Add focused unit and CLI tests (tests/test_porting_workbench.py, tests/test_cli.py, tests/test_workflow_core.py, tests/test_schema.py, tests/test_model_assets.py)\nScope: Large\n1. Test a simple fixture based on image/z_image or a tiny synthetic workflow: report shape, provenance, scratchpad Python emission, import/build, compile, and validate.\n2. Test video/wanvideo_wrapper_22_wan_animate_preprocess_kijai: helper nodes are diagnosed separately, helper nodes do not survive compiled API, no compiled API link points to a removed helper node, required real node packs are suggested, and detection model assets are reported.\n3. Test custom-node inference ignores known helper/UI nodes but still fails unresolved runtime classes.\n4. Test porting-only API-shaped workflow model asset candidates, including filename-only assets with missing URL warnings, without changing extract_from_raw_workflow(...) return shape.\n5. Test widget alias diagnostics with a fake schema provider and keep existing Wan/WanAnimate alias expectations passing.\n6. Test that raw object_info order containing link-only inputs does not drive positional widget mapping or shift widget aliases.\n7. Test HEAD checks with injected/mocked HTTP behavior, not real network.\n8. Add CLI smoke tests for port check --json, scratchpad-mode port convert --out ... --json, ready-template-mode port convert --ready-id ..., and command help discoverability.\n\n### Step 14: Update parity, conversion, and sync tests (tests/test_ready_templates.py, tools/_compile_equivalence.py, tools/convert_ready_templates.py, tests/test_agent_skill_sync.py)\nScope: Medium\n1. Keep ready-template parity tests passing after widget schema migration.\n2. Verify tools/convert_ready_templates.py --template ... --dry-run still uses the moved ready-template emitter and reports equivalent diffs.\n3. Add regression coverage that vibecomfy convert keeps its existing lightweight contract while vibecomfy port convert emits explicit scratchpad Python by default.\n4. Add regression coverage that ready-template emission is only used by port convert --ready-id and ready-template tooling.\n5. Add freshness coverage for .claude/skills/vibecomfy/SKILL.md or the sync path that regenerates it.\n\n## Execution Order\n1. Add report and helper diagnostics first, because helper filtering changes the correctness of every downstream diagnostic.\n2. Add porting-only model asset analysis while preserving legacy extract_from_raw_workflow(...) behavior for doctor and fetch.\n3. Split emitter code into explicit scratchpad and ready-template modes before wiring port convert.\n4. Move widget schema code with compatibility wrappers and parity tests in the same change set, keeping the schema widget-only and not based on unfiltered object_info order.\n5. Add the workbench orchestrator and port check before adding port convert writes.\n6. Add opt-in HEAD checks after offline report behavior is covered.\n7. Wire doctor / RunPod summaries after the report shape is stable.\n8. Finish with discoverability docs, synced agent guidance, and battle-target tests.\n\n## Validation Order\n1. Run focused porting tests first: pytest -q tests/test_porting_workbench.py tests/test_model_assets.py tests/test_workflow_core.py tests/test_schema.py.\n2. Run CLI tests: pytest -q tests/test_cli.py.\n3. Run ready-template and parity regressions: pytest -q tests/test_ready_templates.py plus python -m tools.convert_ready_templates --template image/qwen_image_2512 --dry-run.\n4. Run agent guidance sync tests: python scripts/sync_agent_skill.py and pytest -q tests/test_agent_skill_sync.py.\n5. Run node/model checks: pytest -q tests/test_nodes_install.py tests/test_models_registry.py.\n6. Run the full local suite with pytest.\n7. Manual/optional network check: python -m vibecomfy.cli port check video/wanvideo_wrapper_22_wan_animate_preprocess_kijai --json --head-check-models.\n",
"changes_summary": "Replaced the invalid scripts/sync_agent_skill.py --check validation command with the script's default check mode, and tightened widget alias planning so positional mapping uses widget-only order and never raw object_info input order that includes link-only sockets.",
"flags_addressed": [
"issue_hints",
"all_locations",
"correctness",
"FLAG-008"
],
"assumptions": [
"The dedicated public UX is settled as vibecomfy port ....",
"The first useful slice should be a CLI/tooling workbench inside VibeComfy, not a GUI.",
"Normal tests must remain deterministic and must not require ComfyUI, RunPod, network access, model files, or installed custom nodes.",
"Existing vibecomfy convert, doctor, and fetch behavior should remain compatible.",
"Explicit Python scratchpad materialization belongs to vibecomfy port convert by default.",
"Ready-template-shaped emission requires port convert --ready-id ... or existing ready-template tooling.",
"Raw external JSON may be accepted as input, but the steady-state output should be a Python scratchpad or ready-template module.",
"The current WanAnimate battle-test target is video/wanvideo_wrapper_22_wan_animate_preprocess_kijai unless the user supplies a different production-parity source.",
"Network URL HEAD checks should stay opt-in because upstream hosts and license gates can make them flaky in routine validation.",
"Until schema providers expose widget-vs-link metadata, object_info should validate input names and requirements but should not be used alone to derive positional widget order."
],
"success_criteria": [
{
"criterion": "python -m vibecomfy.cli port check <workflow> --json returns a structured report with source provenance, schema issues, custom-node suggestions, model asset candidates, helper-node diagnostics, widget alias diagnostics, and recommended next commands.",
"priority": "must",
"requires": [
"run_shell",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --out <path> --json emits a scratchpad Python module whose build() returns a VibeWorkflow with source_type='scratchpad' and without requiring READY_METADATA['ready_template'].",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "python -m vibecomfy.cli port convert <workflow> --ready-id kind/name --out <path> --json emits a ready-template candidate with READY_METADATA, READY_REQUIREMENTS, and source_type='ready_template'.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "The emitted Python module preserves provenance fields including original source path or id, source hash, detected shape, output mode, and ready id when supplied.",
"priority": "must",
"requires": [
"read_files",
"run_tests"
]
},
{
"criterion": "Legacy extract_from_raw_workflow(...) continues returning only URL-bearing asset dictionaries compatible with existing doctor and fetch callers.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Porting-only asset analysis reports API-shaped filename-only asset candidates as warnings without passing URL-less entries to legacy fetch/download paths.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "Custom-node pack inference ignores known helper/UI nodes and still reports unresolved runtime class types as hard errors.",
"priority": "must",
"requires": [
"run_tests",
"read_build_output"
]
},
{
"criterion": "The porting report flags unresolved SetNode / GetNode helper broadcasts before compile can silently drop them.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The porting report flags missing required schema inputs before runtime queueing for workflows validated with an available schema provider.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "WanAnimate helper nodes (Note, MarkdownNote, SetNode, GetNode) do not survive compiled API output, no compiled API link points to a removed helper node, and helper classes are not reported as unresolved custom-node packs.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Positional widget_N alias handling is centralized and all callers, including normalize_to_api, VibeWorkflow.compile, the Python emitter, tools/convert_ready_templates.py, and tools/_compile_equivalence.py, use the shared widget-only source.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Object_info inputs that include link-only sockets such as MODEL, CLIP, IMAGE, VAE, or LATENT do not shift positional widget mapping.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "Model asset HEAD checks are opt-in, use injectable/mocked HTTP behavior in tests, and report status without downloading model bodies.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Existing vibecomfy convert tests still pass, while new vibecomfy port convert tests prove explicit scratchpad Python materialization by default and ready-template materialization only with --ready-id.",
"priority": "must",
"requires": [
"run_tests",
"parse_diff"
]
},
{
"criterion": "Focused tests for the simple template path and the WanAnimate production-parity path pass.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "CLI help and repository docs make port check discoverable as the recommended first preflight before manual template editing or RunPod validation.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"read_build_output"
]
},
{
"criterion": "AGENTS/OpenAI/Claude guidance, including .claude/skills/vibecomfy/SKILL.md, is updated or regenerated and covered by sync/freshness checks using valid sync commands.",
"priority": "must",
"requires": [
"run_shell",
"read_files",
"run_tests"
]
},
{
"criterion": "Existing local test suite passes with pytest.",
"priority": "must",
"requires": [
"run_tests"
]
},
{
"criterion": "The new porting modules keep CLI formatting separate from analysis logic and avoid duplicating node/model/schema inference code already present in the package.",
"priority": "should",
"requires": [
"parse_diff",
"subjective_judgment"
]
},
{
"criterion": "The docs give future users and agents a short live validation loop that starts with port check, proceeds to Python scratchpad conversion, and only then spends RunPod time.",
"priority": "should",
"requires": [
"read_files",
"subjective_judgment"
]
},
{
"criterion": "Optional real network HEAD checks pass for the current model asset URLs.",
"priority": "info",
"requires": [
"run_shell",
"observe_runtime_logs"
]
}
],
"questions": [
"What is the canonical source path or id for the current Reigh WanAnimate production-parity workflow if it is not video/wanvideo_wrapper_22_wan_animate_preprocess_kijai?",
"Should direct writes under ready_templates/ be allowed by port convert --ready-id, or should ready-template promotion always be a separate manual step after emitting to out/scratchpads/?"
]
}