@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,107 @@
1
+ # Lanes 2.0 browser decoders (generated)
2
+
3
+ <!-- GENERATED by crates/lanes-protocol/src/schema/codegen.rs from docs/contracts/lanes2/schema (sha256:8770ee3de77611ab0ae32f07efd29a6e9640a86292954de263a91f83cf8ad35c). Do not edit; regenerate with `LANES2_DECODERS_BLESS=1 cargo test -p lanes-protocol --lib schema::codegen` in a managed build job. -->
4
+
5
+ Generated from the 21 exported Lanes 2.0 wire schemas in `docs/contracts/lanes2/schema` by `crates/lanes-protocol/src/schema/codegen.rs` (fan-out lane A5; RT decision D03 and section 12.1). `lanes/web` stays JavaScript: the decoders are a plain ES module and their types are TypeScript declarations that browser code consumes through JSDoc. Only generated files live here; they ship in the Lanes payload.
6
+
7
+ | File | Content |
8
+ | --- | --- |
9
+ | `lanes2_protocol.mjs` | Generated: one decoder per document (`decodeCommand`, `decodeReceipt`, ...), the bounded strict JSON reader, `encode`, `DOCUMENTS`, `SCHEMA_DIGEST`. |
10
+ | `lanes2_protocol.d.mts` | Generated: 141 types (92 objects, 4 tagged unions, 45 enumerations). |
11
+
12
+ The decode tests are `lanes/tests/web/lanes2_protocol.test.mjs` (hand-written; the Lanes unit job runs them through `lanes/tests/unit/test_web_view.py`, or run `node --test lanes/tests/web/lanes2_protocol.test.mjs`). They decode every golden fixture of `crates/lanes-protocol/tests/fixtures/lanes2`, read at run time, against the verdicts of the refused ones in `crates/lanes-protocol/src/schema/codegen/fixture-verdicts.json` (generated beside the generator).
13
+
14
+ ## What a decoder checks
15
+
16
+ Before parsing: at most 1 MiB and 32 nesting levels (the Rust `limits::check_frame`). The reader is strict JSON: valid UTF-8, no lone surrogate escape, no raw control character in a string, no duplicate key, no trailing characters; integers stay exact (`bigint` where the schema allows more than 2^53 - 1). Then the exported schema exactly: required and unknown members, types, constants, enumerations, string length in characters and UTF-8 bytes, the token/text/digest alphabets, list bounds, integer bounds and tagged unions. Only the handshake (`hello`) is tolerant: a newer peer's unknown members are dropped.
17
+
18
+ ## Where it is stricter than serde
19
+
20
+ Inside the members the handshake ignores, serde checks neither a duplicate unknown key, a lone surrogate escape nor invalid UTF-8; this reader refuses all three as `syntax`. No Rust peer emits any of them. The verdict manifest pins each case (`divergences`): the Rust decoder accepts it and these decoders refuse it.
21
+
22
+ ## What it does not check
23
+
24
+ The `Validate` refusals of the Rust decoders are not expressed in the exported schema and are not generated. A document refused only by one of them passes these decoders; the decode tests pin that set fixture by fixture, so the structural decoders are never laxer than serde on the corpus.
25
+
26
+ (a) Single-field bounds the exported schema could express with `minimum`/`maximum` but does not, so these decoders accept a value the host refuses. Request to the protocol owner (Z3): tighten these `WireSchema` impls; each fixture then moves from `rule` to `schema` with no generator change.
27
+
28
+ - `command` `/payload/args/cols`: minimum 1 (`refused/command/resize-zero.json`: resize to a zero dimension)
29
+ - `command` `/remaining_deadline_ms`: minimum 1 (`refused/command/deadline-zero.json`: command deadline already expired)
30
+ - `event` `/delivery_sequence`: minimum 1 (`refused/event/sequence-zero.json`: delivery sequences start at 1)
31
+ - `hello` `/protocol_epoch`: minimum 1 (`refused/hello/epoch-zero.json`: protocol epochs start at 1)
32
+ - `hello` `/replay_horizon/max_events`: minimum 1 (`refused/hello/horizon-zero.json`: replay horizon with a zero bound retains nothing)
33
+ - `message_create_payload` `/ttl_s`: maximum 9007199254740991 (`refused/message_create_payload/ttl-out-of-range.json`: a message time-to-live outside the canonical integer range)
34
+ - `message_create_payload` `/ttl_s`: minimum 1 (`refused/message_create_payload/ttl-zero.json`: a message time-to-live of zero is already expired)
35
+ - `receipt` `/outcome/detail/last_observed_navigation_step`: minimum 1 (`refused/receipt/step-zero.json`: navigation steps are numbered from 1)
36
+ - `retry_horizon` `/tombstone_retention_ms`: minimum 1 (`refused/retry_horizon/zero-tombstones.json`: a zero tombstone retention keeps no anti-replay evidence)
37
+ - `snapshot` `/delivery_sequence`: minimum 1 (`refused/snapshot/sequence-zero.json`: delivery sequences start at 1)
38
+ - `subscribe` `/page_limit`: minimum 1, maximum 500 (`refused/subscribe/page-limit-501.json`: page limit outside 1..=500)
39
+
40
+ (b) Cross-field rules (a port to these decoders is open):
41
+
42
+ - `adapter_capability`: an adapter cannot answer prompts it cannot observe
43
+ - `adapter_capability`: an answering adapter must accept at least one option
44
+ - `command`: a native-session command must name its expected native generation
45
+ - `command`: a revision-checked command must name its expected revision
46
+ - `event`: a prompt event's target generation must equal the prompt's generation
47
+ - `event`: a prompt without options cannot be answered
48
+ - `event`: duplicate prompt assurance
49
+ - `event`: duplicate prompt option id
50
+ - `execution_binding`: a derived request cannot name itself as its parent
51
+ - `execution_binding`: a derived request has depth at least 1
52
+ - `execution_binding`: a derived request must name its parent run; absent lineage expands nothing
53
+ - `execution_binding`: a request below the root is not its own root
54
+ - `execution_binding`: allowed routes and models are explicit allow-lists, never empty
55
+ - `execution_binding`: an execution binding needs a horizon
56
+ - `execution_binding`: an initial request has no parent and depth 0
57
+ - `execution_binding`: an initial request's run is its own root
58
+ - `execution_binding`: the acting lane belongs to the binding's workspace
59
+ - `frame_refusal`: an epoch change ends the connection; it answers no request
60
+ - `hello`: a client hello carries no protocol epoch; the host owns it
61
+ - `hello`: a host hello must announce its protocol epoch
62
+ - `hello`: capability advertised twice
63
+ - `hello`: capability advertised with neither send nor receive
64
+ - `hello`: capability min_version exceeds max_version
65
+ - `lane_directory_projection`: a lane appears once per directory, keyed by stable identity
66
+ - `lane_directory_projection`: a projection with a stale or unknown source cannot claim completeness
67
+ - `lane_directory_projection`: the total count is smaller than the page
68
+ - `lane_directory_row`: Needs you requires an explicit question, approval or actionable error
69
+ - `lane_directory_row`: a directory row needs at least one membership
70
+ - `lane_directory_row`: a lane is a member of the workspace that minted its id
71
+ - `lane_directory_row`: an action is listed twice on a row
72
+ - `lane_directory_row`: an unavailable action must say why
73
+ - `operation_tombstone`: an accepted operation's tombstone keeps the owner reference
74
+ - `operation_tombstone`: an operation refused before custody has no owner reference
75
+ - `operation_tombstone`: an unresolved outcome is never evicted into a tombstone
76
+ - `owner_operation_receipt`: a final work outcome cannot also be unknown
77
+ - `owner_operation_receipt`: a receipt cannot claim an effect without known custody
78
+ - `owner_operation_receipt`: accepted custody names the owner's operation
79
+ - `owner_operation_receipt`: an operation outside custody has no effect and no uncertainty
80
+ - `owner_operation_receipt`: an unknown custody outcome cannot be certain
81
+ - `owner_operation_receipt`: no owner operation exists for a refused or unknown custody outcome
82
+ - `owner_operation_receipt`: recovery by operation id names the caller's operation id
83
+ - `owner_operation_receipt`: recovery by owner reference needs that owner reference
84
+ - `preferences_update`: a lane cannot be both pinned and hidden
85
+ - `principal_presentation_preferences`: a lane cannot be both pinned and hidden
86
+ - `principal_presentation_preferences`: a preference set lists a lane twice
87
+ - `receipt`: a definite navigation names its last positively observed step
88
+ - `receipt`: a merely possible navigation has no positively observed step
89
+ - `receipt`: a possible submission or holder acceptance means submission possibly started
90
+ - `receipt`: a receipt past refusal must name when custody became durable
91
+ - `receipt`: a refused receipt has no durable custody
92
+ - `receipt`: an unresolved receipt requires revalidation before a new operation
93
+ - `receipt`: partial input means submission definitely did not start; otherwise the outcome is unknown
94
+ - `receipt`: the effect certainty contradicts the receipt state
95
+ - `receipt`: the outcome contradicts the receipt state
96
+ - `retry_horizon`: oldest accepted retry epoch is after the current one
97
+ - `retry_horizon`: tombstones must outlive detailed receipts, or an expired id could look new
98
+ - `runtime_binding`: a capability is negotiated at most once
99
+ - `snapshot`: a snapshot page names its next page until the last, and only the last carries the resume token
100
+ - `source_update`: complete coverage cannot name missing parts
101
+ - `subscribe`: a filter lists a workspace or project twice
102
+
103
+ Corpus: 91 refused fixtures: 19 refused by the schema, 0 not strict JSON, 0 refused before parsing, 72 refused only by a `Validate` rule (11 of them by a single-field bound the schema could express).
104
+
105
+ ## Drift
106
+
107
+ The generated files are never edited. `cargo test -p lanes-protocol --lib schema::codegen` regenerates them and fails on any difference, missing file or stale file (`LANES2_DECODERS_BLESS=1` rewrites them, in a managed build job). The node tests recompute `SCHEMA_DIGEST` from the committed schema files, so regenerated schemas without regenerated decoders fail there too. An added accepted fixture changes no generated file; an added refused fixture needs a re-bless in the same commit. Data-model row: DM-LANES2-A5-DECODERS.