import assert from'node:assert/strict';import{compiledCandidate as baseCompiled,physicalCase as basePhysical,checked}from'./smp-frame-service-artifacts.mjs';import{publicationSymbols}from'./acquire-release-capture.mjs'; export{artifact,checked,read}from'./smp-frame-service-artifacts.mjs'; export function compiledCandidate(candidate){const result=baseCompiled(candidate),{symbols,compiled}=result,image=checked(candidate.artifacts.image),start=symbols._image_start.address;for(const[name,size]of Object.entries(publicationSymbols)){const s=symbols[name];assert.ok(s,name);assert.equal(s.size,size,name);const at=s.address-start;if(at>=0&&at+s.size<=image.length)compiled[name]=Buffer.from(image.subarray(at,at+s.size));else{assert.ok(s.address>=symbols.__bss_start.address&&s.address+s.size<=symbols.__bss_end.address);compiled[name]=Buffer.alloc(s.size);}}for(const[key,suffix]of[['publicationCycle','5cycle'],['publicationDrive','5drive']]){const found=Object.keys(symbols).filter(n=>n.includes('11publication'+suffix)&&symbols[n].size>0);assert.equal(found.length,1,key);const s=symbols[found[0]];symbols[key]=s;compiled[key]=Buffer.from(image.subarray(s.address-start,s.address-start+s.size));}for(const[key,parts]of[['publicationReusable',['runtime15acquire_release','9Publisher','8reusable']],['publicationAcquire',['runtime15acquire_release','6Reader','7acquire']],['publicationBusy',['11publication4busy']],['publicationObserved',['11publication8observed']]]){const found=Object.keys(symbols).filter(n=>parts.every(p=>n.includes(p))&&symbols[n].size>0);assert.equal(found.length,1,key);const s=symbols[found[0]];symbols[key]=s;compiled[key]=Buffer.from(image.subarray(s.address-start,s.address-start+s.size));}for(const[key,n]of[['publicationReusableCall','OUTLINED_FUNCTION_4175'],['publicationBusyCall','OUTLINED_FUNCTION_5501'],['publicationClose','OUTLINED_FUNCTION_6689']]){const s=symbols[n];assert.ok(s,key);symbols[key]=s;compiled[key]=Buffer.from(image.subarray(s.address-start,s.address-start+s.size));}return result;} export function physicalCase(candidate,diagnostic){return{...basePhysical(candidate,diagnostic),...compiledCandidate(candidate),publication:diagnostic.publication};}