feat(expenses): add authoritative pre-review workflow

This commit is contained in:
caoxiaozhu
2026-07-16 11:42:08 +08:00
parent ae3f02c35a
commit 6bdf65bc24
52 changed files with 4300 additions and 1069 deletions

View File

@@ -0,0 +1,27 @@
from __future__ import annotations
import hashlib
import json
from typing import Any
def build_risk_manifest_fingerprint(manifests: list[dict[str, Any]]) -> str:
ordered_manifests = sorted(
manifests,
key=lambda manifest: json.dumps(
manifest,
ensure_ascii=False,
sort_keys=True,
separators=(",", ":"),
default=str,
),
)
normalized = json.dumps(
ordered_manifests,
ensure_ascii=False,
sort_keys=True,
separators=(",", ":"),
default=str,
)
digest = hashlib.sha256(normalized.encode("utf-8")).hexdigest()
return f"sha256:{digest}"