You are already running inside the megaplan harness for this step. Do the requested planning/review/execution work directly. Do NOT invoke the megaplan CLI, do NOT read or activate the megaplan skill, do NOT start nested megaplan plans, and do NOT recurse into another planning harness. Treat mentions of megaplan in the repository or environment as implementation context only.
You are an independent reviewer. Critique the plan against the actual repository.
vibecomfy: model-alias-registry v1 — collapse the four duplicated materialize_model heredoc blocks in runpod_corpus_matrix.py and the inline name-normalization rules in runpod_matrix_remote.py into one declarative YAML registry. No resolver service, no runtime indirection. Just a flat file that staging and normalization both read from.
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 local materialize_model(repo, filename, targets, min_size) function and a hardcoded downloads = [...] 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 is ltx-2.3-22b-dev.safetensors map it to X" branching — one branch per known alias. Adding a new model that ships under multiple node-pack names means appending another elif branch.
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 in ) 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.
{"checks":[],"flags":[{"id":"FLAG-001","concern":"Staging paths: The plan will likely materialize files under models/models/... instead of the paths used today. It keeps registry targets[].path values in the existing heredoc form such as models/diffusion_models/..., defines those paths as relative to models_root, and replaces the heredocs with --models-root models. In stage_entry, models_root / target.path would therefore produce models/models/diffusion_models/..., so ComfyUI would not see the staged files at their existing locations.","category":"correctness","severity_hint":"likely-significant","evidence":"Plan Step 2 schema examples use ; Step 4 invokes ; existing heredocs stage directly in ."},{"id":"FLAG-002","concern":"URL source staging: The proposed URL implementation cannot honor as written because derives its destination from environment/global , not the argument. A URL-kind registry entry staged with would download to , , or instead of the requested root before hardlinking/symlinking.","category":"correctness","severity_hint":"likely-minor","evidence":"Plan Step 1 says URL entries call inside ; shows calls , which calls module-level and has no parameter for an explicit root."}],"verified_flag_ids":[],"disputed_flag_ids":[]}
Assistant
{"checks":[],"flags":[{"id":"FLAG-001","concern":"Staging paths: The plan will likely materialize files under models/models/... instead of the paths used today. It keeps registry targets[].path values in the existing heredoc form such as models/diffusion_models/..., defines those paths as relative to models_root, and replaces the heredocs with --models-root models. In stage_entry, models_root / target.path would therefore produce models/models/diffusion_models/..., so ComfyUI would not see the staged files at their existing locations.","category":"correctness","severity_hint":"likely-significant","evidence":"Plan Step 2 schema examples use ; Step 4 invokes ; existing heredocs stage directly in ."},{"id":"FLAG-002","concern":"URL source staging: The proposed URL implementation cannot honor as written because derives its destination from environment/global , not the argument. A URL-kind registry entry staged with would download to , , or instead of the requested root before hardlinking/symlinking.","category":"correctness","severity_hint":"likely-minor","evidence":"Plan Step 1 says URL entries call inside ; shows calls , which calls module-level and has no parameter for an explicit root."}],"verified_flag_ids":[],"disputed_flag_ids":[]}
model_layout
docs/hiddenswitch_incompatibilities.md
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_model blocks in runpod_corpus_matrix.py with a single loader that reads the YAML and runs the same hardlink-or-symlink, size-check, fail-loud logic.
Replace the alias-normalization branches in runpod_matrix_remote.py with a single lookup against the YAML's aliases field.
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.py contains the four heredoc blocks: lines 380, 447, 521, 647. Each defines materialize_model(repo, filename, targets, min_size) with the same body (hardlink-or-symlink fallback, size check) and a different downloads = [...] list scoped to a different matrix phase.
scripts/runpod_corpus_matrix.py:67 already pip-installs huggingface_hub[hf_xet]>=0.32.0, so hf_hub_download is available.
scripts/runpod_matrix_remote.py:12-19 declares the LTX/Flux module constants. Lines 143–195 contain the cascade of if value == "X": inputs[key] = "Y" normalization branches (LTX-specific). Lines 376–379 contain Wan-specific equivalents.
vibecomfy/model_assets.py already extracts (name, subdir, url) triples from upstream Comfy-Org workflow JSONs. Those triples populate READY_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.py already exists with download_many and atomic-rename semantics. The registry CLI should reuse vibecomfy.fetch for non-HF URLs and huggingface_hub.hf_hub_download for HF entries (matching the heredoc behavior).
The doc entry Model name and directory conventions differ across node packs in docs/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 (or data/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 in runpod_corpus_matrix.py. Convert each to a registry entry. Preserve min_size exactly.
Read every alias branch in runpod_matrix_remote.py (the if value == X: inputs[key] = Y and value in {A, B}: ... blocks). Convert each to an aliases: list under the canonical entry.
Read the module-level constants (LTX_CHECKPOINT, etc.) and confirm each maps to a registry entry's id.
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:
stage_entry(entry: ModelEntry, *, models_root: Path) -> list[Path] — hardlink-or-symlink into every targets[].path under models_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.
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 if value matches any entry's aliases (optionally constrained by node_pack), else None.
In runpod_matrix_remote.py, replace the cascade of if value == X: inputs[key] = Y branches with one call to normalize_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.
For HF entries, use huggingface_hub.hf_hub_download (matching heredoc behavior — falls back to authentication via HF_TOKEN env var if set).
For URL entries, use vibecomfy.fetch.download (already exists).
--dry-run prints 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_hub already provides.
Auto-detection of node packs from installed Python packages.
SHA256 verification (vibecomfy/.megaplan-idea.md already defers this to a follow-up; same applies here).
A "models doctor" that gates execution. Doctor work is deferred per the hiddenswitch_incompatibilities.md decision; 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.py extraction 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: pyyaml is in the matrix's pip install line; confirm it's also in pyproject.toml. If not, add it (it's tiny).
Reversibility: keep the heredoc blocks behind a --legacy-staging flag 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_layout row in hiddenswitch_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 f before/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 one targets: entry to the registry — no code changes elsewhere.
Unit tests in tests/test_models_registry.py: load+roundtrip a sample registry, stage with mocked hf_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) or data/models.yaml (a top-level data dir)? Lean toward vibecomfy/registry/models.yaml for proximity to the loader; revisit if other registries appear.
Should normalize_alias be 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.
Collapse the four duplicated materialize_model heredoc blocks in scripts/runpod_corpus_matrix.py and the inline alias-normalization branches in scripts/runpod_matrix_remote.py into a single declarative YAML registry consumed by both. No resolver service. The registry lives at vibecomfy/registry/models.yaml next to a new vibecomfy/registry/models_loader.py. A new vibecomfy models stage CLI command materializes any subset of the registry into a target models root using huggingface_hub.hf_hub_download for HF entries and vibecomfy.fetch.download for URL entries.
Touched call sites confirmed:
Four heredoc materialize_model blocks at scripts/runpod_corpus_matrix.py:347 (core), :414 (gguf), :488 (ltx), :614 (wan_wrapper). Each contains an identical materialize_model(repo, filename, targets, min_size) Python function and a phase-specific downloads = [...] 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 by tests/test_runpod_matrix.py:7.
Constraints that matter:
pyyaml is not in pyproject.toml (pyproject.toml:11-14 lists only httpx and websockets). It is pip-installed inside the runpod heredoc at scripts/runpod_corpus_matrix.py:67. The loader must work in both contexts; add pyyaml to [project].dependencies.
Some targets lists contain Windows-style literal backslashes (e.g. models/vae/wanvideo\Wan2_1_VAE_bf16.safetensors at :644, MelBandRoformer entries at :696-699). These are deliberate filenames-with-backslashes, not path separators. YAML must preserve them; the loader must treat each target.path as a literal name relative to models_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 reuses flux2-vae.safetensors from a different repo than core (:444 vs :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 new models_loader.py and models.yaml are additive.
tests/test_runpod_matrix.py:7 imports GGUF_MODEL, LTX_CHECKPOINT from scripts.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
Addpyyaml>=6 to [project].dependencies in pyproject.toml:11. Confirm huggingface_hub>=0.32 is also declared (it is currently only pip-installed inside the matrix heredoc at scripts/runpod_corpus_matrix.py:67); add it to [project].dependencies so the loader can import huggingface_hub outside the runpod context as well.
Createvibecomfy/registry/models.yaml (empty top-level list models: [] for now — populated in Step 3).
Createvibecomfy/registry/models_loader.py with the public surface:
Implement an in-process LRU cache for the parsed registry (module-level singleton _REGISTRY_CACHE: dict[Path, tuple[ModelEntry, ...]]) so repeated load_registry() calls within a single process do not re-parse YAML. The default path is Path(__file__).with_name("models.yaml").
Mirror the existing heredoc staging behavior verbatim in stage_entry:
For kind=huggingface: call huggingface_hub.hf_hub_download(repo_id=source.repo, filename=source.filename), resolve, size-check against min_size, fail loud if smaller.
For kind=url: call vibecomfy.fetch.download({"name": canonical_filename, "subdir": <derived>, "url": source.url}). (See open question on subdir derivation.)
For each target in entry.targets: models_root / target.path. Run mkdir -p on 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 raise RuntimeError(f"refusing to overwrite non-owned file at {target}"). Try os.link(source, target) first, fall back to os.symlink on OSError. 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".
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):
yaml
models:
- 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 when VIBECOMFY_MATRIX_SCOPE is one of ltx_official, ltx_official_public, ltx_lightricks, ltx_iclora, ltx_iclora_public (matches the existing if not ltx_lean_model_scope gate at runpod_corpus_matrix.py:520).
requires_hf_token — entry is skipped if HF_TOKEN env var is unset.
excluded_in_public_scope — entry is skipped when scope is ltx_official_public or ltx_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, every aliases value is unique across the global namespace (else fail at load time), every targets[].path does 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 in scripts/runpod_corpus_matrix.py into 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 from Comfy-Org/flux2-klein-9B (note: same target as core's flux2-vae but different repo; assign distinct id flux2_vae_from_klein_9b with tag phase:gguf and the core variant gets phase:core so they never both stage).
Wan wrapper (:638-700): ~17 entries; preserve the literal-backslash-in-filename target rows verbatim.
Tag each entry with its phase (phase:core etc.). Lean-excluded LTX entries also get ltx_lean_excluded. The HDR LoRA gets both requires_hf_token and excluded_in_public_scope.
Translate every alias branch from scripts/runpod_matrix_remote.py into the corresponding entry's aliases: list:
The "ltx-2.3-22b-distilled...transformer_only..." regex normalization at :197 is 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.py and 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, :614 with a single shell line:
The --select-phase <name> filter expands to "include entries with tag phase:<name>, then apply scope filters (ltx_lean_excluded if VIBECOMFY_MATRIX_SCOPE is in the lean set, requires_hf_token if HF_TOKEN unset, etc.)". This matches the existing per-phase gating at :520, :560 exactly.
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 each if grep -q ... ltx_workflows.tsv block.
Add a VIBECOMFY_REGISTRY_LEGACY=1 env-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) -> str inside runpod_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 matrix comment).
Step 5: Replace alias normalization in remote.py (scripts/runpod_matrix_remote.py)
Scope: Medium
Replace the module-level constants at :12-19 with thin lookups:
python
from 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 constants
These remain importable for tests/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:
python
for key, value in list(inputs.items()):
if isinstance(value, str):
normalized = normalize_alias(value, registry=_REGISTRY)
if normalized is not None:
inputs[key] = normalized
This subsumes every if value == X: inputs[key] = Y branch. Behavior is preserved because normalize_alias returns None for unknown values (current branches fall through too).
Replace the alias cascade in _patch_ltx (:142-146) the same way. The only difference is _patch_ltx only 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 the taeltx2_3 suffix match at :195 — these are pattern-based, not alias-based. Document the gap in a comment for follow-up.
Defaults: registry path = vibecomfy/registry/models.yaml, models-root = vibecomfy.fetch.models_root(). --ids and --select-phase are 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.
RegisterCommandSpec("models", "vibecomfy.commands.models") in the COMMANDS tuple at vibecomfy/commands/__init__.py:14 (alphabetical order would put it between logs and nodes; insert wherever the convention is — current order looks usage-driven not alphabetical, append at a sensible spot).
Add a __main__ block to vibecomfy/registry/models_loader.py that delegates to the same stage action, so python -m vibecomfy.registry.models_loader stage ... works inside the bash heredoc-replacement (which avoids the cli registration round-trip during runpod runs).
YAML round-trip: load a small fixture registry, assert entry shape, count, ids, aliases.
stage_entry with mocked huggingface_hub.hf_hub_download (monkeypatch returning a tmp_path file with sufficient size). Assert hardlink is created at every target, size check passes.
stage_entry raises when staged file size < min_size (write a 1-byte file, expect RuntimeError).
stage_entry raises when target exists as a non-symlink, non-hardlink-to-source file (collision protection from Step 1).
normalize_alias returns canonical for known aliases, None for unknowns.
load_registry raises on duplicate ids, duplicate aliases, absolute paths, .. in paths.
Phase/tag filtering: a sample registry with phase:core and phase:gguf entries returns the right subset under --select-phase core.
Add to tests/test_runpod_matrix.py a parity check that asserts LTX_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 of scripts/runpod_corpus_matrix.py (regex-extract or ast.parse of the heredoc body) and asserts every tuple has a matching registry entry. This is the "registry exhaustively reproduces current behavior" gate. Mark the test xfail and remove in a follow-up once the heredocs themselves are deleted (post-soak per the --legacy-staging plan).
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.py to confirm the _patch_* functions still produce the same outputs as before; the existing tests already cover canonical values via LTX_CHECKPOINT/GGUF_MODEL imports.
Full suite: python -m pytest to 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.py run (scope=all). Capture find models -type f -printf '%p %s\n' | sort > /tmp/post.txt before/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.
code
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 subdir explicitly (the vibecomfy.fetch.download API takes {name, subdir, url}), or should the loader infer subdir from the first targets[].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 with vibecomfy/model_assets.py (which extracts model URLs from workflow JSONs at runtime to populate READY_REQUIREMENTS), should the loader cross-reference: i.e., if a model_assets-extracted name matches an aliases: entry, normalize there too? V1 says no \u2014 model_assets stays as-is \u2014 but worth confirming.",
"The _patch_ltx_common regex normalizations at runpod_matrix_remote.py:195 (*taeltx2_3.safetensors suffix match) and :197 (ltx-2.3-22b-distilled...transformer_only... basename extraction) are pattern-based, not alias-based. Should v1 of the registry's aliases: 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 on runpod_corpus_matrix.py or only as the VIBECOMFY_REGISTRY_LEGACY env 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.yaml and vibecomfy/registry/models_loader.py exist, loader exposes load_registry, stage_entry, stage_many, normalize_alias, canonical_filename, and is importable as from vibecomfy.registry.models_loader import ....",
"priority": "must",
"requires": [
"read_files",
"run_shell"
]
},
{
"criterion": "pyyaml and huggingface_hub are declared in [project].dependencies of pyproject.toml (not only pip-installed inside the runpod heredoc).",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": "Every (repo, filename, targets, min_size) tuple from the four downloads = [...] lists in scripts/runpod_corpus_matrix.py (heredocs at lines ~347, ~414, ~488, ~614) has a corresponding entry in models.yaml with identical values, including literal-backslash target paths and conditional gating expressed as tags.",
"priority": "must",
"requires": [
"read_files",
"run_tests"
]
},
{
"criterion": "Every alias branch in scripts/runpod_matrix_remote.py (_patch_ltx, _patch_ltx_common, _patch_wanvideo_wrapper) is represented in the registry's aliases: field, except for pattern-based normalizations (taeltx2_3.safetensors suffix, ltx-2.3-22b-distilled...transformer_only... basename), which are explicitly documented as deferred.",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": "The four heredoc materialize_model blocks in scripts/runpod_corpus_matrix.py are replaced with single python -m vibecomfy.registry.models_loader stage --select-phase <name> invocations, with a VIBECOMFY_REGISTRY_LEGACY=1 env-var fallback to the old heredocs.",
"priority": "must",
"requires": [
"read_files"
]
},
{
"criterion": "The alias-normalization branches and module-level constants in scripts/runpod_matrix_remote.py (lines 12-19, 142-146, 182-198, 373-389) are replaced with calls to normalize_alias and canonical_filename. The 8 module constants remain importable with their pre-registry string values.",
"priority": "must",
"requires": [
"read_files",
"run_tests"
]
},
{
"criterion": "vibecomfy models stage CLI command works with --dry-run, --ids, --select-phase, --registry, --models-root flags. Registered in vibecomfy/commands/__init__.py.",
"priority": "must",
"requires": [
"read_files",
"run_shell"
]
},
{
"criterion": "tests/test_models_registry.py covers: YAML round-trip, mocked hf_hub_download staging, 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, including tests/test_runpod_matrix.py which imports LTX_CHECKPOINT, GGUF_MODEL from the rewritten runpod_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_entry raises 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, and find models -type f produces 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 one aliases: line and one targets: entry in models.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.py and vibecomfy/commands/models.py are each under ~300 lines with a single clear responsibility.",
"priority": "should",
"requires": [
"read_files",
"subjective_judgment"
]
}
],
"assumptions": [
"The registry lives at vibecomfy/registry/models.yaml (default in the brief's open question 1; co-located with the loader for proximity). Revisit if a top-level data/ 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 in models_loader.py. Tests can clear the cache by calling a _clear_cache() helper.",
"pyyaml and huggingface_hub[hf_xet]>=0.32.0 are added to [project].dependencies in pyproject.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) raises RuntimeError rather 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.) in runpod_matrix_remote.py remain at module top level as thin canonical_filename(<id>) lookups. They keep the existing import contract and emit the same string values, so tests/test_runpod_matrix.py does not need updating beyond an optional regression guard.",
"The vibecomfy/registry/__init__.py re-exports the new loader symbols (load_registry, stage_entry, normalize_alias, canonical_filename, ModelEntry) without removing the existing workflow-template exports."
],
"structure_warnings": []
}
code
Plan structure warnings from validator:
[]
Existing flags:
[]
Known accepted debt grouped by subsystem:
{}
Escalated debt subsystems:
[]
Debt guidance:
These are known accepted limitations. Do not re-flag them unless the current plan makes them worse, broadens them, or fails to contain them.
Prefix every new concern with a subsystem tag followed by a colon, for example Timeout recovery: retry backoff remains brittle.
When a concern is recurring debt that still needs to be flagged, prefix it with Recurring debt: after the subsystem tag, for example Timeout recovery: Recurring debt: retry backoff remains brittle.
code
Your output template is at: /Users/user_c042661f/Documents/reigh-workspace/.megaplan-worktrees/vibecomfy-registry/.megaplan/plans/vibecomfy-model-alias-20260426-1637/critique_output.json
Review the plan with a broad scope. Consider whether the approach is correct, whether it covers
all the places it needs to, whether it would break callers or violate codebase conventions,
and whether its verification strategy is adequate.
Place any concrete concerns in the flags array in the template file using the standard format
(id, concern, category, severity_hint, evidence). Leave checks as an empty array.
Workflow: read the file → investigate → read file again → add findings → write file back.
code
Additional guidelines:
- Robustness level: light. Be pragmatic. Only flag issues that would cause real failures. Ignore style, minor edge cases, and issues the executor will naturally resolve.
- Over-engineering: prefer the simplest approach that fully solves the problem.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids`: list flag IDs from prior iterations that the revised plan actually resolves (e.g., if the plan was revised to fix FLAG-001, and you confirm the fix is correct, include "FLAG-001"). Only include flags you've verified — don't guess.
- Verify that the plan follows the expected structure when validator warnings or the outline suggest drift.
- Additional flags may use these categories: correctness, security, completeness, performance, maintainability, other.
- Focus on concrete issues, not structural formatting.