if(existingCompletion.commandId!==existingAdmission.packet.commandId||existingCompletion.packetSha256!==existingAdmission.packetSha256||existingCompletion.targetRuntimeId!==existingAdmission.packet.targetRuntimeId)refuse("command-id-collision","operator completion is not bound to this exact durable admission");
if(existingCompletion)refuse("command-id-collision","operator command id already belongs to a different durable admission");
letadmission;
try{
if(request.sourceActorDiscordId!==ownerDiscordId)refuse("foreign-owner","Epiphany operator command requires the exact configured Discord owner.");
// This persisted Bifrost actor-link is the admitted mapping authority. Its
// Heimdall reference is provenance only until a signed live claim exists.
if(!actorLink||actorLink.guildId!==request.discordGuildId||actorLink.discordAuthorId!==request.sourceActorDiscordId||!actorLink.bifrostActorId?.trim())refuse("missing-actor-link","Epiphany operator command requires the exact admitted Bifrost actor link.");
constat=nowinstanceofDate?now:newDate(now);if(!Number.isFinite(at.getTime())||Date.parse(request.issuedAt)>at.getTime()||Date.parse(request.expiresAt)<at.getTime())refuse("expired-new-request","A new Epiphany operator request is not currently valid.");
if(!envelope||envelope.providerIdentityId!==transport.trustedIdentityId)thrownewError("Operator result did not cross the configured authenticated Epiphany transport boundary.");
if(result.commandId!==admission.packet.commandId||result.packetSha256!==admission.packetSha256||result.targetRuntimeId!==admission.packet.targetRuntimeId)thrownewError("Epiphany operator result is not bound to the admitted command.");
functionrequireDurableLedger(ledger){for(constmemberof["admit","complete","getRequest","getAdmission","getCompletion","terminalize","getTerminal"])if(!ledger||typeofledger[member]!=="function")thrownewError("Epiphany operator admission requires the durable typed collision-ledger port.");}
functionrequireAuthenticatedTransport(transport){if(!transport||typeoftransport.execute!=="function"||typeoftransport.verifyReceipt!=="function"||typeoftransport.trustedIdentityId!=="string"||!transport.trustedIdentityId)thrownewError("No authenticated Epiphany operator CultNet RUDP transport is configured.");}