Skip to content

Commit 317f330

Browse files
authored
Update tpu_testbench.py
1 parent 68dcda4 commit 317f330

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

  • thought_simulator/requirements_20/system_playground/testbenches/path_a/transform

thought_simulator/requirements_20/system_playground/testbenches/path_a/transform/tpu_testbench.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,20 @@ def compare_expected(actual_tp: Dict[str, Any],
152152
# 1. Metadata / committed envelopes
153153
exp_meta = expected.get("metadata", {})
154154
act_meta = actual_tp.get("metadata", {})
155-
156-
for key in ("context", "next_context", "provenance_metadata"):
155+
156+
# Stable envelopes – full compare
157+
for key in ("context", "next_context"):
157158
if key in exp_meta:
158159
if not deep_compare(act_meta.get(key), exp_meta.get(key)):
159160
mismatches.append(f"metadata.{key} mismatch")
161+
162+
# Provenance – only check stable invariants
163+
if "provenance_metadata" in exp_meta:
164+
act_prov = act_meta.get("provenance_metadata") or {}
165+
if act_prov.get("primitive_origin") != "TPU":
166+
mismatches.append("provenance_metadata.primitive_origin must be 'TPU'")
167+
if not act_prov.get("commit_id"):
168+
mismatches.append("provenance_metadata.commit_id missing")
160169

161170
# 2. Audit record
162171
exp_audit = expected.get("tpu_audit_record")

0 commit comments

Comments
 (0)