{
  "sourceKind": "separate production-editor working copy; not a public GitHub commit",
  "reviewedAt": "2026-10-22",
  "excerpts": [
    {
      "file": "app/studio/workspace-store.ts",
      "start": 3,
      "end": 6,
      "code": "export type SmartParent={tabId:string;linkedId:string;sourceKey?:string;sourceHash?:string};\nexport type HistorySnapshot={id:string;name:string;createdAt:number;doc:StudioDoc};\nexport type SavedTab={id:string;doc:StudioDoc;smartParent?:SmartParent;artboardParent?:ArtboardParent;snapshots?:HistorySnapshot[]};\nexport type SavedWorkspace={version:1;activeId:string;tabs:SavedTab[];savedAt:number};",
      "ref": "working-copy-2026-10-22",
      "sha256": "8617c3f508c4a33e48d9f131472d9a2443353d8fd4eb003c97c713bb42c68de6"
    },
    {
      "file": "app/studio/workspace-store.ts",
      "start": 9,
      "end": 10,
      "code": "export function saveWorkspace(value:SavedWorkspace){const snapshot=value;const job=queue.catch(()=>{}).then(async()=>{const db=await database();try{await new Promise<void>((resolve,reject)=>{const t=db.transaction('documents','readwrite'),s=t.objectStore('documents'),r=s.get('workspace');r.onsuccess=()=>{try{if(r.result)s.put(r.result,'workspace-recovery');s.put(snapshot,'workspace');const current=snapshot.tabs.find(t=>t.id===snapshot.activeId);if(current)s.put(current.doc,'current');}catch(error){try{t.abort();}catch{/* Already aborted. */}reject(error);}};t.oncomplete=()=>resolve();t.onabort=()=>reject(t.error??Error('Saving was cancelled.'));t.onerror=()=>reject(t.error);});}finally{db.close();}});queue=job;return job;}\nexport async function loadWorkspace(recovery=false):Promise<SavedWorkspace|null>{const db=await database();try{const v=await new Promise<SavedWorkspace|undefined>((resolve,reject)=>{const r=db.transaction('documents').objectStore('documents').get(recovery?'workspace-recovery':'workspace');r.onsuccess=()=>resolve(r.result);r.onerror=()=>reject(r.error);});if(!v)return null;if(v.version!==1||!Array.isArray(v.tabs)||v.tabs.length>20||!v.tabs.some(t=>t.id===v.activeId))throw Error('Invalid recovery workspace.');for(const t of v.tabs){validateDoc(t.doc);if(t.snapshots){if(!Array.isArray(t.snapshots)||t.snapshots.length>5)throw Error('Invalid history snapshots.');for(const s of t.snapshots){if(typeof s.id!=='string'||typeof s.name!=='string'||s.name.length>80||!Number.isFinite(s.createdAt))throw Error('Invalid history snapshot.');validateDoc(s.doc);}}}return v;}finally{db.close();}}",
      "ref": "working-copy-2026-10-22",
      "sha256": "8617c3f508c4a33e48d9f131472d9a2443353d8fd4eb003c97c713bb42c68de6"
    },
    {
      "file": "app/studio/editor.tsx",
      "start": 248,
      "end": 248,
      "code": "  useEffect(()=>{let live=true;(async()=>{let saved:SavedWorkspace|null=null;try{saved=await loadWorkspace();}catch{saved=await loadWorkspace(true);}if(!live)return;if(saved){sessions.current=new Map(saved.tabs.map(t=>[t.id,{doc:t.doc,undo:[],redo:[],selected:t.doc.layers.at(-1)?.id??null,zoom:.65,smartParent:t.smartParent,artboardParent:t.artboardParent,snapshots:t.snapshots}]));const current=sessions.current.get(saved.activeId)!;tabIdRef.current=saved.activeId;setTabId(saved.activeId);setTabs(saved.tabs.map(t=>({id:t.id,name:t.doc.name})));setDoc(current.doc);docRef.current=current.doc;setSelected(current.selected);}else{const d=await localLoad();if(live&&d){setDoc(d);docRef.current=d;setSelected(d.layers.at(-1)?.id??null);}}if(live){setReady(true);setTimeout(()=>fit(),30);}})().catch(()=>{setReady(true);notify('Recovery is unavailable. Save a project file.');});return()=>{live=false;aiAbort.current?.abort();};},[]);",
      "ref": "working-copy-2026-10-22",
      "sha256": "8cebf076ec902196efa94abd6a2c1d5390e894c4be1f8402e3405bd69fed6f6c"
    },
    {
      "file": "app/studio/editor.tsx",
      "start": 268,
      "end": 269,
      "code": "  function saveProject(){download(new Blob([JSON.stringify(docRef.current)],{type:'application/json'}),`${docRef.current.name}.layerstudio`);notify('Project saved.');}\n  async function openProject(file?:File){if(!file)return;try{if(file.size>100*1024*1024)throw Error('Project files must be 100 MB or smaller.');const next=validateDoc(JSON.parse(await file.text()));await Promise.all(next.layers.filter(l=>l.src).map(l=>loadImage(l.src!)));openDocument(next);}catch(e){notify((e as Error).message);}}",
      "ref": "working-copy-2026-10-22",
      "sha256": "8cebf076ec902196efa94abd6a2c1d5390e894c4be1f8402e3405bd69fed6f6c"
    }
  ],
  "productionUI": {
    "checkedAt": "2026-10-22T01:32:24.915Z",
    "name": "Journal 19 recovery check",
    "opacity": "87",
    "undoEnabled": false,
    "tabsBefore": [
      "Photoshot_03_Curves",
      "original",
      "original",
      "original"
    ],
    "tabsAfter": [
      "Photoshot_03_Curves",
      "original",
      "original",
      "original",
      "original"
    ]
  },
  "autoRecoveryUI": {
    "checkedAt": "2026-10-22T01:33:05.782Z",
    "document": "{\"name\":\"original\",\"width\":1536,\"height\":1024,\"layers\":[{\"id\":\"b18b836a-494b-42bf-a234-0f725317cb5d\",\"name\":\"Journal 19 recovery check\",\"kind\":\"image\",\"text\":\"\",\"fontSize\":80,\"color\":\"#bfff50\",\"x\":0,\"y\":0,\"width\":1536,\"height\":1024,\"rotation\":0,\"opacity\":0.87,\"visible\":true,\"locked\":false,\"blend\":\"normal\",\"brightness\":100,\"contrast\":100,\"saturation\":100,\"strokeCount\":0,\"hasMask\":false}]}",
    "tabs": [
      "Photoshot_03_Curves",
      "original",
      "original",
      "original",
      "original"
    ],
    "undoEnabled": false
  },
  "historicalReports": [
    {
      "file": "workspace-structure-ui-results.json",
      "sha256": "b06581aa777d2a5dbaa81db11da9d395faef8324fb323d690f6536e1f2db94df",
      "results": {
        "passed": true,
        "compCaptureApplyCycle": true,
        "compRenameDuplicate": true,
        "artboardGroup": true,
        "moveContents": true,
        "duplicateUndoRedo": true,
        "recovery": true,
        "errors": []
      },
      "freshRun": false
    }
  ]
}