A 182-line stand-in for the engine's TCP port: six checks, one wrong token, one dropped socket, nothing installed.
Every harness that talks to a socket starts the same way: someone mocks the client's own methods. The test then proves that the mock returns what the mock was told to return, the real client never runs, and the thing that actually breaks in production β framing, the handshake, a half-written frame β is never exercised.
What you have to fake is not your code. It is the peer : a process that reads bytes off a socket and answers frames. If that peer is a line protocol, the stand-in can be a hundred lines of node:net , and it will catch the failures a method-level mock cannot see.
The protocol in ArtCraft's control channel is four frames long β auth , system.ping , engine.execute , engine.batch β and the first one is the whole security model.β¦