Repository navigation
Router 0.3.1
Pairs with Harness 0.3.1. If the installed Harness is older, the installer prints one upgrade notice; upgrade both tools.
Fixed
-
Treat Windows permission bits consistently on Python 3.13, which exposes
fchmodbut cannot enforce private POSIX modes. -
Fall back from incomplete UNC
XDG_STATE_HOMEvalues consistently in the launcher and Python runtime across Python 3.9 and 3.13. -
Run the hooks and the
routercommand on Python 3.9: the shared helpers no longer fail at import onX | Noneannotations. -
routerno longer needs/usr/bin/env -S(busybox and coreutils before 8.30 lack it), and no entry point writes.pycfiles. -
Keep switch files, the ledger and the Harness pressure signal working when HOME, ~/.local or XDG_STATE_HOME sits behind a symlink.
-
Read settings and manifests that start with a UTF-8 byte order mark; the installer still writes them LF without one.
-
Give every settings backup a name no file holds yet: when the clock moves in coarse ticks (Windows Python 3.12), two backups in one run shared a name and the original's copy was replaced.
-
Lock state on a separate
.lockfile (flock or msvcrt, polled for 2 seconds); when the lock stays held, the hook skips that update instead of waiting. -
Lock the ledger spool through
ledger.spool.lockand rename it only while no writer has it open, which Windows requires. -
Run the BAR of
scripts/close-lane.shin the bash that runs the script, never a barebashthat native Windows resolves to the WSL one; a BAR timeout on Windows ends its process tree. -
scripts/wait-until.shon native Windows no longer kills the process it watches:pidasks Windows whether the process has exited,no-procreads the process table itself, and a Git Bash$!pid is mapped to its Windows pid. -
scripts/gen_plugin.py --checkcompares bytes only on Windows, which keeps no execute bit, so a Windows checkout no longer reportsplugins/router/bin/routeras drift. -
router doctorreports[ok] pathon native Windows when the installedrouteris first on PATH, and reads old Windows manifest paths when it checks roles and shared-role skew.
Platforms
- Run on Linux, stock macOS (system Bash 3.2 and
/usr/bin/python33.9), WSL and native Windows through Git for Windows, with Claude Code or Codex. Python 3.9 is the floor in the installer,router doctorand the README. - Start every hook,
routerand the helper scripts throughhooks/router/pyrun.sh, a POSIX sh launcher. It uses$ROUTER_PYTHON, the saved interpreter, then the first ofpython3,pythonandpy -3that is 3.9 or newer, never the Windows Store stub, and sets UTF-8. With no Python, a hook prints one line on stderr and exits 1. - Register hooks as
sh "$HOME/.claude/hooks/router/pyrun.sh" router warn <hook>.py, with quoted absoluteC:/paths on Windows and for a home with spaces. On Windows, Codex hooks also get a PowerShellcommand_windowspinned to the installer's Python.router doctorrecognises the new and the older hook form. - Load the hooks and
routeron native Windows Python:hooks/router/compat.pyholds every POSIX-only call (file lock, open flags, owner check, chmod, atomic replace, pread, home lookup) with a Windows path. - Install into
$HOMEon native Windows (Windows Python's Path.home() reads USERPROFILE only), and detect a host CLI that is on PATH without a PATHEXT extension, such as an npm or Git Bash shim. - Where the account cannot create symlinks, install a copy of each shipped link's target, record it by sha256, and handle links and copies alike on upgrade and uninstall. Links use the native separator; an upgrade rewrites a
/link that Windows left dangling. - Write manifest paths with
/on every OS and read the backslash paths an older Windows install wrote, so a shared role Harness 0.1 or 0.2 claims is kept instead of refused. - Upgrade over a Router 0.1 or 0.2 install on Windows: the installer clears the read-only flag those releases left on its own files.
- Keep a Windows checkout LF (
.gitattributes, SQLite fixtures binary), hash shared role sources with CRLF read as LF, and stopinstall.shon a CRLF copy with one line naming the fix. - Open state files in binary mode and write them LF; a lane label that starts with the home folder in any Windows form shows
~. - Not enforced on native Windows: POSIX owner checks and file modes such as 0600 (NTFS keeps none); the installer skips chmod there.
- Codex hooks on native Windows run the Python that ran
install.sh; after moving or replacing it, reruninstall.sh. - Control-character file names and paths beyond the 260-character MAX_PATH are outside native Windows support.
- State paths written as
~user/..., and on native Windows a~/path such as~//tmpor~/C:state, may needROUTER_PYTHONor a Python on PATH; they cannot start from the saved interpreter alone. - On native Windows, upgrade both tools to 0.3.1 before uninstalling: a 0.2 uninstaller can misread current manifest keys. Upgrading alongside Harness 0.2 there is not supported.
Changed
- Run CI on ubuntu, macOS and Windows (Git Bash) at Python 3.9 and 3.13, with fail-fast off, so one failing job no longer cancels the rest.
- Run every test file through
tests/run_all.pyin CI and from CONTRIBUTING.md: one line per file, a per-file timeout, the output of each failure and a final list of failures. Router and Harness ship the same file. - Run the tests under Git Bash on native Windows:
tests/_platform.pyruns bash by full path (never the WSL bash.exe in System32), puts apython3shim script on PATH, ends a timed-out test's whole process tree and prints the reason for each skip.PYTHONPATH=tests/win_simruns the Windows code paths on Linux and macOS. - Build the 0.1 and 0.2 release trees from commit SHAs in the test and together jobs.
- Pick the Harness commit for the together and shared-drift jobs with
scripts/harness-ref.sh resolve: HARNESS_REF when set, else the Harnessv<VERSION>tag, else Harness main once its VERSION is the same or newer. While a paired release is still being pushed, retry every 20 seconds for up to 10 minutes. - Test more of the installed behaviour: the context guard with an urgent signal,
tests/together.shwith pinned XDG_CONFIG_HOME and ROUTER_LOCAL and a single skew notice, an unreadable shared role, a claim file swapped while being read, and uninstalling directly over a Router 0.1 install. - Check every shipped Python source against the 3.9 grammar, union annotations without the future import, and 3.10+ library names.
- State the platforms, requirements and limits in the README, and correct how Router picks the pressure host:
harness_host, then--host, thenturn_id.