{
  "schema": "keddeh.aether-codeoss-root-source/2",
  "release": "2026.10.18-code-oss-root-r2",
  "sourceBytes": 24015958,
  "sourceDigest": "78266e64db7e03023edb0e39ef621652f040f88690853fdf8195c2d05b1d2f56",
  "adapterDigest": "65f8260c2385c7c0884b79274efbb920388ebf8e30fa873fdf59999435f7c192",
  "predecessor": {
    "release": "2026.10.15-code-oss-r1",
    "sourceBytes": 24015800,
    "sourceDigest": "0280b97dd45f1f633b1dba7805eae7e246d07432698034feed48eb0d9391cb17",
    "adapterDigest": "28819432a9f94f32719fd96dde7e928327bfe701c2b5d8dbe82f7c543e297ca1",
    "transportBytes": 7988599,
    "transportDigest": "1f0fb8d42e891588999db643b640c7f7859cd86523115827c63257a6d143f820",
    "literalBytes": 15543543
  },
  "patches": [
    [
      " const ROOT='/home/engineer/workspace',ID='code-oss',enc=new TextEncoder();",
      " const ROOT='/home/engineer/workspace',ID='code-oss',enc=new TextEncoder();\n const effectiveVfsEntry=p=>(p===ROOT&&!Object.hasOwn(VFS,p))?[]:VFS[p];"
    ],
    [
      "  const rows=()=>new Map(Object.keys(VFS).filter(p=>p===ROOT||p.startsWith(ROOT+'/')).map(p=>[p,Array.isArray(VFS[p])?JSON.stringify(VFS[p]):VFS[p]]));",
      "  const rows=()=>new Map([...new Set([ROOT,...Object.keys(VFS).filter(p=>p===ROOT||p.startsWith(ROOT+'/'))])].map(p=>{const v=effectiveVfsEntry(p);return[p,Array.isArray(v)?JSON.stringify(v):v];}));"
    ],
    [
      "  const get=p=>{if(!Object.hasOwn(VFS,p))throw fail('EntryNotFound',p);return VFS[p];};",
      "  const get=p=>{if(p!==ROOT&&!Object.hasOwn(VFS,p))throw fail('EntryNotFound',p);return effectiveVfsEntry(p);};"
    ],
    [
      "    const initial=canonical(cwd||ROOT);if(!Array.isArray(VFS[initial]))throw Error('Terminal directory does not exist.');",
      "    const initial=canonical(cwd||ROOT);if(!Array.isArray(effectiveVfsEntry(initial)))throw Error('Terminal directory does not exist.');"
    ]
  ],
  "adapterSource": "/* Code-OSS 37.6.0 integration for Aboudy Keddeh's existing AetherOS.\n   Uses original VFS string/array model, AetherProduct write receipts, original\n   persistence broker and AetherTerminalCore/EngineClient execution contracts.\n   Additive adapter r1; UI layout, unsaved buffers and live jobs are session-only. */\n(() => {\n 'use strict';\n const ROOT='/home/engineer/workspace',ID='code-oss',enc=new TextEncoder();\n const effectiveVfsEntry=p=>(p===ROOT&&!Object.hasOwn(VFS,p))?[]:VFS[p];\n let launch=null,loaded=false,failed=false,backend=null,provider=null,sequence=0;\n const same=(a,b)=>a.length===b.length&&a.every((v,i)=>v===b[i]);\n const status=message=>{const e=document.getElementById('aether-codeoss-status');if(e)e.textContent=message;};\n const fail=(code,message)=>Object.assign(new Error(message),{code,name:code+' (FileSystemError)'});\n function ready(){if(!window.AetherPersistenceReady||!window.AetherPersistenceState?.ready)throw Error('Workspace restoration is not ready. Code-OSS will not write over an unconfirmed workspace.');}\n async function awaitReady(){const start=performance.now();while(!window.AetherPersistenceReady){if(performance.now()-start>16000)throw Error('Workspace restoration is still pending.');await new Promise(r=>setTimeout(r,50));}ready();}\n function canonical(p){if(typeof p!=='string'||!aetherValidPath(p)||p.includes('//')||p.endsWith('/')||p.includes('\\\\')||p.split('/').some(v=>v==='.'||v==='..')||!(p===ROOT||p.startsWith(ROOT+'/')))throw fail('NoPermissions','Use a canonical workspace path.');return p;}\n function encoded(p,bytes){const value=window.AetherVfsCodec.encodeBytes(p,bytes),round=window.AetherVfsCodec.decodeEntry(p,value).bytes;if(!same(bytes,round))throw Error('This path cannot represent these exact bytes in the original VFS codec. No write was applied.');return value;}\n async function write(p,bytes){ready();canonical(p);const value=encoded(p,bytes);try{await window.AetherProduct.writeFile(p,value);}catch(error){const applied=VFS[p]===value;status(applied?'File applied in workspace; durable save is unconfirmed: '+error.message:'Save failed: '+error.message);throw Object.assign(Error((applied?'File is in memory, but save/readback failed. ':'')+error.message),{applied,durable:false});}status(window.AetherPersistenceState.mode==='browser'?'Saved and read back through the original browser workspace.':'Saved in the current session; browser retention is not selected.');}\n function confirmReplacement(p){return new Promise(resolve=>{const dialog=document.createElement('dialog');dialog.style.cssText='max-width:560px;background:#142335;color:#eef5ff;padding:24px;border:1px solid #90bddd';const label=document.createElement('p');label.textContent='This file changed in another Aether tool: '+p+'. Replace its current workspace contents with this editor buffer?';const cancel=document.createElement('button'),replace=document.createElement('button');cancel.textContent='Cancel and preserve current file';replace.textContent='Replace with editor buffer';cancel.autofocus=true;let settled=false;const finish=value=>{if(settled)return;settled=true;dialog.close();dialog.remove();resolve(value);};cancel.onclick=()=>finish(false);replace.onclick=()=>finish(true);dialog.addEventListener('cancel',e=>{e.preventDefault();finish(false);});dialog.addEventListener('close',()=>finish(false));dialog.append(label,cancel,replace);document.body.append(dialog);dialog.showModal();cancel.focus();});}\n function createProvider(api){\n  const events=new api.Emitter();let disposed=false;const ownExpected=new Map(),externalChanges=new Set();\n  const rows=()=>new Map([...new Set([ROOT,...Object.keys(VFS).filter(p=>p===ROOT||p.startsWith(ROOT+'/'))])].map(p=>{const v=effectiveVfsEntry(p);return[p,Array.isArray(v)?JSON.stringify(v):v];}));\n  let observed=rows(),clock=Date.now();const stamps=new Map([...observed.keys()].map(p=>[p,clock]));\n  // Session-local observation stamps support Code-OSS etags; original VFS values and persisted schema are untouched.\n  function scan(){if(disposed)return;const next=rows(),changed=[];for(const[p,v]of next)if(!observed.has(p)||observed.get(p)!==v){if(ownExpected.get(p)!==v)externalChanges.add(p);stamps.set(p,clock=Math.max(Date.now(),clock+1));changed.push({type:observed.has(p)?0:1,resource:api.URI.from({scheme:'aether',path:p})});}for(const[p]of observed)if(!next.has(p)){stamps.delete(p);externalChanges.add(p);changed.push({type:2,resource:api.URI.from({scheme:'aether',path:p})});}observed=next;if(changed.length)events.fire(changed);}\n  const previous=aetherPersistVfs;\n  const wrapped=async function(...args){scan();try{return await previous.apply(this,args);}finally{scan();}};\n  aetherPersistVfs=wrapped;\n  const path=u=>{if(u.scheme!=='aether'||u.authority||u.query||u.fragment)throw fail('NoPermissions','Unsupported workspace URI.');return canonical(u.path);};\n  const get=p=>{if(p!==ROOT&&!Object.hasOwn(VFS,p))throw fail('EntryNotFound',p);return effectiveVfsEntry(p);};\n  return {capabilities:2|1024,onDidChangeCapabilities:api.Event.None,onDidChangeFile:events.event,watch:()=>({dispose(){}}),\n   async stat(uri){scan();const p=path(uri),v=get(p);return {type:Array.isArray(v)?2:1,ctime:0,mtime:stamps.get(p)||0,size:Array.isArray(v)?0:window.AetherVfsCodec.decodeEntry(p,v).bytes.length};},\n   async readdir(uri){const p=path(uri),v=get(p);if(!Array.isArray(v))throw fail('EntryNotADirectory',p);return v.map(n=>{const q=p+'/'+n;canonical(q);const row=get(q);return[n,Array.isArray(row)?2:1];});},\n   async readFile(uri){const p=path(uri),v=get(p);if(Array.isArray(v))throw fail('EntryIsADirectory',p);return window.AetherVfsCodec.decodeEntry(p,v).bytes;},\n   async writeFile(uri,content,options){const p=path(uri);ready();scan();const old=VFS[p];if(Array.isArray(old))throw fail('EntryIsADirectory',p);if(old===undefined&&!options.create)throw fail('EntryNotFound',p);if(old!==undefined&&!options.overwrite)throw fail('EntryExists',p);if(externalChanges.has(p)){if(!await confirmReplacement(p))throw fail('Unavailable','External change preserved. Reload the file or explicitly approve replacement.');if(VFS[p]!==old)throw fail('Unavailable','File changed again during confirmation.');}const bytes=new Uint8Array(content),expected=encoded(p,bytes);ownExpected.set(p,expected);try{await write(p,bytes);if(VFS[p]===expected)externalChanges.delete(p);}finally{ownExpected.delete(p);}},\n   async mkdir(){throw fail('Unavailable','Create directories through the original Workspace Terminal.');},\n   async rename(){throw fail('Unavailable','Rename is not exposed by this original VFS adapter.');},\n   async delete(){throw fail('Unavailable','Deletion is not exposed by this original VFS adapter.');},\n   dispose(){disposed=true;events.dispose();if(aetherPersistVfs===wrapped)aetherPersistVfs=previous;}\n  };\n }\n async function mkdir(p){\n  ready();canonical(p);const parts=p.split('/').slice(1);let parent='/';\n  for(const part of parts){const current=(parent==='/'?'':parent)+'/'+part;if(VFS[current]!==undefined&&!Array.isArray(VFS[current]))throw Error('A parent is a file: '+current);if(!VFS[current])VFS[current]=[];if(!Array.isArray(VFS[parent]))throw Error('Invalid parent directory.');if(!VFS[parent].includes(part))VFS[parent].push(part);parent=current;}\n  if(!await aetherPersistVfs())throw Error('Directory is in memory but persistence failed.');if(typeof renderVfsTree==='function')renderVfsTree();return {path:p,readback:Array.isArray(VFS[p])};\n }\n function createBackend(api){\n  const live=new Set();\n  return new class extends api.SimpleTerminalBackend {\n   constructor(){super();this.getProfiles=async()=>[{profileName:'Aether workspace shell',path:'aether-workspace',isDefault:true}];this.setReady();}\n   async getDefaultSystemShell(){return 'aether-workspace';}\n   async createProcess(_launch,cwd){\n    ready();const id=++sequence,owner='code-oss-terminal-'+id;\n    const shell=window.AetherTerminalCore.createTerminal({\n     readFile:p=>typeof VFS[p]==='string'?window.AetherVfsCodec.decodeEntry(canonical(p),VFS[p]).bytes:null,\n     writeFile:async(p,v)=>write(p,typeof v==='string'?enc.encode(v):new Uint8Array(v)),\n     listFiles:p=>Object.keys(VFS).filter(q=>(q===p||q.startsWith(p+'/'))&&(q===ROOT||q.startsWith(ROOT+'/'))).map(q=>({path:q,type:Array.isArray(VFS[q])?'directory':'file'})),mkdir,\n     runEngine:(engine,input)=>window.AetherEngineClient.run(engine,input,owner),\n     engineStatus:()=>window.AetherEngineClient.status(),\n     openApp:app=>{if(!['vfs','terminal','code-editor','sqlite-studio','document-viewer','software'].includes(app))throw Error('Application is not in this terminal launch allowlist.');openApp(app);}\n    },{limits:{fileBytes:2*1024*1024,packageBytes:2*1024*1024,manifestBytes:3*1024*1024,packageFiles:64}});\n    const initial=canonical(cwd||ROOT);if(!Array.isArray(effectiveVfsEntry(initial)))throw Error('Terminal directory does not exist.');\n    if(initial!==ROOT){const result=await shell.execute('cd '+JSON.stringify(initial));if(result.exitCode)throw Error(result.stdout);}\n    const data=new api.Emitter(),readyEvent=new api.Emitter(),exit=new api.Emitter();let line='',running=false,closed=false,started=false;\n    const cancel=()=>{if(!running)return false;shell.cancel();return window.AetherEngineClient.cancel(owner);};\n    const prompt=()=>data.fire('engineer@aether:'+shell.cwd+'$ ');\n    const session={id,shouldPersist:false,onProcessData:data.event,onProcessReady:readyEvent.event,onProcessExit:exit.event,onDidChangeProperty:api.Event.None,\n     async start(){if(closed)return {message:'Terminal is closed.'};if(started)return;started=true;readyEvent.fire({pid:id,cwd:shell.cwd,windowsPty:undefined});data.fire('Aether workspace shell · original VFS and execution engines\\r\\nSession '+id+' is a logical terminal identity; Bash is not installed.\\r\\n');prompt();},\n     input(text){if(closed||!started)return;for(const ch of text){if(ch==='\\x03'){if(running)cancel();else{line='';data.fire('^C\\r\\n');prompt();}continue;}if(running){data.fire('\\r\\nInteractive program stdin is unavailable.\\r\\n');return;}if(ch==='\\r'||ch==='\\n'){const command=line;line='';data.fire('\\r\\n');if(!command.trim()){prompt();continue;}running=true;shell.execute(command).then(result=>{if(closed)return;if(result.clear)data.fire('\\x1b[2J\\x1b[H');data.fire((result.stdout||'').replace(/\\r?\\n/g,'\\r\\n'));data.fire('\\r\\n[Exit '+result.exitCode+(result.receipt?.complete===false?' · partial receipt':'')+']\\r\\n');},error=>{if(!closed)data.fire('Error: '+error.message+'\\r\\n');}).finally(()=>{running=false;if(!closed)prompt();});}else if(ch==='\\x7f'||ch==='\\b'){if(line){line=line.slice(0,-1);data.fire('\\b \\b');}}else if(ch>=' '){if(line.length>=16384){data.fire('\\x07');continue;}line+=ch;data.fire(ch);}}},\n     shutdown(){if(closed)return;cancel();closed=true;live.delete(session);exit.fire(0);data.dispose();readyEvent.dispose();exit.dispose();},\n     sendSignal(s){if(!['SIGINT','SIGTERM'].includes(s))throw Error('Unsupported signal.');cancel();},cancel,\n     resize(){},clearBuffer(){data.fire('\\x1b[2J\\x1b[H');},acknowledgeDataEvent(){},async setUnicodeVersion(){},async getInitialCwd(){return initial;},async getCwd(){return shell.cwd;},async updateProperty(){},async refreshProperty(){throw Error('Property unavailable.');},processBinary(){throw Error('Binary stdin is unavailable.');}\n    };live.add(session);return session;\n   }\n   cancelActive(){for(const s of live)s.cancel();}\n   dispose(){for(const s of [...live])s.shutdown();super.dispose?.();}\n  };\n }\n async function loadPackage(){\n  const carrier=document.getElementById('aether-codeoss-carrier');if(!carrier)throw Error('Installed Code-OSS carrier is missing.');\n  const packed=JSON.parse(carrier.textContent);\n  for(const name of ['workbench','editor']){const bytes=enc.encode(packed[name]);const digest=[...new Uint8Array(await crypto.subtle.digest('SHA-256',bytes))].map(x=>x.toString(16).padStart(2,'0')).join('');const pin=name==='workbench'?'bed40b24bad26aab037756f5c30b1e63b4a298a01f14c192b19cec2ea12caefb':'0c47a24d5499331fa8f7f041a6cf33b2f075140f763d66cd770e0ec1b23bd6e5';if(digest!==pin)throw Error('Installed '+name+' integrity check failed.');}\n  const script=document.createElement('script');script.textContent=packed.workbench;let scriptError=null;const onerror=e=>{scriptError=e.error||Error(e.message||'Code-OSS initialization failed.');};window.addEventListener('error',onerror);try{document.head.appendChild(script);}finally{window.removeEventListener('error',onerror);script.remove();}\n  if(scriptError)throw scriptError;if(!window.AetherCodeOSSApi)throw Error('Installed Code-OSS exports are missing.');loaded=true;return {api:window.AetherCodeOSSApi,editor:packed.editor};\n }\n async function mount(container){\n  await awaitReady();status('Loading verified installed Code-OSS…');\n  const {api,editor}=await loadPackage(),workers=new Set();let workerURL;\n  const oldMonaco=window.MonacoEnvironment;\n  try{\n   provider=createProvider(api);api.registerCustomProvider('aether',provider);\n   workerURL=URL.createObjectURL(new Blob([editor],{type:'text/javascript'}));\n   window.MonacoEnvironment={getWorker(_id,label){if(label!=='editorWorkerService')throw Error('No registered worker for '+label);const worker=new Worker(workerURL,{name:'aether-codeoss-editor'});workers.add(worker);return worker;}};\n   backend=createBackend(api);\n   await api.initialize({...api.workbenchServices(),...api.filesServices(),...api.explorerServices(),...api.configurationServices(),...api.themeServices(),...api.searchServices(),...api.terminalServices(backend),...api.scmServices()},container,{\n    workspaceProvider:{workspace:{folderUri:api.URI.from({scheme:'aether',path:ROOT})},trusted:true,open:async()=>false},\n    productConfiguration:{nameShort:'Code-OSS',nameLong:'Code-OSS in AetherOS',applicationName:'aether-codeoss'},\n    configurationDefaults:{'workbench.colorTheme':'Default Dark Modern','security.workspace.trust.enabled':true,'terminal.integrated.defaultProfile.linux':'Aether workspace shell','files.autoSave':'off'}\n   });\n   status('Code-OSS ready · original workspace files · layout and unsaved buffers are session-only.');\n  }catch(error){for(const w of workers)try{w.terminate();}catch{}try{backend?.dispose();}catch{}try{provider?.dispose();}catch{}if(workerURL)URL.revokeObjectURL(workerURL);window.MonacoEnvironment=oldMonaco;throw error;}\n }\n function open(){\n  if(openWindows[ID]){focusWindow(ID);return launch;}\n  const win=createWindow(ID,'Code-OSS · AetherOS','⌨',1180,760,'');\n  const body=win.el.querySelector('.window-body');body.style.cssText='overflow:hidden;display:flex;flex-direction:column;padding:0;min-height:0;user-select:text';\n  const note=document.createElement('div');note.id='aether-codeoss-status';note.setAttribute('role','status');note.style.cssText='padding:5px 10px;background:#17202a;color:#d8e7f4;font:12px system-ui';note.textContent='Waiting for original workspace restoration…';\n  const container=document.createElement('div');container.id='aether-codeoss-workbench';container.style.cssText='flex:1;position:relative;min-height:0;overflow:hidden;user-select:text';\n  body.append(note,container);\n  if(failed){status('Initialization failed. Save current work and reload the workspace before retrying.');return;}\n  launch=mount(container).catch(error=>{failed=true;status('Code-OSS could not start: '+error.message+' Save current work before reloading.');});return launch;\n }\n const priorOpen=openApp;openApp=function(id){if(id===ID){closeStartMenu();return open();}return priorOpen(id);};\n const priorClose=closeWindow;closeWindow=function(id){if(id===ID&&openWindows[id]){backend?.cancelActive();minimizeWindow(id);return;}return priorClose(id);};\n const grid=document.getElementById('desktop-grid'),item=document.createElement('button');item.type='button';item.className='desktop-icon';item.setAttribute('aria-label','Code-OSS');item.innerHTML='<span class=\"icon-symbol\">⌨</span><span class=\"icon-label\">Code-OSS</span>';item.addEventListener('click',()=>openApp(ID));grid.prepend(item);\n const choice=document.createElement('button');choice.type='button';choice.className='start-app-item';choice.textContent='Code-OSS';choice.addEventListener('click',()=>openApp(ID));document.getElementById('start-apps-list').prepend(choice);\n SOFTWARE_CATALOG.unshift({id:ID,name:'Code-OSS',category:'dev',catLabel:'Installed open-source software',icon:'⌨',version:'37.6.0',size:'Verified embedded browser package',author:'Microsoft / CodinGame; Aether integration attributed separately',license:'MIT and included dependency notices',arch:'Browser workbench',desc:'Original Aether workspace files and execution engines. Session-only layout; saved files use the original persistence broker.',status:'Installed'});\n window.AetherCodeOSS=Object.freeze({open,status:()=>({loaded,failed,resident:!!openWindows[ID],workspace:ROOT,lifecycle:'resident until workspace reload'})});\n})();\n",
  "generatorSource": "import fs from 'node:fs';\nimport {gunzipSync,gzipSync} from 'node:zlib';\nimport {createHash} from 'node:crypto';\nconst [sourceJson,originalHtml,originalLiteralGzip,oldDeltaModule,outDir]=process.argv.slice(2);\nif(!outDir)throw Error('Usage: node build-aether-codeoss-root-r2.mjs SOURCE_JSON ORIGINAL_HTML ORIGINAL_LITERAL_GZIP OLD_DELTA_MODULE OUTPUT_DIR');\nconst record=JSON.parse(fs.readFileSync(sourceJson,'utf8')),hash=b=>createHash('sha256').update(b).digest('hex');\nconst raw=fs.readFileSync(originalHtml);if(raw.length!==record.predecessor.sourceBytes||hash(raw)!==record.predecessor.sourceDigest)throw Error('Original identity');\nlet text=raw.toString('utf8'),literal=gunzipSync(fs.readFileSync(originalLiteralGzip)).toString('utf8');\nfor(const [from,to]of record.patches){if(text.split(from).length!==2||literal.split(from).length!==2)throw Error('Patch anchor');text=text.replace(from,to);literal=literal.replace(from,to);}\nconst bytes=Buffer.from(text),pool=Buffer.from(literal);if(hash(bytes)!==record.sourceDigest||bytes.length!==record.sourceBytes)throw Error('Derivative identity');\nconst old=await import(new URL('file://'+fs.realpathSync(oldDeltaModule)));const recipe=old.aetherDeltaRecipe.map(x=>[...x]);const lastLiteral=recipe.findLast(x=>x[0]===1);lastLiteral[2]+=pool.length-record.predecessor.literalBytes;\nfs.mkdirSync(outDir,{recursive:true});fs.writeFileSync(outDir+'/aether-native-root-r2.html',bytes);fs.writeFileSync(outDir+'/aether-codeoss-root-r2-literal.gz',gzipSync(pool,{level:6,mtime:0}));\nconst module='export const aetherDeltaRecipe='+JSON.stringify(recipe)+';\\nexport const aetherDeltaSha256='+JSON.stringify(record.sourceDigest)+';\\nexport const aetherDeltaGzip='+JSON.stringify(gzipSync(pool,{level:6,mtime:0}).toString('base64'))+';\\n';fs.writeFileSync(outDir+'/aether-codeoss-root-r2-data.mjs',module);\nconsole.log(JSON.stringify({sourceBytes:bytes.length,sourceDigest:hash(bytes),literalBytes:pool.length,scope:'Exact derivative HTML; gzip container may vary by compressor version. Regenerate transport pins from output.'}));\n",
  "storageContract": "aetheros-host-persistence-v1",
  "scope": "Four read-binding substitutions only. An absent already-declared workspace root is exposed as a virtual directory; no startup VFS assignment or permission change.",
  "rebuild": "Apply patches to the exact predecessor HTML, or use the included generator with the retained predecessor literal gzip and delta module. The original Code-OSS libraries, notices and integration archives remain required corresponding source.",
  "gzipScope": "The exact derivative HTML is authoritative. A different compressor may emit different gzip bytes; generated transport identities must be recomputed."
}