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

fix(contract): remove stale 8-bit response and watchdog metadata

codex 2 месяцев назад
Родитель
Сommit
c1a4356a75

+ 6 - 5
contracts/6400-manual.yaml

@@ -13,10 +13,11 @@ uart:
   crc: CRC-16/CCITT-FALSE
   set_all_type: 0x01
   get_snapshot_type: 0x02
-  reserved_type: 0x03
-  removed_type: 0x04
-  ack_type: 0x06
-  snapshot_type: 0x82
+  length_width_bits: 16
+  unsupported_types: [0x03, 0x04, 0x08, 0x09]
+  keepalive_type: 0x05
+  ack_type: 0x80
+  snapshot_type: 0x81
   set_all_payload_bytes: 32
 host_i2c:
   address_7bit: 0x2A
@@ -44,7 +45,7 @@ outputs:
   fan_duty_semantics: connector_high_level_request_percent
 watchdog:
   seconds: 30
-  only_feed_on_successful_set_all: true
+  feed_on: [successful_atomic_set_all, active_output_keepalive]
 safety:
   bmc_single_channel_off_c: 76
   bmc_lane_hard_c: 77

+ 2 - 1
contracts/6400-wire.yaml

@@ -61,7 +61,8 @@ invalid_behavior:
   resync: next_real_frame_after_trusted_extent
 outstanding_transactions: 1
 command_fifo: false
-snapshot_lock_release: final_data_crc_byte_stop_bit_complete
+snapshot_lock_release: bounded_snapshot_copy_complete
+host_transaction_release: final_response_stop_bit_or_mailbox_copy_complete
 watchdog_feed: legal_atomic_set_all_commit_or_active_keepalive_only
 retry_semantics:
   set_all_pure_output: retryable

+ 10 - 0
tests/unit/test_unified_consumer_metadata.py

@@ -0,0 +1,10 @@
+import json
+from tools.generate_6400_manual import generate,OUT
+
+def test_exported_uart_metadata_agrees_with_command_tables():
+    data=json.loads(generate()[OUT/'manual-uart-contract.json'])
+    uart=data['wire']['uart'];responses=data['wire']['responses']
+    assert uart['ack_type']==responses['ACK_NACK']['type']==128
+    assert uart['snapshot_type']==responses['ALL_STATUS_DATA']['type']==129
+    assert uart['length_width_bits']==16
+    assert 'active_output_keepalive' in data['watchdog']['feed_on']

+ 4 - 0
tools/generate_6400_manual.py

@@ -162,6 +162,10 @@ def generate() -> dict[Path, bytes]:
     channel_source = load_yaml("channel-map.yaml")
     evidence = load_json("host-i2c-pin-evidence.json")
     sha = contract_hash(manual, wire, snapshot, fan, evidence)
+    if manual['uart']['ack_type']!=wire['responses']['ACK_NACK']['type'] or manual['uart']['snapshot_type']!=wire['responses']['ALL_STATUS_DATA']['type']:
+        raise ValueError('manual/wire response identifiers disagree')
+    if manual['uart']['length_width_bits']!=wire['length_width_bits']:
+        raise ValueError('manual/wire length widths disagree')
     fields, length = snapshot_layout(snapshot)
     channel_map = dict(channel_source)
     channel_map["contract_sha256"] = sha