Initial commit

This commit is contained in:
LZH-YS1998
2026-07-01 17:56:31 +08:00
commit d78931979d
731 changed files with 311088 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
"""Artifact delta helpers."""
from __future__ import annotations
from typing import Iterable
from .types import RuntimeArtifact
def changed_artifacts(
artifacts: Iterable[RuntimeArtifact],
previous_hashes: dict[str, str] | None = None,
) -> list[tuple[RuntimeArtifact, bool]]:
previous = dict(previous_hashes or {})
changed: list[tuple[RuntimeArtifact, bool]] = []
for artifact in artifacts:
content_hash = str(artifact.metadata.get("content_hash", "") or "")
is_delta = bool(previous.get(artifact.artifact_type)) and previous.get(artifact.artifact_type) != content_hash
changed.append((artifact, is_delta))
return changed