fix(#295): client-side detection of stale pre-self-heal servers
A server old enough to predate the self-reported staleness machinery sends `server_has_update: None`, so it can never tell the client it is stale. The client then attaches and a newer-protocol request (e.g. set_route) explodes against the ancient daemon. Add an independent client-side check: when the server cannot self-report (server_has_update: None), compare the server's reported release version against the client's own and defer + reload when the server is strictly older. Selfdev-safe: gated on clean release semvers on BOTH sides. Any -dev/dirty/ unparseable version (self-dev or branched daemons, which share a base semver and cannot be ordered) is left to the existing mtime-directional path, so we never force-downgrade or loop a dev daemon (#277/#291). Reuses the existing pending_server_reload machinery (force reload + #277 loop backoff). When the older server cannot heal via reload, the user is pointed at `jcode server stop` + relaunch. Tests: unit coverage for the gate precedence and selfdev-safe semver parsing, plus e2e handle_server_event tests for the ancient (None) defer case and the current-release no-defer case.
J
jeremy committed
d12161fc370d0d7e9ba06b319d3d9c3b4b080c8e
Parent: b48652e