Release v3.5.3 maintenance hotfix

This commit is contained in:
ukr8b3g-cmyk
2026-08-26 03:24:08 +09:00
parent 70cbbcd5fb
commit 67a0d80117
22 changed files with 184 additions and 61 deletions
+61
View File
@@ -0,0 +1,61 @@
from __future__ import annotations
import json
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[1]
WORKFLOW_DIR = ROOT / "examples" / "workflows"
WORKFLOWS = sorted(WORKFLOW_DIR.glob("*.json"))
@pytest.mark.parametrize("workflow_path", WORKFLOWS, ids=lambda path: path.name)
def test_public_workflow_links_are_serialization_consistent(workflow_path: Path) -> None:
workflow = json.loads(workflow_path.read_text(encoding="utf-8"))
workflow = json.loads(json.dumps(workflow, ensure_ascii=False))
nodes = {int(node["id"]): node for node in workflow["nodes"]}
links = {int(link[0]): link for link in workflow["links"]}
assert len(nodes) == len(workflow["nodes"]), "duplicate node ID"
assert len(links) == len(workflow["links"]), "duplicate link ID"
for link_id, link in links.items():
_, source_id, source_slot, target_id, target_slot, link_type = link
source = nodes[int(source_id)]
target = nodes[int(target_id)]
outputs = source.get("outputs") or []
inputs = target.get("inputs") or []
assert 0 <= int(source_slot) < len(outputs), f"link {link_id}: invalid source slot"
assert 0 <= int(target_slot) < len(inputs), f"link {link_id}: invalid target slot"
assert link_id in (outputs[int(source_slot)].get("links") or []), (
f"link {link_id}: source output does not reference the link"
)
assert inputs[int(target_slot)].get("link") == link_id, (
f"link {link_id}: target input does not reference the link"
)
endpoint_types = {
value
for value in (
outputs[int(source_slot)].get("type"),
inputs[int(target_slot)].get("type"),
link_type,
)
if value not in (None, "*")
}
assert len(endpoint_types) <= 1, f"link {link_id}: endpoint type mismatch"
for node in nodes.values():
for output in node.get("outputs") or []:
for link_id in output.get("links") or []:
assert int(link_id) in links, f"node {node['id']}: dangling output link {link_id}"
for input_ in node.get("inputs") or []:
link_id = input_.get("link")
if link_id is not None:
assert int(link_id) in links, f"node {node['id']}: dangling input link {link_id}"
if links:
assert int(workflow["last_link_id"]) >= max(links)
+1 -1
View File
@@ -6,7 +6,7 @@ import tomllib
ROOT = Path(__file__).resolve().parents[1]
EXPECTED_VERSION = "3.5.2"
EXPECTED_VERSION = "3.5.3"
def test_v35_release_metadata_is_consistent():
+1 -1
View File
@@ -145,4 +145,4 @@ def test_v217_result_pack_expands_legacy_outputs():
def test_v217_has_no_frontend_display_controller():
assert not (ROOT / "web" / "h3_continuum_v2.js").exists()
version_source = (ROOT / "version.py").read_text(encoding="utf-8")
assert 'PACKAGE_VERSION = "3.5.2"' in version_source
assert 'PACKAGE_VERSION = "3.5.3"' in version_source
+21
View File
@@ -57,6 +57,27 @@ def test_hybrid_prompt_validation_offsets_reference_numbers() -> None:
) == ""
def test_hybrid_prompt_validation_keeps_public_picture_numbers_in_warnings() -> None:
warning = validate_reference_prompts(
["<Picture 1> starts the shot and <Picture 4> is unavailable."],
1,
picture_offset=2,
)
assert "unavailable <Picture 4>" in warning
assert "connected reference <Picture 3>" in warning
assert "unavailable <Picture 2>" not in warning
def test_hybrid_prompt_validation_reports_the_missing_reference_number() -> None:
warning = validate_reference_prompts(
["<Picture 1> starts the shot."],
1,
picture_offset=2,
)
assert "connected reference <Picture 3>" in warning
assert "the prompt contains no <Picture N> tag" not in warning
def test_pure_fl_identity_is_unchanged() -> None:
assert combine_hybrid_visual_identity(
keyframe_identity_hash="fl-identity",