Переглянути джерело

6400-contract-lock-and-audits

Prod2U 3 місяців тому
батько
коміт
cbe78a66ef

+ 67 - 0
ACTIVE_6400_MANUAL_I2C_LOCK.yaml

@@ -0,0 +1,67 @@
+schema: active-6400-manual-i2c-lock-v1
+status: ACTIVE_CANDIDATE_UART_NO_PID
+product: 6400-front-rear
+board: FCB V1.1
+device: EF2L45BG256B
+clock_hz: 25000000
+pll: forbidden
+firmware_count: 1
+gui_count: 1
+mrdimm_changed: false
+outputs:
+  ptc_count: 24
+  front_fan_count: 4
+  rear_fan_count: 4
+  ptc_pwm_hz: 500
+  fan_pwm_hz: 500
+  safe_ptc_percent: 0
+  safe_front_percent: 20
+  safe_rear_percent: 20
+  fan_duty_semantics: connector_high_level_percent
+  fan_board_invert_mask: 0x0F
+uart:
+  baud: 921600
+  format: 8N1
+  frame_header: [0xA5, 0x5A]
+  crc: CRC-16/CCITT-FALSE
+  commands: [SET_ALL, GET_SNAPSHOT, RESERVED_UNSUPPORTED, REMOVED_UNSUPPORTED]
+  ack_type: 0x06
+  snapshot_type: 0x82
+  set_all_payload_bytes: 32
+host_i2c:
+  address_7bit: 0x2A
+  register_address_width: 16
+  modes: [100kHz, 400kHz]
+  clock_stretching: forbidden
+  sda_drive: low_or_hiz_only
+  status: BLOCKED_IMPLEMENTATION
+  production_binding: NOT_BOUND
+  selected_candidate: CON36
+  candidate_sda: {connector: CON36, pin: 3, ball: C12, net: FAN_GPIO15}
+  candidate_scl: {connector: CON36, pin: 4, ball: B12, net: FAN_GPIO16}
+  evidence_status: LOCAL_BOARDVIEWER_NOT_YET_MIGRATED
+  pullup_status: UNKNOWN
+control:
+  mode: SAFE_MANUAL_ONLY
+  watchdog_seconds: 30
+  reset: {ptc: 0, front: 20, rear: 20, manual_active: 0}
+  timeout: {ptc: 0, front: 20, rear: 20, manual_active: 0}
+  bmc_stale_allows_manual: true
+  safety_thresholds_c: {channel_off: 76, lane_hard: 77}
+pid:
+  active_logic: 0
+  dsp_use: 0
+  command_0x04: UNSUPPORTED
+source:
+  worktree: /data/prod2u/worktrees/6400-no-pid
+  commit: 5b658ca0e34fff37c74e9ace0d78d68d1c0fcbb5
+build:
+  td_status: PASS
+  bitstream_sha256: 810cb9ac5a5dacf2e594af716981f77ce89f9a633efcca1bc06709f88a14ab86
+  td_receipt: /data/prod2u/runs/6400-no-pid-5b658ca0/td-receipt.json
+evidence:
+  hardware: NOT_RUN
+  com: NOT_RUN
+  jtag: NOT_RUN
+  actual_host_i2c_hardware: NOT_RUN
+  external_mcu_firmware: NOT_IMPLEMENTED

+ 11 - 0
EXECUTION_PLAN.md

@@ -0,0 +1,11 @@
+# 6400 manual migration execution plan
+
+1. Freeze active values in `ACTIVE_6400_MANUAL_I2C_LOCK.yaml`.
+2. Validate the local V1.1 board-viewer evidence and keep CON36 unbound until pull-up and conflict evidence is present.
+3. Keep CT7428 master on M8/N9 and do not share its physical wires with Host-I2C.
+4. Remove PID and automatic-control code from the active UART closure.
+5. Verify SAFE/MANUAL SET_ALL, 30-second watchdog, BMC 76/77 safety, and atomic output-bank commit.
+6. Build the 6400 Bitstream on `edk2-uefi-lab` only, with TD receipt bound to the exact clean commit.
+7. Build one offline GUI from the same manual contract. A Linux host cannot emit a Windows PE executable without a Windows toolchain; provide source and Linux build until one is available remotely.
+8. Deploy the dedicated UART abstraction kit to ringzle without replacing the legacy hth-platform deployment.
+9. Run focused software tests and report Hardware/COM/JTAG/I2C as NOT RUN.

