You are already running inside the megaplan harness for this step. Do the requested…
- User
You are already running inside the megaplan harness for this step. Do the requested planning/review/execution work directly. Do NOT invoke the
megaplanCLI, do NOT read or activate themegaplanskill, do NOT start nested megaplan plans, and do NOT recurse into another planning harness. Treat mentions of megaplan in the repository or environment as implementation context only.You are creating an implementation plan for the following idea.
codeIdea:vibecomfy: model-alias-registry v1 — collapse the four duplicated
materialize_modelheredoc blocks inrunpod_corpus_matrix.pyand the inline name-normalization rules inrunpod_matrix_remote.pyinto one declarative YAML registry. No resolver service, no runtime indirection. Just a flat file that staging and normalization both read from.Source repo: /Users/user_c042661f/Documents/reigh-workspace/vibecomfy
Problem
Model staging and aliasing knowledge is currently spread across:
-
Four near-identical heredoc Python blocks in
scripts/runpod_corpus_matrix.py(lines ~380, ~447, ~521, ~647) that each define a localmaterialize_model(repo, filename, targets, min_size)function and a hardcodeddownloads = [...]list. Adding a new model means editing all four (or remembering which one applies). Drift is inevitable. -
Inline name-normalization rules in
scripts/runpod_matrix_remote.py(lines ~143–195) that hardcode "if value isltx-2.3-22b-dev.safetensorsmap it to X" branching — one branch per known alias. Adding a new model that ships under multiple node-pack names means appending anotherelifbranch. -
Module-level constants at the top of
scripts/runpod_matrix_remote.py(lines 12–19) —LTX_CHECKPOINT,LTX_TEXT_ENCODER, etc. — that pin canonical names per model. These are referenced from the normalization branches. -
Workflow-embedded URLs that the materializer already extracts via
vibecomfy/model_assets.py(this work is done; do not redo it). But the staging path on RunPod still doesn't read from those — it uses the hardcoded heredoc lists instead.
The result: a "downloaded but invisible" failure class (entry
model_layoutindocs/hiddenswitch_incompatibilities.md) where a model is correctly downloaded but lives at the wrong path for the node pack that needs it. Each new node pack adds another inline branch instead of declaring its expected paths once.Goal
One YAML file that staging and normalization both consume. Five mechanical steps:
- Define a YAML schema: canonical model id → source (HF repo + filename or generic URL) → list of
(node_pack, target_path)pairs that should be created via hardlink/symlink → minimum size for sanity check → optional list of accepted alias names that should be normalized to the canonical filename. - Author the registry by extracting the existing four
downloads = [...]lists and the existing alias branches from the two scripts. Verify exhaustively against current matrix behavior. - Replace the four heredoc
materialize_modelblocks inrunpod_corpus_matrix.pywith a single loader that reads the YAML and runs the samehardlink-or-symlink, size-check, fail-loudlogic. - Replace the alias-normalization branches in
runpod_matrix_remote.pywith a single lookup against the YAML'saliasesfield. - Add a one-shot
vibecomfy models stage <registry.yaml>CLI command that any local dev box (not just RunPod) can use to materialize the registry into a target models root.
The registry is append-only and flat. No resolver service. No background daemon. No precedence rules across multiple registries. One file, in repo, edited via PR.
Verified facts (do not re-research)
scripts/runpod_corpus_matrix.pycontains the four heredoc blocks: lines 380, 447, 521, 647. Each definesmaterialize_model(repo, filename, targets, min_size)with the same body (hardlink-or-symlink fallback, size check) and a differentdownloads = [...]list scoped to a different matrix phase.scripts/runpod_corpus_matrix.py:67already pip-installshuggingface_hub[hf_xet]>=0.32.0, sohf_hub_downloadis available.scripts/runpod_matrix_remote.py:12-19declares the LTX/Flux module constants. Lines 143–195 contain the cascade ofif value == "X": inputs[key] = "Y"normalization branches (LTX-specific). Lines 376–379 contain Wan-specific equivalents.vibecomfy/model_assets.pyalready extracts(name, subdir, url)triples from upstream Comfy-Org workflow JSONs. Those triples populateREADY_REQUIREMENTS["models"]in materialized scratchpads. The registry should complement that mechanism, not replace it: the registry covers models whose canonical staging path differs across node packs (LTX, Wan, ACE Step), while the model-assets path covers the simple "URL embedded in the workflow" case.vibecomfy/fetch.pyalready exists withdownload_manyand atomic-rename semantics. The registry CLI should reusevibecomfy.fetchfor non-HF URLs andhuggingface_hub.hf_hub_downloadfor HF entries (matching the heredoc behavior).- The doc entry
Model name and directory conventions differ across node packsindocs/hiddenswitch_incompatibilities.md(Root cause:model_layout) is the spec for what this registry exists to solve.
Steps
S1: YAML schema
Single file at
vibecomfy/registry/models.yaml(ordata/models.yaml— pick one and document). Schema per entry:yaml- id: ltx_2_3_22b_dev_fp8 # canonical id, used for cross-references source: kind: huggingface # or "url" repo: Lightricks/LTX-Video # for kind=huggingface filename: ltx-2.3-22b-dev-fp8.safetensors # url: https://... # for kind=url (uses vibecomfy.fetch) min_size: 1_000_000_000 # bytes, fail loud if smaller targets: # paths to materialize via hardlink-or-symlink - node_pack: lightricks path: models/diffusion_models/ltx-2.3-22b-dev-fp8.safetensors - node_pack: kjnodes path: models/checkpoints/ltx-2.3-22b-dev-fp8.safetensors aliases: # accepted names that normalize to canonical - ltx-2.3-22b-dev.safetensors - LTX23_22B_dev.safetensors notes: | Multi-pack model. Lightricks expects diffusion_models/, KJNodes expects checkpoints/.The schema must be expressive enough to reproduce every download in the four existing heredoc blocks AND every alias branch in
runpod_matrix_remote.py. If any current behavior cannot be expressed, the schema is wrong — extend it before proceeding.S2: Author the registry
- Read all four
downloads = [...]lists inrunpod_corpus_matrix.py. Convert each to a registry entry. Preservemin_sizeexactly. - Read every alias branch in
runpod_matrix_remote.py(theif value == X: inputs[key] = Yandvalue in {A, B}: ...blocks). Convert each to analiases:list under the canonical entry. - Read the module-level constants (
LTX_CHECKPOINT, etc.) and confirm each maps to a registry entry'sid. - The registry must be complete enough that S3 and S4 can be dropped in without behavioral change. If the registry is incomplete, S3/S4 will silently break workflows.
S3: Replace heredoc blocks in runpod_corpus_matrix.py
- Add a small loader:
vibecomfy/registry/models_loader.py. Functions:load_registry(path: str | Path) -> list[ModelEntry]stage_entry(entry: ModelEntry, *, models_root: Path) -> list[Path]— hardlink-or-symlink into everytargets[].pathundermodels_root, run size check, raise on mismatch. Pure mirror of the existing heredoc behavior.stage_many(entries: list[ModelEntry], *, models_root: Path, ids: list[str] | None = None) -> None— stage all (or a subset by id).
- In
runpod_corpus_matrix.py, replace each of the four heredoc blocks with a single call:Each phase passes the subset of ids it needs. The four phases stay distinct (different model subsets) but share the loader.python$PY -m vibecomfy.registry.models_loader stage \ --registry vibecomfy/registry/models.yaml \ --models-root models \ --ids ltx_2_3_22b_dev_fp8 ltx_2_3_text_encoder ...
S4: Replace alias normalization in runpod_matrix_remote.py
- Add a function in
vibecomfy/registry/models_loader.py:normalize_alias(value: str, *, registry: list[ModelEntry], node_pack: str | None = None) -> str | None— returns the canonical filename ifvaluematches any entry'saliases(optionally constrained by node_pack), else None. - In
runpod_matrix_remote.py, replace the cascade ofif value == X: inputs[key] = Ybranches with one call tonormalize_alias. If it returns a value, use it; otherwise leave the input untouched (current behavior preserves unknown values). - The module constants (
LTX_CHECKPOINT, etc.) become thin wrappers that look up the canonical filename by id from the registry. Keep them for source-code readability; they no longer carry the source of truth.
S5: vibecomfy models stage CLI
- New file
vibecomfy/commands/models.pyexposingvibecomfy models stage <registry.yaml> [--ids id1 id2 ...] [--models-root PATH] [--dry-run]. - Reuses
vibecomfy.registry.models_loader.stage_many. - For HF entries, use
huggingface_hub.hf_hub_download(matching heredoc behavior — falls back to authentication viaHF_TOKENenv var if set). - For URL entries, use
vibecomfy.fetch.download(already exists). --dry-runprints what would be staged and where, with size checks against any already-present files.- Register in
vibecomfy/cli.py.
Out of scope (do NOT add)
- A resolver service. No HTTP API, no background process, no caching layer beyond what
huggingface_hubalready provides. - Auto-detection of node packs from installed Python packages.
- SHA256 verification (
vibecomfy/.megaplan-idea.mdalready defers this to a follow-up; same applies here). - A "models doctor" that gates execution. Doctor work is deferred per the
hiddenswitch_incompatibilities.mddecision; the registry is consumed by staging only, not by submit-gating. - Multi-registry composition (overlay registries, project-local overrides). One file.
- Migration of
vibecomfy/model_assets.pyextraction logic — that path stays as-is for workflow-embedded URLs. - A web UI / inspector.
Design constraints
- Flat file: a single YAML, source-of-truth for all model staging/aliasing. Append-only in normal operation; edits go through PRs.
- No new top-level deps:
pyyamlis in the matrix's pip install line; confirm it's also inpyproject.toml. If not, add it (it's tiny). - Reversibility: keep the heredoc blocks behind a
--legacy-stagingflag for one release cycle in case the registry has a gap that needs an emergency revert. Remove after one passing matrix run. - Behavioral parity: every download and alias the matrix currently handles must be representable. The registry is wrong if it cannot reproduce the current behavior bit-for-bit.
- Loud failure: if a registry entry is referenced by id but missing, fail at load time, not at stage time. If a target path collides with an unrelated existing file (not a symlink/hardlink we own), fail rather than overwriting.
- Doc cross-reference: when adding a new entry to the registry, the PR description must reference the
model_layoutrow inhiddenswitch_incompatibilities.md(per the Contributing rules in that doc) if the addition was driven by a documented incompatibility.
No prereq clauses
This brief has no hard-halt prereqs. Independent of the validator brief (#1), the watchdog/override/fixture subagents (#2/#3/#4), and the doc-discipline work (#6, already shipped). Ship as soon as ready.
Validation evidence to produce
- A full RunPod matrix run completes with the registry-driven staging, producing the same set of staged files as the previous heredoc behavior. Diff
find models -type fbefore/after. Zero diff is the bar. - The 14 existing runtime-green workflows still go green.
- A new fictional workflow that uses the same model under a third node-pack name can be supported by appending one
aliases:line and onetargets:entry to the registry — no code changes elsewhere. - Unit tests in
tests/test_models_registry.py: load+roundtrip a sample registry, stage with mockedhf_hub_download, normalize aliases (hits and misses), reject collisions with non-owned files.
Open questions
-
Should the registry live at
vibecomfy/registry/models.yaml(next to the loader) ordata/models.yaml(a top-level data dir)? Lean towardvibecomfy/registry/models.yamlfor proximity to the loader; revisit if other registries appear. -
Should
normalize_aliasbe node-pack-aware (i.e., scope which alias maps activate based on the workflow's source family)? V1: no — global alias namespace. Revisit if two node packs ship the same alias pointing to different canonical models, which would require disambiguation. -
Should the loader cache the parsed registry in-memory across calls within a single process? Yes — parse once per process, stash on a module-level singleton or pass through explicitly. Avoid re-parsing per stage call.
codeProject directory: /Users/user_c042661f/Documents/reigh-workspace/.megaplan-worktrees/vibecomfy-registry 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 Phasewith### 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.
-
Assistant
Drafting the implementation plan now.
Assistant
I've drafted the implementation plan. Highlights:
- Schema-and-loader first (
vibecomfy/registry/models.yaml+models_loader.py), then registry authoring, then swapping consumers (runpod_corpus_matrix.pyheredocs andrunpod_matrix_remote.pyalias branches). - Phase/scope gating via tags (
phase:core,ltx_lean_excluded,requires_hf_token,excluded_in_public_scope) — preserves the existing conditional download behavior atrunpod_corpus_matrix.py:520, :560without re-introducing branchy code. - Module constants stay importable as thin
canonical_filename(<id>)lookups sotests/test_runpod_matrix.py:7keeps working. pyyaml+huggingface_hubadded to[project].dependencies(currently only pip-installed inside the runpod heredoc).- Reversibility via
VIBECOMFY_REGISTRY_LEGACY=1env var rather than a CLI flag (matches how the matrix script is actually invoked). - Collision protection is one strict-ness step beyond the current heredoc behavior, per the brief's "loud failure" constraint.
Open questions called out: URL-kind subdir convention, model_assets cross-referencing, whether
aliases:should accept regex/glob (current pattern-based normalizations stay inline as deferred work), and CLI flag vs env var for the legacy escape hatch.- Schema-and-loader first (
- User
You are already running inside the megaplan harness for this step. Do the requested planning/review/execution work directly. Do NOT invoke the
megaplanCLI, do NOT read or activate themegaplanskill, do NOT start nested megaplan plans, and do NOT recurse into another planning harness. Treat mentions of megaplan in the repository or environment as implementation context only.You are revising an implementation plan after critique and gate feedback.
codeProject directory: /Users/user_c042661f/Documents/reigh-workspace/.megaplan-worktrees/vibecomfy-registry Idea:vibecomfy: model-alias-registry v1 — collapse the four duplicated
materialize_modelheredoc blocks inrunpod_corpus_matrix.pyand the inline name-normalization rules inrunpod_matrix_remote.pyinto one declarative YAML registry. No resolver service, no runtime indirection. Just a flat file that staging and normalization both read from.Source repo: /Users/user_c042661f/Documents/reigh-workspace/vibecomfy
Problem
Model staging and aliasing knowledge is currently spread across:
-
Four near-identical heredoc Python blocks in
scripts/runpod_corpus_matrix.py(lines ~380, ~447, ~521, ~647) that each define a localmaterialize_model(repo, filename, targets, min_size)function and a hardcodeddownloads = [...]list. Adding a new model means editing all four (or remembering which one applies). Drift is inevitable. -
Inline name-normalization rules in
scripts/runpod_matrix_remote.py(lines ~143–195) that hardcode "if value isltx-2.3-22b-dev.safetensorsmap it to X" branching — one branch per known alias. Adding a new model that ships under multiple node-pack names means appending anotherelifbranch. -
Module-level constants at the top of
scripts/runpod_matrix_remote.py(lines 12–19) —LTX_CHECKPOINT,LTX_TEXT_ENCODER, etc. — that pin canonical names per model. These are referenced from the normalization branches. -
Workflow-embedded URLs that the materializer already extracts via
vibecomfy/model_assets.py(this work is done; do not redo it). But the staging path on RunPod still doesn't read from those — it uses the hardcoded heredoc lists instead.
The result: a "downloaded but invisible" failure class (entry
model_layoutindocs/hiddenswitch_incompatibilities.md) where a model is correctly downloaded but lives at the wrong path for the node pack that needs it. Each new node pack adds another inline branch instead of declaring its expected paths once.Goal
One YAML file that staging and normalization both consume. Five mechanical steps:
- Define a YAML schema: canonical model id → source (HF repo + filename or generic URL) → list of
(node_pack, target_path)pairs that should be created via hardlink/symlink → minimum size for sanity check → optional list of accepted alias names that should be normalized to the canonical filename. - Author the registry by extracting the existing four
downloads = [...]lists and the existing alias branches from the two scripts. Verify exhaustively against current matrix behavior. - Replace the four heredoc
materialize_modelblocks inrunpod_corpus_matrix.pywith a single loader that reads the YAML and runs the samehardlink-or-symlink, size-check, fail-loudlogic. - Replace the alias-normalization branches in
runpod_matrix_remote.pywith a single lookup against the YAML'saliasesfield. - Add a one-shot
vibecomfy models stage <registry.yaml>CLI command that any local dev box (not just RunPod) can use to materialize the registry into a target models root.
The registry is append-only and flat. No resolver service. No background daemon. No precedence rules across multiple registries. One file, in repo, edited via PR.
Verified facts (do not re-research)
scripts/runpod_corpus_matrix.pycontains the four heredoc blocks: lines 380, 447, 521, 647. Each definesmaterialize_model(repo, filename, targets, min_size)with the same body (hardlink-or-symlink fallback, size check) and a differentdownloads = [...]list scoped to a different matrix phase.scripts/runpod_corpus_matrix.py:67already pip-installshuggingface_hub[hf_xet]>=0.32.0, sohf_hub_downloadis available.scripts/runpod_matrix_remote.py:12-19declares the LTX/Flux module constants. Lines 143–195 contain the cascade ofif value == "X": inputs[key] = "Y"normalization branches (LTX-specific). Lines 376–379 contain Wan-specific equivalents.vibecomfy/model_assets.pyalready extracts(name, subdir, url)triples from upstream Comfy-Org workflow JSONs. Those triples populateREADY_REQUIREMENTS["models"]in materialized scratchpads. The registry should complement that mechanism, not replace it: the registry covers models whose canonical staging path differs across node packs (LTX, Wan, ACE Step), while the model-assets path covers the simple "URL embedded in the workflow" case.vibecomfy/fetch.pyalready exists withdownload_manyand atomic-rename semantics. The registry CLI should reusevibecomfy.fetchfor non-HF URLs andhuggingface_hub.hf_hub_downloadfor HF entries (matching the heredoc behavior).- The doc entry
Model name and directory conventions differ across node packsindocs/hiddenswitch_incompatibilities.md(Root cause:model_layout) is the spec for what this registry exists to solve.
Steps
S1: YAML schema
Single file at
vibecomfy/registry/models.yaml(ordata/models.yaml— pick one and document). Schema per entry:yaml- id: ltx_2_3_22b_dev_fp8 # canonical id, used for cross-references source: kind: huggingface # or "url" repo: Lightricks/LTX-Video # for kind=huggingface filename: ltx-2.3-22b-dev-fp8.safetensors # url: https://... # for kind=url (uses vibecomfy.fetch) min_size: 1_000_000_000 # bytes, fail loud if smaller targets: # paths to materialize via hardlink-or-symlink - node_pack: lightricks path: models/diffusion_models/ltx-2.3-22b-dev-fp8.safetensors - node_pack: kjnodes path: models/checkpoints/ltx-2.3-22b-dev-fp8.safetensors aliases: # accepted names that normalize to canonical - ltx-2.3-22b-dev.safetensors - LTX23_22B_dev.safetensors notes: | Multi-pack model. Lightricks expects diffusion_models/, KJNodes expects checkpoints/.The schema must be expressive enough to reproduce every download in the four existing heredoc blocks AND every alias branch in
runpod_matrix_remote.py. If any current behavior cannot be expressed, the schema is wrong — extend it before proceeding.S2: Author the registry
- Read all four
downloads = [...]lists inrunpod_corpus_matrix.py. Convert each to a registry entry. Preservemin_sizeexactly. - Read every alias branch in
runpod_matrix_remote.py(theif value == X: inputs[key] = Yandvalue in {A, B}: ...blocks). Convert each to analiases:list under the canonical entry. - Read the module-level constants (
LTX_CHECKPOINT, etc.) and confirm each maps to a registry entry'sid. - The registry must be complete enough that S3 and S4 can be dropped in without behavioral change. If the registry is incomplete, S3/S4 will silently break workflows.
S3: Replace heredoc blocks in runpod_corpus_matrix.py
- Add a small loader:
vibecomfy/registry/models_loader.py. Functions:load_registry(path: str | Path) -> list[ModelEntry]stage_entry(entry: ModelEntry, *, models_root: Path) -> list[Path]— hardlink-or-symlink into everytargets[].pathundermodels_root, run size check, raise on mismatch. Pure mirror of the existing heredoc behavior.stage_many(entries: list[ModelEntry], *, models_root: Path, ids: list[str] | None = None) -> None— stage all (or a subset by id).
- In
runpod_corpus_matrix.py, replace each of the four heredoc blocks with a single call:Each phase passes the subset of ids it needs. The four phases stay distinct (different model subsets) but share the loader.python$PY -m vibecomfy.registry.models_loader stage \ --registry vibecomfy/registry/models.yaml \ --models-root models \ --ids ltx_2_3_22b_dev_fp8 ltx_2_3_text_encoder ...
S4: Replace alias normalization in runpod_matrix_remote.py
- Add a function in
vibecomfy/registry/models_loader.py:normalize_alias(value: str, *, registry: list[ModelEntry], node_pack: str | None = None) -> str | None— returns the canonical filename ifvaluematches any entry'saliases(optionally constrained by node_pack), else None. - In
runpod_matrix_remote.py, replace the cascade ofif value == X: inputs[key] = Ybranches with one call tonormalize_alias. If it returns a value, use it; otherwise leave the input untouched (current behavior preserves unknown values). - The module constants (
LTX_CHECKPOINT, etc.) become thin wrappers that look up the canonical filename by id from the registry. Keep them for source-code readability; they no longer carry the source of truth.
S5: vibecomfy models stage CLI
- New file
vibecomfy/commands/models.pyexposingvibecomfy models stage <registry.yaml> [--ids id1 id2 ...] [--models-root PATH] [--dry-run]. - Reuses
vibecomfy.registry.models_loader.stage_many. - For HF entries, use
huggingface_hub.hf_hub_download(matching heredoc behavior — falls back to authentication viaHF_TOKENenv var if set). - For URL entries, use
vibecomfy.fetch.download(already exists). --dry-runprints what would be staged and where, with size checks against any already-present files.- Register in
vibecomfy/cli.py.
Out of scope (do NOT add)
- A resolver service. No HTTP API, no background process, no caching layer beyond what
huggingface_hubalready provides. - Auto-detection of node packs from installed Python packages.
- SHA256 verification (
vibecomfy/.megaplan-idea.mdalready defers this to a follow-up; same applies here). - A "models doctor" that gates execution. Doctor work is deferred per the
hiddenswitch_incompatibilities.mddecision; the registry is consumed by staging only, not by submit-gating. - Multi-registry composition (overlay registries, project-local overrides). One file.
- Migration of
vibecomfy/model_assets.pyextraction logic — that path stays as-is for workflow-embedded URLs. - A web UI / inspector.
Design constraints
- Flat file: a single YAML, source-of-truth for all model staging/aliasing. Append-only in normal operation; edits go through PRs.
- No new top-level deps:
pyyamlis in the matrix's pip install line; confirm it's also inpyproject.toml. If not, add it (it's tiny). - Reversibility: keep the heredoc blocks behind a
--legacy-stagingflag for one release cycle in case the registry has a gap that needs an emergency revert. Remove after one passing matrix run. - Behavioral parity: every download and alias the matrix currently handles must be representable. The registry is wrong if it cannot reproduce the current behavior bit-for-bit.
- Loud failure: if a registry entry is referenced by id but missing, fail at load time, not at stage time. If a target path collides with an unrelated existing file (not a symlink/hardlink we own), fail rather than overwriting.
- Doc cross-reference: when adding a new entry to the registry, the PR description must reference the
model_layoutrow inhiddenswitch_incompatibilities.md(per the Contributing rules in that doc) if the addition was driven by a documented incompatibility.
No prereq clauses
This brief has no hard-halt prereqs. Independent of the validator brief (#1), the watchdog/override/fixture subagents (#2/#3/#4), and the doc-discipline work (#6, already shipped). Ship as soon as ready.
Validation evidence to produce
- A full RunPod matrix run completes with the registry-driven staging, producing the same set of staged files as the previous heredoc behavior. Diff
find models -type fbefore/after. Zero diff is the bar. - The 14 existing runtime-green workflows still go green.
- A new fictional workflow that uses the same model under a third node-pack name can be supported by appending one
aliases:line and onetargets:entry to the registry — no code changes elsewhere. - Unit tests in
tests/test_models_registry.py: load+roundtrip a sample registry, stage with mockedhf_hub_download, normalize aliases (hits and misses), reject collisions with non-owned files.
Open questions
-
Should the registry live at
vibecomfy/registry/models.yaml(next to the loader) ordata/models.yaml(a top-level data dir)? Lean towardvibecomfy/registry/models.yamlfor proximity to the loader; revisit if other registries appear. -
Should
normalize_aliasbe node-pack-aware (i.e., scope which alias maps activate based on the workflow's source family)? V1: no — global alias namespace. Revisit if two node packs ship the same alias pointing to different canonical models, which would require disambiguation. -
Should the loader cache the parsed registry in-memory across calls within a single process? Yes — parse once per process, stash on a module-level singleton or pass through explicitly. Avoid re-parsing per stage call.
codeCurrent plan (markdown): # Implementation Plan: vibecomfy model-alias-registry v1
Overview
Collapse the four duplicated
materialize_modelheredoc blocks inscripts/runpod_corpus_matrix.pyand the inline alias-normalization branches inscripts/runpod_matrix_remote.pyinto a single declarative YAML registry consumed by both. No resolver service. The registry lives atvibecomfy/registry/models.yamlnext to a newvibecomfy/registry/models_loader.py. A newvibecomfy models stageCLI command materializes any subset of the registry into a target models root usinghuggingface_hub.hf_hub_downloadfor HF entries andvibecomfy.fetch.downloadfor URL entries.Touched call sites confirmed:
- Four heredoc
materialize_modelblocks atscripts/runpod_corpus_matrix.py:347(core),:414(gguf),:488(ltx),:614(wan_wrapper). Each contains an identicalmaterialize_model(repo, filename, targets, min_size)Python function and a phase-specificdownloads = [...]list. - Alias-normalization cascades at
scripts/runpod_matrix_remote.py:142-146(_patch_ltx),:182-198(_patch_ltx_common),:373-389(_patch_wanvideo_wrapper). - Module-level canonical-name constants at
scripts/runpod_matrix_remote.py:12-19(LTX_CHECKPOINT,LTX_TEXT_ENCODER,LTX_TEXT_PROJECTION,LTX_VIDEO_VAE,LTX_AUDIO_VAE,LTX_PREVIEW_VAE,GGUF_MODEL,FLUX_VAE). Imported bytests/test_runpod_matrix.py:7.
Constraints that matter:
pyyamlis not inpyproject.toml(pyproject.toml:11-14lists onlyhttpxandwebsockets). It is pip-installed inside the runpod heredoc atscripts/runpod_corpus_matrix.py:67. The loader must work in both contexts; addpyyamlto[project].dependencies.- Some
targetslists contain Windows-style literal backslashes (e.g.models/vae/wanvideo\Wan2_1_VAE_bf16.safetensorsat:644, MelBandRoformer entries at:696-699). These are deliberate filenames-with-backslashes, not path separators. YAML must preserve them; the loader must treat eachtarget.pathas a literal name relative tomodels_root. - The ltx heredoc has two conditional branches: a "lean scope" gate (
if not ltx_lean_model_scope: downloads.extend([...])at:520-540) and an HF-token-gated HDR LoRA (:560-566). The gguf phase reusesflux2-vae.safetensorsfrom a different repo than core (:444vs:378). The registry needs a way to express scope/gate metadata so the runner can choose subsets per phase without re-introducing branchy code. - The existing
vibecomfy/registry/package (workflow templates:library.py,ready.py,ready_template.py) must continue to expose its current API; the newmodels_loader.pyandmodels.yamlare additive. tests/test_runpod_matrix.py:7importsGGUF_MODEL, LTX_CHECKPOINTfromscripts.runpod_matrix_remote. These constants must remain importable; they become thin lookups against the registry.
Main Phase
Step 1: Add pyyaml dependency and registry skeleton (
pyproject.toml,vibecomfy/registry/)Scope: Small
- Add
pyyaml>=6to[project].dependenciesinpyproject.toml:11. Confirmhuggingface_hub>=0.32is also declared (it is currently only pip-installed inside the matrix heredoc atscripts/runpod_corpus_matrix.py:67); add it to[project].dependenciesso the loader canimport huggingface_huboutside the runpod context as well. - Create
vibecomfy/registry/models.yaml(empty top-level listmodels: []for now — populated in Step 3). - Create
vibecomfy/registry/models_loader.pywith the public surface:python@dataclass(frozen=True) class ModelSource: kind: str; repo: str | None; filename: str | None; url: str | None @dataclass(frozen=True) class ModelTarget: node_pack: str; path: str @dataclass(frozen=True) class ModelEntry: id: str source: ModelSource min_size: int targets: tuple[ModelTarget, ...] aliases: tuple[str, ...] tags: tuple[str, ...] # e.g. "ltx_lean_excluded", "[REDACTED]: str # convenience: source.filename basename or first target basename def load_registry(path: str | Path | None = None) -> tuple[ModelEntry, ...]: ... def stage_entry(entry: ModelEntry, *, models_root: Path) -> list[Path]: ... def stage_many(entries: Iterable[ModelEntry], *, models_root: Path) -> None: ... def normalize_alias(value: str, *, registry: tuple[ModelEntry, ...] | None = None) -> str | None: ... def canonical_filename(model_id: str, *, registry: tuple[ModelEntry, ...] | None = None) -> str: ... - Implement an in-process LRU cache for the parsed registry (module-level singleton
_REGISTRY_CACHE: dict[Path, tuple[ModelEntry, ...]]) so repeatedload_registry()calls within a single process do not re-parse YAML. The default path isPath(__file__).with_name("models.yaml"). - Mirror the existing heredoc staging behavior verbatim in
stage_entry:- For
kind=huggingface: callhuggingface_hub.hf_hub_download(repo_id=source.repo, filename=source.filename), resolve, size-check againstmin_size, fail loud if smaller. - For
kind=url: callvibecomfy.fetch.download({"name": canonical_filename, "subdir": <derived>, "url": source.url}). (See open question on subdir derivation.) - For each
targetinentry.targets:models_root / target.path. Runmkdir -pon parent. If the target exists or is a symlink,unlink()first but only if it is a symlink we own or a hardlink to the same inode — otherwise raiseRuntimeError(f"refusing to overwrite non-owned file at {target}"). Tryos.link(source, target)first, fall back toos.symlinkonOSError. Re-stat staged path and re-check size. - The collision check is the only behavior addition over the current heredoc; the brief calls for it explicitly under "Loud failure".
- For
Step 2: Define the YAML schema and document scope/gate metadata (
vibecomfy/registry/models.yaml, top-of-file comment)Scope: Small
- Document the schema as a top-of-file YAML comment block in
models.yaml. Schema (one entry per model):yamlmodels: - id: ltx_2_3_22b_dev_fp8 # canonical id for cross-references source: kind: huggingface # huggingface | url repo: Lightricks/LTX-2.3-fp8 # required if kind=huggingface filename: ltx-2.3-22b-dev-fp8.safetensors # url: https://... # required if kind=url min_size: 20_000_000_000 # bytes; fail loud if smaller targets: - node_pack: lightricks path: models/checkpoints/ltx-2.3-22b-dev-fp8.safetensors aliases: # accepted names normalized to canonical - ltx-2.3-22b-dev.safetensors tags: [] # e.g. ltx_lean_excluded, requires_hf_token, lean_scope_excluded notes: | Free-form, not consumed by code. - Tags are the mechanism for scope/gate metadata. Reserved tags (consumed by
runpod_corpus_matrix.py):ltx_lean_excluded— entry is skipped whenVIBECOMFY_MATRIX_SCOPEis one ofltx_official, ltx_official_public, ltx_lightricks, ltx_iclora, ltx_iclora_public(matches the existingif not ltx_lean_model_scopegate atrunpod_corpus_matrix.py:520).requires_hf_token— entry is skipped ifHF_TOKENenv var is unset.excluded_in_public_scope— entry is skipped when scope isltx_official_publicorltx_iclora_public(matches the gated HDR LoRA logic at:560).phase:core,phase:gguf,phase:ltx,phase:wan_wrapper— used by the corpus matrix to select a phase's id list. Tag-based phase selection avoids hard-coding ids in the bash script.
- Loader validates: every entry has a unique
id, everyaliasesvalue is unique across the global namespace (else fail at load time), everytargets[].pathdoes not contain..and is non-absolute. Loud failure on any violation.
Step 3: Author the registry by extracting all four heredoc download lists (
vibecomfy/registry/models.yaml)Scope: Medium
- Translate every entry from the four
downloads = [...]lists inscripts/runpod_corpus_matrix.pyinto registry entries. Source ranges:- Core (
:371-393): 7 entries — Flux 2 klein 4b fp8, Z-Image qwen 3 4b text encoder, flux2-vae, four ACE Step entries. - GGUF (
:438-447): 2 entries — flux-2-klein-9b GGUF (3 targets), flux2-vae fromComfy-Org/flux2-klein-9B(note: same target as core's flux2-vae but different repo; assign distinct idflux2_vae_from_klein_9bwith tagphase:ggufand the core variant getsphase:coreso they never both stage). - LTX (
:512-564): 2 unconditional + 6 lean-excluded + 4 unconditional + 1 token-gated. - Wan wrapper (
:638-700): ~17 entries; preserve the literal-backslash-in-filename target rows verbatim.
- Core (
- Tag each entry with its phase (
phase:coreetc.). Lean-excluded LTX entries also getltx_lean_excluded. The HDR LoRA gets bothrequires_hf_tokenandexcluded_in_public_scope. - Translate every alias branch from
scripts/runpod_matrix_remote.pyinto the corresponding entry'saliases:list:_patch_ltx_common(:182-198):ltx-2.3-22b-dev.safetensors → LTX_CHECKPOINT;comfy_gemma_3_12B_it.safetensors,gemma_3_12B_it_fp8_scaled.safetensors,gemma_3_12B_it_fp4_mixed.safetensors → LTX_TEXT_ENCODER;LTX23_video_vae_bf16_KJ.safetensors → LTX_VIDEO_VAE;LTX23_audio_vae_bf16_KJ.safetensors → LTX_AUDIO_VAE;*taeltx2_3.safetensors → LTX_PREVIEW_VAE._patch_wanvideo_wrapper(:373-389): trailing-underscore Lightx2v variant, v0.1 → v1.1 control LoRA, Q8 → Q4_K_M GGUFs.- The "ltx-2.3-22b-distilled...transformer_only..." regex normalization at
:197is basename extraction, not alias mapping. Document this as a separate normalization rule the registry does not (yet) own — leave the regex in place for now and call it out as a follow-up.
- Verify exhaustiveness: write a one-off audit test (can be a transient pytest in Step 6) that re-parses the heredocs from
runpod_corpus_matrix.pyand asserts every(repo, filename, targets, min_size)tuple appears in the registry. If anything mismatches, the registry is wrong — fix the registry, not the test.
Step 4: Replace heredoc staging with registry calls (
scripts/runpod_corpus_matrix.py)Scope: Medium
- Replace each of the four heredoc blocks at
:347, :414, :488, :614with a single shell line:Thebash$PY -m vibecomfy.registry.models_loader stage \ --registry vibecomfy/registry/models.yaml \ --models-root models \ --select-phase core # or gguf | ltx | wan_wrapper--select-phase <name>filter expands to "include entries with tagphase:<name>, then apply scope filters (ltx_lean_excludedifVIBECOMFY_MATRIX_SCOPEis in the lean set,requires_hf_tokenifHF_TOKENunset, etc.)". This matches the existing per-phase gating at:520, :560exactly. - Preserve the existing scope env vars (
VIBECOMFY_MATRIX_SCOPE,HF_TOKEN) — the loader reads them. No change to bash logic that decides whether to enter eachif grep -q ... ltx_workflows.tsvblock. - Add a
VIBECOMFY_REGISTRY_LEGACY=1env-controlled fallback: when set, the bash emits the old heredocs unchanged. Implement this by keeping the existing heredoc text in a Python helper_legacy_heredoc_for_phase(phase: str) -> strinsiderunpod_corpus_matrix.py, returning either the new one-liner or the old heredoc. Remove after one passing matrix run (track via a# REMOVEME after one green matrixcomment).
Step 5: Replace alias normalization in remote.py (
scripts/runpod_matrix_remote.py)Scope: Medium
- Replace the module-level constants at
:12-19with thin lookups:These remain importable forpythonfrom vibecomfy.registry.models_loader import canonical_filename, normalize_alias, load_registry _REGISTRY = load_registry() LTX_CHECKPOINT = canonical_filename("ltx_2_3_22b_dev_fp8", registry=_REGISTRY) LTX_TEXT_ENCODER = canonical_filename("ltx_2_3_text_encoder", registry=_REGISTRY) # ... etc for all 8 constantstests/test_runpod_matrix.py:7. No test changes needed if the registry produces the same string values. - Replace the alias cascade in
_patch_ltx_common(:182-198). Pattern:This subsumes everypythonfor key, value in list(inputs.items()): if isinstance(value, str): normalized = normalize_alias(value, registry=_REGISTRY) if normalized is not None: inputs[key] = normalizedif value == X: inputs[key] = Ybranch. Behavior is preserved becausenormalize_aliasreturnsNonefor unknown values (current branches fall through too). - Replace the alias cascade in
_patch_ltx(:142-146) the same way. The only difference is_patch_ltxonly normalizes against LTX-family aliases — but since v1 uses a global alias namespace (per the brief's open question 2), the global call works. - Replace the wanvideo cascade in
_patch_wanvideo_wrapper(:373-389) the same way. - Keep the basename-extraction logic at
:197-198(ltx-2.3-22b-distilled...transformer_only...) and thetaeltx2_3suffix match at:195— these are pattern-based, not alias-based. Document the gap in a comment for follow-up.
Step 6: Add the
vibecomfy models stageCLI (vibecomfy/commands/models.py,vibecomfy/commands/__init__.py,vibecomfy/cli.py)Scope: Small
- Create
vibecomfy/commands/models.pyexposingregister(subparsers)and astagesubcommand:Defaults: registry path =codevibecomfy models stage [--registry PATH] [--models-root PATH] \ [--ids id1 id2 ...] [--select-phase NAME] \ [--dry-run]vibecomfy/registry/models.yaml, models-root =vibecomfy.fetch.models_root().--idsand--select-phaseare mutually exclusive; if both omitted, stage everything except entries excluded by env-derived scope filters. - Wire
--dry-run: print each entry's resolved source (HF cache path or URL), every target, current presence, size status. No staging side effects. - Register
CommandSpec("models", "vibecomfy.commands.models")in theCOMMANDStuple atvibecomfy/commands/__init__.py:14(alphabetical order would put it betweenlogsandnodes; insert wherever the convention is — current order looks usage-driven not alphabetical, append at a sensible spot). - Add a
__main__block tovibecomfy/registry/models_loader.pythat delegates to the samestageaction, sopython -m vibecomfy.registry.models_loader stage ...works inside the bash heredoc-replacement (which avoids the cli registration round-trip during runpod runs).
Step 7: Tests (
tests/test_models_registry.py,tests/test_runpod_matrix.py)Scope: Medium
- Create
tests/test_models_registry.pycovering:- YAML round-trip: load a small fixture registry, assert entry shape, count, ids, aliases.
stage_entrywith mockedhuggingface_hub.hf_hub_download(monkeypatch returning atmp_pathfile with sufficient size). Assert hardlink is created at every target, size check passes.stage_entryraises when staged file size < min_size (write a 1-byte file, expectRuntimeError).stage_entryraises when target exists as a non-symlink, non-hardlink-to-source file (collision protection from Step 1).normalize_aliasreturns canonical for known aliases,Nonefor unknowns.load_registryraises on duplicate ids, duplicate aliases, absolute paths,..in paths.- Phase/tag filtering: a sample registry with
phase:coreandphase:ggufentries returns the right subset under--select-phase core.
- Add to
tests/test_runpod_matrix.pya parity check that assertsLTX_CHECKPOINT,GGUF_MODEL,FLUX_VAE, etc. retain their pre-registry string values (regression guard against silent registry drift breaking the existing import contract). - Add a parity test that parses the four heredoc
downloads = [...]lists out ofscripts/runpod_corpus_matrix.py(regex-extract orast.parseof the heredoc body) and asserts every tuple has a matching registry entry. This is the "registry exhaustively reproduces current behavior" gate. Mark the testxfailand remove in a follow-up once the heredocs themselves are deleted (post-soak per the--legacy-stagingplan).
Execution Order
- Step 1 (deps + skeleton) and Step 2 (schema doc) — must land before any consumer reads the registry.
- Step 3 (author registry) — can be authored once skeleton exists; must be exhaustive before Step 4 swaps over.
- Step 4 (corpus matrix swap) and Step 5 (remote.py swap) are independent and can land in either order, but both depend on Step 3 being complete and verified.
- Step 6 (CLI) is independent of Steps 4 and 5; it can land alongside Step 1 if convenient.
- Step 7 (tests) — author the unit tests in Step 1's PR for the loader; add the parity tests with Steps 4–5.
Validation Order
-
Cheapest first:
python -m pytest tests/test_models_registry.py(pure unit, no network). -
Next:
python -m pytest tests/test_runpod_matrix.pyto confirm the_patch_*functions still produce the same outputs as before; the existing tests already cover canonical values viaLTX_CHECKPOINT/GGUF_MODELimports. -
Full suite:
python -m pytestto catch any incidental regression. -
Dry-run on a dev box:
vibecomfy models stage --dry-run --select-phase core --models-root /tmp/models-test— verify the planned operations match the old heredoc's intent (same repos, filenames, targets, min_sizes). -
Live runpod matrix: a full
python scripts/runpod_corpus_matrix.pyrun (scope=all). Capturefind models -type f -printf '%p %s\n' | sort > /tmp/post.txtbefore/after and diff. Zero-diff is the bar (manual / human verification). -
Negative test: append one fake alias and one fake target to a registry entry, run a workflow that uses that alias under a third node-pack name, confirm normalization + staging both fire with no code changes.
codeCurrent plan metadata: {
"version": 1, "timestamp": "2026-04-26T14:42:17Z", "hash": "sha256:87ace15bfbb7fe3af80a9d012aa33d983e1c7976b3a2cd2bd936bb8e110ee6bd", "questions": [ "Schema for URL-kind sources: should each url entry declare a
subdirexplicitly (thevibecomfy.fetch.downloadAPI takes{name, subdir, url}), or should the loader infer subdir from the firsttargets[].path's parent? Inference is simpler but couples URL fetch behavior to target layout in a possibly surprising way. (Current heredocs are all HF-kind, so this only matters for future url entries.)", "For the registry's interaction withvibecomfy/model_assets.py(which extracts model URLs from workflow JSONs at runtime to populateREADY_REQUIREMENTS), should the loader cross-reference: i.e., if amodel_assets-extracted name matches analiases:entry, normalize there too? V1 says no \u2014 model_assets stays as-is \u2014 but worth confirming.", "The_patch_ltx_commonregex normalizations atrunpod_matrix_remote.py:195(*taeltx2_3.safetensorssuffix match) and:197(ltx-2.3-22b-distilled...transformer_only...basename extraction) are pattern-based, not alias-based. Should v1 of the registry'saliases:field accept glob/regex patterns, or do these stay as inline code with a follow-up to widen the schema later? The brief implies plain string aliases only.", "Should--legacy-staging(the reversibility flag) live as a CLI flag onrunpod_corpus_matrix.pyor only as theVIBECOMFY_REGISTRY_LEGACYenv var? The brief mentions the flag generically; the matrix script is invoked from CI via env vars more than CLI args, so env is probably the better hook." ], "success_criteria": [ { "criterion": "vibecomfy/registry/models.yamlandvibecomfy/registry/models_loader.pyexist, loader exposesload_registry,stage_entry,stage_many,normalize_alias,canonical_filename, and is importable asfrom vibecomfy.registry.models_loader import ....", "priority": "must", "requires": [ "read_files", "run_shell" ] }, { "criterion": "pyyamlandhuggingface_hubare declared in[project].dependenciesofpyproject.toml(not only pip-installed inside the runpod heredoc).", "priority": "must", "requires": [ "read_files" ] }, { "criterion": "Every(repo, filename, targets, min_size)tuple from the fourdownloads = [...]lists inscripts/runpod_corpus_matrix.py(heredocs at lines ~347, ~414, ~488, ~614) has a corresponding entry inmodels.yamlwith identical values, including literal-backslash target paths and conditional gating expressed as tags.", "priority": "must", "requires": [ "read_files", "run_tests" ] }, { "criterion": "Every alias branch inscripts/runpod_matrix_remote.py(_patch_ltx,_patch_ltx_common,_patch_wanvideo_wrapper) is represented in the registry'saliases:field, except for pattern-based normalizations (taeltx2_3.safetensorssuffix,ltx-2.3-22b-distilled...transformer_only...basename), which are explicitly documented as deferred.", "priority": "must", "requires": [ "read_files" ] }, { "criterion": "The four heredocmaterialize_modelblocks inscripts/runpod_corpus_matrix.pyare replaced with singlepython -m vibecomfy.registry.models_loader stage --select-phase <name>invocations, with aVIBECOMFY_REGISTRY_LEGACY=1env-var fallback to the old heredocs.", "priority": "must", "requires": [ "read_files" ] }, { "criterion": "The alias-normalization branches and module-level constants inscripts/runpod_matrix_remote.py(lines 12-19, 142-146, 182-198, 373-389) are replaced with calls tonormalize_aliasandcanonical_filename. The 8 module constants remain importable with their pre-registry string values.", "priority": "must", "requires": [ "read_files", "run_tests" ] }, { "criterion": "vibecomfy models stageCLI command works with--dry-run,--ids,--select-phase,--registry,--models-rootflags. Registered invibecomfy/commands/__init__.py.", "priority": "must", "requires": [ "read_files", "run_shell" ] }, { "criterion": "tests/test_models_registry.pycovers: YAML round-trip, mockedhf_hub_downloadstaging, size-check failure, collision rejection, alias hits/misses, phase/tag filtering, validation errors (duplicate ids, duplicate aliases, absolute paths). All tests pass.", "priority": "must", "requires": [ "run_tests" ] }, { "criterion": "Existing test suite (pytest) passes, includingtests/test_runpod_matrix.pywhich importsLTX_CHECKPOINT, GGUF_MODELfrom the rewrittenrunpod_matrix_remote.py.", "priority": "must", "requires": [ "run_tests" ] }, { "criterion": "Loader rejects target paths containing..or absolute paths; loader rejects duplicate ids and duplicate aliases at load time, not at stage time.", "priority": "must", "requires": [ "run_tests" ] }, { "criterion": "Collision protection:stage_entryraises rather than overwriting a target that is a regular file unrelated to the source (not a symlink, not a hardlink to the source inode). Verified by unit test.", "priority": "must", "requires": [ "run_tests" ] }, { "criterion": "A full RunPod corpus matrix run (scope=all) completes successfully under the registry-driven path, andfind models -type fproduces a zero-diff output compared to a legacy-flag run.", "priority": "info", "requires": [ "verify_physical_device" ] }, { "criterion": "The 14 existing runtime-green workflows still go green on RunPod after the swap.", "priority": "info", "requires": [ "verify_physical_device" ] }, { "criterion": "Adding a fictional new node pack alias for an existing model requires only appending onealiases:line and onetargets:entry inmodels.yaml\u2014 no code changes elsewhere. Verified by inspection / a synthetic test.", "priority": "should", "requires": [ "read_files", "subjective_judgment" ] }, { "criterion": "Registry parsing is cached per-process;load_registry()does not re-parse YAML on repeat calls.", "priority": "should", "requires": [ "run_tests" ] }, { "criterion": "models_loader.pyandvibecomfy/commands/models.pyare each under ~300 lines with a single clear responsibility.", "priority": "should", "requires": [ "read_files", "subjective_judgment" ] } ], "assumptions": [ "The registry lives atvibecomfy/registry/models.yaml(default in the brief's open question 1; co-located with the loader for proximity). Revisit if a top-leveldata/directory becomes conventional.", "Alias namespace is global (no per-node-pack scoping) per the brief's open question 2. If two node packs ever need the same alias to map to different canonical models, revisit; loader fails at load time on duplicate aliases so the regression would be immediate.", "The parsed registry is cached per-process via a module-level dict inmodels_loader.py. Tests can clear the cache by calling a_clear_cache()helper.", "pyyamlandhuggingface_hub[hf_xet]>=0.32.0are added to[project].dependenciesinpyproject.toml. They are already pip-installed in the runpod heredoc; declaring them explicitly lets the loader work in dev/test environments without that bash setup.", "Phase selection uses tags (phase:core,phase:gguf,phase:ltx,phase:wan_wrapper) on each registry entry. The bash script passes--select-phase <name>to the loader, which filters to entries with that tag and additionally applies env-based scope filters (ltx_lean_excluded,requires_hf_token,excluded_in_public_scope).", "The collision-detection rule for already-existing target paths: a target is safe to overwrite if it is a symlink (any) or a hardlink whose inode matches the source's inode. Anything else (a real, independent file) raisesRuntimeErrorrather than silently overwriting. This is one strict-ness step beyond the current heredoc behavior, per the brief's 'loud failure' constraint.", "Module constants (LTX_CHECKPOINT, etc.) inrunpod_matrix_remote.pyremain at module top level as thincanonical_filename(<id>)lookups. They keep the existing import contract and emit the same string values, sotests/test_runpod_matrix.pydoes not need updating beyond an optional regression guard.", "Thevibecomfy/registry/__init__.pyre-exports the new loader symbols (load_registry,stage_entry,normalize_alias,canonical_filename,ModelEntry) without removing the existing workflow-template exports." ], "structure_warnings": [] }codeGate summary: {"recommendation": "ITERATE", "rationale": "Light robustness: single revision pass to incorporate critique feedback.", "signals_assessment": "", "warnings": [], "settled_decisions": [] }
codeOpen significant flags: [{ "id": "FLAG-001", "severity": "significant", "status": "open", "concern": "Staging paths: The plan will likely materialize files under
models/models/...instead of the paths used today. It keeps registrytargets[].pathvalues in the existing heredoc form such asmodels/diffusion_models/..., defines those paths as relative tomodels_root, and replaces the heredocs with--models-root models. Instage_entry,models_root / target.pathwould therefore producemodels/models/diffusion_models/..., so ComfyUI would not see the staged files at their existing locations.", "evidence": "Plan Step 2 schema examples usepath: models/checkpoints/...; Step 4 invokes--models-root models; existing heredocs stagePath(\"models/diffusion_models/flux-2-klein-4b-fp8.safetensors\")directly inscripts/runpod_corpus_matrix.py:371-393." } ]codeRequirements: - 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. - 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 Phasewith### 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.
-
Assistant
Revised the plan to fix FLAG-001. Key change: registry
target.pathis now relative tomodels_rootand never starts withmodels/. The translation step strips the leadingmodels/from every heredoc-extracted path. Loader rejects any path starting withmodels/ormodels\at load time, and a parity test confirms the strip was applied uniformly so the bug cannot reappear.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.