@vibelord/lanes 1.7.3 → 1.7.4

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 (50) hide show
  1. package/README.md +9 -0
  2. package/package.json +1 -1
  3. package/payload/lanes/VERSION +1 -1
  4. package/payload/lanes/bin/lanes +97 -17
  5. package/payload/lanes/bin/lanes-site-serve +15 -0
  6. package/payload/lanes/bin-rs/BINARIES.json +5 -0
  7. package/payload/lanes/container/lane-mcp +105 -5
  8. package/payload/lanes/container/lane_core.py +110 -0
  9. package/payload/lanes/container/throttle-pulse +159 -14
  10. package/payload/lanes/docs/ARCHITECTURE.md +108 -11
  11. package/payload/lanes/docs/DESIGN.md +10 -8
  12. package/payload/lanes/docs/INSTALL.md +1 -1
  13. package/payload/lanes/docs/RUNBOOK.md +297 -5
  14. package/payload/lanes/docs/USERGUIDE.md +11 -6
  15. package/payload/lanes/install/host-install.sh +14 -3
  16. package/payload/lanes/libexec/adopt.py +325 -0
  17. package/payload/lanes/libexec/cutover.py +656 -0
  18. package/payload/lanes/libexec/docsd.py +12 -8
  19. package/payload/lanes/libexec/doctor_lanes2.py +213 -0
  20. package/payload/lanes/libexec/economy_poll.py +87 -2
  21. package/payload/lanes/libexec/lanes_lib.py +465 -2
  22. package/payload/lanes/libexec/native.sh +38 -0
  23. package/payload/lanes/libexec/native_bin.py +668 -0
  24. package/payload/lanes/libexec/shadow.py +1311 -0
  25. package/payload/lanes/libexec/sidebar.py +252 -30
  26. package/payload/lanes/libexec/sidebar_status.py +373 -25
  27. package/payload/lanes/libexec/statusd.py +67 -3
  28. package/payload/lanes/libexec/tokens.py +99 -131
  29. package/payload/lanes/libexec/tokens.sh +1 -1
  30. package/payload/lanes/libexec/update.py +48 -5
  31. package/payload/lanes/libexec/users.py +282 -0
  32. package/payload/lanes/site/README.md +9 -0
  33. package/payload/lanes/site/conformance.py +280 -0
  34. package/payload/lanes/site/protocol.py +368 -0
  35. package/payload/lanes/site/server.py +314 -0
  36. package/payload/lanes/tokens/README.md +156 -0
  37. package/payload/lanes/tokens/generate.py +930 -0
  38. package/payload/lanes/tokens/generated/parity.v1.tsv +489 -0
  39. package/payload/lanes/tokens/generated/tokens.resolved.json +835 -0
  40. package/payload/lanes/tokens/tokens.v1.json +763 -0
  41. package/payload/lanes/tokens/tokens.v1.schema.json +143 -0
  42. package/payload/lanes/web/README.md +132 -4
  43. package/payload/lanes/web/directory.css +95 -0
  44. package/payload/lanes/web/directory.js +951 -0
  45. package/payload/lanes/web/generated/README.md +107 -0
  46. package/payload/lanes/web/generated/lanes2_protocol.d.mts +1162 -0
  47. package/payload/lanes/web/generated/lanes2_protocol.mjs +2333 -0
  48. package/payload/lanes/web/mobile.js +17 -21
  49. package/payload/lanes/web/tokens.css +137 -0
  50. package/payload/manifest.json +7 -4