+ 11 - 56
QUICK_PROGRESS.md

@@ -1,57 +1,12 @@
-# 6400 V1.1 Bounded Fix Progress
+# Quick progress
 
 
-## 2026-08-26 PWM startup and remote migration
-
-- Baseline: `4d0e5c0e1809a72522567c1103bc77bee984b509`; branch: `fix/6400-pwm-remote-migration`; initial status clean.
-- Phase: P0 PWM startup handoff only; TD, canonical repair, remote migration and WSL shutdown not started.
-- Required change: `boot_init_complete -> runtime_duty_ready`; preserve safe PTC0/FAN20 until one complete 32-channel runtime scan, then take over only on a phase boundary.
-- Required focused tests: generator check, lint, PWM unit, production Top POR/Boot three-period Cocotb, fan polarity and focused control.
-- Remote runtime policy: rootless Podman + Quadlet preferred; no remote write until SSH host identity is trusted.
-- Hardware/COM/JTAG: NOT RUN; TTL pin unresolved/disabled.
-- P0 implemented: PWM holds safe carrier until `boot_init_complete` and a complete 32-channel runtime scan; takeover remains phase-boundary atomic.
-- PASS: Generator `--check`, closure check, Verilator lint, PWM unit, focused control Cocotb.
-- PASS: production-parameter POR/Boot Cocotb observed three 50,000-clock periods; each PTC high=0 and each Front/Rear connector high=10,000.
-- PASS: Front Ball low=10,000 and Rear Ball high=10,000 per complete period; no 0%/100% carrier, narrow pulse or pre-scan commit.
-- Next: independent P0 commit, then Fresh TD/GUI/Delivery before canonical or remote work.
-
-- Workspace: `/root/workspaces/thermal-system/cpld-temperature-control`
-- Branch: `dev`
-- Baseline: `a00a5b673f6007ba4602221393aa4dce1e75e51e`; committed HEAD before current fix: `704b947d10d924325598ac15847febb0c4908f49`.
-- Initial Git status: clean.
-- Product: `6400-front-rear`; Board: `FCB V1.1`.
-- Phase: Final acceptance complete; external exact-commit repackage is the only remaining action after this commit.
-- Prior Quick artifacts are historical evidence only and will not be reused.
-- Fixed-point YAML exists and specifies incremental PI Q4.12/Q8.8, half-away rounding, slew 1280, Kd 0.
-- Fixed: production Top/Core/Command stimulus parameter, RAM, ports and states removed; 0x03 remains UNSUPPORTED.
-- Fixed: fan contract split into manual independence and PID safe20/hard100 policy.
-- Fixed: one sequential incremental PI datapath, Q4.12/Q8.8 and BRAM-resident 24-channel state.
-- Fixed: new hard fault global-safe once; persistent fault and stale no repeated global Bank churn.
-- Fixed: SET_ALL final commit handshake returns SAFETY_LOCKED if a new hard lock cancels apply.
-- PASS: bounded oversized-frame RX audit and source-closure hash/separation checks.
-- Implemented: bounded oversized-frame CRC/discard path; length-34 embedded-header and bad-CRC Icarus PASS.
-- Implemented: unambiguous manual/PID fan-policy contract; deterministic generator rebuild and `--check` PASS.
-- Toolchain: OSS CAD Suite restored at `/data/prod2u/oss-cad-suite/latest`; no global PATH or driver changes.
-- PASS: deterministic generator check, Verilator lint, Frame RX Icarus, Host Command Icarus, Core Icarus.
-- PASS: canonical Python-vs-RTL PI differential including EDGE/CENTER, rounding, slew, saturation, epoch hold, MANUAL freeze, timeout clear and stale hold.
-- PASS: current-contract full-top control Cocotb: SAFE 0/20, MANUAL without BMC, 76 clamp, 77 lane lock, SAFETY_LOCKED, three-epoch release, persistent stale hold.
-- PASS: full-UART oversized Length 34/255, embedded A5 5A, one BAD_LENGTH/UNSUPPORTED response and no ghost command.
-- PASS: active Formal manifest is single-product; bounded Boolector board-adapter smoke proves Front inverse/Rear direct.
-- PASS: 64 focused unit tests, Verilator/Yosys lint, all focused Icarus, PWM three-period reset, Host/control Cocotb, PI differential, closure checks and two deterministic generator checks.
-- Registry: `01 SET_ALL`, `02 GET_SNAPSHOT`, `03 SET_STIMULUS reserved`, `04 SET_PID_TARGET`, `06 ACK_NACK`, `82 SNAPSHOT_DATA`.
-- Hardware/COM/JTAG: NOT RUN. Pre-configuration pin state: NOT VERIFIED.
-- Q3 PASS: Fresh TD commit `635fd540`, bit SHA `0bc41195...`, GUI SHA `908fdab2...`; Quick paths reported.
-- Q4: canonical Base/Current/Delivery implementation added; 19 focused package tests PASS.
-- Q4 PASS: final Base ID `bcaa43c7a953`; Base/Current/Delivery deterministic rebuild, fresh overlay and tamper rejection PASS.
-- L1 PASS: Board Adapter Boolector+Z3; Core Owner Boolector depth90 (110s); Snapshot Lock and BMC Bank Boolector.
-- L1: affected current-contract Formal PASS; evidence binds unchanged 6400 production source closure.
-- PASS: current-contract 96-round soak at `d6b604e4`, seed `1677779166`, including two reset/reconfiguration points.
-- PASS: mutation 6/6 and full 6400 integration; prior Final TD at `704b947` is superseded by the current RTL fix.
-- Fixed after Formal counterexample: Watchdog reload now occurs only on final safely applied Manual output commit; staging/cancelled SET_ALL cannot feed it.
-- PASS current focused replay: generator/closure, lint, 21 unit, Icarus sim, Host Cocotb, hard-fault cancellation race with Watchdog non-feed assertion.
-- Formal split: Core Owner invariant k-induction PASS 94s; added transaction/race properties BMC depth90 PASS 125s; Frame RX Z3/Boolector PASS; Snapshot transport Boolector depth48 PASS and Z3 probe TIMEOUT.
-- PASS: Final TD source commit `44feaa57`; later Legacy-only fixes do not intersect the 6400 production source closure.
-- PASS: Final bitstream SHA `7d30bb5e...`; GUI SHA `e2d4f009...`; Contract SHA `35fe2e06...`.
-- PASS: affected Legacy Gate at `a67ae51`: Icarus 42/42, Cocotb UART E2E, Verilator.
-- PASS: canonical Base ID `bcaa43c7a953`; Current/Delivery fresh extraction and tamper rejection.
-- Boundaries: Hardware/COM/JTAG/Real BMC/RPM/Airflow/Thermal NOT RUN; pre-configuration NOT VERIFIED; Host TTL pins BLOCKED_EVIDENCE.
-- Next: rebuild Current/Delivery on this exact clean `dev` commit, then close audit without further source edits.
+- Remote authority inspected: cpld-temperature-control, hth-platform, engineering-manifests, thermal-control-lab.
+- Safe isolated worktree: `/data/prod2u/worktrees/6400-no-pid`.
+- No-PID active RTL closure scan: PASS (zero PID hits).
+- Clean TD: PASS; commit `5b658ca0e34fff37c74e9ace0d78d68d1c0fcbb5`.
+- Bitstream: `/data/prod2u/runs/6400-no-pid-5b658ca0/bitgen/prod2u_6400_front_back.bit`.
+- Bitstream SHA256: `810cb9ac5a5dacf2e594af716981f77ce89f9a633efcca1bc06709f88a14ab86`.
+- GUI source: no automatic-control/PID page; Linux ELF build exists, Windows PE not built remotely.
+- Dedicated UART abstraction kit deployed to 2.66: `/home/cxkj/bin/prod2u6400-uart`.
+- Host-I2C: CON36 candidate recorded but not bound in this candidate.
+- Hardware, COM, JTAG, and actual Host-I2C: NOT RUN.

