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

fix: reuse verified immutable base package

root 3 месяцев назад
Родитель
Сommit
bc13c4cbec
3 измененных файлов с 24 добавлено и 12 удалено
  1. 7 3
      ACTIVE_REMOTE_MIGRATION.yaml
  2. 5 0
      QUICK_PROGRESS.md
  3. 12 9
      tools/package_6400_canonical.py

+ 7 - 3
ACTIVE_REMOTE_MIGRATION.yaml

@@ -44,9 +44,13 @@ protocol:
   ACK_NACK: 0x06
   ACK_NACK: 0x06
   SNAPSHOT_DATA: 0x82
   SNAPSHOT_DATA: 0x82
 execution:
 execution:
-  phase: CANONICAL_PACKAGE_FIX_IMPLEMENTED_FOCUSED_PASS
+  phase: REMOTE_BLOCKED_NETWORK_CANONICAL_FINALIZING
   heavy_tests_before_quick: forbidden
   heavy_tests_before_quick: forbidden
   remote_not_started: true
   remote_not_started: true
+  remote_blocker: REMOTE_NETWORK_UNSTABLE
+  remote_endpoint_from_ssh_config: 192.168.2.119:22
+  remote_attempts: 5
+  wsl_shutdown: FORBIDDEN_BY_REMOTE_GATE
   hardware: NOT_RUN
   hardware: NOT_RUN
   com: NOT_RUN
   com: NOT_RUN
   jtag: NOT_RUN
   jtag: NOT_RUN
@@ -78,5 +82,5 @@ focused_results:
     rear_connector_high: 10000
     rear_connector_high: 10000
     front_ball_low: 10000
     front_ball_low: 10000
     rear_ball_high: 10000
     rear_ball_high: 10000
-last_test: CANONICAL_PACKAGE_UNIT_9_PASS_GENERATOR_CLOSURE_PASS
-next: commit_canonical_then_build_and_negative_test_base_current
+last_test: CANONICAL_OVERLAY_PASS_REMOTE_5_RETRIES_FAILED
+next: finalize_latest_commit_base_current_and_windows_local_exchange_then_report_blocker

+ 5 - 0
QUICK_PROGRESS.md

@@ -19,6 +19,11 @@
 - Added Base replay dependencies, lazy MRDIMM generator import, exact hashed Python lock, Podman Containerfile and Quadlet.
 - Added Base replay dependencies, lazy MRDIMM generator import, exact hashed Python lock, Podman Containerfile and Quadlet.
 - PASS: canonical package unit 9, generator check, production/analysis closure; local Doctor degraded only because invocation PATH omitted repo `tools/td2026` and old verify venv runtime is broken.
 - PASS: canonical package unit 9, generator check, production/analysis closure; local Doctor degraded only because invocation PATH omitted repo `tools/td2026` and old verify venv runtime is broken.
 - Next: commit canonical changes, create new Base/Current, run tamper/wrong-base/fresh-overlay matrix, then begin SSH probe.
 - Next: commit canonical changes, create new Base/Current, run tamper/wrong-base/fresh-overlay matrix, then begin SSH probe.
+- Canonical commits: `56d7b0f`, fingerprint follow-up `3889776`, safe SSH wrapper `8b2eef7`.
+- PASS: Base `aa8bdce6743c` and Current overlay; deterministic rebuild; Current-alone and fake-marker both BASE_REQUIRED.
+- Remote probe: SSH alias resolves `192.168.2.119:22`; unsafe local alias defaults were overridden with strict known-host checking.
+- BLOCKED: five bounded SSH attempts ended timeout/connection-closed, final `REMOTE_NETWORK_UNSTABLE`.
+- Gate enforced: no remote writes, no remote Podman/Quadlet deployment, no remote replay, no WSL shutdown.
 
 
 - Workspace: `/root/workspaces/thermal-system/cpld-temperature-control`
 - Workspace: `/root/workspaces/thermal-system/cpld-temperature-control`
 - Branch: `dev`
 - Branch: `dev`

+ 12 - 9
tools/package_6400_canonical.py

@@ -282,13 +282,13 @@ def package_base(output: Path) -> Path:
     payload = common_payload("base", commit, tree, selected, {"base_id": base_id,
     payload = common_payload("base", commit, tree, selected, {"base_id": base_id,
         "base_manifest_sha256": sha_bytes(base_manifest)})
         "base_manifest_sha256": sha_bytes(base_manifest)})
     target = output / f"Prod2U-CPLD-Analysis-Base-{base_id}.zip"
     target = output / f"Prod2U-CPLD-Analysis-Base-{base_id}.zip"
+    if target.exists():
+        existing_id, _existing_manifest, existing_base_manifest_sha = base_metadata(target)
+        if existing_id != base_id or existing_base_manifest_sha != sha_bytes(base_manifest):
+            raise SystemExit("BASE_ID_COLLISION")
+        return target
     with tempfile.TemporaryDirectory() as tmp:
     with tempfile.TemporaryDirectory() as tmp:
         candidate = write_zip(Path(tmp) / target.name, payload)
         candidate = write_zip(Path(tmp) / target.name, payload)
-        if target.exists():
-            verify_zip(target)
-            if sha_file(target) != sha_file(candidate):
-                raise SystemExit("BASE_ID_COLLISION")
-            return target
         target.parent.mkdir(parents=True, exist_ok=True)
         target.parent.mkdir(parents=True, exist_ok=True)
         shutil.copy2(candidate, target)
         shutil.copy2(candidate, target)
     return target
     return target
@@ -296,10 +296,13 @@ def package_base(output: Path) -> Path:
 
 
 def base_metadata(base_zip: Path) -> tuple[str, dict, str]:
 def base_metadata(base_zip: Path) -> tuple[str, dict, str]:
     verify_zip(base_zip)
     verify_zip(base_zip)
-    with zipfile.ZipFile(base_zip) as archive:
-        manifest = json.loads(archive.read("PACKAGE-MANIFEST.json"))
-        identity = json.loads(archive.read("BASE-IDENTITY.json"))
-        base_manifest_bytes = archive.read("BASE-PACKAGE-MANIFEST.json")
+    try:
+        with zipfile.ZipFile(base_zip) as archive:
+            manifest = json.loads(archive.read("PACKAGE-MANIFEST.json"))
+            identity = json.loads(archive.read("BASE-IDENTITY.json"))
+            base_manifest_bytes = archive.read("BASE-PACKAGE-MANIFEST.json")
+    except (KeyError, json.JSONDecodeError) as exc:
+        raise SystemExit("BASE_IDENTITY_INVALID") from exc
     if manifest.get("profile") != "base":
     if manifest.get("profile") != "base":
         raise SystemExit("selected Base package is not profile=base")
         raise SystemExit("selected Base package is not profile=base")
     if identity.get("base_id") != manifest.get("base_id"):
     if identity.get("base_id") != manifest.get("base_id"):