@vibelord/lanes 1.7.7 → 1.8.0

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 (36) hide show
  1. package/README.md +13 -9
  2. package/package.json +1 -1
  3. package/payload/lanes/VERSION +1 -1
  4. package/payload/lanes/bin/lanes +26 -4
  5. package/payload/lanes/bin/lanes-site-serve +4 -8
  6. package/payload/lanes/bin-rs/BINARIES.json +17 -2
  7. package/payload/lanes/bin-rs/THIRD-PARTY-NOTICES +18953 -0
  8. package/payload/lanes/bin-rs/x86_64-unknown-linux-musl/lanes-hook +0 -0
  9. package/payload/lanes/bin-rs/x86_64-unknown-linux-musl/lanes-terminal +0 -0
  10. package/payload/lanes/client/lanes-launch +4 -2
  11. package/payload/lanes/container/lane-mcp +1 -1
  12. package/payload/lanes/container/lane_core.py +4 -3
  13. package/payload/lanes/docs/ARCHITECTURE.md +26 -4
  14. package/payload/lanes/docs/RUNBOOK.md +121 -52
  15. package/payload/lanes/docs/USERGUIDE.md +28 -0
  16. package/payload/lanes/install/lanes-host.service.in +25 -0
  17. package/payload/lanes/install/services.py +243 -0
  18. package/payload/lanes/libexec/agent_state.py +3 -1
  19. package/payload/lanes/libexec/attach.py +139 -21
  20. package/payload/lanes/libexec/cutover.py +24 -4
  21. package/payload/lanes/libexec/doctor_lanes2.py +3 -3
  22. package/payload/lanes/libexec/native.sh +2 -2
  23. package/payload/lanes/libexec/native_bin.py +595 -109
  24. package/payload/lanes/libexec/shadow.py +51 -3
  25. package/payload/lanes/libexec/sidebar_status.py +190 -80
  26. package/payload/lanes/libexec/update.py +12 -3
  27. package/payload/lanes/site/protocol.py +24 -9
  28. package/payload/lanes/site/relay.py +292 -0
  29. package/payload/lanes/site/server.py +31 -3
  30. package/payload/lanes/web/README.md +6 -6
  31. package/payload/lanes/web/directory.js +10 -8
  32. package/payload/lanes/web/generated/README.md +85 -21
  33. package/payload/lanes/web/generated/lanes2_protocol.d.mts +4190 -188
  34. package/payload/lanes/web/generated/lanes2_protocol.mjs +14218 -351
  35. package/payload/lanes/web/inbox.js +8 -6
  36. package/payload/manifest.json +22 -5
@@ -644,8 +644,10 @@ upload_helper() {
644
644
  case "$line" in
645
645
  READY|PING)
646
646
  heard=0
647
- [ -z "$service" ] || touch "$state/helper.alive" 2>/dev/null
648
- [ "$up" = 1 ] || { up=1; log "upload helper: serving '$helper_target' via $primary"; } ;;
647
+ # The transition is logged before helper.alive is touched: whoever sees the service alive
648
+ # (a window's service_serving, a test) finds its serving line already written.
649
+ [ "$up" = 1 ] || { up=1; log "upload helper: serving '$helper_target' via $primary"; }
650
+ [ -z "$service" ] || touch "$state/helper.alive" 2>/dev/null ;;
649
651
  BEGIN\ *) set -- $line; req=$2; req_board=$3; req_paste=$4; list=$(mktemp) ;;
650
652
  P\ *) printf '%s\n' "${line#P }" >> "$list" ;;
651
653
  END)
