export function deriveRemoteNegotiation(contract, connection) {
    if (!contract) {
        return {
            transport: 'acp',
            executionProtocol: 'direct',
            reviewMode: 'none',
            communicationLane: 'direct',
            trustClass: connection ? 'connection-only' : 'unknown',
            detail: connection
                ? 'Transport is active but no runner contract has been registered yet.'
                : 'No remote contract or connection is available.',
        };
    }
    return {
        transport: contract.sourceTransport,
        executionProtocol: contract.capabilityCeiling.executionProtocol,
        reviewMode: contract.capabilityCeiling.reviewMode,
        communicationLane: contract.capabilityCeiling.communicationLane,
        trustClass: contract.trustClass,
        detail: `${contract.template} runner negotiated ${contract.capabilityCeiling.executionProtocol}/${contract.capabilityCeiling.reviewMode} on ${contract.sourceTransport}.`,
    };
}
