<commit_before>## Protocol

The generated protocol code is formed arround a simple set of json messages.
Only one set of plain-text messages will be sent at the start, containing the version string and a "good" or "invalid" response.


### Version verification
The client opens a websocket to server. Server waits for a plain-text message. Client sends the version string (sha256). Server compares the version string and returns "good" or "invalid"

### JSON request/response
The request and response formats are equal for both client->server and server->client.
```json
{
	// type string
    // type of the message
    //      "req": request from one side to the other
    //      "res": response on an earlier send request
    "type": "",

    // procedure string
    // procedure name for the to-be-called procedure
    // exclusively and mandatory for type "req"
    "procedure": "",

    // cb_id number
    // cb_id is a callback generated by side that creates the req
    // cb_id is used to relay any response back to the original request
    // mandatory for types "req" and "res" where the procedure is not a 'oneway' procedure
    "cb_id": 0,

    // data object
    // type "req": parameters for the to-be-called procedure
    // type "res": return values from the called procedure (if it provides return values)
    "data": {},

    // error object
    // when this field is not nil/null/undefined, and error ocurred<commit_msg>Cleared up some of the protocol notes<commit_after>## Protocol

The generated protocol code is based on a simple set of JSON messages.
Only one set of plain-text messages will be sent at the start, containing the version string and a "good" or "invalid" response.
After that, the protocol is 'stateless', in the sense that all JSON messages defined below can be sent at any time.

### Version verification
The client opens a websocket to server. Server waits for a plain-text message. Client sends the version string (sha256). Server validates the version string and returns "good" or "invalid". When the version is invalid, the server closes the connection.

### JSON request/response
The request and response formats are equal for both client->server and server->client.
```json
{
	// type string
    // type of the message
    //      "req": request from one side to the other
    //      "res": response on an earlier send request
    "type": "",

    // procedure string
    // procedure name for the to-be-called procedure
    // exclusively and mandatory for type "req"
    "procedure": "",

    // cb_id number
    // cb_id is a callback generated by side that creates the req
    // cb_id is used to relay any response back to the original request
    // mandatory for types "req" and "res" where the procedure is not a 'oneway' procedure
    "cb_id": 0,

    // data object
    // type "req": parameters for the to-be-called procedure
    // type "res": return values from the called procedure (if it provides return values)
    "data": {},

    // error object
    // when this field is not nil/null/undefined, and error ocurred
{'fraction_non_alphanumeric': 0.08181818181818182, 'fraction_numerical': 0.0025974025974025974, 'mean_word_length': 3.0539473684210527, 'pattern_counts': {'":': 16, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5128764', 'n_tokens_mistral': 789, 'n_tokens_neox': 764, 'n_words': 426}