|
@@ -558,6 +558,43 @@ def build_firmware_package(
|
|
|
expected_filename=sibling_expected,
|
|
expected_filename=sibling_expected,
|
|
|
release_set_id=release_set_id,
|
|
release_set_id=release_set_id,
|
|
|
)
|
|
)
|
|
|
|
|
+ td_verification_run_id = str(td_report.get("verification_run_id") or "")
|
|
|
|
|
+ td_artifact_run_id = str(td_report.get("run_id") or td_run_id or "")
|
|
|
|
|
+ if not td_artifact_run_id:
|
|
|
|
|
+ raise PackagingError(
|
|
|
|
|
+ "firmware package requires td_artifact_run_id from TD receipt run_id"
|
|
|
|
|
+ )
|
|
|
|
|
+ if td_artifact_run_id == "20260806T112210Z-3f2f5f2f":
|
|
|
|
|
+ raise PackagingError(
|
|
|
|
|
+ "refusing Round-10 hardcoded td_artifact_run_id fallback"
|
|
|
|
|
+ )
|
|
|
|
|
+ release_identity = {
|
|
|
|
|
+ "schema": "prod2u-release-set-identity-v1",
|
|
|
|
|
+ "algorithm_version": "prod2u-release-set-id-v1",
|
|
|
|
|
+ "package_stage": "final-review",
|
|
|
|
|
+ "non_final": False,
|
|
|
|
|
+ "release_set_id": release_set_id,
|
|
|
|
|
+ "base_dev_commit": BASE_DEV_COMMIT_DEFAULT,
|
|
|
|
|
+ "artifact_source_commit": artifact_commit,
|
|
|
|
|
+ "td_bound_commit": artifact_commit,
|
|
|
|
|
+ "delivery_commit": final_dev_commit,
|
|
|
|
|
+ "bitstream_sha256": bitstream_sha256,
|
|
|
|
|
+ "production_polarity_config": {
|
|
|
|
|
+ "limit_active_high": motor_polarity.get("limit_active_high"),
|
|
|
|
|
+ "dir_close_level": motor_polarity.get("dir_close_level"),
|
|
|
|
|
+ "close_limit_is_ls": motor_polarity.get("close_limit_is_ls"),
|
|
|
|
|
+ "generated_masks": motor_polarity.get("masks"),
|
|
|
|
|
+ "config_fingerprint": motor_polarity["sha256"],
|
|
|
|
|
+ },
|
|
|
|
|
+ "verification_run_id": td_verification_run_id or td_artifact_run_id,
|
|
|
|
|
+ "td_artifact_run_id": td_artifact_run_id,
|
|
|
|
|
+ "reference_set_fingerprint": reference_fp["sha256"],
|
|
|
|
|
+ "hardware_validation": "not_run",
|
|
|
|
|
+ "note": (
|
|
|
|
|
+ "release_set_id uses td_artifact_run_id (= TD receipt run_id); "
|
|
|
|
|
+ "FINAL-DEV-COMMIT.txt is a deprecated alias for delivery_commit."
|
|
|
|
|
+ ),
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
manifest: dict[str, Any] = {
|
|
manifest: dict[str, Any] = {
|
|
|
"schema": "prod2u-door-temp-final-package-manifest-v2",
|
|
"schema": "prod2u-door-temp-final-package-manifest-v2",
|
|
@@ -613,6 +650,7 @@ def build_firmware_package(
|
|
|
relations_json = json.dumps(relations, indent=2, sort_keys=True) + "\n"
|
|
relations_json = json.dumps(relations, indent=2, sort_keys=True) + "\n"
|
|
|
reference_pointer_json = json.dumps(reference_pointer, indent=2, sort_keys=True) + "\n"
|
|
reference_pointer_json = json.dumps(reference_pointer, indent=2, sort_keys=True) + "\n"
|
|
|
sibling_json = json.dumps(sibling, indent=2, sort_keys=True) + "\n"
|
|
sibling_json = json.dumps(sibling, indent=2, sort_keys=True) + "\n"
|
|
|
|
|
+ release_identity_json = json.dumps(release_identity, indent=2, sort_keys=True) + "\n"
|
|
|
|
|
|
|
|
with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED, allowZip64=True) as zipf:
|
|
with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED, allowZip64=True) as zipf:
|
|
|
# Bitstream and provenance
|
|
# Bitstream and provenance
|
|
@@ -621,7 +659,12 @@ def build_firmware_package(
|
|
|
_add_text(zipf, artifact_commit, "ARTIFACT-SOURCE-COMMIT.txt", sha256_entries)
|
|
_add_text(zipf, artifact_commit, "ARTIFACT-SOURCE-COMMIT.txt", sha256_entries)
|
|
|
_add_text(zipf, matrix_commit, "MATRIX-COMMIT.txt", sha256_entries)
|
|
_add_text(zipf, matrix_commit, "MATRIX-COMMIT.txt", sha256_entries)
|
|
|
_add_text(zipf, final_dev_commit, "DELIVERY-COMMIT.txt", sha256_entries)
|
|
_add_text(zipf, final_dev_commit, "DELIVERY-COMMIT.txt", sha256_entries)
|
|
|
- _add_text(zipf, final_dev_commit, "FINAL-DEV-COMMIT.txt", sha256_entries) # deprecated_alias
|
|
|
|
|
|
|
+ _add_text(
|
|
|
|
|
+ zipf,
|
|
|
|
|
+ final_dev_commit + "\n# deprecated_alias for delivery_commit; not git-dev\n",
|
|
|
|
|
+ "FINAL-DEV-COMMIT.txt",
|
|
|
|
|
+ sha256_entries,
|
|
|
|
|
+ )
|
|
|
_add_text(
|
|
_add_text(
|
|
|
zipf,
|
|
zipf,
|
|
|
"true" if comparison["source_closure_equal"] is True else "false",
|
|
"true" if comparison["source_closure_equal"] is True else "false",
|
|
@@ -668,6 +711,7 @@ def build_firmware_package(
|
|
|
_add_text(zipf, relations_json, "meta/source-closure-relations.json", sha256_entries)
|
|
_add_text(zipf, relations_json, "meta/source-closure-relations.json", sha256_entries)
|
|
|
_add_text(zipf, reference_pointer_json, "meta/REFERENCE-POINTER.json", sha256_entries)
|
|
_add_text(zipf, reference_pointer_json, "meta/REFERENCE-POINTER.json", sha256_entries)
|
|
|
_add_text(zipf, sibling_json, "meta/release-set-sibling.json", sha256_entries)
|
|
_add_text(zipf, sibling_json, "meta/release-set-sibling.json", sha256_entries)
|
|
|
|
|
+ _add_text(zipf, release_identity_json, "meta/release-set-identity.json", sha256_entries)
|
|
|
|
|
|
|
|
# Optional matrix receipt
|
|
# Optional matrix receipt
|
|
|
if matrix_receipt_path and matrix_receipt_path.is_file():
|
|
if matrix_receipt_path and matrix_receipt_path.is_file():
|