+ 17 - 0
TEST_IMPACT_MAP.yaml

@@ -0,0 +1,17 @@
+schema: test-impact-map-v1
+product: 6400-front-rear
+tests:
+  generator_deterministic: {scope: UART_codec, status: PASS}
+  contract_drift: {scope: manual_contract, status: PASS}
+  pid_absence: {scope: active_src_closure, status: PASS}
+  td_synthesis_place_route_bitgen: {scope: 6400_no_pid_uart, status: PASS}
+  uart_set_all: {scope: protocol_and_simulation, status: NOT_RUN}
+  uart_get_snapshot: {scope: protocol_and_simulation, status: NOT_RUN}
+  watchdog_reset_safety: {scope: RTL_simulation, status: NOT_RUN}
+  bmc_76_77_safety: {scope: RTL_simulation, status: NOT_RUN}
+  i2c_register_protocol: {scope: Host-I2C, status: BLOCKED_IMPLEMENTATION}
+  i2c_pin_evidence: {scope: CON36, status: BLOCKED_EVIDENCE}
+  hth_uart_codec: {scope: prod2u6400-uartkit, status: PASS}
+  gui_contract_sha: {scope: manual_gui_source, status: PASS}
+  real_uart_hardware: {scope: /dev/ttyUSB2, status: NOT_RUN}
+  jtag_programming: {scope: FCB_V1_1, status: NOT_RUN}

