▤ WORKSPACE · CODEintensity 03 · STUDIO
Keep the bar’s socket across a reload
Technical, precise, machine-forward. More mono, no imagery, and colour only where Milo acts or work runs locally.
3 files2 of 4 tests$0.06 so far
TASK
Make the Milo bar survive a GPU driver reload without dropping its socket.
◇ Offline ecosystemclaude-code · wkgd-macbookRunning
RUN STATE
run 4 · step 5 of 8 · 4m 06s
claude-code · wkgd-macbook$0.06
This one is not local. Milo said so before it started, and the cost is on the screen while it runs.
DIFF
def reconnect(self, retries=3):
- self.sock = socket.socket()
+ if self.sock and not self.sock._closed:
+ return self.sock
self.sock.settimeout(0.5)
self.sock.connect(self.path)
return self.sock
def close(self):
- self.sock.close()
+ if self.keep_alive:
+ return # the reload is not a logout
+ self.sock.close()
you wrote thisrun 4 wrote this
FILES
- bar/socket.pyrun 4
- bar/lifecycle.pyrun 4
- tests/test_socket.pyyou
TESTS
- test_socket_survives_reload0.42s
- test_socket_reuses_open_handle0.08s
- test_bar_repaints_after_reloadrunning
- test_logout_keeps_sessionqueued
TERMINAL
$ ssh wkgd ‘systemctl --user restart milo-bar’ ⌁ restarted in 0.31s $ pytest tests/test_socket.py -q ..F 2 passed, 1 running
A real terminal on a real machine. Milo addresses it; it does not repaint it.
Design-system prototype. In production the terminal is a real session on a real machine and the tests are the real run.