From 559027dbd39d5fc1d9ccf8c281080009ed9519f6 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Tue, 17 Nov 2026 00:47:08 +0000 Subject: [PATCH 1/2] =?UTF-8?q?feat(generate):=20add=20alias=20=E2=86=92?= =?UTF-8?q?=20Router=20v2=20id=20table=20and=20drop=20five=20retired=20ali?= =?UTF-8?q?ases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Delete five aliases whose cloud routes are retired (every submit was already refused by comfy-api): kling-extend, luma, luma-i2v, moonvalley-t2v and moonvalley-i2v — from _ALIASES and _ENDPOINT_ALLOWLIST, along with the now-unused luma/moonvalley poller rows. Typing one now returns the normal unknown-model error with suggestions rather than failing at the proxy. Add _ROUTER_IDS (alias → Router v2 id) with a router_id() helper, kept exhaustive over the remaining 40 aliases. The table is data only; the Router client that will consume it is separate work. --- CHANGELOG.md | 10 +++ README.md | 4 +- comfy_cli/command/generate/poll.py | 16 ---- comfy_cli/command/generate/spec.py | 85 +++++++++++++++---- comfy_cli/schemas/generate_schema.json | 2 +- tests/comfy_cli/command/generate/test_app.py | 30 +------ tests/comfy_cli/command/generate/test_spec.py | 49 +++++++++++ .../command/generate/test_video_poll.py | 30 +------ 8 files changed, 132 insertions(+), 94 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5c9f271e..338a53147 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,16 @@ history. (`exact: true` for deployments, no `truncated` for releases), and the note saying it can read low is left out. `note` is empty when nothing is left to say. +### Removed + +- `comfy generate` drops five model aliases whose cloud routes are retired, so + every submit was already refused: `kling-extend` (Kling retired the V1.x + models the video-extend route accepts), `luma` and `luma-i2v` (Luma retired + its Ray video models and shut Photon down), and `moonvalley-t2v` / + `moonvalley-i2v` (Moonvalley exited and its `/proxy` routes were removed). + Typing one now returns the usual unknown-model error with suggestions rather + than failing at the proxy. + ### Fixed - The `comfy-build`, `comfy-build-pins`, `comfy-build-authoring` and diff --git a/README.md b/README.md index 642d9041e..56e496991 100644 --- a/README.md +++ b/README.md @@ -532,9 +532,9 @@ with `comfy generate resume `. Examples: comfy generate kling --prompt "a paper boat drifting on a river at dusk" \ --duration 5 --download boat.mp4 -comfy generate luma --prompt "..." --aspect_ratio 16:9 --async +comfy generate vidu --prompt "..." --async # → prints job id; resume with: -comfy generate resume luma --download out.mp4 +comfy generate resume vidu --download out.mp4 ``` **Gemini Flash Image (nano-banana)** — text-to-image and image edits in one diff --git a/comfy_cli/command/generate/poll.py b/comfy_cli/command/generate/poll.py index 11629a906..f0c2dfb43 100644 --- a/comfy_cli/command/generate/poll.py +++ b/comfy_cli/command/generate/poll.py @@ -191,14 +191,6 @@ class PollSpec: success_values=("succeed",), failure_values=("failed",), ), - "luma": PollSpec( - name="luma", - id_paths=("id",), - poll_url="/proxy/luma/generations/{id}", - status_paths=("state",), - success_values=("completed",), - failure_values=("failed",), - ), "minimax": PollSpec( name="minimax", id_paths=("task_id",), @@ -218,14 +210,6 @@ class PollSpec: failure_values=("FAILED", "CANCELLED", "THROTTLED"), progress_path="progress", ), - "moonvalley": PollSpec( - name="moonvalley", - id_paths=("id",), - poll_url="/proxy/moonvalley/prompts/{id}", - status_paths=("status",), - success_values=("completed",), - failure_values=("failed", "error"), - ), "pika": PollSpec( name="pika", id_paths=("video_id", "id"), diff --git a/comfy_cli/command/generate/spec.py b/comfy_cli/command/generate/spec.py index 64ac1359a..53614caf2 100644 --- a/comfy_cli/command/generate/spec.py +++ b/comfy_cli/command/generate/spec.py @@ -95,7 +95,7 @@ class Endpoint: request_schema: dict[str, Any] # resolved (no $ref) request body schema request_content_type: str # "application/json" | "multipart/form-data" response_schema: dict[str, Any] # resolved 200 response schema - polling: str | None # "bfl" | "kling" | "luma" | "topaz" | None + polling: str | None # "bfl" | "kling" | "seedance" | None # Short, creative-facing aliases mapping to the curated openapi paths below. @@ -139,18 +139,11 @@ class Endpoint: # Video — Kling "kling": "kling/v1/videos/text2video", "kling-i2v": "kling/v1/videos/image2video", - "kling-extend": "kling/v1/videos/video-extend", "kling-lipsync": "kling/v1/videos/lip-sync", - # Video — Luma Dream Machine - "luma": "luma/generations", - "luma-i2v": "luma/generations/image", # Video — MiniMax / Hailuo "hailuo": "minimax/video_generation", # Video — Runway Gen-3 "runway-i2v": "runway/image_to_video", - # Video — Moonvalley - "moonvalley-t2v": "moonvalley/prompts/text-to-video", - "moonvalley-i2v": "moonvalley/prompts/image-to-video", # Video — Pika "pika": "pika/generate/2.2/t2v", "pika-i2v": "pika/generate/2.2/i2v", @@ -168,6 +161,73 @@ class Endpoint: } +# Router v2 id for each alias. None = proxy-only today: the operation has no +# Router id (non-JSON encoding, or an unbound model family). A value ending in +# "/{model}" is a family: the alias's --model becomes the id suffix, and the +# second element is the default when --model is omitted. +# This table is data only — nothing in `comfy generate` consumes it yet; the +# Router client that will read it is separate work. Keep it exhaustive over +# `_ALIASES` (the test in test_spec.py enforces that). +_ROUTER_IDS: dict[str, tuple[str, str | None] | None] = { + "flux-pro": ("bfl/flux-pro-1.1", None), + "flux-ultra": ("bfl/flux-pro-1.1-ultra", None), + "flux-2": ("bfl/flux-2-pro", None), + "flux-kontext": ("bfl/flux-kontext-pro", None), + "flux-kontext-max": ("bfl/flux-kontext-max", None), + "flux-fill": ("bfl/flux-pro-1.0-fill", None), + "flux-expand": ("bfl/flux-pro-1.0-expand", None), + "ideogram": ("ideogram/ideogram-v3", None), + "ideogram-edit": None, + "ideogram-remix": None, + "ideogram-reframe": None, + "ideogram-bg": None, + "recraft": ("recraft/{model}", "recraftv3"), + "recraft-vectorize": None, + "recraft-upscale": None, + "recraft-upscale-creative": None, + "recraft-rmbg": None, + "recraft-replace-bg": None, + "recraft-i2i": None, + "recraft-inpaint": None, + "dalle": ("openai/{model}", "gpt-image-2.5-sunburst"), + "dalle-edit": ("openai/{model}", "gpt-image-2.5-sunburst"), # same id; Router selects edits when `image` is present + "grok": ("xai/grok-imagine-image", None), + "grok-edit": ("xai/grok-imagine-image", None), # same id; `image`/`images` selects the edit + "reve": None, + "reve-edit": None, + "runway": ("runway/gen4_image", None), + "runway-i2v": ("runway/gen4_turbo", None), + "kling": ("kling/{model}", "kling-v2-5-turbo"), + "kling-i2v": ("kling/{model}", "kling-v2-5-turbo"), # same id; `image` selects image2video + "kling-lipsync": ("kling/videos-lip-sync", None), + "hailuo": None, + "pika": None, + "pika-i2v": None, + "vidu": None, + "vidu-i2v": None, + "vidu-extend": None, + "grok-video": ("xai/grok-imagine-video", None), + "nano-banana": ("vertexai/{model}", "gemini-2.5-flash-image"), + "seedance": ("byteplus/{model}", "seedance-1-0-pro-250528"), +} + + +def router_id(alias: str, model: str | None = None) -> str | None: + """Router v2 id for an alias, or None when the alias is proxy-only. + + For a family id (one whose template contains ``{model}``) the suffix is + ``model`` when given, else the table's default; a non-family id is returned + unchanged. An alias absent from the table is treated as proxy-only (None), + so callers never raise on a stray key.""" + entry = _ROUTER_IDS.get(alias) + if entry is None: + return None + template, default = entry + if "{model}" in template: + return template.replace("{model}", model or default or "") + return template + + # Used in the `list` table for endpoints whose openapi summary is empty or too # generic to convey what the model is. _SUMMARY_OVERRIDES: dict[str, str] = { @@ -244,18 +304,11 @@ def resolve_alias(target: str) -> str: # Video — Kling ("kling/v1/videos/text2video", "text-to-video", "kling"), ("kling/v1/videos/image2video", "image-to-video", "kling"), - ("kling/v1/videos/video-extend", "video-extend", "kling"), ("kling/v1/videos/lip-sync", "lipsync", "kling"), - # Video — Luma - ("luma/generations", "text-to-video", "luma"), - ("luma/generations/image", "image-to-video", "luma"), # Video — MiniMax / Hailuo ("minimax/video_generation", "text-to-video", "minimax"), # Video — Runway ("runway/image_to_video", "image-to-video", "runway"), - # Video — Moonvalley - ("moonvalley/prompts/text-to-video", "text-to-video", "moonvalley"), - ("moonvalley/prompts/image-to-video", "image-to-video", "moonvalley"), # Video — Pika ("pika/generate/2.2/t2v", "text-to-video", "pika"), ("pika/generate/2.2/i2v", "image-to-video", "pika"), @@ -497,8 +550,6 @@ def _detect_polling(partner: str, response_schema: dict[str, Any]) -> str | None return "bfl" if partner == "kling" and "data" in props: return "kling" - if partner == "luma" and ("state" in props or "id" in props): - return "luma" if partner == "topaz" and "process_id" in props: return "topaz" return None diff --git a/comfy_cli/schemas/generate_schema.json b/comfy_cli/schemas/generate_schema.json index 06b6fa4c3..be906a288 100644 --- a/comfy_cli/schemas/generate_schema.json +++ b/comfy_cli/schemas/generate_schema.json @@ -33,7 +33,7 @@ }, "polling": { "type": ["string", "null"], - "description": "Poller family driving the async result fetch (bfl, kling, luma, topaz), or null for sync models." + "description": "Poller family driving the async result fetch (e.g. bfl, kling, runway, seedance), or null for sync models." }, "content_type": { "type": "string", diff --git a/tests/comfy_cli/command/generate/test_app.py b/tests/comfy_cli/command/generate/test_app.py index dace1849a..49fa8369e 100644 --- a/tests/comfy_cli/command/generate/test_app.py +++ b/tests/comfy_cli/command/generate/test_app.py @@ -775,34 +775,6 @@ def test_video_kling_async_path(runner, api_key, monkeypatch): assert "https://cdn.example/k.mp4" in r.stdout -def test_video_luma_async_path(runner, api_key, monkeypatch): - submit = httpx.Response(200, json={"id": "luma-1", "state": "queued"}) - done = httpx.Response(200, json={"id": "luma-1", "state": "completed", "assets": {"video": "https://cdn/l.mp4"}}) - monkeypatch.setattr(gen_app.client.httpx, "post", lambda *a, **kw: submit) - monkeypatch.setattr("comfy_cli.command.generate.client.get", lambda *a, **kw: done) - monkeypatch.setattr("comfy_cli.command.generate.poll._sleep", lambda *_: None) - - r = runner.invoke( - cli_app, - [ - "generate", - "luma", - "--prompt", - "a cat", - "--aspect_ratio", - "16:9", - "--model", - "ray-2", - "--resolution", - "{}", - "--duration", - "{}", - ], - ) - assert r.exit_code == 0, r.stdout - assert "https://cdn/l.mp4" in r.stdout - - def test_video_runway_failure_surfaces(runner, api_key, monkeypatch): submit = httpx.Response(200, json={"id": "rw-1"}) fail = httpx.Response(200, json={"id": "rw-1", "status": "FAILED"}) @@ -861,7 +833,7 @@ def test_list_video_filter(runner): r = runner.invoke(cli_app, ["generate", "list", "--style", "text-to-video"]) assert r.exit_code == 0 assert "kling" in r.stdout - assert "luma" in r.stdout + assert "seedance" in r.stdout assert "pika" in r.stdout diff --git a/tests/comfy_cli/command/generate/test_spec.py b/tests/comfy_cli/command/generate/test_spec.py index 80a82a3c2..53af9a09a 100644 --- a/tests/comfy_cli/command/generate/test_spec.py +++ b/tests/comfy_cli/command/generate/test_spec.py @@ -1,6 +1,7 @@ """Tests for the openapi registry — verify the curated image allowlist resolves against the vendored spec and classifies each endpoint correctly.""" +import re from unittest import mock import pytest @@ -603,6 +604,54 @@ def test_find_property_descends_top_level_composition(): assert spec._find_property({"allOf": [{"type": "object"}]}, "model") is None +# ── dead aliases — retired on /proxy, removed from the alias table ── + + +@pytest.mark.parametrize("dead", ["kling-extend", "luma", "luma-i2v", "moonvalley-t2v", "moonvalley-i2v"]) +def test_retired_aliases_removed(dead): + """The five aliases dead on /proxy are gone from both tables, and typing + one yields the normal unknown-model error — not a silent skip.""" + assert dead not in spec._ALIASES + endpoint_ids = {eid for eid, _cat, _poll in spec._ENDPOINT_ALLOWLIST} + assert spec.resolve_alias(dead) not in endpoint_ids + with pytest.raises(spec.SpecError) as excinfo: + spec.get_endpoint(dead) + assert "Unknown model" in str(excinfo.value) + + +# ── _ROUTER_IDS — the alias → Router v2 id table ── + + +def test_router_ids_exhaustive_over_aliases(): + """Every alias has a Router-id row and vice versa (40 rows after the + dead-alias removal).""" + assert set(spec._ROUTER_IDS) == set(spec._ALIASES) + assert len(spec._ROUTER_IDS) == 40 + + +def test_router_ids_match_router_segment_pattern(): + """Every non-None id matches Router's segment pattern, with `{model}` + allowed in the model segment of a family id.""" + pattern = re.compile(r"^[a-z0-9]+([._-][a-z0-9]+)*/[a-z0-9{}]+([._-][a-z0-9{}]+)*$") + for alias, entry in spec._ROUTER_IDS.items(): + if entry is None: + continue + template, _default = entry + assert pattern.match(template), f"{alias}: {template!r} fails the Router segment pattern" + + +def test_router_id_resolves_families_and_proxy_only(): + assert spec.router_id("recraft") == "recraft/recraftv3" + assert spec.router_id("recraft", "recraftv4_pro") == "recraft/recraftv4_pro" + assert spec.router_id("vidu") is None + # i2v shares the base alias's id — Router selects image2video from the payload. + assert spec.router_id("kling-i2v") == spec.router_id("kling") + # A plain (non-family) id ignores --model. + assert spec.router_id("flux-pro", "anything") == "bfl/flux-pro-1.1" + # An alias not in the table is treated as proxy-only. + assert spec.router_id("not-an-alias") is None + + # ── allowlist / alias drift against the bundled spec ────────────────────── diff --git a/tests/comfy_cli/command/generate/test_video_poll.py b/tests/comfy_cli/command/generate/test_video_poll.py index 5f8d4ac7a..b46fc8f1d 100644 --- a/tests/comfy_cli/command/generate/test_video_poll.py +++ b/tests/comfy_cli/command/generate/test_video_poll.py @@ -41,21 +41,6 @@ def fake_get(url, **kw): assert result.image_urls == ["https://cdn/v.mp4"] -def test_luma_succeeds(no_sleep, monkeypatch): - monkeypatch.setattr( - "comfy_cli.command.generate.client.get", - _make_runner( - [ - _resp({"id": "luma-1", "state": "dreaming"}), - _resp({"id": "luma-1", "state": "completed", "assets": {"video": "https://cdn/x.mp4"}}), - ] - ), - ) - result = poll.get_poller("luma")({"id": "luma-1", "state": "queued"}, api_key="k") - assert result.status == "succeeded" - assert "https://cdn/x.mp4" in result.image_urls - - def test_runway_progress_normalized(no_sleep, monkeypatch): """Runway reports progress as 0–1 floats — the poller forwards as-is.""" seen: list[float] = [] @@ -136,18 +121,6 @@ def fake_get(url, **kw): assert captured["url"] == "/proxy/xai/v1/videos/req-1" -def test_moonvalley_polls_prompts(no_sleep, monkeypatch): - captured = {} - - def fake_get(url, **kw): - captured["url"] = url - return _resp({"id": "p-1", "status": "completed", "output_url": "https://cdn/m.mp4"}) - - monkeypatch.setattr("comfy_cli.command.generate.client.get", fake_get) - poll.get_poller("moonvalley")({"id": "p-1"}, api_key="k") - assert captured["url"] == "/proxy/moonvalley/prompts/p-1" - - def test_missing_id_raises(monkeypatch): monkeypatch.setattr("comfy_cli.command.generate.client.get", lambda *a, **kw: _resp({})) with pytest.raises(Exception, match="missing id"): @@ -161,7 +134,7 @@ def test_kling_without_create_path_raises(): def test_build_synthetic_initial_for_each_partner(): """Sanity-check the resume helper for every registered partner.""" - for name in ("kling", "luma", "minimax", "runway", "moonvalley", "pika", "vidu", "xai_video"): + for name in ("kling", "minimax", "runway", "pika", "vidu", "xai_video"): body = poll.build_synthetic_initial(name, "abc") assert poll.extract_job_id(name, body) == "abc", name @@ -186,7 +159,6 @@ def test_extract_urls_recognizes_query_strings(): def test_extract_job_id_from_nested_paths(): assert poll.extract_job_id("kling", {"data": {"task_id": "k1"}}) == "k1" - assert poll.extract_job_id("luma", {"id": "l1"}) == "l1" assert poll.extract_job_id("minimax", {"task_id": "m1"}) == "m1" assert poll.extract_job_id("xai_video", {"request_id": "x1"}) == "x1" From cfed2032864ec03e0c432906d958017dce2fbbe7 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Tue, 17 Nov 2026 01:20:20 +0000 Subject: [PATCH 2/2] fix(generate): router_id never swaps an explicit model or emits a malformed id A pinned (non-family) Router id now resolves only when no model is chosen or the choice names that same model; any other choice returns None instead of silently routing to the pinned model. A family suffix that is not a valid Router segment also returns None. Adds a test that every row's default resolves to a well-formed id, and drops Luma and Moonvalley from the README's supported-model lists. Co-Authored-By: Claude Opus 5.5 --- README.md | 4 +-- comfy_cli/command/generate/spec.py | 29 ++++++++++++++----- tests/comfy_cli/command/generate/test_spec.py | 27 +++++++++++++++-- 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 56e496991..6359f9703 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ workflows, and call hosted partner image models, all from your terminal. ## Features - 🚀 One-command ComfyUI install and launch -- 🎨 Direct calls to partner image and video nodes (Flux, Ideogram, DALL·E, Recraft, Reve, Gemini/nano-banana, Kling, Luma, Runway, Pika, Vidu, Hailuo, Seedance, …) via `comfy generate`, no workflow JSON required +- 🎨 Direct calls to partner image and video nodes (Flux, Ideogram, DALL·E, Recraft, Reve, Gemini/nano-banana, Kling, Runway, Pika, Vidu, Hailuo, Seedance, …) via `comfy generate`, no workflow JSON required - 🔧 Custom node management — install, update, snapshot, bisect - 📦 Fast dependency resolution with `uv` (`--fast-deps`, `--uv-compile`) - 🗄️ Model downloads from CivitAI, Hugging Face, and direct URLs @@ -492,7 +492,7 @@ local ComfyUI or workflow JSON required. It hits the same hosted partner nodes you'd otherwise wire into a ComfyUI workflow, but as one-shot CLI calls. Image models (Flux, Ideogram, DALL·E, Recraft, Runway, Reve, xAI Grok, Google Gemini Flash Image aka **nano-banana**, …) and video models (Kling, -Luma, Runway Gen-3, Pika, Vidu, Moonvalley, Hailuo, Grok video, ByteDance +Runway Gen-3, Pika, Vidu, Hailuo, Grok video, ByteDance **Seedance**) are all covered; video jobs run async and the CLI polls until the result is ready. diff --git a/comfy_cli/command/generate/spec.py b/comfy_cli/command/generate/spec.py index 53614caf2..40b924e85 100644 --- a/comfy_cli/command/generate/spec.py +++ b/comfy_cli/command/generate/spec.py @@ -163,8 +163,9 @@ class Endpoint: # Router v2 id for each alias. None = proxy-only today: the operation has no # Router id (non-JSON encoding, or an unbound model family). A value ending in -# "/{model}" is a family: the alias's --model becomes the id suffix, and the -# second element is the default when --model is omitted. +# "/{model}" is a family: the alias's model choice becomes the id suffix, and +# the second element is the default when no model is chosen. A plain id pins +# one model; `router_id` returns None for any other model choice. # This table is data only — nothing in `comfy generate` consumes it yet; the # Router client that will read it is separate work. Keep it exhaustive over # `_ALIASES` (the test in test_spec.py enforces that). @@ -212,19 +213,33 @@ class Endpoint: } +# One segment of a Router id: lowercase alphanumerics joined by `.`, `_` or `-`. +_ROUTER_SEGMENT_RE = _re.compile(r"^[a-z0-9]+(?:[._-][a-z0-9]+)*$") + + def router_id(alias: str, model: str | None = None) -> str | None: """Router v2 id for an alias, or None when the alias is proxy-only. For a family id (one whose template contains ``{model}``) the suffix is - ``model`` when given, else the table's default; a non-family id is returned - unchanged. An alias absent from the table is treated as proxy-only (None), - so callers never raise on a stray key.""" + ``model`` when given, else the table's default. A non-family id pins one + model, so it is returned only when ``model`` is omitted or names that same + model; any other ``model`` has no Router id and gets None, rather than being + silently swapped for the pinned one. A resolved suffix that is not a valid + Router segment (empty, or carrying ``/``, ``..``, whitespace, uppercase, …) + also gets None. An alias absent from the table is treated as proxy-only + (None), so callers never raise on a stray key.""" entry = _ROUTER_IDS.get(alias) if entry is None: return None template, default = entry - if "{model}" in template: - return template.replace("{model}", model or default or "") + provider, _, pinned = template.partition("/") + if pinned == "{model}": + suffix = model or default + if not suffix or not _ROUTER_SEGMENT_RE.match(suffix): + return None + return f"{provider}/{suffix}" + if model is not None and model != pinned: + return None return template diff --git a/tests/comfy_cli/command/generate/test_spec.py b/tests/comfy_cli/command/generate/test_spec.py index 53af9a09a..8d7f800bc 100644 --- a/tests/comfy_cli/command/generate/test_spec.py +++ b/tests/comfy_cli/command/generate/test_spec.py @@ -646,12 +646,35 @@ def test_router_id_resolves_families_and_proxy_only(): assert spec.router_id("vidu") is None # i2v shares the base alias's id — Router selects image2video from the payload. assert spec.router_id("kling-i2v") == spec.router_id("kling") - # A plain (non-family) id ignores --model. - assert spec.router_id("flux-pro", "anything") == "bfl/flux-pro-1.1" + # A plain (non-family) id pins one model: naming that model resolves to it, + # any other model has no Router id rather than being swapped for the pinned one. + assert spec.router_id("runway-i2v") == "runway/gen4_turbo" + assert spec.router_id("runway-i2v", "gen4_turbo") == "runway/gen4_turbo" + assert spec.router_id("runway-i2v", "gen3a_turbo") is None + assert spec.router_id("grok", "grok-imagine-image-pro") is None + assert spec.router_id("flux-pro", "anything") is None # An alias not in the table is treated as proxy-only. assert spec.router_id("not-an-alias") is None +@pytest.mark.parametrize("bad", ["../x", "a/b", "x?y", "x#y", "has space", "Upper", "trailing-"]) +def test_router_id_rejects_malformed_family_model(bad): + """A model choice that is not a valid Router segment never yields an id.""" + assert spec.router_id("recraft", bad) is None + + +def test_router_id_defaults_resolve_to_valid_ids(): + """Every row resolves, with no model given, to an id matching the Router + segment pattern — the template test alone cannot catch a bad default.""" + pattern = re.compile(r"^[a-z0-9]+([._-][a-z0-9]+)*/[a-z0-9]+([._-][a-z0-9]+)*$") + for alias, entry in spec._ROUTER_IDS.items(): + if entry is None: + continue + resolved = spec.router_id(alias) + assert resolved is not None, f"{alias}: family row has no default" + assert pattern.match(resolved), f"{alias}: {resolved!r} fails the Router segment pattern" + + # ── allowlist / alias drift against the bundled spec ──────────────────────