Просмотр исходного кода

fix(packaging): keep review-compact DELIVERY on binding tip

Use --binding-commit / git HEAD for delivery identity instead of falling
back to ARTIFACT, so dual-closure and sibling filenames stay correct.

Co-authored-by: Cursor <cursoragent@cursor.com>
root 3 месяцев назад
Родитель
Сommit
0ea04f2355
1 измененных файлов с 14 добавлено и 5 удалено
  1. 14 5
      package_for_agent_analysis.py

+ 14 - 5
package_for_agent_analysis.py

@@ -1177,17 +1177,26 @@ def collect_analysis_inputs(
                 or td_report_payload.get("commit")
                 or ""
             )
+            # DELIVERY is the package tip (git HEAD / --binding-commit). Never fall
+            # back to ARTIFACT or sibling filenames collapse to the wrong tip.
+            delivery = str(head or binding_commit or "").strip()
             artifact = str(
                 binding.get("artifact_source_commit")
                 or report_artifact
                 or pkg_prov.ARTIFACT_DEFAULT
                 or ""
-            )
-            delivery = head or artifact
+            ).strip()
+            if not delivery:
+                raise PackagingError(
+                    "review-compact delivery commit unavailable "
+                    "(git head and --binding-commit both empty)"
+                )
             if not artifact:
-                artifact = delivery
-            # Guard: do not silently collapse ARTIFACT into DELIVERY when a TD
-            # production tip is known and differs from HEAD.
+                raise PackagingError(
+                    "review-compact artifact_source_commit unavailable "
+                    "(TD report commit / ARTIFACT_DEFAULT missing)"
+                )
+            # Prefer TD production tip when binder incorrectly equates ARTIFACT to DELIVERY.
             if report_artifact and artifact == delivery and report_artifact != delivery:
                 artifact = report_artifact