"""Prepare a task-local checkpoint only; never installs it in user recovery data.""" import json from pathlib import Path entry = ( '// Exact source-5 recovery fixture: Unicode 雨, CRLF, and comment number 5.\r\n' 'arcadia // preserve header comment\r\n 5;\r\n' 'project p "Source 5 recovery acceptance" id "15000000-0000-4000-8000-000000000001" {\r\n' ' include "work.arcadia";\r\n}\r\n' ) work = ( '// Preserve this fragment exactly.\r\n' 'oa_activity a "Retained work" id "15000000-0000-4000-8000-000000000002" {}\r\n' ) snapshot = { 'version': 1, 'id': '15000000-0000-4000-8000-000000000010', 'name': 'Source 5 recovery acceptance', 'origin': None, 'modified': 1788750000, 'accepted': {'entry': 'project.arcadia', 'files': {'project.arcadia': entry, 'work.arcadia': work}}, 'workspace': { 'entry': 'project.arcadia', 'active': 'project.arcadia', 'files': {'project.arcadia': [entry + '\r\nunfinished { 雨', entry], 'work.arcadia': [work, work]}, 'reachable': ['project.arcadia', 'work.arcadia'], 'applied': True, 'new_path': 'drafts/retained-name.arcadia', }, 'property': None, 'behavior': None, 'workflow': None, 'selected': '15000000-0000-4000-8000-000000000001', } path = Path('.local/source5-native-recovery-fixture') / (snapshot['id'] + '.json') path.parent.mkdir(exist_ok=True) path.write_text(json.dumps(snapshot, ensure_ascii=False, indent=2), encoding='utf-8') print(path.resolve())