HEL-892: document two audio workflows with pinned definitions and protected upgrades
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""One source-bound editorial document; never a conversion or execution contract."""
|
||||
"""Explicit source-bound editorial documents; never a conversion or execution contract."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -11,7 +11,20 @@ SOURCE_PATH = (
|
||||
"Minimax-H3提示词增强.json"
|
||||
)
|
||||
# Pins the reviewed Chinese text, saved values, pointers and complete evidence citations.
|
||||
DEFINITION_SHA256 = "76d877b68660509c9305dd807109525da42d49481b1e2878a5ce2686bba99799"
|
||||
DEFINITION_SHA256 = "4da30b7b4314d6e3e37b3cefcaae710072ae0ee4e323e999789e63b386080b5e"
|
||||
|
||||
# Explicit path allowlist; a recomputed caller-supplied digest cannot extend trust.
|
||||
DEFINITIONS = {
|
||||
SOURCE_PATH: DEFINITION_SHA256,
|
||||
(
|
||||
"example_ComfyUI_workflows/0-基础处理:图像合"
|
||||
"并-音频分离-视频截取合并-图像视频放大/音频转MP3格式.json"
|
||||
): "288ae80c9348bc85e96adc4dc9caf0fada7efedd1970b920613d1187cfb20a76",
|
||||
(
|
||||
"example_ComfyUI_workflows/0-基础处理:图像合"
|
||||
"并-音频分离-视频截取合并-图像视频放大/音频人声分离.json"
|
||||
): "cced72ff103a8325c41bd3c29c6a92d5e4239146dac2374b7b95c8b74c9b66fe",
|
||||
}
|
||||
|
||||
|
||||
def canonical(value: object) -> bytes:
|
||||
@@ -25,7 +38,7 @@ def fixed_document_for(path: str, source: object, review: dict | None) -> dict |
|
||||
The canonical digest also protects direct build_document callers from mixing
|
||||
another source object with that review. No upstream code or network is used.
|
||||
"""
|
||||
if path != SOURCE_PATH:
|
||||
if path not in DEFINITIONS:
|
||||
return None
|
||||
pending = {
|
||||
"matched": False,
|
||||
@@ -34,7 +47,7 @@ def fixed_document_for(path: str, source: object, review: dict | None) -> dict |
|
||||
block = (review or {}).get("fixed_version_document")
|
||||
if not isinstance(block, dict):
|
||||
return pending
|
||||
if hashlib.sha256(canonical(block)).hexdigest() != DEFINITION_SHA256:
|
||||
if hashlib.sha256(canonical(block)).hexdigest() != DEFINITIONS[path]:
|
||||
return pending
|
||||
if (
|
||||
block["source_path"] != path
|
||||
|
||||
Reference in New Issue
Block a user