@vibelord/lanes 1.8.0 → 1.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/package.json +1 -1
  2. package/payload/lanes/README.md +29 -11
  3. package/payload/lanes/VERSION +1 -1
  4. package/payload/lanes/bin/lanes +159 -59
  5. package/payload/lanes/bin-rs/BINARIES.json +2 -17
  6. package/payload/lanes/client/lanes-launch +51 -2
  7. package/payload/lanes/container/lane +142 -19
  8. package/payload/lanes/container/lane-mcp +168 -55
  9. package/payload/lanes/container/lane-peerd +6 -6
  10. package/payload/lanes/container/lane-signal +48 -3
  11. package/payload/lanes/container/lane_core.py +1040 -164
  12. package/payload/lanes/container/throttle-pulse +13 -4
  13. package/payload/lanes/docs/AGENTS-lanes.md +15 -7
  14. package/payload/lanes/docs/ARCHITECTURE.md +478 -101
  15. package/payload/lanes/docs/DESIGN.md +7 -2
  16. package/payload/lanes/docs/INSTALL.md +20 -3
  17. package/payload/lanes/docs/PLAN-1.9.1-SIDEBAR-CODEX.md +128 -0
  18. package/payload/lanes/docs/RUNBOOK.md +1428 -107
  19. package/payload/lanes/docs/USERGUIDE.md +488 -86
  20. package/payload/lanes/holders/tmux.sh +3 -3
  21. package/payload/lanes/install/services.py +68 -11
  22. package/payload/lanes/libexec/agent_state.py +2 -5
  23. package/payload/lanes/libexec/attach.py +11 -3
  24. package/payload/lanes/libexec/cursor_sync.py +22 -2
  25. package/payload/lanes/libexec/docsd.py +38 -4
  26. package/payload/lanes/libexec/lanes_lib.py +377 -39
  27. package/payload/lanes/libexec/mdlite.py +43 -3
  28. package/payload/lanes/libexec/notify.py +69 -26
  29. package/payload/lanes/libexec/registrations.py +5 -0
  30. package/payload/lanes/libexec/session_actions.py +114 -27
  31. package/payload/lanes/libexec/sidebar.py +246 -64
  32. package/payload/lanes/libexec/site_hooks.py +65 -0
  33. package/payload/lanes/libexec/statusd.py +139 -189
  34. package/payload/lanes/libexec/studio_host.py +8 -2
  35. package/payload/lanes/libexec/tokens.py +6 -2
  36. package/payload/lanes/libexec/update.py +13 -5
  37. package/payload/lanes/libexec/view.sh +39 -4
  38. package/payload/lanes/libexec/workspace_keys.py +54 -0
  39. package/payload/lanes/site/protocol.py +15 -5
  40. package/payload/lanes/site/relay.py +5 -2
  41. package/payload/lanes/site/server.py +29 -18
  42. package/payload/lanes/systemd/lanes-economy.service +3 -1
  43. package/payload/lanes/tokens/README.md +10 -0
  44. package/payload/lanes/tokens/generate.py +1 -1
  45. package/payload/lanes/web/Caddyfile +9 -2
  46. package/payload/lanes/web/README.md +2410 -95
  47. package/payload/lanes/web/browser.css +2 -0
  48. package/payload/lanes/web/browser.js +18 -6
  49. package/payload/lanes/web/directory.js +1 -1
  50. package/payload/lanes/web/docs.js +23 -0
  51. package/payload/lanes/web/links.js +157 -0
  52. package/payload/lanes/web/manifest.webmanifest +0 -2
  53. package/payload/lanes/web/mobile.css +30 -32
  54. package/payload/lanes/web/mobile.js +286 -227
  55. package/payload/lanes/web/upload.js +65 -22
  56. package/payload/lanes/web/workspace-keys.js +65 -0
  57. package/payload/lanes/zellij/config.kdl +1 -1
  58. package/payload/manifest.json +5 -22
  59. package/payload/lanes/bin-rs/THIRD-PARTY-NOTICES +0 -18953
  60. package/payload/lanes/bin-rs/x86_64-unknown-linux-musl/lanes-hook +0 -0
  61. package/payload/lanes/bin-rs/x86_64-unknown-linux-musl/lanes-terminal +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibelord/lanes",
3
- "version": "1.8.0",
3
+ "version": "1.9.3",
4
4
  "description": "Installer for Lanes: shared agent terminals over SSH with Zellij views, registry sync, uploads and a phone interface.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -141,23 +141,24 @@ The installer starts an empty catalog safely; it does not assume anyone's contai