@@ -0,0 +1,143 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "lanes/tokens/tokens.v1.schema.json",
4
+ "title": "Lanes semantic design tokens (lanes.tokens/1)",
5
+ "description": "One versioned semantic token source for every Lanes client (IC section 5.1, A26): roles, the theme id/revision shared across clients (each revision bound to a digest of its styling content), the five colour tiers (truecolor, 256, 16, palette16, none), glyph twins, labels, the text hierarchy, the semantic states with their no-colour cues, the contrast rules and the platform projections (CSS aliases, Zellij theme slots, docs roles, shell names). lanes/tokens/generate.py derives every client projection from it.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema", "source", "description", "theme", "roles", "painted_roles", "backgrounds", "vivid_tiers", "tiers", "glyph_modes", "glyphs", "labels", "text", "semantics", "contrast", "projections"],
9
+ "properties": {
10
+ "schema": {"const": "lanes.tokens/1"},
11
+ "source": {"type": "string", "minLength": 1},
12
+ "description": {"type": "string", "minLength": 1},
13
+ "theme": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "required": ["id", "revision", "revisions", "palette", "revision_note", "variants", "auto", "platform_names", "shared", "device_local"],
17
+ "properties": {
18
+ "id": {"type": "string", "pattern": "^[a-z][a-z0-9-]*$"},
19
+ "revision": {"type": "integer", "minimum": 1},
20
+ "revisions": {
21
+ "description": "Revision -> sha256 (hex) of that revision's styling content: this document without schema, source, description and theme, and without each tier's description, serialised as JSON with sorted keys, separators (',', ':') and UTF-8 text. The current revision's digest must match the content, so a styling change without a new revision fails, and two clients at one id/revision paint alike.",
22
+ "type": "object", "minProperties": 1,
23
+ "propertyNames": {"pattern": "^[1-9][0-9]*$"},
24
+ "additionalProperties": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
25
+ },
26
+ "palette": {"type": "string", "minLength": 1},
27
+ "revision_note": {"type": "string", "minLength": 1},
28
+ "variants": {"const": ["dark", "light"]},
29
+ "auto": {"type": "string", "minLength": 1},
30
+ "platform_names": {"type": "object", "additionalProperties": {"type": "object", "required": ["dark", "light"], "additionalProperties": {"type": "string"}}},
31
+ "shared": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
32
+ "device_local": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
33
+ }
34
+ },
35
+ "roles": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/role"}},
36
+ "painted_roles": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/role"}},
37
+ "backgrounds": {"type": "object", "additionalProperties": {"$ref": "#/$defs/role"}},
38
+ "vivid_tiers": {"type": "array", "uniqueItems": true, "items": {"enum": ["truecolor", "256"]}},
39
+ "tiers": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": ["truecolor", "256", "16", "palette16", "none"],
43
+ "properties": {
44
+ "truecolor": {
45
+ "type": "object", "additionalProperties": false, "required": ["kind", "description", "dark", "light"],
46
+ "properties": {"kind": {"const": "rgb-hex"}, "description": {"type": "string"},
47
+ "dark": {"$ref": "#/$defs/role_values"}, "light": {"$ref": "#/$defs/role_values"}}
48
+ },
49
+ "256": {
50
+ "type": "object", "additionalProperties": false, "required": ["kind", "description", "dark", "light"],
51
+ "properties": {"kind": {"const": "xterm-index"}, "description": {"type": "string"},
52
+ "dark": {"$ref": "#/$defs/xterm_indexes"}, "light": {"$ref": "#/$defs/xterm_indexes"}}
53
+ },
54
+ "16": {
55
+ "type": "object", "additionalProperties": false, "required": ["kind", "description", "sgr", "dim_roles", "dim_sgr"],
56
+ "properties": {"kind": {"const": "ansi-sgr"}, "description": {"type": "string"},
57
+ "sgr": {"type": "object", "additionalProperties": {"type": "string", "pattern": "^[0-9]+(;[0-9]+)*$"}},
58
+ "dim_roles": {"type": "array", "uniqueItems": true, "items": {"$ref": "#/$defs/role"}},
59
+ "dim_sgr": {"type": "object", "required": ["default"], "additionalProperties": {"type": "string", "pattern": "^[0-9]+$"}}}
60
+ },
61
+ "palette16": {
62
+ "type": "object", "additionalProperties": false, "required": ["kind", "description", "dark", "light", "slot_roles"],
63
+ "properties": {"kind": {"const": "defined-16-slot"}, "description": {"type": "string"},
64
+ "dark": {"$ref": "#/$defs/slots"}, "light": {"$ref": "#/$defs/slots"},
65
+ "slot_roles": {"type": "object", "propertyNames": {"pattern": "^([0-9]|1[0-5])$"}, "additionalProperties": {"$ref": "#/$defs/role"}}}
66
+ },
67
+ "none": {
68
+ "type": "object", "additionalProperties": false, "required": ["kind", "description", "bold"],
69
+ "properties": {"kind": {"const": "attributes-only"}, "description": {"type": "string"},
70
+ "bold": {"type": "array", "uniqueItems": true, "items": {"$ref": "#/$defs/role"}}}
71
+ }
72
+ }
73
+ },
74
+ "glyph_modes": {"const": ["unicode", "ascii", "emoji"]},
75
+ "glyphs": {
76
+ "type": "object",
77
+ "additionalProperties": false,
78
+ "required": ["agent", "stream", "marks", "economy"],
79
+ "properties": {"agent": {"$ref": "#/$defs/glyph_table"}, "stream": {"$ref": "#/$defs/glyph_table"},
80
+ "marks": {"$ref": "#/$defs/glyph_table"}, "economy": {"$ref": "#/$defs/glyph_table"}}
81
+ },
82
+ "labels": {"type": "object", "additionalProperties": {"type": "object", "additionalProperties": {"type": "string", "minLength": 1}}},
83
+ "text": {
84
+ "description": "The text hierarchy: the role each level of text paints (integrated cockpit section 5.1, text hierarchy).",
85
+ "type": "object", "additionalProperties": false, "required": ["primary", "secondary", "tertiary"],
86
+ "properties": {"primary": {"$ref": "#/$defs/role"}, "secondary": {"$ref": "#/$defs/role"}, "tertiary": {"$ref": "#/$defs/role"}}
87
+ },
88
+ "semantics": {
89
+ "description": "The semantic states every client shares (integrated cockpit section 5.1; terminal UX: selection, stale data, errors and disabled actions need text or shape as well as colour): each names the painted role it takes and the cues that carry it with colour removed (the none tier, NO_COLOR, a colour-blind reader): a glyph (its ASCII twin keeps it in ASCII mode), a label, or text (the lane name, the unavailable reason, the focus legend).",
90
+ "type": "object", "minProperties": 1,
91
+ "propertyNames": {"pattern": "^[a-z][a-z-]*$"},
92
+ "additionalProperties": {"$ref": "#/$defs/semantic"}
93
+ },
94
+ "contrast": {
95
+ "description": "Contrast rules, per variant: every foreground reference on every background reference of a rule keeps at least `min`:1 (WCAG relative luminance). A reference is `truecolor:<role>`, `256:<painted role>` (the fixed RGB of its xterm index) or `palette16:<slot>`.",
96
+ "type": "array", "minItems": 1, "items": {"$ref": "#/$defs/contrast_rule"}
97
+ },
98
+ "projections": {
99
+ "description": "The mappings tokens.py's renderers use beyond the role tables, so the CSS, Zellij KDL, docs CSS and shell projections can be rebuilt from this file alone.",
100
+ "type": "object",
101
+ "additionalProperties": false,
102
+ "required": ["css_aliases", "zellij_slots", "docs_roles", "sh_names"],
103
+ "properties": {
104
+ "css_aliases": {"type": "object", "minProperties": 1, "additionalProperties": {"$ref": "#/$defs/role"}, "description": "legacy --lanes-<alias> CSS names -> role"},
105
+ "zellij_slots": {"type": "object", "minProperties": 1, "additionalProperties": {"$ref": "#/$defs/role"}, "description": "Zellij --zj-<slot> theme slots -> role"},
106
+ "docs_roles": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/role"}, "description": "the roles the docs page CSS carries"},
107
+ "sh_names": {"type": "object", "minProperties": 1, "propertyNames": {"$ref": "#/$defs/role"}, "additionalProperties": {"type": "string", "pattern": "^LZ_[A-Z]+$"}, "description": "painted role -> the viewer's shell variable"}
108
+ }
109
+ }
110
+ },
111
+ "$defs": {
112
+ "role": {"type": "string", "pattern": "^[a-z][a-z0-9-]*$"},
113
+ "role_values": {"type": "object", "minProperties": 1, "propertyNames": {"$ref": "#/$defs/role"}, "additionalProperties": {"type": "string", "minLength": 1}},
114
+ "xterm_indexes": {"type": "object", "minProperties": 1, "propertyNames": {"$ref": "#/$defs/role"}, "additionalProperties": {"type": "integer", "minimum": 16, "maximum": 255}},
115
+ "slots": {"type": "array", "minItems": 16, "maxItems": 16, "items": {"type": "string", "pattern": "^#[0-9a-f]{6}$"}},
116
+ "glyph_table": {
117
+ "type": "object",
118
+ "minProperties": 1,
119
+ "additionalProperties": {
120
+ "type": "object", "additionalProperties": false, "required": ["unicode", "ascii", "tone"],
121
+ "properties": {"unicode": {"type": "string", "minLength": 1}, "ascii": {"type": "string", "minLength": 1, "pattern": "^[\\x20-\\x7e]+$"},
122
+ "tone": {"$ref": "#/$defs/role"}}
123
+ }
124
+ },
125
+ "semantic": {
126
+ "type": "object", "additionalProperties": false, "required": ["role", "cues"],
127
+ "properties": {"role": {"$ref": "#/$defs/role"}, "cues": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/cue"}}}
128
+ },
129
+ "cue": {
130
+ "type": "object", "minProperties": 1, "maxProperties": 1, "additionalProperties": false,
131
+ "properties": {"glyph": {"type": "string", "pattern": "^(agent|stream|marks|economy)\\.[a-z0-9_-]+$"},
132
+ "label": {"type": "string", "pattern": "^[a-z][a-z0-9_]*\\.[a-z0-9_-]+$"},
133
+ "text": {"enum": ["name", "reason", "legend"]}}
134
+ },
135
+ "colour_ref": {"type": "string", "pattern": "^((truecolor|256):[a-z][a-z0-9-]*|palette16:([0-9]|1[0-5]))$"},
136
+ "contrast_rule": {
137
+ "type": "object", "additionalProperties": false, "required": ["fg", "bg", "min"],
138
+ "properties": {"fg": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/colour_ref"}},
139
+ "bg": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/colour_ref"}},
140
+ "min": {"type": "number", "minimum": 1, "maximum": 21}}
141
+ }
142
+ }
143
+ }
@@ -251,14 +251,133 @@ inside its own bytes — its line-1 pointer comment moved to Code notes below an
251
251
  `onkeydown` property — 3 334 -> 3 318 B MEASURED, so the laptop/tablet download is 24 747 + 3 318 = 28 065 B and the
