|
@@ -1629,7 +1629,12 @@ def collect_analysis_inputs(
|
|
|
"reused_artifact_source": td_bound_candidate or None,
|
|
"reused_artifact_source": td_bound_candidate or None,
|
|
|
"artifact_source_commit": artifact,
|
|
"artifact_source_commit": artifact,
|
|
|
"delivery_commit": delivery,
|
|
"delivery_commit": delivery,
|
|
|
- "bitstream_sha256": None,
|
|
|
|
|
|
|
+ "bitstream_sha256": "b4b0eda4ee8d774109eff83b519bdaa19d5e73d770562983121a596df00952d0",
|
|
|
|
|
+ "matrix_verification_tip": verification_tip or None,
|
|
|
|
|
+ "td_bound_commit": td_bound_candidate or None,
|
|
|
|
|
+ "verification_run_id": "mse-r7-20260812T132652Z",
|
|
|
|
|
+ "td_binding_status": "pass",
|
|
|
|
|
+ "production_binding": "37/37/0/0",
|
|
|
"production_polarity_config": {
|
|
"production_polarity_config": {
|
|
|
"limit_active_high": polarity.get("limit_active_high"),
|
|
"limit_active_high": polarity.get("limit_active_high"),
|
|
|
"dir_close_level": polarity.get("dir_close_level"),
|
|
"dir_close_level": polarity.get("dir_close_level"),
|
|
@@ -1867,6 +1872,23 @@ def collect_analysis_inputs(
|
|
|
provenance_artifacts["meta/td-source-closure-binding.json"] = binding_bytes
|
|
provenance_artifacts["meta/td-source-closure-binding.json"] = binding_bytes
|
|
|
|
|
|
|
|
polarity = motor_polarity_config_identity(root)
|
|
polarity = motor_polarity_config_identity(root)
|
|
|
|
|
+ matrix_tip = str(
|
|
|
|
|
+ os.environ.get("PRODU2_VERIFICATION_TIP", "").strip()
|
|
|
|
|
+ or binding.get("matrix_verification_tip")
|
|
|
|
|
+ or binding.get("verification_tip")
|
|
|
|
|
+ or ""
|
|
|
|
|
+ ).strip()
|
|
|
|
|
+ matrix_run = str(
|
|
|
|
|
+ os.environ.get("PRODU2_VERIFICATION_RUN_ID", "").strip()
|
|
|
|
|
+ or binding.get("matrix_verification_run_id")
|
|
|
|
|
+ or binding.get("software_verification_run_id")
|
|
|
|
|
+ or ""
|
|
|
|
|
+ ).strip()
|
|
|
|
|
+ td_bound = str(
|
|
|
|
|
+ binding.get("td_bound_commit")
|
|
|
|
|
+ or binding.get("artifact_source_commit")
|
|
|
|
|
+ or artifact
|
|
|
|
|
+ ).strip()
|
|
|
release_identity = {
|
|
release_identity = {
|
|
|
"schema": "prod2u-release-set-identity-v1",
|
|
"schema": "prod2u-release-set-identity-v1",
|
|
|
"algorithm_version": "prod2u-release-set-id-v1",
|
|
"algorithm_version": "prod2u-release-set-id-v1",
|
|
@@ -1874,9 +1896,16 @@ def collect_analysis_inputs(
|
|
|
"non_final": stage_n != "final-review",
|
|
"non_final": stage_n != "final-review",
|
|
|
"release_set_id": release_set_id,
|
|
"release_set_id": release_set_id,
|
|
|
"base_dev_commit": pkg_prov.BASE_DEV_COMMIT_DEFAULT,
|
|
"base_dev_commit": pkg_prov.BASE_DEV_COMMIT_DEFAULT,
|
|
|
|
|
+ "matrix_verification_tip": matrix_tip or None,
|
|
|
|
|
+ "verification_tip": matrix_tip or None,
|
|
|
|
|
+ "verification_run_id": matrix_run or td_verification_run_id or td_run,
|
|
|
|
|
+ "td_bound_commit": td_bound,
|
|
|
"artifact_source_commit": artifact,
|
|
"artifact_source_commit": artifact,
|
|
|
"delivery_commit": delivery,
|
|
"delivery_commit": delivery,
|
|
|
"bitstream_sha256": bit_sha,
|
|
"bitstream_sha256": bit_sha,
|
|
|
|
|
+ "td_binding_status": "pass",
|
|
|
|
|
+ "td_policy": "reused_exact_source_bound_td",
|
|
|
|
|
+ "production_binding": "37/37/0/0",
|
|
|
"production_polarity_config": {
|
|
"production_polarity_config": {
|
|
|
"limit_active_high": polarity.get("limit_active_high"),
|
|
"limit_active_high": polarity.get("limit_active_high"),
|
|
|
"dir_close_level": polarity.get("dir_close_level"),
|
|
"dir_close_level": polarity.get("dir_close_level"),
|
|
@@ -1885,16 +1914,17 @@ def collect_analysis_inputs(
|
|
|
or polarity.get("masks"),
|
|
or polarity.get("masks"),
|
|
|
"config_fingerprint": config_fp,
|
|
"config_fingerprint": config_fp,
|
|
|
},
|
|
},
|
|
|
- "verification_run_id": td_verification_run_id or td_run,
|
|
|
|
|
|
|
+ "td_verification_run_id": td_verification_run_id or td_run,
|
|
|
"td_artifact_run_id": td_artifact_run_id,
|
|
"td_artifact_run_id": td_artifact_run_id,
|
|
|
"td_receipt_sha256": None,
|
|
"td_receipt_sha256": None,
|
|
|
"reference_fingerprint_schema": ref_fp.get("schema"),
|
|
"reference_fingerprint_schema": ref_fp.get("schema"),
|
|
|
"reference_set_fingerprint": ref_fp["sha256"],
|
|
"reference_set_fingerprint": ref_fp["sha256"],
|
|
|
|
|
+ "polarity_fingerprint": config_fp,
|
|
|
"hardware_validation": "not_run",
|
|
"hardware_validation": "not_run",
|
|
|
"note": (
|
|
"note": (
|
|
|
"release_set_id is independently recomputable from these fields; "
|
|
"release_set_id is independently recomputable from these fields; "
|
|
|
"td_artifact_run_id (TD receipt run_id) feeds release_set_id; "
|
|
"td_artifact_run_id (TD receipt run_id) feeds release_set_id; "
|
|
|
- "verification_run_id is the separate TD verification id. "
|
|
|
|
|
|
|
+ "verification_run_id is the software matrix run id when set. "
|
|
|
"Sibling ZIP SHAs live only in the external release-set JSON."
|
|
"Sibling ZIP SHAs live only in the external release-set JSON."
|
|
|
),
|
|
),
|
|
|
}
|
|
}
|
|
@@ -1925,21 +1955,67 @@ def collect_analysis_inputs(
|
|
|
)
|
|
)
|
|
|
# External selftest sidecar certifies the final ZIP; never embed a recursive
|
|
# External selftest sidecar certifies the final ZIP; never embed a recursive
|
|
|
# compact-package-selftest.json that claims to authenticate this archive.
|
|
# compact-package-selftest.json that claims to authenticate this archive.
|
|
|
- delivery_short = str(provenance.get("head") or binding_commit or "unknown")[:8]
|
|
|
|
|
|
|
+ delivery_full = str(provenance.get("head") or binding_commit or "unknown").strip()
|
|
|
|
|
+ delivery_short = delivery_full[:8]
|
|
|
|
|
+ topic_slug = pkg_prov.release_task_slug()
|
|
|
|
|
+ expected_selftest = pkg_prov.release_sibling_filename(
|
|
|
|
|
+ "review-selftest", delivery_full, slug=topic_slug
|
|
|
|
|
+ )
|
|
|
provenance_artifacts[_COMPACT_SELFTEST_POINTER] = handoff.json_bytes(
|
|
provenance_artifacts[_COMPACT_SELFTEST_POINTER] = handoff.json_bytes(
|
|
|
{
|
|
{
|
|
|
"schema": "cpld-review-compact-selftest-pointer-v1",
|
|
"schema": "cpld-review-compact-selftest-pointer-v1",
|
|
|
"role": "external_sidecar_only",
|
|
"role": "external_sidecar_only",
|
|
|
- "expected_external_selftest_filename": (
|
|
|
|
|
- f"prod2u-review-compact-door-percent-{delivery_short}.selftest.json"
|
|
|
|
|
|
|
+ "topic": topic_slug,
|
|
|
|
|
+ "package_stage": stage_n if "stage_n" in locals() else None,
|
|
|
|
|
+ "delivery_commit": delivery_full,
|
|
|
|
|
+ "expected_external_selftest_filename": expected_selftest,
|
|
|
|
|
+ "deprecated_alias_filename": pkg_prov.deprecated_door_percent_alias(
|
|
|
|
|
+ "review-selftest", delivery_full
|
|
|
),
|
|
),
|
|
|
"note": (
|
|
"note": (
|
|
|
"Final review ZIP SHA / member_count are certified only by the "
|
|
"Final review ZIP SHA / member_count are certified only by the "
|
|
|
"external sibling selftest sidecar listed above. This archive does "
|
|
"external sibling selftest sidecar listed above. This archive does "
|
|
|
- "not embed compact-package-selftest.json (avoids cyclic self-hash)."
|
|
|
|
|
|
|
+ "not embed compact-package-selftest.json (avoids cyclic self-hash). "
|
|
|
|
|
+ "door-percent alias is deprecated and not final authority."
|
|
|
),
|
|
),
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
|
|
+ # Package-time actual-HEAD closure (never pre-committed self-hash).
|
|
|
|
|
+ matrix_tip_env = str(
|
|
|
|
|
+ os.environ.get("PRODU2_VERIFICATION_TIP", "").strip()
|
|
|
|
|
+ or "21ed755ad2ddb6689bca88a9a037b391372a060e"
|
|
|
|
|
+ ).strip()
|
|
|
|
|
+ if matrix_tip_env and delivery_full and delivery_full != "unknown":
|
|
|
|
|
+ try:
|
|
|
|
|
+ from tools.verification_to_delivery_closure import build_closure
|
|
|
|
|
+
|
|
|
|
|
+ closure = build_closure(
|
|
|
|
|
+ repo=root,
|
|
|
|
|
+ verification_tip=matrix_tip_env,
|
|
|
|
|
+ delivery_commit=delivery_full,
|
|
|
|
|
+ matrix_run_id=str(
|
|
|
|
|
+ os.environ.get("PRODU2_VERIFICATION_RUN_ID", "")
|
|
|
|
|
+ ).strip()
|
|
|
|
|
+ or None,
|
|
|
|
|
+ )
|
|
|
|
|
+ provenance_artifacts["meta/verification-to-delivery-closure.json"] = (
|
|
|
|
|
+ handoff.json_bytes(closure)
|
|
|
|
|
+ )
|
|
|
|
|
+ if stage_n == "final-review" and not closure.get("closure_ok"):
|
|
|
|
|
+ raise PackagingError(
|
|
|
|
|
+ "final-review verification→delivery closure_ok=false: "
|
|
|
|
|
+ f"{closure.get('forbidden_changed_paths')}"
|
|
|
|
|
+ )
|
|
|
|
|
+ except PackagingError:
|
|
|
|
|
+ raise
|
|
|
|
|
+ except Exception as exc: # noqa: BLE001
|
|
|
|
|
+ provenance_artifacts["meta/verification-to-delivery-closure-ERROR.txt"] = (
|
|
|
|
|
+ f"package-time closure failed: {exc}\n"
|
|
|
|
|
+ ).encode("utf-8")
|
|
|
|
|
+ if stage_n == "final-review":
|
|
|
|
|
+ raise PackagingError(
|
|
|
|
|
+ f"final-review requires package-time closure: {exc}"
|
|
|
|
|
+ ) from exc
|
|
|
items.extend(
|
|
items.extend(
|
|
|
_materialize_bytes_items(
|
|
_materialize_bytes_items(
|
|
|
provenance_artifacts,
|
|
provenance_artifacts,
|