@@ -56,7 +56,7 @@ terminal); `lanes sync` publishes the change (lanes-statusd starts one within ~1
56
56
  (lane_core.dispatch_lock, W15 part 2); an adapter whose answer was lost is `unknown`:
57
57
  held, never sent again by Lanes (a person: `lane inbox retry <id> --duplicate-risk`)
58
58
  lanes_message_ack <id> this agent's own lane has a message: its text leaves the inbox, the receipt stays
59
- Project tools (Lanes 2.0 Round 2, R2-S10; listed only while ~/.lz/flags/projects exists, the container's
59
+ Project tools (Lanes 2.0 Round 2, R2-S10; listed only while ~/.lz/flags/feature.projects exists, the container's
60
60
  LANES_PROJECTS=on, so the frozen listing above keeps its bytes): lanes_work_list, lanes_work_claim,
61
61
  lanes_work_release and lanes_checkpoint build the request the host's project store takes (lane_core.project_request)
62
62
  and, until a transport carries it there (integration gate I1), answer `projects_unavailable` with that request:
@@ -3836,12 +3836,13 @@ def _unlink_at(dir_fd, name):
3836
3836
  # checkpoint store that lives in the host runtime (crates/lanes-runtime/src/project, built and NOT activated): the
3837
3837
  # request a project tool would send, built and validated here, and the refusal every tool answers until the host
3838
3838
  # serves it. The project tools are listed only while the container holds the projects switch (PROJECTS_FLAG, the
3839
- # container's LANES_PROJECTS=on; no installer writes it yet), so the frozen wire v1 listing keeps its bytes; and
3839
+ # container's LANES_PROJECTS=on under FC-X11's one switch spelling `flags/feature.projects`; no installer writes it
3840
+ # yet), so the frozen wire v1 listing keeps its bytes; and
3840
3841
  # even then no transport carries the request to the host before integration gate I1, so the answer is
3841
3842
  # `projects_unavailable` with the request it would have sent — never a simulated claim. The request's bytes are
3842
3843
  # the ones lanes-runtime's `project::requests` decodes: both sides are held to the shared fixture
3843
3844
  # crates/lanes-runtime/src/project/testdata/agent-requests.json.
3844
- PROJECTS_FLAG = ('flags', 'projects') # ~/.lz/flags/projects: a regular file, no link
3845
+ PROJECTS_FLAG = ('flags', 'feature.projects') # ~/.lz/flags/feature.projects: a regular file, no link
3845
3846
  PROJECT_REQUEST = 'lanes.project-request.v1'
3846
3847
  PROJECT_ID_RE = re.compile(r'[A-Za-z0-9_][A-Za-z0-9_.:-]{0,127}') # lanes-core's project-domain id grammar
3847
3848
  WORK_CURSOR_RE = re.compile(r'[0-9]{10}:[0-9]{20}:[A-Za-z0-9_][A-Za-z0-9_.:-]{0,127}') # the ready view's cursor
@@ -3864,7 +3865,7 @@ PROJECTS_PICKUP = 'lanes-runtime project store' # who would take the request (
3864
3865
 
3865
3866
 
3866
3867
  def projects_enabled(root):
3867
- """Whether the container holds the projects switch: ~/.lz/flags/projects as a regular file reached without a
3868
+ """Whether the container holds the projects switch: ~/.lz/flags/feature.projects as a regular file reached without a
3868
3869
  symbolic link (a link planted in the volume is never followed)."""
3869
3870
  path = Path(root).joinpath(*PROJECTS_FLAG)
3870
3871
  try:
@@ -986,7 +986,7 @@ through the installed server check a container without an agent: the
986
986
  [protocol smoke](RUNBOOK.md#protocol-smoke).
987
987
 
988
988
  Behind a flag, additive (Lanes 2.0 Round 2, R2-S10): while the container holds the projects switch
989
- `~/.lz/flags/projects` the listing appends four project tools after the thirteen, pinned by
989
+ `~/.lz/flags/feature.projects` (FC-X11's one switch spelling) the listing appends four project tools after the thirteen, pinned by
990
990
  [`tests/unit/golden/lane-mcp-tools.projects.json`](../tests/unit/golden/lane-mcp-tools.projects.json) (see
991
991
  "Project tools" below); without it the listing and the golden above keep their bytes and calling a project tool is
992
992
  -32602. A project tool answers one JSON object; its refusals are `invalid_arguments`, `not_in_lane` and
@@ -1067,7 +1067,7 @@ holds no `lanes` package and no `lanes_*` tool; `test_docs.AgentApi` checks both
1067
1067
 
1068
1068
  **[BUILT, INERT]** (Lanes 2.0 Round 2, lane R2-S10; ultracode plan W28-D). The agent's half of the project, claim and
1069
1069
  checkpoint store the host runtime keeps (`crates/lanes-runtime/src/project`, not activated). Listed only while
1070
- `~/.lz/flags/projects` exists as a regular file (no installer writes it yet); each tool resolves the agent's own lane
1070
+ `~/.lz/flags/feature.projects` exists as a regular file (no installer writes it yet); each tool resolves the agent's own lane
1071
1071
  (`not_in_lane` outside one), builds the `lanes.project-request.v1` request (`lane_core.project_request`, the same bytes
1072
1072
  `lanes-runtime`'s `project::requests` decodes: the shared fixture
1073
1073
  `crates/lanes-runtime/src/project/testdata/agent-requests.json`) and, until a transport carries it to the host
@@ -1105,7 +1105,12 @@ output starts at its first escape sequence; once the terminal holds everything k
1105
1105
  repaint by giving the client one row less and, `REPAINT_GAP` (0.1 s) later, the real size, at most every
1106
1106
  `REPAINT_EVERY` (1 s). `OUTPUT_AGE` (5 s) is a progress deadline, not an age: only when output waits and the terminal
1107
1107
  has taken no byte for that long does the supervisor terminate its child, with `STOP_GRACE` (1 s) before KILL, and
1108
- exit 1 for the existing `lanes-launch` reconnect loop. No output means no timeout. `LANES_DISPLAY_BACKLOG_BYTES` and
1108
+ exit 1 for the existing `lanes-launch` reconnect loop. No output means no timeout. The deadline is judged on the
1109
+ terminal's consumption as the supervisor records it (`StallRecord`, and `relay::stall` in the Rust relay): past the
1110
+ deadline the pending output is offered once more and only a refused offer ends the display, so the supervisor's own
1111
+ lateness on a loaded host is never charged to the terminal (BEY-7309). `LANES_DISPLAY_STALL_RECORD=1` writes that
1112
+ record at exit as one stderr line (bytes taken per stall period of waiting output, periods, longest wait, decision);
1113
+ both relays write the same keys, and the relay tests judge a run by it rather than by their own clock. `LANES_DISPLAY_BACKLOG_BYTES` and
1109
1114
  `LANES_DISPLAY_STALL_S` override the two limits; `lanes attach` passes exactly those keys through its clean
1110
1115
  environment, and `attach.settings` refuses a value outside its range. Human lines (the first fall-behind notice, the
1111
1116
  session's shed summary, a stall's reason) go to stderr, which over SSH is the same terminal. The view server, its
@@ -1535,6 +1540,22 @@ install; an update (`--update-only`) enables nothing and only restarts what runs
1535
1540
  The co-located Throttle Studio Host (`lanes-studio-host.service` and its enrolment retry timer) is opt-in too:
1536
1541
  `install/enable-studio-host.sh` enables it, and its binary is selected by `lanes studio-host install` from an
1537
1542
  `opt-in` line of `holders.lock` or a local build, sha256-verified either way (`libexec/studio_host.py`).
1543
+
1544
+ **Lanes 2.0 flags and the lanes host (final contract decisions FC-R1, FC-R7, FC-G8, FC-G9, FC-E12, FC-X11).** Each
1545
+ native component has one request, site.conf's `LANES_RS_<COMPONENT>=off|shadow|on` (`lanes rs set` writes it; a missing
1546
+ line is the release default of `lanes/VERSION`, all `off` below 2.0.0), and one spelling of its effect,
1547
+ `$LANES_STATE/flags/native.<component>[.shadow]`, which `lanes rs apply` (`libexec/native_bin.py`) alone writes and
1548
+ every reader tests by existence: `libexec/native.sh`, the hot-key front (`native.key`), the CLI launcher
1549
+ (`native.client`), the Rust routes (`native.routes`). The seven feature switches become `flags/feature.<name>` only
1550
+ when on. HOST runs `throttle-rc lanes host` — one process per state root, the unit `lanes-host.service`, which
1551
+ `install/services.py` renders and `lanes rs apply` enables only while `flags/native.host[.shadow]` exists (disabled,
1552
+ stopped and removed otherwise; a Python twin stands down only once its duty's flag exists and comes back when it goes)
1553
+ — in `--mode shadow` on a guest owner
1554
+ install, or `--mode owner` or `--mode aggregator` by `LANES_HOST_ROLE`. The host duties (STATUSD, VISIBILITY, NOTIFY,
1555
+ ECONOMY, SYNC, SITE, STORE, ROUTES, ATTENTION, LIFECYCLE) run inside it: a duty's flag is a request, and ownership is
1556
+ its domains' cutover records (`$LANES_STATE/cutover/<domain>.json`); `on` needs every record active for `lanes-rs`,
1557
+ and a Python twin stands down on the record, never on a flag file. The Studio Host checks the `attention` record before
1558
+ it types an answer (`attention_owner_elsewhere`, zero bytes, while the lanes host owns it).
1538
1559
  Temporary-file cleanup and process protection have explicit plan/apply or enable steps; installation does not
1539
1560
  arm them. The root host guard is also separate and records rollback values. See [the runbook](RUNBOOK.md)
1540
1561
  and [host protection](HOST-GUARD.md) for those operations.
@@ -1586,7 +1607,8 @@ typing go through `/proc/<init>/root` and `docker exec`) or `guest:<ssh alias>`
1586
1607
  | Part | File | Role |
1587
1608
  | --- | --- | --- |
1588
1609
  | Protocol | `site/protocol.py` | Framing (one compact JSON object per line, at most 1 MiB), the six v1 ops (plan row H1's interim ops; transport, framing, hello and versioning are AR §3.32's), the typed error codes and the reserved owner-fence codes, the normative check order (shape, verb and text bounds, then the recipient), the tmux read allowlist, the text bound, the read reply's byte budget, the two exec template ids, the optional `intent`/`epoch` of the mutating ops, the secret-key detector. Stdlib only; shared by the parts below. |
1589
- | Forced command | `bin/lanes-site-serve` | AR §3.32's keyed path (`command="<home>/.local/share/lanes/current/bin/lanes-site-serve",restrict`). POSIX sh: the Python server, or — with `$LANES_STATE/flags/rs-site` — one `adapter_unavailable` frame until `lanesd site-serve` exists (W20). |
1610
+ | Forced command | `bin/lanes-site-serve` | AR §3.32's keyed path (`command="<home>/.local/share/lanes/current/bin/lanes-site-serve",restrict`). POSIX sh that always execs the Python server and reads no flag (final contract decision FC-X31). |
1611
+ | Relay | `site/relay.py` | FC-X31: once the guest's lanes host owns a domain, `msg.deliver` becomes `request{inbox_compose}` and `msg.status` `command{query_operation}` on `$LANES_STATE/run/lanesd.sock`; `tmux_write`, `exec` and `exec.run` are refused `owned_elsewhere` in a domain the host owns. A refusal receipt is no success: `owner_unavailable` for FC-X5's class of that name, `relay_refused` naming any other code and any boundary `refused` frame. No store, lock or probe. |
1590
1612
  | Reference server | `site/server.py` | One process per ssh connection. Answers from the guest's own `registry.json` and `containers.json`, read per request; holds no store and no lock between requests. Its one write types into a registered lane's active pane under the recipient's dispatch lock; `exec` builds a fixed argv from the template id and a registered container name, and only when the guest's own statusd checks find the re-arm due (never on a critical guest). |
1591
1613
  | Host client | `libexec/lanes_lib.py` transport section | `catalog_transports` (per board: a bad board costs that board only), `board_refusal` (build_registry: an invalid board, and `aggregator_absent` for a guest board before W20), `refresh_containers` (a guest's containers stamped, never inspected), `SiteClient` (one `ssh -T` per guest and process, hello first, deadlines, an intent id per mutating request, never a resend), `guest_probe` (tmux_probe's guest arm), `write_route`, `lane_write`, `names_refusal`, `transport_report` (doctor). The hooked functions (`build_registry`, `tmux_probe`, `tmux_query`, `tmux_socket`, `host_path`, `containers_info`, `container_info`, `refresh_containers`) keep their signatures, and every typed path calls `tmux_probe` by its module attribute, so the rd-control runtime hook keeps working until the aggregator replaces it. |
1592
1614
  | Conformance kit | `site/conformance.py` | The protocol suite against any adapter's stdio; later also against `lanesd site-serve`. Every refused request names an unregistered target. |
@@ -396,7 +396,12 @@ lanes studio-host re-key --yes after the owner revoked the Host: a new mac
396
396
  - **Stall (a hung terminal).** A terminal that accepts no byte at all for 5 s (`LANES_DISPLAY_STALL_S`) while output
397
397
  waits ends only that client (TERM, then KILL after 1 s if needed); the supervisor prints `lanes: display output
398
398
  stalled; reconnecting the display.`, exits 1, and `lanes-launch` reconnects to the existing view (BEY-6844: progress,
399
- not the age of the oldest output, decides).
399
+ not the age of the oldest output, decides). The supervisor judges on an offer made at the deadline: it hands the
400
+ terminal its pending output once more and ends the display only if the terminal takes none of it, so a supervisor
401
+ that was itself held off the CPU past the deadline on a busy host credits what the terminal read meanwhile
402
+ (BEY-7309). With `LANES_DISPLAY_STALL_RECORD=1` (not forwarded by `lanes attach`; for a supervisor run by hand)
403
+ it ends with one diagnostics line, `lanes: display stall record {...}`: bytes the terminal took per stall period,
404
+ the periods, the longest wait and the decision.
400
405
 
401
406
  A terminal that keeps taking bytes, however slowly, is never ended. Idle terminals have no deadline; input, resizing
402
407
  and normal exit codes pass through. Both limits are read from the environment `lanes attach` runs in (the SSH
@@ -3105,10 +3110,13 @@ The aggregator's site key gets one `authorized_keys` line (AR §3.32's path), an
3105
3110
  command="/home/<user>/.local/share/lanes/current/bin/lanes-site-serve",restrict ssh-ed25519 AAAA... lanes-site@<aggregator>
3106
3111
  ```
3107
3112
 
3108
- `bin/lanes-site-serve` (POSIX sh) execs `python3 -S -E -B site/server.py`. When `$LANES_STATE/flags/rs-site` exists it
3109
- names the native adapter (`lanesd site-serve`, W20), which no guest has yet, so it answers one
3110
- `adapter_unavailable` frame and exits 69 instead of serving something else. `restrict` gives no pty, no forwarding and
3111
- no agent, and the client's requested command is ignored. On the aggregator, `~/.ssh/config` names the alias
3113
+ `bin/lanes-site-serve` (POSIX sh) always execs `python3 -S -E -B site/server.py` and reads no flag: the Python
3114
+ reference server is the 2.0 `lanes-site/1` server on every guest (final contract decision FC-X31; no `lanesd` exists).
3115
+ Once the guest's own lanes host owns a domain the server is its relay (`site/relay.py`): `msg.deliver` goes to it as
3116
+ `request{inbox_compose}` and `msg.status` as `command{query_operation}` on `$LANES_STATE/run/lanesd.sock`
3117
+ (`owner_unclaimed` before the host owns `delivery`, `owner_unavailable` while the socket is absent), and the local
3118
+ effects of an owned domain — `tmux_write` (delivery), `exec` and `exec.run` (lifecycle) — are refused `owned_elsewhere`
3119
+ with zero bytes. `restrict` gives no pty, no forwarding and no agent, and the client's requested command is ignored. On the aggregator, `~/.ssh/config` names the alias
3112
3120
  (`Host rd-work-site`, its `HostName`, `User`, `IdentityFile` of the site key, `IdentitiesOnly yes`). The site alias is
3113
3121
  never the alias a holder attaches through: attaching needs a pty, which this key refuses.
3114
3122
 
@@ -3180,53 +3188,95 @@ python3 lanes/site/conformance.py -- ssh -T -o BatchMode=yes rd-work-site
3180
3188
  python3 lanes/site/conformance.py -- python3 -S -E -B lanes/site/server.py
3181
3189
  ```
3182
3190
 
3183
- ## Lanes 2.0 native binaries and flags (`lanes rs`; every flag off)
3184
-
3185
- Lanes 2.0 moves components to Rust one at a time, each behind a flag (lanes2 Round 1 H2, BEY-6988; the Lanes2
3186
- architecture specification §7.3, §7.4, §9.3 and decision D9, and the Rust runtime specification §3.1, §3.2, which takes
3187
- precedence). No release ships a native binary yet, nothing reads a flag yet, and every path below stays the Python
3188
- one. Measured on the dev container only; no reference machine has run a native component.
3189
-
3190
- **Flags.** One `site.conf` line per component (`~/.config/lanes/site.conf`, the same `LANES_<KEY>=<value>` grammar as
3191
- the site facts), AR §7.3's components and the first-party routes:
3192
-
3193
- | Key | Native binary | Round 1 |
3194
- | --- | --- | --- |
3195
- | `LANES_RS_RELAY` | `lanes-terminal` (its `relay` mode, `connection.py`'s arguments) | `on` admitted for a verified binary; read by lane C7's view hook (`view.sh` and `holders/ssh.sh`), not yet |
3196
- | `LANES_RS_SIDEBAR` | `lanes-terminal` (its `sidebar` mode) | `on` admitted for a verified binary; read by lane C7's sidebar-wrapper hook, not yet |
3197
- | `LANES_RS_KEY` | `lanes-terminal` (the hot keys, lane C6) | `on` admitted for a verified binary; no reader yet |
3198
- | `LANES_RS_SIGNAL` | `lanes-hook` (the hook emitter behind `lane-signal`) | `on` admitted for a verified binary; container install is a later round |
3199
- | `LANES_RS_MCP`, `LANES_RS_AGENTD` | none yet: no lanes crate declares one | refused `binary_absent` |
3200
- | `LANES_RS_STATUSD`, `VISIBILITY`, `NOTIFY`, `ECONOMY`, `SYNC`, `SITE`, `STORE` | none: duties of the host coordinator, which the throttle-rc Studio Host composes | refused `host_composed`: one host owner per state root, no second daemon beside the Studio host (RT §3.2); the cutover fence (lane H3) activates them in that composition |
3201
- | `LANES_RS_ROUTES` | none: the first-party docs and enrolment routes in Rust (RT §12.4, lanes2 Round 2 R2-ROUTES; `crates/lanes-runtime/src/http/`), a host duty the throttle-rc Studio Host composes | refused `host_composed` like the duties above; the Rust routes read only the flag files `native.routes` / `native.routes.shadow`, never this line, so `lanes-docsd` and `lanes-enrold` keep answering |
3202
-
3203
- Values are `off` (the default, also for a missing line), `shadow` and `on`. Any other value reads as `off`, and a
3204
- `LANES_RS_<X>` that names no component above is ignored (`LANES_RS_MCP_EXCLUDE` is a setting, not a component).
3205
- `shadow` is refused (`shadow_unsupported`) for a component whose strangler row has no shadow step (relay, sidebar,
3206
- key, signal).
3207
-
3208
- **`lanes rs apply`** is the one writer of the flag files: it turns the lines into empty files,
3191
+ ## Lanes 2.0 native binaries and flags (`lanes rs`; every default off before 2.0.0)
3192
+
3193
+ Lanes 2.0 moves components to Rust one at a time, each behind a flag (lanes2 Round 1 H2, BEY-6988; the final contract
3194
+ decisions FC-R1, FC-R7, FC-G8, FC-G9, FC-E12 and FC-X11, which amend the Lanes2 architecture §7.3, §7.4, §9.3 and §9.4
3195
+ and the Rust runtime specification §3.1, §3.2 and §17.1). From 1.8.0 the release tree ships the static x86_64 musl
3196
+ binaries `lanes-terminal` and `lanes-hook` under `bin-rs/` (with `BINARIES.json` and `THIRD-PARTY-NOTICES`; Binaries,
3197
+ below), and every component still defaults to `off`, so every path below stays the Python one until an operator asks.
3198
+
3199
+ **Components and requests.** One request per component: the `site.conf` line `LANES_RS_<COMPONENT>=off|shadow|on`
3200
+ (`~/.config/lanes/site.conf`, the site facts' `LANES_<KEY>=<value>` grammar). `lanes rs set COMPONENT MODE` writes that
3201
+ line atomically under `~/.config/lanes/.site.conf.lock` (earlier lines naming the key go, every other line and the
3202
+ file's mode bits stay) and changes no flag; it refuses `unknown_component`, `shadow_unsupported` for a component
3203
+ without a shadow step, and for `host shadow|on` `binary_absent` while no `throttle-rc` is installed (neither the `lanes
3204
+ rs install` link nor the `lanes studio-host install` selection) or `digest_mismatch` for one that does not verify. A
3205
+ missing line is the release default of the installed `lanes/VERSION` (below 2.0.0: `off`). `lanes doctor` lists a
3206
+ `LANES_RS_` line apply does not understand and a feature switch value refused `flag_value_invalid`.
3207
+
3208
+ | Component | What runs it | Shadow step | Admitted |
3209
+ | --- | --- | --- | --- |
3210
+ | `RELAY`, `SIDEBAR`, `KEY`, `CLIENT` | `lanes-terminal` (its relay and sidebar modes, the hot keys, the first-party CLI route that `lanes-launcher.sh` reads from `flags/native.client`) | no | `on` for a verified binary |
3211
+ | `SIGNAL` | `lanes-hook` (the hook emitter behind `lane-signal`) | no | `on` for a verified binary |
3212
+ | `MCP`, `AGENTD` | none yet: no lanes crate declares one | yes | refused `binary_absent` |
3213
+ | `HOST` | `throttle-rc lanes host` (the `lanes rs install` link `bin-rs/throttle-rc`, else the `lanes studio-host install` selection) | yes: `--mode shadow` | shadow only where `LANES_HOST_ROLE=owner`; on as `--mode owner` or `--mode aggregator` by that role; no role: `owner_undeclared` |
3214
+ | `STATUSD`, `VISIBILITY`, `NOTIFY`, `ECONOMY`, `SYNC`, `SITE`, `ROUTES` | duties inside the lanes host | yes | `host_absent` while HOST is off; `shadow` while HOST is shadow or on and no cutover record exists; `on` only with HOST on and every domain's cutover record active for `lanes-rs`, else `cutover_pending`; STATUSD and SYNC need `LANES_HOST_ROLE=owner`, SITE `aggregator` (`aggregator_required`) and is never on by default |
3215
+ | `STORE`, `ATTENTION`, `LIFECYCLE` | duties inside the lanes host | no | as the duties above, `off` straight to `on` |
3216
+
3217
+ The duties' cutover records are keyed by state domain (`$LANES_STATE/cutover/<domain>.json`, `lanes.cutover/1`):
3218
+ STATUSD is `observation` and `delivery`; STORE is `store`, `schedule`, `project` and `connectors`; every other duty its
3219
+ own name. With no record a domain stays with its legacy owner — the Studio Host for `attention`, the Python host for the
3220
+ rest. For a duty the flag is the request and the record is ownership: a Python twin stands down on the record, never on
3221
+ a flag file alone. `lanes rs status` shows, per component, the request and its source (`default` or `site.conf`), the
3222
+ flag file, every cutover record of a duty, and what runs.
3223
+
3224
+ **`lanes rs apply`** is the one writer of the flag files: it turns each request into an empty file,
3209
3225
  `~/.local/state/lanes/flags/native.<component>` for `on` and `native.<component>.shadow` for `shadow`, each only for a
3210
- mode it admits. Otherwise it prints `! LANES_RS_<C>=<mode> refused, kept off: <reason>` with `host_composed`,
3211
- `binary_absent` (nothing installed or shipped), `digest_mismatch` (other bytes than the recorded sha256, or a binary
3212
- the tree ships unlisted), `not_executable`, `shadow_unsupported` or `arch_unsupported` (not x86_64), and exits 3.
3213
- Every other `native.*` file is removed. `lanes sync` and its timer never write a flag. `lanes rs status` shows, per
3214
- component, the `site.conf` mode, the flag file and what runs (the binary's path, or `python`). A shell reader never
3215
- parses `site.conf`: it sources `libexec/native.sh` and tests the flag with `[ -e ]`, then takes the first binary
3216
- candidate that exists and only if it passes the same structural test `apply` applied (never the next one).
3226
+ mode it admits. Otherwise it prints `! LANES_RS_<C>=<mode> refused, kept off: <reason>` and exits 3 — `host_absent`,
3227
+ `cutover_pending`, `owner_undeclared`, `aggregator_required`, `binary_absent`, `digest_mismatch` (other bytes than the
3228
+ recorded sha256, or a binary the tree ships unlisted), `not_executable`, `shadow_unsupported` or `arch_unsupported`.
3229
+ A release default that this host refuses is reported on an indented line and kept off, never an exit 3. A duty
3230
+ requested `on` — explicitly or by the release default, whose role admits it — with HOST on first drives each domain not
3231
+ yet active for `lanes-rs` through `throttle-rc lanes cutover <domain> --to lanes-rs` (the H3 fence; it refuses
3232
+ `owner_unbuilt` until owner mode, gate I2, composes the fence driver, so the duty stays `cutover_pending`); a duty requested
3233
+ `off` whose domain is still active for `lanes-rs` is driven back with `--to <legacy owner>` (the reverse fence). Every
3234
+ other `native.*` file is removed. The seven feature
3235
+ switches (`LANES_OPERATIONS`, `LANES_BUILD_WRITES`, `LANES_PLANNER`, `LANES_TOOL_REPAIR`, `LANES_PROJECTS`,
3236
+ `LANES_CONNECTOR_GITHUB`, `LANES_CONNECTOR_LINEAR`) are off when absent: `on`, `1`, `true` or `yes` (any case) becomes
3237
+ `flags/feature.<name>` (for example `feature.connector-github`), anything else removes it, and a value outside both
3238
+ words is `flag_value_invalid`. Last, apply reconciles the units with the flags in both directions (`install/services.py`
3239
+ `reconcile_units`): while HOST is shadow or on it renders `~/.config/systemd/user/lanes-host.service`, reloads the user
3240
+ manager when the text changed, enables the unit and restarts it (changed) or starts it (unchanged); while HOST is off it
3241
+ disables and stops a unit still there, then removes the file and reloads. In owner or aggregator mode each Python twin
3242
+ of a duty whose flag exists — its cutover records active for `lanes-rs` — is disabled and stopped (STATUSD:
3243
+ `lanes-statusd.service`; SYNC: the sync, ensure, guard and tmpreap timers; SITE on an aggregator: the sync timer;
3244
+ NOTIFY, ECONOMY: their opt-in services, only where enabled), recorded in `~/.local/state/lanes/rs/twins.json`, and
3245
+ each twin recorded there is enabled and started again once its duty's flag is gone. A failed `systemctl --user` step is
3246
+ printed with `!` and exits 3. `lanes sync` and its timer never write a flag. A shell reader never parses `site.conf`: it tests the
3247
+ flag with `[ -e ]` (`libexec/native.sh` takes the first binary candidate that exists and only if it passes the same
3248
+ structural test `apply` applied, never the next one).
3249
+
3250
+ **The lanes host.** `throttle-rc lanes host --mode shadow|owner|aggregator --state <LANES_STATE>` runs one process per
3251
+ state root (`$LANES_STATE` for owner and aggregator, `$LANES_STATE/shadow/host` for shadow) under the unit
3252
+ `lanes-host.service` (`Type=notify`, `KillMode=process` so the tmux servers it started survive a stop,
3253
+ `RestartPreventExitStatus=3`, `MemoryHigh=192M`, `MemoryMax=384M`; a shadow unit runs after `lanes-statusd.service`
3254
+ and conflicts with nothing; an owner unit conflicts with the Python twins of its duties that are on). It exits 3 on a
3255
+ typed refusal (`host_running` while another process holds `<root>/locks/host.lock`, `owner_undeclared`,
3256
+ `aggregator_required`, `store_schema_ahead`, `state_unsafe`, `machine_id_absent`, `i1_workspace_collision` — a shadow
3257
+ candidate while the production catalog, read where `lanes_lib` reads it (`$LANES_WORKSPACES`, else
3258
+ `~/.config/lanes/workspaces`, else the installed tree's `workspaces/`), names a board `lanes2-i1`). Its `--config
3259
+ lanes-host.toml` declares the shadow candidate's own test lanes (`[shadow] workspace = "lanes2-i1"`, `[[shadow.test_lane]]
3260
+ lane, server, argv`; a lane is a lane id). Until the runtime half lands it takes only the lock, its instance id
3261
+ (`<root>/host/instance`, derived from `/etc/machine-id` or `$LANES_HOST_MACHINE_ID_FILE`, written through a rename) and
3262
+ the test lanes: no store, no socket, nothing admitted.
3217
3263
 
3218
3264
  **Binaries.** Both `apply` and the readers look in the same two places, in this order:
3219
3265
 
3220
3266
  1. `lanes rs install --from PATH --sha256 HEX`, for a locally built binary (development and offline). PATH must be a
3221
- regular executable file named `lanes-terminal` or `lanes-hook`. `--sha256` is required and checked before anything
3222
- is written; under the lock `~/.local/share/lanes/bin-rs/.lock` the copy is hashed again, placed as
3267
+ regular executable file named `lanes-terminal`, `lanes-hook` or `throttle-rc`. `--sha256` is required and checked
3268
+ before anything is written; under the lock `~/.local/share/lanes/bin-rs/.lock` the copy is hashed again, placed as
3223
3269
  `bin-rs/<name>-<sha12>`, recorded in `bin-rs/INSTALLED.json`, and only then is the link `bin-rs/<name>` moved. It
3224
3270
  changes no flag and restarts nothing. Exit 0 installed, 2 usage, 3 refused (`binary_mismatch`,
3225
3271
  `installed_malformed`: a record it cannot read is never reset, `busy`).
3226
3272
  2. The release tree. The npm payload carries `bin-rs/x86_64-unknown-linux-musl/<name>` and `bin-rs/BINARIES.json`
3227
3273
  (`name`, `target`, `sha256`, `size`, `commit`) inside `pkg/<version>/`, so the `current` flip that updates or rolls
3228
3274
  back the Python moves the binaries with it in one rename. `npm/lanes/scripts/build-payload.mjs` ships a binary
3229
- only from `LANES_RS_ARTIFACTS=<dir>`, built from the same commit (npm/lanes/README.md, Maintainers).
3275
+ only from `LANES_RS_ARTIFACTS=<dir>`, built from the same commit with `LANES_BUILD_COMMIT` set to it, so each
3276
+ `--version` reads `<name> <version> (commit <40-hex>)` (npm/lanes/README.md, Maintainers). HOST's
3277
+ `throttle-rc` comes from the `lanes studio-host install` selection instead (its pin record holds the digest).
3278
+ The shipped binaries use the plain `release` profile (no LTO, no full strip); the Lanes2 architecture §9.2
3279
+ `lanes-release` profile (fat LTO, one codegen unit, `strip`, `panic = "abort"`) is a follow-up.
3230
3280
 
3231
3281
  `lanes rs verify` checks both against their records and prints a `WARN` line for an explicit install that runs
3232
3282
  instead of a shipped binary with other bytes (exit 0 all match or none exists, 3 a mismatch); `lanes rs verify --tree`
@@ -3235,17 +3285,36 @@ checks the release tree alone.
3235
3285
  **Updates.** The server installer's commit phase (`install/host-install.sh`, an update and a full install alike) runs
3236
3286
  `libexec/native_bin.py verify-tree` on the tree it is about to install, before `current` moves: a binary that is
3237
3287
  unlisted, not executable or has other bytes than its digest refuses the install (`refused`, exit 3; the installed
3238
- release keeps running and nothing changes). Then every `native.*` flag that tree cannot serve is removed, and the
3239
- post-commit checks the tree again as the step `verify bin-rs` (only for a tree that carries binaries). An explicit
3240
- install is never the update's to judge. While `flags/native.statusd` exists (no verb writes it in Round 1) the
3241
- post-commit skips statusd's restart with a warning.
3242
-
3243
- **Rollback.** A behaviour: set the line to `off` (or delete it), run `lanes rs apply`, then `lanes reload-views` once
3244
- a reader exists. An explicit install: `lanes rs uninstall NAME` removes the link (the placed file and its record stay)
3245
- so the release tree's binary runs again, and removes each flag the tree cannot serve; `lanes rs status` and `lanes rs
3246
- verify` show which binary runs. A release: `lanes update --rollback` removes, before its flip, every flag the release
3247
- it returns to cannot serve (a flag file it cannot remove refuses the rollback). Never stop or start a unit by hand to
3248
- switch a component: no unit is rendered from a flag in Round 1.
3288
+ release keeps running and nothing changes). Then every `native.*` flag that tree cannot serve is removed (HOST's and its
3289
+ duties' flags too once `bin-rs/throttle-rc` no longer verifies), and the post-commit checks the tree again as the step
3290
+ `verify bin-rs` (only for a tree that carries binaries). An explicit install is never the update's to judge. While
3291
+ `flags/native.statusd` exists the post-commit skips statusd's restart with a warning, and while HOST is shadow or on it
3292
+ try-restarts `lanes-host.service`, whose new process takes the host lock first.
3293
+
3294
+ **Releases (FC-G9).** A component moves `off`, then `shadow` (only with a shadow step), then `on`, by explicit request
3295
+ at the integration gates (`native_bin.GATE_FLAG_SETS`: I1 `HOST=shadow` on one guest owner install; after I1 the six
3296
+ duties in shadow; I2 HOST and the duties `on` through their fences; I3 CLIENT, SIDEBAR, KEY, RELAY, SIGNAL and
3297
+ LIFECYCLE; I4 ATTENTION, then MCP and AGENTD shadow and on). Release N (the 1.8.x and 1.9.x line) ships every default
3298
+ `off`. 2.0.0 (N+1) defaults every component but SITE to `on`, and a default never turns on a component `apply` would
3299
+ refuse on that host. `lanes/VERSION` may become 2.0.0 only in a commit where `lanes/tests/unit/test_release_gate.py`
3300
+ passes: the parity manifest complete (`open_owners` empty, every row `parity-tested` or `new-path-tested`) and the I5
3301
+ record present; a release that cannot meet that is a 1.x minor. Python twins go in 2.1.0 (N+2), never as a 2.0.0 exit
3302
+ criterion; `rs`, `update` and `doctor` stay Python. 1.8.0 is the first release N (operator decision 2026-11-05): it
3303
+ carries the composed Lanes 2.0 tree (`lanes-core`, `lanes-protocol` and its one NDJSON wire `lanes.api/1`,
3304
+ `lanes-runtime`, `lanes-client`, `lanes-terminal`, `lanes-hook`, and `throttle-rc lanes host` with its shadow mode)
3305
+ with every default `off` — `lanes rs status` shows each component `off` from source `default`, and `lanes rs apply`
3306
+ opts a host in — and the remaining I1 witnesses (W3–W10) and the 24-hour shadows and soaks of I2, I4 and I5 run on
3307
+ production hosts after it. 2.0.0 stays the default-on release under the gate above (FC-G9 unchanged); R54 and R55
3308
+ are 2.0.1 (BEY-7232).
3309
+
3310
+ **Rollback.** A behaviour: `lanes rs set <component> off`, `lanes rs apply`, then `lanes reload-views` once a reader
3311
+ exists; for a duty apply drives the reverse fence and enables and starts the Python twin it had disabled. The lanes
3312
+ host itself: `lanes rs set host off && lanes rs apply` disables and stops `lanes-host.service` (its process releases
3313
+ `<root>/locks/host.lock` on the way out), removes the unit, and brings back every twin apply disabled. An explicit install: `lanes rs uninstall NAME` removes
3314
+ the link (the placed file and its record stay) so the release tree's binary runs again, and removes each flag the tree
3315
+ cannot serve; `lanes rs status` and `lanes rs verify` show which binary runs. A release: `lanes update --rollback`
3316
+ removes, before its flip, every flag the release it returns to cannot serve (a flag file it cannot remove refuses the
3317
+ rollback). Never stop or start a unit by hand to switch a component: a bare `systemctl` is not a rollback.
3249
3318
 
3250
3319
  ## Safety rules baked into the code (do not remove)
3251
3320
 
@@ -618,6 +618,33 @@ would put the bad release back, is refused (install it by hand with `npx @vibelo
618
618
  reach this machine` — the view and its login token still work. The client updates itself first (public npm), the
619
619
  server when its operator runs `npx @vibelord/lanes@latest --server`, so this mixed window is expected.
620
620
 
621
+ ### Lanes 1.8.0
622
+
623
+ 1.8.0 brings two fixes to every window and carries the Lanes 2.0 Rust tree without turning any of it on.
624
+
625
+ - **What changes for you.** The sidebar never acts on a sentence typed into it, `h`, `H` and `R` ask first and take
626
+ Enter, and a workspace with hidden lanes says how many (1.7.7, BEY-7248; [The sidebar](#the-sidebar)). Two writes of
627
+ a device file inside one clock tick are both seen (1.7.6, #760). A 1.7.6 or 1.7.7 window that says hello to a 1.8.0
628
+ server is answered ` update=1.8.0` and updates itself as [Versions](#versions) describes.
629
+ - **What 1.8.0 carries, off.** The composed Lanes 2.0 host in Rust: `lanes-core`, `lanes-protocol` (one wire,
630
+ `lanes.api/1`: one compact JSON frame per LF-terminated line, at most 1 MiB), `lanes-runtime` (the host's runtime),
631
+ `lanes-client`, `lanes-terminal` (CLI, sidebar, relay and hot keys) and `lanes-hook` (the hook emitter behind
632
+ `lane-signal`), and the `throttle-rc lanes host` process with its shadow mode (`--mode shadow`: its own state under
633
+ `shadow/host` and its own test lanes, never a cutover record). In this release that process takes only the host lock,
634
+ its instance id and the shadow's test lanes; `throttle-rc lanes cutover` refuses `runtime_unavailable`, so a host duty
635
+ asked `on` stays `cutover_pending`.
636
+ - **Every native component defaults to off.** A missing `LANES_RS_<COMPONENT>` line in `~/.config/lanes/site.conf` is
637
+ the release default, and below 2.0.0 that is `off` for all eighteen. Nothing runs natively until an operator opts a
638
+ host in: `lanes rs status` lists each component with its request and source (`off default`), `lanes rs set COMPONENT
639
+ MODE` then `lanes rs apply` opts this host in, and `lanes rs set COMPONENT off` then `lanes rs apply` takes it back
640
+ (RUNBOOK, "Lanes 2.0 native binaries and flags"). A component needs a verified binary first: the package carries
641
+ `lanes-terminal` and `lanes-hook` only when it was built with them, and the host's `throttle-rc` comes from `lanes
642
+ studio-host install` or `lanes rs install`; without one `lanes rs apply` keeps it off (`binary_absent`).
643
+ - **What comes next.** The I1 witnesses and the 24-hour shadows and soaks of gates I2, I4 and I5 run on production
644
+ hosts, in shadow, after this release. 2.0.0 is the release whose defaults turn the Rust components on, once the I5
645
+ record exists (FC-G9, unchanged). The browser workspace and the Rust workspace manager (R54, R55) are Lanes 2.0.1
646
+ (BEY-7232).
647
+
621
648
  ### Uninstall
622
649
 
623
650
  - Client: `./install.sh --uninstall` or `npx @vibelord/lanes --uninstall`. Your view session on the server stays until
@@ -2905,6 +2932,7 @@ Server and views:
2905
2932
  | `LANES_TESTS_FORCE` | `tests/guards.py` | unset | `1` runs live suites on a busy host (on purpose only) |
2906
2933
  | `LANES_DISPLAY_BACKLOG_BYTES` | `libexec/attach.py`, passed on by `lanes attach` | `1048576` | Output (bytes) a desktop view may hold for a terminal that is behind; beyond it the oldest part is dropped and the screen repainted. Whole bytes, 131072–268435456 |
2907
2934
  | `LANES_DISPLAY_STALL_S` | `libexec/attach.py`, passed on by `lanes attach` | `5` | Seconds a terminal may accept no output at all before the view is ended and reconnected. 1–600, up to three decimals |
2935
+ | `LANES_DISPLAY_STALL_RECORD` | `libexec/attach.py` run by hand (not passed on by `lanes attach`) | unset | `1` ends the run with one diagnostics line on stderr, `lanes: display stall record {...}`: bytes the terminal took per stall period, the periods and the decision |
2908
2936
 
2909
2937
  `LANES_THROTTLE_*` and `LANES_NOTIFY_CONF` set in the installer's environment are rendered into their units only. The
2910
2938
  `LANES_ENROL_*` settings go in a drop-in, `systemctl --user edit lanes-enrold.service`, which a re-install keeps; the
@@ -0,0 +1,25 @@
1
+ [Unit]
2
+ Description=lanes: the Lanes 2.0 host (throttle-rc lanes host --mode @MODE@; rendered by `lanes rs apply` while LANES_RS_HOST is shadow or on)
3
+ Documentation=https://github.com/bwllaming/bw-tools/blob/main/lanes/docs/RUNBOOK.md
4
+ @ORDER@
5
+
6
+ [Service]
7
+ Type=notify
8
+ # The binary is the `lanes rs install` link bin-rs/throttle-rc, else the `lanes studio-host install` selection
9
+ # bin/throttle-rc (FC-R1). The mode follows LANES_RS_HOST and site.conf LANES_HOST_ROLE (FC-X11).
10
+ ExecStart="@THROTTLE_RC@" lanes host --mode @MODE@ --state "@STATE@"
11
+ Restart=on-failure
12
+ # Exit 3 is a typed refusal (host_running, owner_undeclared, aggregator_required, store_schema_ahead, state_unsafe,
13
+ # machine_id_absent, i1_workspace_collision): a restart would refuse again.
14
+ RestartPreventExitStatus=3
15
+ # Above the G2 6 s shutdown budget plus the fence.
16
+ TimeoutStopSec=15
17
+ # The host process only: tmux servers it started survive a stop as native holders.
18
+ KillMode=process
19
+ KillSignal=SIGTERM
20
+ @WATCHDOG@MemoryHigh=192M
21
+ MemoryMax=384M
22
+ Slice=lanes.slice
23
+
24
+ [Install]
25
+ WantedBy=default.target