+ 59 - 0
tools/validate_active_6400_lock.py

@@ -0,0 +1,59 @@
+#!/usr/bin/env python3
+"""Fail-closed validation for the active 6400 lock."""
+from __future__ import annotations
+
+import sys
+from pathlib import Path
+
+try:
+    import yaml
+except Exception as exc:  # pragma: no cover
+    print(f"LOCK_FAIL yaml unavailable: {exc}", file=sys.stderr)
+    raise SystemExit(2)
+
+ROOT = Path(__file__).resolve().parents[1]
+LOCK = ROOT / "ACTIVE_6400_MANUAL_I2C_LOCK.yaml"
+
+EXPECTED = {
+    "product": "6400-front-rear",
+    "board": "FCB V1.1",
+    "device": "EF2L45BG256B",
+    "clock_hz": 25_000_000,
+    "pll": "forbidden",
+    "firmware_count": 1,
+    "gui_count": 1,
+}
+
+
+def main() -> int:
+    if not LOCK.is_file():
+        print("LOCK_FAIL missing ACTIVE_6400_MANUAL_I2C_LOCK.yaml", file=sys.stderr)
+        return 2
+    data = yaml.safe_load(LOCK.read_text(encoding="utf-8"))
+    for key, value in EXPECTED.items():
+        if data.get(key) != value:
+            print(f"LOCK_FAIL {key}: expected {value!r}, got {data.get(key)!r}", file=sys.stderr)
+            return 2
+    outputs = data.get("outputs", {})
+    if outputs.get("ptc_count") != 24 or outputs.get("front_fan_count") != 4 or outputs.get("rear_fan_count") != 4:
+        print("LOCK_FAIL actuator counts", file=sys.stderr)
+        return 2
+    if outputs.get("ptc_pwm_hz") != 500 or outputs.get("fan_pwm_hz") != 500:
+        print("LOCK_FAIL PWM frequency", file=sys.stderr)
+        return 2
+    uart = data.get("uart", {})
+    if uart.get("baud") != 921600 or uart.get("format") != "8N1":
+        print("LOCK_FAIL UART", file=sys.stderr)
+        return 2
+    if data.get("host_i2c", {}).get("address_7bit") != 0x2A:
+        print("LOCK_FAIL Host-I2C address", file=sys.stderr)
+        return 2
+    if data.get("pid", {}).get("active_logic") != 0 or data.get("pid", {}).get("dsp_use") != 0:
+        print("LOCK_FAIL PID is active", file=sys.stderr)
+        return 2
+    print("LOCK_PASS")
+    return 0
+
+
+if __name__ == "__main__":
+    raise SystemExit(main())