feat(HEL-892): pin mixed core audio separation reference contract

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
leefer
2026-10-30 03:15:40 +08:00
co-authored by multica-agent
parent 006d8a0864
commit ba911dc907
38 changed files with 12169 additions and 20 deletions
@@ -31,6 +31,7 @@ from calliope.comfyui.serialization_reference import (
PRIMITIVE_PROFILE,
PROFILE,
REEL_PROFILE,
SEPARATION_PROFILE,
resolve_reference_link,
serialize_case04_node,
serialize_promoted_node,
@@ -287,6 +288,7 @@ REFERENCE_PROFILES = (
CASE04_PROFILE,
ASR_PROFILE,
*MEDIA_PROFILES,
SEPARATION_PROFILE,
)
@@ -376,6 +378,8 @@ def media_field_evidence(source, prompt, profile):
layouts = {
"LoadAudio": ("audio",),
"SaveAudioMP3": ("filename_prefix", "quality"),
"PreviewAudio": (),
"AudioSeparation": ("chunk_fade_shape", "chunk_length", "chunk_overlap"),
"LoadImage": ("image",),
"PreviewImage": (),
"LayerUtility: ImageReel": (
@@ -428,7 +432,9 @@ def media_field_evidence(source, prompt, profile):
"source_pointer": pointer,
"rule": rule,
"profile": profile,
"contract_manifest": "media-reference/contract.json",
"contract_manifest": "separation-reference/contract.json"
if profile == SEPARATION_PROFILE
else "media-reference/contract.json",
}
)
return fields
@@ -472,12 +478,28 @@ def profile_attempt(source, profile):
"case04-reference/sources.json",
],
}
if profile == SEPARATION_PROFILE:
assumptions["separation_reference"] = {
"LoadAudio_and_PreviewAudio": "0.3.68@265adad858e1f31b66cd3523a02b16f5d34ced52",
"SaveAudioMP3": "0.3.71@c55fd7481626d8bee8044ea7512ea996d13a1b90",
"AudioSeparation": "1.4.0@5291831d7c321ab7a5192374482f9848dffee75b",
"registry_source_bytes_match": True,
"registry_commit_binding": "unknown; API exposes no commit",
"plugin_license": "unknown; LICENSE referenced but absent at pinned version",
"numeric_policy": (
"finite int/float within frontend UI [0,2048]; saved values unchanged"
),
}
assumptions["reference_sources"] = [
"separation-reference/sources.json",
*assumptions["reference_sources"],
]
base = {"profile": profile, "assumptions": assumptions}
declared_frontend = (source.get("extra") or {}).get("frontendVersion")
assumptions["source_frontend_declaration"] = declared_frontend
assumptions["missing_frontend_policy"] = (
"explicit_media_reference_assumption"
if profile in MEDIA_PROFILES
if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE)
else "explicit_legacy_reference_assumption"
if profile in (PROFILE, AUX_PROFILE, PRIMITIVE_PROFILE)
else "requires_explicit_declaration"
@@ -490,7 +512,8 @@ def profile_attempt(source, profile):
]
if declared_frontend != expected and not (
declared_frontend is None
and profile in (PROFILE, AUX_PROFILE, PRIMITIVE_PROFILE, *MEDIA_PROFILES)
and profile
in (PROFILE, AUX_PROFILE, PRIMITIVE_PROFILE, *MEDIA_PROFILES, SEPARATION_PROFILE)
):
return {
**base,
@@ -527,13 +550,13 @@ def profile_attempt(source, profile):
{"field_evidence": asr_field_evidence(source, result.prompt)}
if profile == ASR_PROFILE
else {"field_evidence": media_field_evidence(source, result.prompt, profile)}
if profile in MEDIA_PROFILES
if profile in (*MEDIA_PROFILES, SEPARATION_PROFILE)
else {}
),
}
def audit_library(repo: Path, profiles=REFERENCE_PROFILES):
def audit_library(repo: Path, profiles=REFERENCE_PROFILES, *, baseline_profiles=None):
"""Actually invoke every version-applicable profile; never choose first success.
The immutable manifest/SHA binding and delivery_scope define the partition.
@@ -625,11 +648,13 @@ def audit_library(repo: Path, profiles=REFERENCE_PROFILES):
cohort: dict(Counter(r["status"] for r in rows if r["cohort"] == cohort))
for cohort in ("without_companion", "with_companion")
}
if baseline_profiles is None:
baseline_profiles = tuple(p for p in profiles if p != SEPARATION_PROFILE)
old_complete = {
row["source_path"]
for row in rows
if any(
a["status"] == "complete_reference_candidate" and a["profile"] not in MEDIA_PROFILES
a["status"] == "complete_reference_candidate" and a["profile"] in baseline_profiles
for a in row["attempts"]
)
}
@@ -639,7 +664,8 @@ def audit_library(repo: Path, profiles=REFERENCE_PROFILES):
"source_total": len(manifest),
"target_total": len(rows) + len(api_paths),
"coverage_delta": {
"baseline": "previous eleven profiles excluding MEDIA_PROFILES; applied this run",
"baseline": "explicit baseline profile subset; applied this run",
"baseline_profiles": list(baseline_profiles),
"previous_complete_paths": sorted(old_complete),
"current_complete_paths": sorted(now_complete),
"new_complete_paths": sorted(now_complete - old_complete),
@@ -677,6 +703,7 @@ def main():
choices=(
ASR_PROFILE,
*MEDIA_PROFILES,
SEPARATION_PROFILE,
PROFILE,
AUX_PROFILE,
PRIMITIVE_PROFILE,