 # compounds adds the service-to-client communication on top of that.
 # The component itself is built heavily on top of a code emission
 # and delivery platform, as implemented by `Screenplay` service.
-module.exports.Bilateral = class Bilateral extends DuplexCore
+assert module.exports.Bilateral = class Bilateral extends DuplexCore
 
     # This is a marker that indicates to some internal subsystems
     # that this class has to be considered abstract and therefore

    # This is the place where you would be importing the dependencies.
    # Pay attention that most implementations side effect the context.
    prelude: (symbol, context, request, next) ->
        _.forIn this, (value, name, service) =>
            setter = "#{symbol}.#{name}.%s = (%s)"
            directives = value?.uplink?.directives
            return unless _.isPlainObject directives
            assert json = try JSON.stringify directives
            template = format setter, "directives", json
            context.invokes.push "\r\n#{template}\r\n"
            uplinks = context.uplinks ?= new Object
            uplinks[name] = directives; return @
        return next.call this, undefined

    # Declarate the supplied implementation function as the uplink.
    # An uplink is an external (remote) function published on socket

    # socket channel that makes it available for the invocation by
    # the corresponding server site facilities implemented belows.
    bilateral: @autocall z: +102, ->
        assert _.isFunction o = -> try _.head arguments
        assert _.isFunction i = -> try _.head arguments
        assert _.isString(@service), "invalid service data"
        assert _.isString(@location), "location misconfied"
        assert _.isString(@nsp), "bilateral nsp malfunction"
        try uplinking = "Uplink %s at #{@location}, nsp=%s"
        _.forIn this, (value, reference, context) => do =>
            return unless reference of (this.uplinks or {})
            assert mangled = try "#{@location}/#{reference}"
            mangled += "/#{nsp}" if _.isString nsp = this.nsp
            assert value; return this.socket.on mangled, =>
                try logger.info uplinking, reference, nsp or 0
                value.call this, i(arguments)..., (params...) =>
                    id = @socket.sacks = (@socket.sacks ?= 0) + 1
                    ack = type: "ack", name: mangled, ack: "data"