141
141
  | Add a workspace (board) | `lanes workspaces add <id> --container <name> --repo /home/coder/<repo> [--title T]` on the server prints the catalog and manifest diff; add `--write` to apply, then `lanes sync` ([install](docs/INSTALL.md#2-configure-workspaces-and-editor-sync)) |
142
142
  | Onboard a user's container | `lanes onboard <login> --container <name> --workspace <id> --repo /home/coder/<repo>` on the server prints every step (board, contract, Claude and Codex hooks, Throttle attachment, canonical recipes, sync, doctor); add `--write` to apply them and keep a receipt ([install](docs/INSTALL.md#onboard-a-users-container)) |
143
143
  | Let an agent see and manage its lanes | The container's agents get the Lanes MCP server, `lane-mcp`, from `lanes install-container <name>` (on by default; `--no-mcp` leaves it out). `lanes_whoami`, `lanes_list`, `lanes_status` and `lanes_capture` read the lanes of that container. `lanes_register`, `lanes_rename`, `lanes_unregister` and `lanes_new` change a lane's declaration, shown on the boards within about 15 s. `lanes_send` types into a sibling lane, `lanes_signal` reports the agent's own status, and `lanes_publish` puts a file on the docs page (`lane publish <file>` in a shell). Ending, interrupting or attaching a lane stays yours ([architecture](docs/ARCHITECTURE.md#agent-api), [guide](docs/USERGUIDE.md#agent-tools-mcp)) |
144
- | See which agents need you | The sidebar sorts **Needs you** (◆ approval, ✗ error, ◇ waiting for a prompt), **Working** (▸) and **Done** (✓, until you open the lane) above the rest; the header counts them in the same glyphs (`◆1 ◇2 ▸6 ✓1`, zeros left out; `N lanes` when no lane runs an agent). The queue holds still: each section keeps the order its lanes entered it, a lane moves up a section at once but down only after the new state has held 8 s (leaving Needs you) or 5 s (leaving Working or Done), so an agent that asks again within seconds of an answer does not jump; the Needs you and Working headers stay drawn, `(0)` included, and the cursor stays on its lane ([how](docs/ARCHITECTURE.md#attention-queue)) |
144
+ | See which agents need you | The sidebar sorts **Needs you** (◆ approval, ✗ error, ◇ waiting for a prompt), **Working** (▸) and **Done, not seen** (✓, until you open the lane) above the rest; the header counts them in the same glyphs (`◆1 ◇2 ▸6 ✓1`, zeros left out; `N lanes` when no lane runs an agent). The queue holds still: each section keeps the order its lanes entered it, a lane moves up a section at once but down only after the new state has held 8 s (leaving Needs you) or 5 s (leaving Working or Done), so an agent that asks again within seconds of an answer does not jump; the Needs you and Working headers stay drawn, `(0)` included, and the cursor stays on its lane ([how](docs/ARCHITECTURE.md#attention-queue)) |
145
145
  | Read a sidebar row | `▌` cursor · agent glyph · `›` the lane this pane shows (`²`/`³`: shown in pane 2/3; `▲` pinned) · the name (`·` per other viewer, `…` when clipped) · an **age column** on every row (agent turn, else last output: `45s`, ` 3m`, ` 2h`, ` 4d`; amber in **Needs you**) · stream glyph · one tail cell by priority (`?` not observed right now > `⚠` starving: producing output but no request for over 10 min, or a 429 > `↓` downgraded > `$` mostly paid — the economy cells need the opt-in economy poller; a dim `⚠`/`↓` is a frozen last-known figure, not a live alarm) · `×` close. `⋮ N more` ends a list that continues below |
146
146
  | End an unregistered session and its jobs | **×** beside the session, or select it and press `x`: ` › close ‘name’ — y⏎ confirm · Esc cancel`; `y` arms (` — ⏎ confirm`), Enter closes; any other key cancels (typed text closes nothing unless it is `x`, `y`, Enter in a row) |
147
- | Every sidebar key | `?` replaces the list with the key sheet until the next key (that key only closes it): the short form of the [user guide's table](docs/USERGUIDE.md#the-sidebar), first `lanes <installed> · view <running>`, then companion keys on one line (`J K`, `Tab S-Tab`, `+ U d`, `u z`, `R m`, `p o`, `h H`, `r i ?`; `d` shows the cursor lane's docs link, `i` folds the fleet block), ending with Ctrl–Alt–L, the chord that brings the keyboard to the sidebar from a lane. The footer legend says ` ⏎ open · / find · x close · ? keys`; one prompt at a time, in one shape on the desktop and the phone (` › close ‘name’ — y⏎ confirm · Esc cancel`, ` › rename ‘name’? ⏎ confirms · Esc` then ` › Rename: …█`, ` › Register as: …█` then ` › register ‘name’ — y⏎ confirm`) and a filter counts its matches (` /abc · 3 matches`). What an action says in the footer (` Closed sh`, ` Cancelled`, why it failed) stays 3 s or until your next action, not just until the next key. After an action — a close, rename, register, cancel, `Esc`, `r`, closing `?`, a click that opens no lane — the keyboard goes back to the lane, so what you type next reaches the lane, not the sidebar; a prompt, the filter and the armed upload strip keep it. A sentence typed into the sidebar is no command (1.7.7): three printable keys inside 0.3 s start a typing state that swallows the rest of the burst (` Typing? ⏎ opens the lane · Esc`), and a question a letter opened takes no Enter for 0.3 s ([guide](docs/USERGUIDE.md#the-sidebar)) |
148
- | Pin, hide | `p` pins the cursor lane (it leads its section, `▲`, and never falls below `⋮ N more`), `h` then `Enter` hides it (` › hide ‘name’? ⏎ confirms · Esc`; any other key cancels), `o` shows the hidden lanes again (faint) — while they are hidden the list ends with `── hidden (n) · o shows them` —, `H` then `Enter` hides the whole workspace — its tab closes, its lanes keep running. They are yours, not the device's: every device you own follows your profile on its next tick; a session under **Unregistered** is never hidden ([guide](docs/USERGUIDE.md#the-sidebar)) |
147
+ | Every sidebar key | `?` replaces the list with the key sheet until the next key (that key only closes it): the short form of the [user guide's table](docs/USERGUIDE.md#the-sidebar), first `lanes <installed> · view <running>`, then companion keys on one line (`J K`, `Tab S-Tab`, `+ U d`, `u z`, `R m`, `p o`, `h H`, `r i ?`; `d` shows the cursor lane's docs link, `i` folds the fleet block), ending with Ctrl–Alt–L, the chord that brings the keyboard to the sidebar from a lane. The footer legend says ` ⏎ open · / find · x close · ? keys`; one prompt at a time, in one shape on the desktop and the phone (` › close ‘name’ — y⏎ confirm · Esc cancel`; on the desktop also ` › rename ‘name’? ⏎ confirms · Esc` then ` › Rename: …█`, ` › Register as: …█` then ` › register ‘name’ — y⏎ confirm`, which no phone key opens since E2, BEY-8667) and a filter counts its matches (` /abc · 3 matches`). What an action says in the footer (` Closed sh`, ` Cancelled`, why it failed) stays 3 s or until your next action, not just until the next key. After an action — a close, rename, register, cancel, `Esc`, `r`, closing `?`, a click that opens no lane — the keyboard goes back to the lane, so what you type next reaches the lane, not the sidebar; a prompt, the filter and the armed upload strip keep it. A sentence typed into the sidebar is no command (1.7.7): three printable keys inside 0.3 s start a typing state that swallows the rest of the burst (` Typing? ⏎ opens the lane · Esc`), and a question a letter opened takes no Enter for 0.3 s; on a phone picker the first letter starts that state and 2 s of silence ends it, so letters typed there act on nothing until you tap a lane (E2, BEY-8667; not yet checked on a device) ([guide](docs/USERGUIDE.md#the-sidebar)) |
148
+ | Pin, hide | `p` pins the cursor lane (it leads its section, `▲`, and never falls below `⋮ N more`), `h` then `Enter` hides it (` › hide ‘name’? ⏎ confirms · Esc`; any other key cancels), `o` shows the hidden lanes again (faint) — while they are hidden the list ends with `── hidden (n) · o shows them`; on a phone it says `tap shows them`, and a tap on it shows them (E2, BEY-8667; not yet checked on a device) —, `H` then `Enter` hides the whole workspace — its tab closes, its lanes keep running. They are yours, not the device's: every device you own follows your profile on its next tick; a session under **Unregistered** is never hidden ([guide](docs/USERGUIDE.md#the-sidebar)) |
149
149
  | Jump to the next lane that needs you | `Tab` / `Shift-Tab` in the sidebar (cycles **Needs you** from the lane the pane shows; the pane title carries the counts and a lane that starts needing you raises one OSC 9 desktop notification on desktop layouts — `lanes-launch <device> --notify 0` (or `lanes attach <device> --notify 0` on the server) silences it for that device, live; `LANES_NOTIFY=0` in the shell that creates a view session does the same for it, see the [user guide](docs/USERGUIDE.md#9-appearance)) |
150
150
  | Other workspaces that need you | The row above the footer rule: ` ◆1 Worlds · ◇2 Code` (blank and absent when none; panes of 18 rows or more) |
151
151
  | What the fleet spends | With the opt-in economy poller ([RUNBOOK](docs/RUNBOOK.md#economy-projection-opt-in)) the same row is the fleet economy strip instead: ` $8.5k/16k 53% · F2 S1 · spill 76% · free 3/19` — overflow spend against the daily cap (amber at the alert level), new upstream 429s, this workspace's lanes by model tier (`F` fable, `O` opus, `S` sonnet, `H` haiku, `G` gpt), the pool's spill fraction, free accounts and the next 5 h reset, whole parts dropped from the end to fit; a leading `?` means the figures are frozen — the poller could not reach the daemon, or it stopped (no rewrite for over 3 min) |
152
152
  | Upload | Click the one-row upload strip above the footer (` ↑ uploads · click, then drop (U)`), press `U` in the sidebar or Ctrl–Alt–U from anywhere in the tab, then drop anywhere on the window; or use `~/Lanes Uploads/<workspace>/`, or `lanes-upload <files>` |
153
153
  | See what an agent published, or upload from a phone | The Docs page, `https://<server>:8443/lanes-docs/`, open only to your own tailnet login: **More → Docs** on a phone or tablet, **Docs** in the laptop's Lanes bar, a ⌘/Ctrl-click on the sidebar's ` ↑ uploads · ▤ docs N` strip, or `d` on a lane for its own link. An agent publishes with `lanes_publish` (or `~/.lz/bin/lane publish <file>` in a lane's shell): Markdown with Mermaid diagrams rendered, HTML and SVG opened in a sandbox, any other file a download, each with a sha256 receipt; the page's drop area lands files in the workspace's `uploads/` with the same receipt. It answers nobody until the operator pins the Serve header check (`lanes enrol mode request`) ([user guide](docs/USERGUIDE.md#docs)) |
154
154
  | Phone view from a client | `lanes-launch web phone` in your own terminal: prepares `<your device>-phone` (phone layout), makes Tailscale Serve forward private HTTPS 8443 when the mapping is missing, prints the private URL with a QR code of it and a login token; scan the code or open the URL in Safari. `sh install/enable-phone.sh --host lanes` is the older one-shot for the device `phone` ([guide](docs/USERGUIDE.md#phone-safari-home-screen)) |
155
- | Laptop or tablet browser view | `lanes-launch web laptop` (`<your device>-web`, desktop layout) or `lanes-launch web <device> [--desktop\|--mobile]` from a client; on the server `lanes web <device> [--desktop\|--mobile] [--viewports N] [--token \| --print-only]` (prepares the view, enables the loopback web services, adds the Tailscale Serve `https:8443` mapping when missing, prints the private URL) ([guide](docs/INSTALL.md#laptop-and-tablet-browser)) |
155
+ | Laptop or tablet browser view | `lanes-launch web laptop` (`<your device>-web`, desktop layout) or `lanes-launch web <device> [--desktop\|--mobile]` from a client; on the server `lanes web <device> [--desktop\|--mobile] [--viewports N] [--token \| --print-only]` (prepares the view, enables the loopback web services, adds the Tailscale Serve `https:8443` mapping when missing, prints the private URL); a laptop's page opens on the workspace and lane it showed last (Ed) ([guide](docs/INSTALL.md#laptop-and-tablet-browser)) |
156
156
  | Web login tokens | `lanes token list` (each token with the device it was created for), `lanes token revoke <device>`, `lanes token revoke-all --yes` ([runbook](docs/RUNBOOK.md#login-tokens)) |
157
157
  | Update the client | Automatic: before a window connects, at most every 6 h, a client older than the server installs exactly the server's release once npm has it (`npx --yes @vibelord/lanes@<version>` with your remembered install options) and starts again, once; a release npm does not have yet is only logged and asked about again 6 h later; a failure is one dim line and the window goes on, and closing the window ends the whole install (`LANES_NO_AUTOUPDATE=1`: off; a checkout's client never does). By hand: `lanes-launch update` (the newest client from npm with your remembered install options; flags you add win). A client older than the server says so in one dim line when it attaches |
158
158
  | Update the server | Automatic on an npm-installed server: `lanes-update.timer` (enabled by the full server install; `--update-only` never enables it, so on a server set up before 1.2.0 run `npx @vibelord/lanes@latest --server` once, or `systemctl --user enable --now lanes-update.timer`; `lanes doctor` warns while it is off) checks npm 15 min after a boot and every 30 min and installs a newer release (`npx --yes @vibelord/lanes@<version> --server --update-only` with the npx the install recorded; never a downgrade; `channel=stable` in `~/.config/lanes/update.conf` follows the `lanes-stable` tag). By hand: `lanes update --now`; `lanes update --status` prints the record of the last check and update; `lanes update --rollback` goes back to the release before and marks the one left bad. A checkout server updates with `git pull` ([guide](docs/USERGUIDE.md#update)) |
159
159
  | Which release the server runs | `lanes version` on the server: `lanes 1.2.0 (39998ed) · tree pkg/1.2.0 · current ✓ · statusd runs 1.1.0 ✗` — the release, its tree, whether `current` names it, and `✗` for each service whose last start ran an older tree or, on a checkout, came before its `git pull` (`started before its tree changed ✗`): restart it; `--json` for scripts. `lanes doctor` judges the same facts (only processes that run now; a daemon or sidebar with no record started from an older release) and adds the device layouts and the units, each `✗` with its fix ([user guide](docs/USERGUIDE.md#versions)) |
160
160
  | Which release this client or phone runs | `lanes-launch --version` (`lanes-launch 1.2.0`); its connecting line says it too (`lanes 1.2.0: connecting to lanes…`). On a phone or tablet, **More** shows the server's release above **Text size** (**Lanes v1.2.0**) |
161
+ | Type on a slow path to the server | `LANES_TRANSPORT=mosh lanes-launch` (or `lanes-launch <device> --mosh`; `lane <id>` windows take the variable): the window runs through mosh, so keys show at once instead of after a whole round trip. Off unless asked for. It needs mosh on this machine, mosh-server on the server and mosh's UDP on the path; before it connects the window says in one line which transport it uses, and uses ssh, saying why, when mosh or mosh-server is missing ([install](docs/INSTALL.md)) |
161
162
  | Switch workspace or lane in a laptop browser | The **Lanes** chip (top right) opens the workspace and lane pickers |
162
163
  | Invite a teammate, approve a machine, remove one | On the server, in your own terminal: `lanes invite <name> --email <addr>` prints a five-line welcome kit with a one-time code (shown once, on a terminal only); `lanes enrol list` / `lanes enrol approve <id>` decide machines that asked without a code; `lanes enrol mode request` pins request mode once the Serve header check passed; `lanes offboard <device> --yes` revokes a machine's key, signs its browsers and phones out and ends its view ([guide](docs/USERGUIDE.md#invite-a-user-administrator), [install](docs/INSTALL.md#offboard-a-machine)) |
163
164
  | Detach | Close the window, or Ctrl–Alt–O then `d`; the agents keep running |
@@ -169,15 +170,30 @@ session reuses it; closing a view leaves it running. Registered lanes have no **
169
170
  **Add to workspace** keeps the session running and moves it into the selected workspace's registered list.
170
171
  The picker offers workspaces using the same container. Registration keeps its name and open views, persists
171
172
  across sync/reconnects, and removes its close control. On a phone, tap the **+** and a workspace; no typing is needed.
172
- `u` takes it out again (the session keeps running under **Unregistered**); `z` within 10 seconds undoes that.
173
+ `u` takes it out again (the session keeps running under **Unregistered**); `z` within 10 seconds undoes that. Both are
174
+ desktop keys: on a phone they type since E2 (BEY-8667), so run `lanes unregister <lane-id>` on the server instead.
173
175
  Closing from the phone needs no keyboard either: tap **×**, and while the picker asks, a short `⏎ y Esc` key row sits
174
176
  above the dock (`y` then `⏎` closes, `Esc` cancels).
175
177
 
176
- On iPhone, open the printed private HTTPS URL in Safari and choose **Share → Add to Home Screen**.
178
+ On iPhone, open the printed private HTTPS URL in Safari and choose **Share → Add to Home Screen** on that address
179
+ (nothing after `#`): the icon opens that view, and each view you add is its own app (not yet checked on a device).
177
180
  The interface provides Workspaces, Lanes and Panes controls, safe areas, portrait/landscape layout and adjustable
178
181
  terminal text. The keyboard opens when you tap **Type here** or another input; swipes and updates leave it closed.
179
- A lane's tab has quick keys (`⏎ y n Esc ^C ↑ ↓`), and **Copy** and **Paste** in the header copy the screen and paste
180
- into the lane.
182
+ A lane's tab has a strip of keys on the dock, `⏎ ↑ ↓ Esc ^C Keys` (`^C` needs a hold); **Keys** opens a panel with
183
+ `y TAB CTRL ALT ← → n`. **Copy** and **Paste** sit in the header, with the keyboard up or down. **Copy** copies the
184
+ screen and opens it as **Captured screen**, text you can select one line from (by touch: not yet checked on a
185
+ device). **Paste** pastes into the lane. (Changed in E1a, BEY-8667: from slice 2a until E1a a phone's **Paste** was on
186
+ the strip while the keyboard was up.) The header names the workspace and the
187
+ lane; the line under them says what became of your last action. A refusal such as `No text to paste` stays there
188
+ until your next key that sends something. After a lost connection `Disconnected` or `Check last input` stays there
189
+ while the workspace and the lane remain in view, and a key pressed then says `Not sent: no connection` for about
190
+ 1.6 s ([user guide](docs/USERGUIDE.md#phone-controls)). Since E3 (BEY-8667) the terminal is dimmed meanwhile and
191
+ **Reconnect** stands in **Paste**'s place: a tap checks the server and reloads the page. Once the browser has put the
192
+ page away, the page does that by itself when its connection is gone and you come back to it, or the phone is online
193
+ again; after more than 30 s away with the connection still looking open it says `Reconnecting…` and does it unless
194
+ Zellij sends something within about 5 s, so a quiet lane is reloaded too. It never reloads by itself after the host's
195
+ own `Disconnected` notice. This reload is an interim measure: BEY-8676 tracks the update of the pinned Zellij client
196
+ that is to replace it. None of this is checked on a device yet.
181
197
 
182
198
  On macOS, allow **Lanes Helper** to read Downloads/Desktop/Documents when prompted. Upload progress and original
183
199
  errors are retained; an active large transfer is not cut off by a total-duration timeout. Files are read only
@@ -218,8 +234,8 @@ user-supplied and not regenerated.
218
234
  **iPhone in Safari:** the lane picker and touch controls for workspaces, panes, and explicit text input.
219
235
  Captured before v2: the v2 sidebar shows attention sections, an agent glyph per row, the age column and a one-row
220
236
  upload strip (see [docs/DESIGN.md](docs/DESIGN.md)). On the phone the picker gives each lane three rows (name,
221
- status and age, the agent's task) without the upload strip, and view tabs gain the quick-key row; the image is not
222
- regenerated.
237
+ status and age, the agent's task) without the upload strip, view tabs gain the key strip, and the header names the
238
+ workspace and the lane with a status line under them and no Lanes mark; the image is not regenerated.
223
239
 
224
240
  <img src="docs/images/iphone.png" alt="Lanes on iPhone in Safari, showing the lane picker and Workspaces, Lanes, Panes, and Type here controls" width="360">
225
241
 
@@ -313,7 +329,9 @@ Put this object in the catalog's `sshWorkspaces` array. Configure the host SSH
313
329
  alias with its dedicated key and pinned host key. The command must attach to an
314
330
  existing persistent session. Lanes does not provision or terminate remote agents.
315
331
  `layout: "lanes"` uses the standard sidebar; `position: "before-host"` places a
316
- control workspace immediately before Host. Existing `split` layouts stay supported.
332
+ control workspace after the tools, immediately before Host when the server's
333
+ site.conf turns the Host tab on (`LANES_HOST_TAB=1`; off by default since 1.8.1).
334
+ Existing `split` layouts stay supported.
317
335
  Split workspaces can share an SSH host and helper when their pane IDs are distinct.
318
336
  An endpoint assigned to multiple split workspaces is ambiguous and refuses sync.
319
337
 
@@ -1 +1 @@
1
- 1.8.0
1
+ 1.9.2
@@ -89,8 +89,8 @@
89
89
  a person's message to a lane of any container (W15 L4, BEY-6842; the sidebar's `m`):
90
90
  sender host:<login> (this account's name without --from), the text in one envelope
91
91
  written into the lane's inbox (~/.lz/state/inbox/<lane>/ through the home volume),
92
- typed at once when the lane is idle at its prompt, else queued — lanes-statusd types
93
- it when the lane is next idle with no terminal attached; ttl 24 h by default
92
+ queued there until the lane's agent reads it — a message never types into a terminal
93
+ (BEY-7538); ttl 24 h by default
94
94
  lanes workspaces print the board ids (what the client installer reads)
95
95
  lanes workspaces add <id> --container <name> --repo <path> [--title T] [--session S] [--write]
96
96
  add a board to the site catalog (catalog.json + a new workspaces.<id>.json whose one
@@ -160,9 +160,9 @@
160
160
  for it: when a tab the view still has would get other panes, the view is rebuilt
161
161
  (`lanes rebuild`) if `zellij action list-clients` shows no client attached; with a
162
162
  client — or no answer — it keeps running and gets ~/.local/state/lanes/clients/
163
- <device>.update-ready, which its sidebars show as `update ready · reload (r)` (r
164
- rebuilds it). Tabs `lanes sync` adds, renames or orders in a running view are no
165
- change. Without the flag only a device with that file is compared, so
163
+ <device>.update-ready, which its sidebars show as `update ready · reload (r)`
164
+ (desktop), and r rebuilds it. Tabs `lanes sync` adds, renames or orders in a running
165
+ view are no change. Without the flag only a device with that file is compared, so
166
166
  lanes-ensure.timer rebuilds it once its last client has left. The whole run holds the
167
167
  view-session lock (as rebuild, attach/prepare/web's create, offboard and device forget
168
168
  do): with the flag it waits up to 120 s for another holder, without it 10 s, then
@@ -514,7 +514,15 @@ def q(text):
514
514
  def sync_registry():
515
515
  """Rebuild and publish the registry, print the per-board table -> (boards with errors, [(container, why)] whose
516
516
  `~/.lz/registry.json` was refused). `lanes sync` turns either into exit 1; a rename that publishes through it
517
- raises the refusal (DEF-1796: that container's `lane open` keeps its previous projection)."""
517
+ raises the refusal (DEF-1796: that container's `lane open` keeps its previous projection). A site.conf line a
518
+ validated key refuses (L.site_problems: LANES_THROTTLE_CONTROL, BEY-6845) refuses the whole sync first, naming the
519
+ key — nothing is rebuilt or published, so no pulse is ever started with a guessed URL in its place. A refused
520
+ LANES_HOST_TAB line (L.host_tab_problem, BEY-8423) refuses it the same way."""
521
+ for key, why in L.site_problems():
522
+ raise L.LanesError(f'site.conf {key}: {why} — refused; fix the line, then lanes sync')
523
+ why = L.host_tab_problem()
524
+ if why:
525
+ raise L.LanesError(f'site.conf {L.HOST_TAB_KEY}: {why} — refused; fix the line, then lanes sync')
518
526
  with L.registry_lock():
519
527
  previous = L.read_json(L.STATE / 'registry.json')
520
528
  registry = L.build_registry(previous)
@@ -541,14 +549,57 @@ def cmd_sync(_args):
541
549
 
542
550
 
543
551
  def cmd_register(args):
552
+ """lanes register <lane-id> [workspace] — add an unregistered session to a board (registered-sessions.json). A
553
+ session whose binding a repository's terminals.json still keeps without its board row (BEY-7435: the row was lost
554
+ to a concurrent rewrite; `lanes doctor` names it) is repaired instead: the row is put back from the binding — same
555
+ id, same tmux target, the declared name — and the registry synced (`repaired_from_binding`). <lane-id> is then the
556
+ unregistered session's id or the id the binding stands for."""
544
557
  if not 1 <= len(args) <= 2:
545
558
  raise L.LanesError('Usage: lanes register <lane-id> [workspace]')
546
559
  import registrations
547
- workspace, entry = L.find_lane(L.load_registry(), args[0])
560
+ import session_actions
561
+ registry = L.load_registry()
562
+ try:
563
+ repaired = session_actions.repair_dangling(registry, args[0], args[1] if len(args) == 2 else None)
564
+ except session_actions.DeclaredRefused as error:
565
+ raise L.LanesError(f'{error} ({error.code})') from None
566
+ if repaired is not None:
567
+ if repaired['changed']:
568
+ cmd_sync([])
569
+ print(f"Repaired {repaired['name']!r} as {repaired['lane']} in {repaired['board']} "
570
+ f"({repaired['outcome']}): its row is back in {repaired['source']}, the binding (tmux "
571
+ f"{repaired['tmux']['socket']}/{repaired['tmux']['session']}) and the session untouched")
572
+ return 0
573
+ workspace, entry = L.find_lane(registry, args[0])
548
574
  lane = registrations.register(workspace['id'], entry, args[1] if len(args) == 2 else None)
549
575
  print(f"Registered {lane['name']} in {lane['workspace']}")
550
576
 
551
577
 
578
+ def binding_doctor(registry, containers):
579
+ """BEY-7435: `lanes doctor`'s consistency of the boards' terminals.json files (lanes_lib.registry_bindings) ->
580
+ [(label, detail)], one ✗ each: a `lanes.terminals` binding no `terminals[]` row declares (its session shows as
581
+ unregistered; the detail names the repair verb), and a file's rows no binding reaches (`lanes sync` refuses that
582
+ board). [] when every binding has its row and every row a binding."""
583
+ out = []
584
+ for fact in L.registry_bindings(registry, containers):
585
+ where = f"{fact['container']}:{fact['source']}"
586
+ for item in fact['dangling']:
587
+ tmux = item['tmux']
588
+ repair = (f"lanes register {item['lane_id']}" if item['lane_id']
589
+ else 'lanes register <its session id: lanes ls --unregistered>')
590
+ if item['id'] and item['derived'] and not L.lane_core().lane_id_agrees(item['id'], item['derived']):
591
+ repair = (f"by hand: its recorded id {item['id']} is not the {item['derived']} its name gives, so "
592
+ 'lanes register refuses it')
593
+ out.append((f"binding without board row: {item['name']!r} in {where}",
594
+ f"tmux {tmux.get('socket')}/{tmux.get('session')} shows as an unregistered session; repair: "
595
+ f"{repair} (or lanes_register on that session in the container)"))
596
+ if fact['unbound']:
597
+ out.append((f'board row without binding in {where}',
598
+ ', '.join(repr(name) for name in fact['unbound']) + ': no lanes.terminals, throttle or '
599
+ 'manifest binding, so lanes sync refuses the board; declare its binding or remove the row'))
600
+ return out
601
+
602
+
552
603
  def cmd_unregister(args):
553
604
  """lanes unregister <lane-id> — the sidebar's `u` (cockpit v3 S7): take a session added with Add to workspace /
554
605
  `lanes register` out of registered-sessions.json. Nothing is stopped; a running session is listed under
@@ -661,12 +712,14 @@ def tab_layout(lines):
661
712
  ' }', ' }'] + lines + ['}']) + '\n'
662
713
 
663
714
 
664
- def tab_specs(device, registry, mobile=False, viewports=1, profile=None):
715
+ def tab_specs(device, registry, mobile=False, viewports=1, profile=None, host_tab=False):
665
716
  """The tabs a view session has, in order: the workspace boards, then ssh workspaces and tools, then the boards whose
666
- `position` is `before-host`, then Host. The boards are the ones the device's owner sees (cockpit v3 R4, LNS-77):
667
- `profile` (users/<login>.json as users.read gives it, device_profile) hides `workspaces.hidden` and orders the rest
668
- by `workspaces.order` (users.arrange: an unknown id is ignored, an unlisted board follows in catalog order, a hidden
669
- list that would leave no board hides none); None — a device nobody owns — is the catalog order."""
717
+ `position` is `before-host`, then Host — only when `host_tab` (site.conf LANES_HOST_TAB=1, L.host_tab; off by
718
+ default since BEY-8423, so a view ends with its last board or tool). The boards are the ones the device's owner
719
+ sees (cockpit v3 R4, LNS-77): `profile` (users/<login>.json as users.read gives it, device_profile) hides
720
+ `workspaces.hidden` and orders the rest by `workspaces.order` (users.arrange: an unknown id is ignored, an unlisted
721
+ board follows in catalog order, a hidden list that would leave no board hides none); None — a device nobody owns —
722
+ is the catalog order."""
670
723
  result = []
671
724
  def add(key, title, lines):
672
725
  result.append({'key': key, 'title': title, 'lines': lines, 'layout': tab_layout(lines)})
@@ -688,15 +741,18 @@ def tab_specs(device, registry, mobile=False, viewports=1, profile=None):
688
741
  add('tool/' + tool['view'], tool['tab'], tool_tab_kdl(device, tool, mobile=mobile))
689
742
  for workspace in boards:
690
743
  if workspace.get('position') == 'before-host': board(workspace)
691
- add('host', 'Host', [' tab name="Host" {', ' pane command="/bin/bash" {', ' args "-l"', ' }', ' }'])
744
+ if host_tab:
745
+ add('host', 'Host', [' tab name="Host" {', ' pane command="/bin/bash" {', ' args "-l"', ' }', ' }'])
692
746
  return result
693
747
 
694
748
 
695
- def layout_kdl(device, mobile=False, viewports=1, profile=None):
749
+ def layout_kdl(device, mobile=False, viewports=1, profile=None, host_tab=None):
696
750
  """The view session's layout (create_session, `lanes layout`): tab_specs for the device's owner's profile — passed
697
- by the caller, else read here (device_profile) — with the focus on the first tab."""
751
+ by the caller, else read here (device_profile) — and for site.conf's LANES_HOST_TAB (`host_tab`, else read here:
752
+ L.host_tab), with the focus on the first tab."""
698
753
  specs = tab_specs(device, L.load_registry(), mobile, viewports,
699
- device_profile(device) if profile is None else profile)
754
+ device_profile(device) if profile is None else profile,
755
+ L.host_tab() if host_tab is None else host_tab)
700
756
  lines = []
701
757
  for index, spec in enumerate(specs):
702
758
  tab = list(spec['lines'])
@@ -740,14 +796,17 @@ def layout_changed(stored, generated):
740
796
  that title (another tree path, another pane, size or argument — what a release changes). A tab only one of them has
741
797
  and the order of the tabs are no change: `lanes sync` (upgrade-session, device_sync.reconcile) adds, renames and
742
798
  orders the tabs of a running view, and never changes a tab's panes, so after a board was added or renamed the file
743
- no longer names every tab a view shows. A missing or unreadable layout is a change: nothing says what the view
744
- runs."""
799
+ no longer names every tab a view shows. The one exception is the Host tab: a stored Host tab that `generated` no
800
+ longer has (site.conf LANES_HOST_TAB off, BEY-8423) is a change, since reconcile closes no Host tab — the rebuild
801
+ (`lanes ensure --if-layout-changed`: at once with no client attached, else `update ready · reload (r)` (desktop))
802
+ is what takes it out of a running view; a Host tab only `generated` has is added by reconcile like any tab. A
803
+ missing or unreadable layout is a change: nothing says what the view runs."""
745
804
  if stored is None:
746
805
  return True
747
806
  frame, tabs = layout_parts(stored)
748
807
  frame_now, tabs_now = layout_parts(generated)
749
- return frame != frame_now or any(tab not in tabs_now[title]
750
- for title, kept in tabs.items() if title in tabs_now for tab in kept)
808
+ return frame != frame_now or ('Host' in tabs and 'Host' not in tabs_now) or any(
809
+ tab not in tabs_now[title] for title, kept in tabs.items() if title in tabs_now for tab in kept)
751
810
 
752
811
 
753
812
  # Every tree file a layout runs is named through L.CURRENT (W9 U1, LNS-89): the `current` link while it names this
@@ -758,24 +817,30 @@ def layout_changed(stored, generated):
758
817
  def mobile_workspace_tab(device, workspace, picker):
759
818
  title = workspace['title'] + (' ☰' if picker else '')
760
819
  command = str(L.CURRENT / 'libexec' / ('sidebar' if picker else 'view.sh'))
761
- args = f'{q(device)} {q(workspace["id"])}' + ('' if picker else ' "main" "--mobile"')
762
- # The picker's sidebar pane has NO layout name: Zellij reports a non-empty pane name instead of the pane's own
763
- # OSC 2 title, and that title (the attention counts) is what the phone reads (DEF-1531).
764
- name = '' if picker else f' name={q(workspace["title"])}'
820
+ args = f'{q(device)} {q(workspace["id"])}' + ('' if picker else f' "main" "--mobile" {q(workspace["title"])}')
821
+ # Neither pane has a layout name: Zellij reports a non-empty pane name instead of the pane's own OSC 2 title, and
822
+ # the phone reads both titles. The picker's sidebar writes the attention counts (DEF-1531); the lane tab's view.sh
823
+ # writes the lane it shows, and while it shows none the workspace title, its fifth argument (E6, BEY-8667).
765
824
  return [f' tab name={q(title)} {{',
766
- f' pane borderless=true{name} command={q(command)} {{',
825
+ f' pane borderless=true command={q(command)} {{',
767
826
  f' args {args}', ' }', ' }']
768
827
 
769
828
 
770
- def stale_picker_layouts():
771
- """Phone devices whose stored layout still names the picker's sidebar pane (the pre-Task 26 `name="Lanes"`).
829
+ def stale_phone_layouts():
830
+ """Phone devices whose stored layout still names a pane the phone reads the OSC 2 title of, each with the panes
831
+ named: `picker`, the picker's sidebar pane (the pre-Task 26 `name="Lanes"`: no counts, DEF-1531), and `lane tab`, a
832
+ lane tab's view.sh pane (named after its workspace before E6, BEY-8667: the header names the workspace on every
833
+ lane). Until 20 November 2026 (E6, the lead's ruling E6-R3) this was `stale_picker_layouts`, the first pane only.
772
834
 
773
- `upgrade-session` / `ensure` only add missing tabs and rename titles: a picker tab created from an older layout
774
- keeps its pane name, which Zellij reports instead of the OSC 2 counts, until `lanes rebuild <device>` (DEF-1531).
835
+ `upgrade-session` / `ensure` only add missing tabs and rename titles: a tab created from an older layout keeps its
836
+ pane names, which Zellij reports instead of the panes' OSC 2 titles, until `lanes rebuild <device>`.
775
837
  `create_session` is the only writer of layouts/<device>.kdl, so the file is the layout the session was built from.
776
- The sidebar is recognised by its tree file, whichever tree path the layout names (W9 U1: pkg/<version> before,
838
+ A lane tab is a tab whose `<title> ☰` picker the same layout holds: a tool tab's view pane keeps its name.
839
+ Each pane is recognised by its tree file, whichever tree path the layout names (W9 U1: pkg/<version> before,
777
840
  `current` since, a checkout's own path).
778
841
  """
842
+ def named(line, tree_file, name=' name='):
843
+ return name in line and any(L.tree_file_at([command], tree_file) == 0 for command in layout_commands(line))
779
844
  stale = []
780
845
  for meta_file in sorted((L.STATE / 'devices').glob('*.json')):
781
846
  if not (L.read_json(meta_file) or {}).get('mobile'):
@@ -784,9 +849,13 @@ def stale_picker_layouts():
784
849
  text = (L.STATE / 'layouts' / f'{meta_file.stem}.kdl').read_text()
785
850
  except OSError:
786
851
  continue
787
- if any('name="Lanes"' in line and any(L.tree_file_at([command], 'libexec/sidebar') == 0
788
- for command in layout_commands(line)) for line in text.splitlines()):
789
- stale.append(meta_file.stem)
852
+ tabs = layout_parts(text)[1]
853
+ panes = tuple(pane for pane, found in (
854
+ ('picker', any(named(line, 'libexec/sidebar', 'name="Lanes"') for line in text.splitlines())),
855
+ ('lane tab', any(named(line, 'libexec/view.sh') for title, blocks in tabs.items()
856
+ if f'{title} ☰' in tabs for block in blocks for line in block.splitlines()))) if found)
857
+ if panes:
858
+ stale.append((meta_file.stem, panes))
790
859
  return stale
791
860
 
792
861
 
@@ -951,7 +1020,7 @@ def create_session(device, mobile, viewports=1):
951
1020
  def update_ready_path(device):
952
1021
  """clients/<device>.update-ready (DM-LANES-UPDATE-READY, W9 U6): written by `lanes ensure --if-layout-changed` when
953
1022
  this release lays out the running view `device` differently while a client is attached (or zellij did not say);
954
- its sidebars offer `update ready · reload (r)` while it exists; create_session removes it."""
1023
+ its sidebars offer `update ready · reload (r)` (desktop) while it exists; create_session removes it."""
955
1024
  return L.STATE / 'clients' / f'{device}.update-ready'
956
1025
 
957
1026
 
@@ -1025,6 +1094,8 @@ def viewports_arg(args, default=1):
1025
1094
  LOOK_KEYS = {'--theme': ('theme', ('dark', 'light', 'auto')), '--color': ('color', ('truecolor', '256', '16', 'none')),
1026
1095
  '--glyphs': ('glyphs', ('unicode', 'ascii', 'emoji')), '--notify': ('notify', ('1', '0')),
1027
1096
  '--dim': ('dim', ('90', '2')),
1097
+ '--sidebar-order': ('sidebar_order', ('attention', 'coordinator', 'pinned')),
1098
+ '--workspace-keys': ('workspace_keys', ('on', 'off')),
1028
1099
  # The editor quick edit (`lanes edit`, W9 E2) hands lane-edit as LANES_EDITOR; `auto` takes the choice back.
1029
1100
  # Per device, like notify/dim: never a profile key (users.LOOK), never read by a sidebar.
1030
1101
  '--editor': ('editor', ('micro', 'hx', 'nvim', 'vim', 'auto'))}
@@ -1487,19 +1558,23 @@ def start_pulse(container):
1487
1558
  'no daemon container is known (site.conf LANES_THROTTLE_CONTAINER, or a board with a Throttle monitor)'
1488
1559
  print(f'throttle pulse: installed, not started here — {why}')
1489
1560
  return 0
1561
+ control, problem = L.pulse_control() # BEY-6845: site.conf LANES_THROTTLE_CONTROL, or nothing (the pulse's default)
1562
+ if problem: # a refused line names its key; nothing is started with a guessed URL in its place
1563
+ print(f'! throttle pulse: not started in {container} — site.conf {L.THROTTLE_CONTROL_KEY}: {problem}')
1564
+ return 1
1490
1565
  rc, _out, _err = L.run_bounded(pulse_argv(container, 'has-session', '-t', f'={PULSE_SESSION}'), PULSE_DOCKER_S)
1491
1566
  if rc == 0:
1492
1567
  print(f'throttle pulse: already running in {container} (tmux -L lanes-pulse, session {PULSE_SESSION})')
1493
1568
  return 0
1494
- rc, _out, err = L.run_bounded(pulse_argv(container, 'new', '-d', '-s', PULSE_SESSION, PULSE_BIN, '--loop'),
1495
- PULSE_DOCKER_S)
1569
+ rc, _out, err = L.run_bounded(pulse_argv(container, 'new', '-d', '-s', PULSE_SESSION, PULSE_BIN, '--loop',
1570
+ *L.pulse_control_args(control)), PULSE_DOCKER_S)
1496
1571
  if rc != 0:
1497
1572
  last = next((line.strip() for line in reversed(err.splitlines()) if line.strip()), '')
1498
1573
  why = f'no answer within {PULSE_DOCKER_S} s' if rc is None else f'exit {rc}'
1499
1574
  print(f'! throttle pulse: not started in {container} ({why}' + (f': {last[:160]}' if last else '') + ')')
1500
1575
  return 1
1501
- print(f'throttle pulse: started in {container} ({named_by}): tmux -L lanes-pulse, session {PULSE_SESSION}; '
1502
- 'it writes ~/.lz/state/throttle.json every 10 s')
1576
+ print(f'throttle pulse: started in {container} ({named_by}): tmux -L lanes-pulse, session {PULSE_SESSION}'
1577
+ + (f', polling {control}' if control else '') + '; it writes ~/.lz/state/throttle.json every 10 s')
1503
1578
  return 0
1504
1579
 
1505
1580
 
@@ -2067,13 +2142,14 @@ def cmd_upgrade_session(args):
2067
2142
  live = live_sessions()
2068
2143
  devices = [device_name(a) for a in args] or [p.stem for p in sorted((L.STATE / 'devices').glob('*.json'))]
2069
2144
  failures = []
2145
+ host_tab = L.host_tab()
2070
2146
  for device in devices:
2071
2147
  if device not in live:
2072
2148
  continue # ensure recreates missing sessions with the same catalog
2073
2149
  meta = L.read_json(L.STATE / 'devices' / (device + '.json')) or {}
2074
2150
  mobile, viewports = bool(meta.get('mobile')), int(meta.get('viewports') or 1)
2075
2151
  try:
2076
- specs = tab_specs(device, registry, mobile, viewports, device_profile(device))
2152
+ specs = tab_specs(device, registry, mobile, viewports, device_profile(device), host_tab)
2077
2153
  shown = {spec['key'].split('/')[1] for spec in specs if spec['key'].startswith('workspace/')}
2078
2154
  hidden = [workspace['id'] for workspace in registry['workspaces'] if workspace['id'] not in shown]
2079
2155
  for change in device_sync.reconcile(device, registry, specs, mobile, zellij, hidden=hidden):
@@ -2226,8 +2302,8 @@ def refresh_view(device, meta):
2226
2302
  L.atomic_write(stamp, f'{time.time()}\n')
2227
2303
  attached = 'zellij did not say which clients are attached' if clients is None else (
2228
2304
  f"{clients} client{'' if clients == 1 else 's'} attached")
2229
- print(f'{device}: its layout changed; {attached}: left running, its sidebars offer `update ready · reload (r)` '
2230
- f'({stamp.name})')
2305
+ print(f'{device}: its layout changed; {attached}: left running, its sidebars offer '
2306
+ f'`update ready · reload (r)` (desktop) ({stamp.name})')
2231
2307
 
2232
2308
 
2233
2309
  def cmd_ensure(args):
@@ -5072,7 +5148,8 @@ def number(value):
5072
5148
 
5073
5149
  def pulse_line(throttle, container, now):
5074
5150
  """The pulse: its age by `at`, the container it runs in, whether the daemon answered and whether it holds the
5075
- opt-in bearer (money and burn lines need it; `lanes throttle adopt-token <c>` is the operator's step)."""
5151
+ opt-in bearer (money and burn lines need it; `lanes throttle adopt-token <c>` is the operator's step). A pulse whose
5152
+ GET never reached a daemon says where it asked and which site key points it elsewhere (BEY-6845), never `down`."""
5076
5153
  where = (f'container {container}' if container else
5077
5154
  'no daemon container: site.conf LANES_THROTTLE_CONTAINER unset and no Throttle tab')
5078
5155
  adopt = f'lanes throttle adopt-token {container}' if container else 'lanes throttle adopt-token <container>'
@@ -5085,10 +5162,19 @@ def pulse_line(throttle, container, now):
5085
5162
  age = now - at
5086
5163
  up = throttle.get('up') is True
5087
5164
  error = throttle.get('error')
5088
- daemon = 'daemon up' if up else 'daemon down' + (f' ({plain(error)[:80]})' if isinstance(error, str) and error else '')
5089
5165
  tokened = throttle.get('tokened') is True
5090
- text = (f'throttle pulse: {age_shown(age)} old ({where}), {daemon}, tokened: {"yes" if tokened else "no"}'
5091
- + ('' if tokened else f' — {adopt}'))
5166
+ if not up and L.pulse_unreached(error):
5167
+ # BEY-6845: the GET never reached a daemon — not known to be down; its control URL (the pulse's `control_url`,
5168
+ # none from a pulse before the key) is where to point LANES_THROTTLE_CONTROL. Content-free: the error class and
5169
+ # the URL, never a token or a body.
5170
+ url = throttle.get('control_url')
5171
+ at_url = f' at {plain(url)[:80]}' if isinstance(url, str) and url else ''
5172
+ text = (f'throttle pulse: cannot reach the daemon{at_url} ({plain(error)[:80]}); set {L.THROTTLE_CONTROL_KEY} to a '
5173
+ f'reachable forward — {age_shown(age)} old ({where}), tokened: {"yes" if tokened else "no"}')
5174
+ else:
5175
+ daemon = 'daemon up' if up else 'daemon down' + (f' ({plain(error)[:80]})' if isinstance(error, str) and error else '')
5176
+ text = (f'throttle pulse: {age_shown(age)} old ({where}), {daemon}, tokened: {"yes" if tokened else "no"}'
5177
+ + ('' if tokened else f' — {adopt}'))
5092
5178
  if throttle.get('stale') is True or age > PULSE_FRESH_S:
5093
5179
  rearm = f'lanes install-container {container}' if container else 'lanes install-container <container>'
5094
5180
  return '⚠', text + f'; stale: the pulse stopped (statusd re-arms it at most every 10 min, or {rearm})'
@@ -5096,13 +5182,16 @@ def pulse_line(throttle, container, now):
5096
5182
 
5097
5183
 
5098
5184
  def pools_line(throttle):
5099
- """The pools the pulse reports, usable of configured: `throttle pools: claude 12/19 · codex 3/5 · kimi 5/8 usable`.
5185
+ """The pools the pulse reports, usable of configured: `throttle pools: claude 12/19 · codex 3/5 · kimi 5/8 usable`;
5186
+ `unknown` while the pulse's last document says the daemon did not answer (its counts are kept, not measured).
5100
5187
  A pool with nothing configured is `0/0` (a daemon with no Kimi account), one the pulse did not report `?`. A `⚠`
5101
5188
  when a configured pool has no usable account (the sidebar's attention tone); otherwise information. The pulse
5102
5189
  line above says how old these figures are."""
5103
5190
  pools = throttle.get('pools') if isinstance(throttle, dict) else None
5104
5191
  if not isinstance(pools, dict) or number(throttle.get('at')) is None:
5105
5192
  return '', 'throttle pools: none in status.json'
5193
+ if throttle.get('up') is False: # BEY-6845: the kept counts are the last measured ones, not this cycle's
5194
+ return '', 'throttle pools: unknown (the daemon did not answer the pulse; the last measured counts are kept)'
5106
5195
 
5107
5196
  def count(value):
5108
5197
  return value if isinstance(value, int) and not isinstance(value, bool) and value >= 0 else None
@@ -5540,6 +5629,9 @@ def cmd_doctor(_args):
5540
5629
  pass
5541
5630
  check(not stale_sources, 'registry up to date',
5542
5631
  'run lanes sync — ' + '; '.join(stale_sources[:3]) + (' …' if len(stale_sources) > 3 else ''))
5632
+ # BEY-7435: every binding has its board row and every row a binding. Said only when one does not (a ✗ each).
5633
+ for label, detail in binding_doctor(registry, containers):
5634
+ check(False, label, detail)
5543
5635
  for name, info in containers.items():
5544
5636
  check(bool(info.get('running')), f'container {name} running', f"init pid {info.get('pid')}")
5545
5637
  # Lanes writes the agents' files into this home as this account: a uid split leaves them unreadable to
@@ -5634,10 +5726,17 @@ def cmd_doctor(_args):
5634
5726
  print(f'⚠ devices without an owner: {", ".join(ownerless[:8])}{" …" if len(ownerless) > 8 else ""} — each keeps '
5635
5727
  'its look and seen marks to itself; `lanes device claim <device> --login <login>` names one (`lanes keys '
5636
5728
  'owner <device> <login>` when members/ holds its key)')
5637
- stale_pickers = stale_picker_layouts()
5638
- check(not stale_pickers, 'phone picker panes report their own title (DEF-1531)',
5639
- 'built from a layout that names the picker pane, so the phone shows no counts; upgrade-session does not '
5640
- 're-lay-out a tab — run ' + '; '.join(f'lanes rebuild {d}' for d in stale_pickers))
5729
+ # One line per stale phone layout, each with its own remedy (E6, the lead's ruling E6-R3).
5730
+ stale_phones = stale_phone_layouts()
5731
+ if not stale_phones:
5732
+ check(True, 'phone panes report their own titles (DEF-1531)')
5733
+ for device, panes in stale_phones:
5734
+ shows = {'picker': 'the phone shows no counts',
5735
+ 'lane tab': "the phone's header names the workspace, not the lane"}
5736
+ check(False, f'phone {device} reports layout names, not its panes\' own titles (DEF-1531)',
5737
+ f'built from a layout that names its {" and ".join(panes)} pane{"s" if len(panes) > 1 else ""}, so '
5738
+ f'{" and ".join(shows[pane] for pane in panes)}; upgrade-session does not re-lay-out a tab — '
5739
+ f'run lanes rebuild {device}')
5641
5740
  for mark, text in web_doctor(): # browser/phone: web units and the Tailscale Serve mapping (LNS-50)
5642
5741
  if mark == '⚠':
5643
5742
  print(f'⚠ {text}')
@@ -5928,9 +6027,9 @@ MESSAGE_USAGE = 'usage: lanes message [--from <login>] [--ttl S] [--] <lane-id|@
5928
6027
  def cmd_message(args):
5929
6028
  """lanes message [--from <login>] [--ttl S] <lane-id|@address> <text...> (W15 L4): a person's message to a lane of
5930
6029
  any container on this site, sender `host:<login>` (the login given, else this account's name) — written into the
5931
- lane's inbox through its container's home volume, then typed at once when the lane is idle at its prompt, else left
5932
- `queued` for lanes-statusd, which types it when the lane is next idle with no terminal attached. The sidebar's `m`
5933
- runs this verb. Exit 0 once the message is in the inbox, typed or not; a refusal is exit 1 (main's LanesError)."""
6030
+ lane's inbox through its container's home volume, `queued` there until the lane's agent reads it. Never typed into
6031
+ the lane, idle or not (BEY-7538: a message never types into a terminal). The sidebar's `m` runs this verb. Exit 0
6032
+ once the message is in the inbox; a refusal is exit 1 (main's LanesError)."""
5934
6033
  import pwd as _pwd
5935
6034
  import statusd as SD
5936
6035
  C = L.lane_core()
@@ -5965,12 +6064,8 @@ def cmd_message(args):
5965
6064
  info = (L.read_json(L.STATE / 'containers.json', {}) or {}).get(place.get('container') or '') or {}
5966
6065
  row = (payload.get('lanes') or {}).get(lane_id)
5967
6066
  message_id, outcome, detail = SD.host_message(place, row, info, lane_id, address, sender, text, ttl)
5968
- if outcome in ('typed', 'typed-no-enter'):
5969
- print(f'message {message_id} to @{address}: {outcome} ({detail})' if outcome != 'typed'
5970
- else f'message {message_id} to @{address}: typed')
5971
- else:
5972
- print(f'message {message_id} to @{address}: queued — lanes-statusd types it when the lane is next idle '
5973
- f'({detail})')
6067
+ print(f'message {message_id} to @{address}: {outcome} — it waits in the lane\'s inbox until its agent reads it '
6068
+ f'({detail})')
5974
6069
  return 0
5975
6070
 
5976
6071
 
@@ -6880,6 +6975,11 @@ COMMANDS = {'rebuilt': cmd_rebuilt, 'hello': cmd_hello, 'client-config': cmd_cli
6880
6975
  'version': cmd_version, 'update': cmd_update, 'docs': cmd_docs,
6881
6976
  'address': cmd_address, 'names': cmd_names, 'migrate': cmd_migrate, 'message': cmd_message}
6882
6977
 
6978
+
6979
+ # lanes site-hook loader (FLE-388)
6980
+ import site_hooks
6981
+ site_hooks.apply('cli', COMMANDS, globals())
6982
+
6883
6983
  if __name__ == '__main__':
6884
6984
  if len(sys.argv) < 2 or sys.argv[1] not in COMMANDS:
6885
6985
  sys.exit(__doc__)
@@ -1,20 +1,5 @@
1
1
  {
2
2
  "schema": "lanes.bin-rs/1",
3
- "commit": "e5bc8704b389d515dd283e0e393cb37694c19a5d",
4
- "binaries": [
5
- {
6
- "name": "lanes-hook",
7
- "target": "x86_64-unknown-linux-musl",
8
- "sha256": "6259018bf2495e0add3298ac96f9ffb5da69dab9d9878a3b43e217f96d2a7823",
9
- "size": 1250024,
10
- "commit": "e5bc8704b389d515dd283e0e393cb37694c19a5d"
11
- },
12
- {
13
- "name": "lanes-terminal",
14
- "target": "x86_64-unknown-linux-musl",
15
- "sha256": "4f7a3ba8514658531a0cf6dd7fe19fb3972372e7d743518a38a9fa693093d159",
16
- "size": 17161512,
17
- "commit": "e5bc8704b389d515dd283e0e393cb37694c19a5d"
18
- }
19
- ]
3
+ "commit": "5c99782f6def52af26fe1e2bcc88360b80686cb8",
4
+ "binaries": []
20
5
  }