252
252
  DEF-1569 ratchet rose by the 135 `mobile.js` bytes net of those 16, to that measured size.
253
253
 
254
- | File | Cap | MEASURED 2026-10-08 (`wc -c`) | Bound by |
254
+ The Lanes 2.0 lane directory (fan-out F3, 2026-10-30; [Lane directory](#lane-directory-lanes-20-fan-out-f3) below) put
255
+ its on-demand loader into `mobile.js` without moving any budget: the 218 B loader was paid inside the file with
256
+ equivalent code — `make()` as one expression that also types every button it makes (`type="button"`, which four call
257
+ sites had set by hand and three buttons outside any form had left at the default), one `finder()` for the two search
258
+ fields, three listener bodies without braces — so `mobile.js` MEASURED 24 728 B with `wc -c` (dev-container profile),
259
+ 19 B under its unchanged 24 747 B cap. The review round then made the loader exact (`#lanes`, or `#lane=` and nothing
260
+ else that starts `#lane`) and gave it a flag of its own, so a second navigation before `directory.js` ran appends
261
+ nothing: 4 B less, 24 724 B MEASURED, and the laptop/tablet download 24 724 + 3 318 = 28 042 B, under its unchanged
262
+ ratchet. No cap in `test_web_view` changed. The directory's own files are fetched only when it opens and are bound by
263
+ caps of their own in `tests/unit/test_web_directory.py`.
264
+
265
+ | File | Cap | MEASURED (`wc -c`) | Bound by |
255
266
  | --- | --- | --- | --- |
256
- | `mobile.js` | 24 747 B (exact) | 24 747 B | spec §8 phone row, `test_web.test_bundle_growth`, `test_web_view` `JS_DOCS` |
267
+ | `mobile.js` | 24 747 B | 24 724 B (2026-10-30, F3) | spec §8 phone row, `test_web.test_bundle_growth`, `test_web_view` `JS_DOCS` |
257
268
  | `mobile.css` | 18 982 B | 18 945 B | spec §8 phone row |
258
269
  | `browser.js` | 4 096 B | 3 318 B | `test_web_view.BROWSER_JS_CAP` |
259
270
  | `browser.css` | 2 048 B | 1 947 B | `test_web_view.BROWSER_CSS_CAP` |
260
- | `mobile.js` + `browser.js` | 28 065 B (exact) | 28 065 B | DEF-1569, `LAPTOP_TABLET_JS_RATCHET` |
271
+ | `mobile.js` + `browser.js` | 28 065 B | 28 042 B (2026-10-30, F3) | DEF-1569, `LAPTOP_TABLET_JS_RATCHET` |
261
272
  | `mobile.css` + `browser.css` | 20 993 B | 20 892 B | DEF-1569's CSS twin, `LAPTOP_TABLET_CSS_CAP` |
273
+ | `directory.js` (on demand) | 60 239 B (exact) | 60 239 B (2026-10-30) | `test_web_directory.DIRECTORY_JS_CAP` |
274
+ | `directory.css` (on demand) | 7 394 B (exact) | 7 394 B (2026-10-30) | `test_web_directory.DIRECTORY_CSS_CAP` |
275
+
276
+ ## Lane directory (Lanes 2.0, fan-out F3)
277
+
278
+ `directory.js` and `directory.css` are the browser's view of the one lane directory every Lanes client shows
279
+ ([integrated cockpit §5.1](../../docs/superpowers/specs/2026-10-25-lanes-2.0.0-integrated-cockpit.md#51-one-lane-directory-and-one-client-experience);
280
+ witnesses A24-A27). Status: the directory surface is built and tested against fixtures, the Day-0 goldens and the frozen
281
+ schemas; **not connected** and **no entry point yet**. No host serves a directory source (the principal-scoped directory
282
+ operation is fan-out lane E7's, the projector B9's), so on every host today it opens and says "Not connected"; and
283
+ nothing on the page links to it yet (the phone picker, the tablet workspace panel and the desktop Lanes chip still lead
284
+ to their own surfaces), so it opens only from a typed `#lanes` or a resume link. E32/E33 (continuous workspace §21) are
285
+ therefore not yet "migrated with parity": the entry points, and the parity manifest rows naming this suite, are open
286
+ items (below).
287
+
288
+ - **Loaded on demand.** `index.html` never lists it. `mobile.js` appends `/lanes-assets/directory.js` once (a flag of
289
+ the loader's own) only when the page's fragment is exactly `#lanes` or starts `#lane=` (a resume link), at load or on
290
+ `hashchange`, in all three modes (the loader runs before the desktop shell returns); the script then appends
291
+ `directory.css` itself. A phone that never opens it downloads exactly what it did before.
292
+ - **Two halves, one renderer.** `laneDirectory(input)` is the conformance kit's evaluation (`lanes/tests/conformance`):
293
+ rows keyed by the authority-qualified identity, relayed and direct copies collapsed to the newest source revision,
294
+ two different documents at one revision refused, the highest preference revision applied, an unrecorded theme
295
+ refused; sections, order, labels, counts and action reasons as `libexec/sidebar.py` draws them. The node suite replays
296
+ every kit fixture through it, in every arrival order. The **page** draws the owner's `LaneDirectoryProjection`
297
+ (`crates/lanes-protocol` `contracts/directory.rs`; `docs/contracts/lanes2/schema`) as delivered: the owner's rows in
298
+ the owner's order and sections, its labels, and its action availability and reason words, never re-derived here.
299
+ The suite feeds the page what the owner would send for each kit fixture (the kit's evaluation as Day-0 rows) and
300
+ requires the kit's rows, sections and reasons on screen in all three modes, and decodes and draws the Day-0 goldens.
301
+ - **Three geometries.** The phone picker fills the screen, the tablet panel is a left column, the desktop overlay hangs
302
+ below the Lanes chip; `<html data-lanes-shell>` picks the class and nothing else. Every row names its lane, state word
303
+ and workspace (`aria-label`) and shows the state glyph in its token tone, so state is never colour alone. The state
304
+ is the row's `style_token` when it names a token state, otherwise its attention (approval, actionable error, input)
305
+ or activity (working, delegating, waiting for a build or capacity: Working; finished: Done). The terminal's tab state
306
+ is never read (A25).
307
+ - **Keyboard.** The directory is a modal dialog (`role="dialog"`, `aria-modal`). Opened on a tablet or a desktop, where
308
+ the Zellij terminal had the keyboard, it takes it (the selected row, else the first, else Close); a redraw keeps it
309
+ on the same control (`data-focus`), or on Close if that control went away; Escape closes; closing on a desktop gives
310
+ the terminal its keys back. A phone's picker opens no keyboard.
311
+ - **Visible filter, counts, empty states.** The workspace filter offers the boards of the delivered rows (the lane's
312
+ authority with its workspace and memberships); a filtered view is titled and chipped with the board's name and clears
313
+ back to All lanes. The page subscribes to All lanes and filters locally, because the Day-0 `DirectoryFilter` names
314
+ workspaces without their authority. The header counts the drawn lanes, Needs you, Working and hidden lanes. Not
315
+ connected, loading, refused (the host's words), no lanes and an emptied filter are separate, worded states.
316
+ - **Stale, incomplete, read horizon (A27).** A row whose source is `stale` or `unknown` is kept, marked stale, and the
317
+ directory says it is incomplete: unavailability is not removal. Past a known read horizon those rows go, and the page
318
+ says why; one directory-wide timer redraws at that horizon (never one per lane). A delivery that cannot be read, or a
319
+ resync, replaces nothing: the rows already read stay, all marked stale, still bound by the same horizon, and no
320
+ action is taken on them. Day-0 has no read-horizon field, so the horizon arrives in a provisional frame (below).
321
+ - **Tokens.** `directory.css` opens with the current theme's roles from `lanes/tokens/tokens.v1.json` (truecolor,
322
+ dark and light under `data-zj-theme`; theme lanes/3 since the group F fan-in), re-rendered and compared by the node
323
+ suite, whose block header names the source's current revision; outside that block it paints by role only.
324
+ `LANES_DIRECTORY_TOKENS` in `directory.js` carries the theme, the agent glyphs, ASCII twins, tones and the phone's
325
+ labels, also compared with the JSON. Neither loads F1's generated `web/tokens.css` yet: F1's generator taking both
326
+ projections over is open.
327
+ - **Device-local and shared.** Density and glyph mode (device appearance overrides), and this device's filter,
328
+ selection and scroll, live in `localStorage` under `lanes:directory:` (the place keys per principal); Show hidden is
329
+ for this page only. Pins and hidden lanes are never stored here: Pin, Hide and Unhide send the frozen
330
+ `PreferencesUpdate` (`v`, `expected_revision` and the whole current content with one list changed; hiding a pinned
331
+ lane unpins it, since a lane is never both) to the preference owner (fan-out F5), and only its answer and the next
332
+ document change the rows. An answer carrying another device's change says so.
333
+ - **Hidden lanes.** The header counts them and **Show hidden (n)** draws them faint: in their places when the owner
334
+ sends their rows, otherwise by identity under Hidden, but only on a board the directory shows and never one whose
335
+ access was revoked. A hidden lane offers Open and **Unhide**. As in the sidebar, hiding the selected lane takes it
336
+ out of the list, with a word on how to bring it back.
337
+ - **Native actions.** Open and Close send the frozen `Command` envelope to the lane's owner: a fresh operation id and
338
+ request id, the transport's protocol and retry epochs, the target identity, the owner epoch, the native generation and
339
+ the row revision the person saw (D06). A close asks first, and the armed confirmation holds only for the generation
340
+ it was armed for: a new generation, selecting another lane or any other action voids it. A receipt's refusal shows the
341
+ owner's words. Both stay unavailable ("Waiting for this lane's owner") until a `directory_row` event has carried the
342
+ lane's owner epoch, because the row has none.
343
+ - **Resume links.** `#lane=<encoded identity>`, in lanes-core's identity grammar (authority a token of at most 64 B,
344
+ workspace and lane identifiers of at most 128 B, upper case and a leading underscore included), opens the directory on
345
+ that lane. It moves no other device's focus, sends no input or resize and attaches nothing. While the directory is
346
+ incomplete a link waits for its lane; once complete, a lane that is not there is said once and forgotten, and no
347
+ saved selection survives it. Back, or closing and reopening, restores this device's filter, selection and scroll.
348
+ - **Revocation and account change (A27, QI-13).** Subscription callbacks are bound to their subscription, action
349
+ answers to the authority (principal, authorization epoch, runtime, schema) and to their one request. A new
350
+ authorization epoch is compared with what the old one could read: a lane or board it no longer carries is revoked,
351
+ not lost, so no tombstone names it and no filter, selection, saved place or answer of it survives.
352
+ `resync{authorization_changed}` takes every row off the screen and subscribes again; `directory_row_removed` with
353
+ `access_revoked` purges that lane the same way. A principal change purges the old principal's saved place and
354
+ subscribes again, and the first principal of a page load purges every other principal's saved place. An older
355
+ authorization epoch is dropped. A source that delivers inside `subscribe()` leaves exactly one live subscription.
356
+ - **Source port** (`window.lanesDirectorySource`, or `lanesDirectory.connect(source)`; wired by the E7 gateway):
357
+ `subscribe(onFrame) -> cancel`, delivering the Day-0 frames `{frame: 'snapshot'|'event'|'resync'|'refused', body}`
358
+ (paged snapshots reassembled as `crates/lanes-protocol` `snapshot.rs` describes: same request, stream, epoch and
359
+ cursor, contiguous delivery sequence, counts equal to the rows; an event's sequence continues the snapshot's, a gap
360
+ subscribes again) plus two provisional frames, `{frame: 'preferences', body: PrincipalPresentationPreferences}` and
361
+ `{frame: 'read_horizon', body: {authorization_epoch, read_until_unix_ms}}`; `updatePreferences(PreferencesUpdate)`
362
+ and `command(Command)`, each answering a frame (`receipt`, `refused` or `preferences`); and the transport's
363
+ negotiated `protocol_epoch` and `retry_epoch`. The page makes no request of its own.
364
+ - **Day-0 gaps (integrator requests, recorded in the PR).** No frame kind carries the preference document or its update
365
+ (Z3, F5); `CommandPayload` has no `attach` or `close` kind although rows name both actions (Z3; the page sends
366
+ `{kind: <the row's action name>, args: {}}`); neither the row nor `NativeBindingRef` carries the owner epoch a Command
367
+ must name (Z3); `ProjectionScope` and `SourceCursorEntry` carry no read horizon (Z3); `DirectoryFilter` names workspaces
368
+ without their authority (Z3, B9); whether the projection carries hidden rows is unspecified, and a board whose lanes
369
+ are all hidden cannot be unhidden here until it does (B9); no frame says the principal is denied the directory (Z3);
370
+ `style_token`'s vocabulary is not frozen (Z3, F1); the kit's identity pattern is lower case only, narrower than
371
+ lanes-core (F2); the parity manifest's E32/E33 rows name no owner module or test (G1).
372
+ - **Brand scan.** `lanes/web` carries no occurrence of the retired brand term before or after this change (`grep -ci`
373
+ is 0 for every file) and the brand baseline records none there, so the rebuilt `mobile.js` needs no policy wave.
374
+ - Tests: `tests/web/directory.test.mjs` (the kit, tokens, the owner's projection in three modes, the Day-0 goldens and
375
+ schemas, filter, states, stale and read horizon, malformed deliveries, device-local and the shared documents, hidden
376
+ lanes, links, revocation, resync, account change, subscriptions, actions, close, keyboard, the loader; every test has
377
+ at least one sabotage leg, LEGS, a broken copy its detector must catch), `tests/unit/test_web_directory.py` (budget
378
+ rows, the single load point, no request and one timer, the suite's test names and leg count),
379
+ `tests/web/prove_directory.sh` (budget, timer and loading legs on edited copies, and the suite failing on the tree
380
+ before F3; run in the lane's managed job).
262
381
 
263
382
  ## Docs page (plan W10 W6, LNS-107)
264
383
 
@@ -316,12 +435,21 @@ order.
316
435
  - The file: the Lanes browser shell (phone, tablet, desktop) over the pinned Zellij 0.45.1 client's window hooks. Its
317
436
  explanations are these notes (the file's line-1 pointer to them moved here too, W9 V3).
318
437
  - `root.dataset.lanesShell = mode`: read by `browser.js` for the desktop bar and the tablet's full rendering.
319
- - `if (mode !== 'phone')`: appends the laptop/tablet extras (`browser.css`, `browser.js`); a phone never fetches them.
438
+ - `add()` / `if (mode !== 'phone')`: appends the laptop/tablet extras (`browser.css`, `browser.js`); a phone never
439
+ fetches them. `add` serves every mode since F3.
440
+ - `dir()`: the lane directory's on-demand loader (see Lane directory): `directory.js` once, when the fragment is
441
+ exactly `#lanes` or starts `#lane=` (`/^#lane(s$|=)/`, so `#laneboard` or `#lane` load nothing), at load and on
442
+ `hashchange`, before the desktop shell returns. `d` is the loader's own once flag, set as `add()`'s ignored third
443
+ argument, so a second navigation before `directory.js` has run appends no second script. `globalThis` and `?.` keep
444
+ it silent on a page without `location` or `addEventListener` (the node suites' bare pages).
320
445
  - `if (mode === 'tablet')`: iPad Safari's user agent is a desktop one, so the shell asks for the client's mobile UI
321
446
  (`zellij:mobile-ui` set to `on`); a stored `off` stays.
322
447
  - The `HTMLElement.prototype.focus` guard: only a native tap on an input may open the keyboard; it is installed before
323
448
  upstream's first terminal or modal.
449
+ - `make()`: one element; a button is always `type="button"` (F3 paid for the directory loader with this and
450
+ `finder()`).
324
451
  - `kbd()` / `aria()`: `window.__zjSoftKbdCapture` and an `aria-label` setter, shared to keep the phone budget.
452
+ - `finder()`: a search field (no autocomplete or spellcheck) with its label — the workspace search and the lane filter.
325
453
  - `viewport()`: browser toolbars alone must not mean keyboard mode (`occluded` needs more than 120 px hidden). Zellij's
326
454
  input is in a closed shadow root, so `document.activeElement` is its host; `__zjSoftKbdCapture.isFocused` is read
327
455
  first.
@@ -0,0 +1,95 @@
1
+ /* BEGIN lanes tokens (theme lanes/3 from lanes/tokens/tokens.v1.json; tests/web/directory.test.mjs re-renders it) */
2
+ .lanes-directory {
3
+ color-scheme: dark;
4
+ --lanes-surface: #101318;
5
+ --lanes-surface-raised: #191e25;
6
+ --lanes-line: #2c333d;
7
+ --lanes-accent-wash: #1c3326;
8
+ --lanes-accent-line: #4b6955;
9
+ --lanes-press: #26332c;
10
+ --lanes-chip: #ffffff0f;
11
+ --lanes-ink: #f2f5f8;
12
+ --lanes-ink-dim: #a6b1be;
13
+ --lanes-ink-faint: #6f7a87;
14
+ --lanes-accent: #8fe3a6;
15
+ --lanes-on-accent: #101318;
16
+ --lanes-on-accent-urgent: #7a1a12;
17
+ --lanes-tone-urgent: #ff7b6e;
18
+ --lanes-tone-attention: #ffc233;
19
+ --lanes-tone-working: #6fb6ff;
20
+ --lanes-tone-done: #5fdc8a;
21
+ --lanes-scrim: #000000a6;
22
+ --lanes-shadow: 0 -16px 80px #0007;
23
+ }
24
+ :root[data-zj-theme="light"] .lanes-directory {
25
+ color-scheme: light;
26
+ --lanes-surface: #f3f5f2;
27
+ --lanes-surface-raised: #ffffff;
28
+ --lanes-line: #d5ded6;
29
+ --lanes-accent-wash: #e5f0e6;
30
+ --lanes-accent-line: #acc9b4;
31
+ --lanes-press: #d8e9db;
32
+ --lanes-chip: #edf3ec;
33
+ --lanes-ink: #111a14;
34
+ --lanes-ink-dim: #4a5661;
35
+ --lanes-ink-faint: #6f7b87;
36
+ --lanes-accent: #1f6f3f;
37
+ --lanes-on-accent: #ffffff;
38
+ --lanes-on-accent-urgent: #ffd3cc;
39
+ --lanes-tone-urgent: #c41c1c;
40
+ --lanes-tone-attention: #a04d00;
41
+ --lanes-tone-working: #1a56c4;
42
+ --lanes-tone-done: #0d7338;
43
+ --lanes-scrim: #1a222b80;
44
+ --lanes-shadow: 0 -16px 80px #0003;
45
+ }
46
+ /* END lanes tokens */
47
+ /* Lanes 2.0 lane directory (fan-out F3; integrated cockpit §5.1). Loaded with directory.js, on demand; never by
48
+ index.html. One renderer, three geometries: the phone picker fills the screen, the tablet panel is a left column,
49
+ the desktop overlay hangs below the Lanes chip. Colour by token role only; state is never colour alone. */
50
+ .lanes-directory { position: fixed; z-index: 900; display: flex; flex-direction: column; gap: 8px; box-sizing: border-box; overflow: hidden; padding: 12px 14px; background: var(--lanes-surface-raised); color: var(--lanes-ink); font: 15px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; }
51
+ .lanes-directory[hidden] { display: none; }
52
+ .lanes-directory-phone { inset: 0; padding: calc(12px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(14px + env(safe-area-inset-left, 0px)); }
53
+ .lanes-directory-tablet { top: 0; bottom: 0; left: 0; width: min(420px, 85vw); border-right: 1px solid var(--lanes-line); padding-left: calc(14px + env(safe-area-inset-left, 0px)); }
54
+ .lanes-directory-desktop { top: 34px; right: 8px; width: min(420px, calc(100vw - 16px)); max-height: calc(100vh - 48px); border: 1px solid var(--lanes-line); border-radius: 10px; font-size: 13px; }
55
+ .lanes-directory button, .lanes-directory select { font: inherit; color: inherit; }
56
+ .lanes-directory :focus-visible { outline: 2px solid var(--lanes-accent); outline-offset: 2px; }
57
+ .lanes-directory-head { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; }
58
+ .lanes-directory-head h2 { margin: 0; font-size: 1.15em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
59
+ .lanes-directory-count { grid-column: 1; margin: 0; color: var(--lanes-ink-dim); font-size: .87em; }
60
+ .lanes-directory-close { grid-row: 1 / span 2; grid-column: 2; min-width: 44px; min-height: 44px; border: 0; border-radius: 22px; background: var(--lanes-chip); font-size: 1.4em; cursor: pointer; }
61
+ .lanes-directory-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
62
+ .lanes-directory-pick { min-height: 36px; max-width: 100%; border: 1px solid var(--lanes-line); border-radius: 8px; background: var(--lanes-surface); padding: 0 8px; }
63
+ .lanes-directory-chip { padding: 2px 8px; border: 1px solid var(--lanes-accent-line); border-radius: 12px; background: var(--lanes-accent-wash); }
64
+ .lanes-directory-clear, .lanes-directory-dismiss, .lanes-directory-toggle, .lanes-directory-act { min-height: 36px; padding: 0 10px; border: 1px solid var(--lanes-line); border-radius: 8px; background: var(--lanes-surface); cursor: pointer; }
65
+ .lanes-directory-notice, .lanes-directory-empty { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--lanes-surface); color: var(--lanes-ink-dim); }
66
+ .lanes-directory-notice.is-stale { color: var(--lanes-tone-attention); }
67
+ .lanes-directory-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
68
+ .lanes-directory-section { margin: 12px 0 4px; color: var(--lanes-ink-dim); font-size: .8em; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
69
+ .lanes-directory-section.is-needs { color: var(--lanes-tone-attention); }
70
+ .lanes-directory-section.is-working { color: var(--lanes-tone-working); }
71
+ .lanes-directory-section.is-done { color: var(--lanes-tone-done); }
72
+ .lanes-directory-row { border-radius: 8px; }
73
+ .lanes-directory-pick-row { display: grid; grid-template-columns: 1.4em 1fr auto auto; grid-template-areas: "glyph name state mark" "glyph where where where"; align-items: baseline; gap: 0 8px; width: 100%; min-height: 48px; padding: 6px 8px; border: 0; background: none; text-align: left; cursor: pointer; }
74
+ .lanes-directory[data-density="compact"] .lanes-directory-pick-row { min-height: 32px; padding: 2px 8px; }
75
+ .lanes-directory-row.is-selected { background: var(--lanes-accent-wash); }
76
+ .lanes-directory-row.is-selected .lanes-directory-pick-row { border-left: 3px solid var(--lanes-accent); padding-left: 5px; }
77
+ .lanes-directory-glyph { grid-area: glyph; font-weight: 700; }
78
+ .lanes-directory-name { grid-area: name; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
79
+ .lanes-directory-where { grid-area: where; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--lanes-ink-faint); font-size: .85em; }
80
+ .lanes-directory-state { grid-area: state; color: var(--lanes-ink-dim); font-size: .85em; }
81
+ .lanes-directory-mark { grid-area: mark; color: var(--lanes-accent); }
82
+ .lanes-directory-mark.is-stale, .lanes-directory-row.is-stale .lanes-directory-name { color: var(--lanes-ink-faint); }
83
+ .lanes-directory-row.is-hidden .lanes-directory-name, .lanes-directory-row.is-hidden .lanes-directory-state { color: var(--lanes-ink-faint); font-style: italic; }
84
+ .lanes-directory-row[data-tone="tone-urgent"] .lanes-directory-glyph { color: var(--lanes-tone-urgent); }
85
+ .lanes-directory-row[data-tone="tone-attention"] .lanes-directory-glyph { color: var(--lanes-tone-attention); }
86
+ .lanes-directory-row[data-tone="tone-working"] .lanes-directory-glyph { color: var(--lanes-tone-working); }
87
+ .lanes-directory-row[data-tone="tone-done"] .lanes-directory-glyph { color: var(--lanes-tone-done); }
88
+ .lanes-directory-row[data-tone="ink-dim"] .lanes-directory-glyph { color: var(--lanes-ink-dim); }
89
+ .lanes-directory-detail { display: grid; gap: 6px; padding: 4px 8px 10px 30px; }
90
+ .lanes-directory-facts { margin: 0; color: var(--lanes-ink-faint); font-size: .8em; overflow-wrap: anywhere; }
91
+ .lanes-directory-link { color: var(--lanes-accent); }
92
+ .lanes-directory-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
93
+ .lanes-directory-act:disabled { color: var(--lanes-ink-faint); cursor: not-allowed; }
94
+ .lanes-directory-reason { color: var(--lanes-ink-dim); font-size: .8em; }
95
+ .lanes-directory-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--lanes-ink-faint); font-size: .8em; }