feat(simulation): add Worker AI polygon runtime and terrain navigation
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import tempfile
|
||||
@@ -8,6 +9,14 @@ from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
def canonical_json_sha256(value: object) -> str:
|
||||
"""Platform-independent identity for shared Core/Worker JSON contracts."""
|
||||
payload = json.dumps(
|
||||
value, ensure_ascii=False, allow_nan=False, separators=(",", ":"), sort_keys=True
|
||||
).encode("utf-8")
|
||||
return hashlib.sha256(payload).hexdigest()
|
||||
|
||||
|
||||
def utc_now_iso() -> str:
|
||||
"""Return a stable UTC timestamp for manifests and capture artifacts."""
|
||||
return datetime.now(UTC).isoformat(timespec="milliseconds").replace("+00:00", "Z")
|
||||
|
||||
Reference in New Issue
Block a user