fix(01): WR-02 recover interrupted Windows runs without invented clocks

This commit is contained in:
UnixNight committed 2026-11-13 17:07:44 -05:00
1 parent 548c97aa58
commit 2608517c37
5 files changed
+86 -2

No files matched your search

+9 -1
View File
@@ -331,9 +331,15 @@ def validate_receipt(receipt, root):
if not isinstance(clocks, dict):
raise ValueError('Clocks must be an object')
start, end = clocks.get('monotonic_start'), clocks.get('monotonic_end')
if not _finite(start) or not _finite(end) or start < 0 or end < start:
missing_end = (status == 'aborted' and receipt.get('acceptance', {}).get('state') == 'open'
and end is None and clocks.get('wall_end') is None)
if not _finite(start) or start < 0 or (not missing_end and (not _finite(end) or end < start)):
raise ValueError('Invalid/reset monotonic clocks')
if missing_end and receipt['events']:
raise ValueError('Missing end clocks cannot bound launch-aligned event observations')
for key in ('wall_start', 'wall_end'):
if key == 'wall_end' and missing_end:
continue
try:
dt = datetime.fromisoformat(clocks[key].replace('Z', '+00:00'))
if dt.tzinfo is None:
@@ -395,6 +401,8 @@ def validate_receipt(receipt, root):
if synthetic and kind != 'synthetic':
raise ValueError('Synthetic artifacts cannot be relabeled as runtime evidence')
missing = list(receipt['missing_evidence']) + list(acceptance['remaining'])
if missing_end:
missing.append('Interrupted collector end clocks unavailable')
if kind not in ('native_port', 'original_dxwnd'):
missing.append(kind + ' is not original/native gameplay acceptance')
if receipt['historical']: