letify 2.11.4__tar.gz → 2.11.5__tar.gz

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 (317) hide show
  1. {letify-2.11.4 → letify-2.11.5}/PKG-INFO +1 -1
  2. {letify-2.11.4 → letify-2.11.5}/docs/SPEC.md +4 -2
  3. {letify-2.11.4 → letify-2.11.5}/letify/__init__.py +1 -1
  4. {letify-2.11.4 → letify-2.11.5}/letify/transport/linkchannel.py +17 -0
  5. {letify-2.11.4 → letify-2.11.5}/letify/transport/linkshim.py +1 -1
  6. {letify-2.11.4 → letify-2.11.5}/letify/transport/linksignal.py +9 -1
  7. {letify-2.11.4 → letify-2.11.5}/letify-core/Cargo.lock +3 -3
  8. {letify-2.11.4 → letify-2.11.5}/letify-core/Cargo.toml +1 -1
  9. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/punch.rs +10 -0
  10. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/sidecar.rs +15 -12
  11. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/sidecar.rs +79 -9
  12. {letify-2.11.4 → letify-2.11.5}/letify-ext/package-lock.json +2 -2
  13. {letify-2.11.4 → letify-2.11.5}/letify-ext/package.json +1 -1
  14. {letify-2.11.4 → letify-2.11.5}/pyproject.toml +1 -1
  15. {letify-2.11.4 → letify-2.11.5}/tests/test_link_channel.py +14 -0
  16. {letify-2.11.4 → letify-2.11.5}/tests/test_link_command_channel.py +31 -0
  17. {letify-2.11.4 → letify-2.11.5}/tests/test_link_signal.py +4 -0
  18. {letify-2.11.4 → letify-2.11.5}/.github/workflows/ci.yml +0 -0
  19. {letify-2.11.4 → letify-2.11.5}/.github/workflows/docs.yml +0 -0
  20. {letify-2.11.4 → letify-2.11.5}/.github/workflows/letify-link.yml +0 -0
  21. {letify-2.11.4 → letify-2.11.5}/.github/workflows/publish-crates.yml +0 -0
  22. {letify-2.11.4 → letify-2.11.5}/.github/workflows/publish.yml +0 -0
  23. {letify-2.11.4 → letify-2.11.5}/.github/workflows/reserve-crates.yml +0 -0
  24. {letify-2.11.4 → letify-2.11.5}/.gitignore +0 -0
  25. {letify-2.11.4 → letify-2.11.5}/.researchtree +0 -0
  26. {letify-2.11.4 → letify-2.11.5}/CLAUDE.md +0 -0
  27. {letify-2.11.4 → letify-2.11.5}/LICENSE +0 -0
  28. {letify-2.11.4 → letify-2.11.5}/PROJECT.md +0 -0
  29. {letify-2.11.4 → letify-2.11.5}/README.md +0 -0
  30. {letify-2.11.4 → letify-2.11.5}/docs/COMPONENT.md +0 -0
  31. {letify-2.11.4 → letify-2.11.5}/docs/INTENT.md +0 -0
  32. {letify-2.11.4 → letify-2.11.5}/docs/NETWORK.md +0 -0
  33. {letify-2.11.4 → letify-2.11.5}/docs/ROADMAP-3.0.md +0 -0
  34. {letify-2.11.4 → letify-2.11.5}/docs/guide/01-getting-started.md +0 -0
  35. {letify-2.11.4 → letify-2.11.5}/docs/guide/02-providers.md +0 -0
  36. {letify-2.11.4 → letify-2.11.5}/docs/guide/03-execution-modes.md +0 -0
  37. {letify-2.11.4 → letify-2.11.5}/docs/guide/04-environments-and-data.md +0 -0
  38. {letify-2.11.4 → letify-2.11.5}/docs/guide/05-concurrency.md +0 -0
  39. {letify-2.11.4 → letify-2.11.5}/docs/guide/06-cost.md +0 -0
  40. {letify-2.11.4 → letify-2.11.5}/docs/guide/07-troubleshooting.md +0 -0
  41. {letify-2.11.4 → letify-2.11.5}/docs/guide/08-releasing.md +0 -0
  42. {letify-2.11.4 → letify-2.11.5}/docs/guide/09-agent.md +0 -0
  43. {letify-2.11.4 → letify-2.11.5}/docs/guide/README.md +0 -0
  44. {letify-2.11.4 → letify-2.11.5}/docs/guide/ko/01-/354/213/234/354/236/221/355/225/230/352/270/260.md" +0 -0
  45. {letify-2.11.4 → letify-2.11.5}/docs/guide/ko/02-/355/224/204/353/241/234/353/260/224/354/235/264/353/215/224.md" +0 -0
  46. {letify-2.11.4 → letify-2.11.5}/docs/guide/ko/03-/354/213/244/355/226/211-/353/260/251/354/213/235.md" +0 -0
  47. {letify-2.11.4 → letify-2.11.5}/docs/guide/ko/04-/355/231/230/352/262/275/352/263/274-/353/215/260/354/235/264/355/204/260.md" +0 -0
  48. {letify-2.11.4 → letify-2.11.5}/docs/guide/ko/05-/353/217/231/354/213/234-/354/213/244/355/226/211.md" +0 -0
  49. {letify-2.11.4 → letify-2.11.5}/docs/guide/ko/06-/353/271/204/354/232/251.md" +0 -0
  50. {letify-2.11.4 → letify-2.11.5}/docs/guide/ko/07-/353/254/270/354/240/234-/355/225/264/352/262/260.md" +0 -0
  51. {letify-2.11.4 → letify-2.11.5}/docs/guide/ko/08-/353/246/264/353/246/254/354/212/244.md" +0 -0
  52. {letify-2.11.4 → letify-2.11.5}/docs/guide/ko/09-/354/227/220/354/235/264/354/240/204/355/212/270.md" +0 -0
  53. {letify-2.11.4 → letify-2.11.5}/docs/guide/ko/README.md +0 -0
  54. {letify-2.11.4 → letify-2.11.5}/docs/locales/README_ko.md +0 -0
  55. {letify-2.11.4 → letify-2.11.5}/docs/mkdocs.yml +0 -0
  56. {letify-2.11.4 → letify-2.11.5}/examples/README.md +0 -0
  57. {letify-2.11.4 → letify-2.11.5}/examples/nvfp4-lora/.letify.example +0 -0
  58. {letify-2.11.4 → letify-2.11.5}/examples/nvfp4-lora/00_smoke.py +0 -0
  59. {letify-2.11.4 → letify-2.11.5}/examples/nvfp4-lora/01_sweep.py +0 -0
  60. {letify-2.11.4 → letify-2.11.5}/examples/nvfp4-lora/02_resume.py +0 -0
  61. {letify-2.11.4 → letify-2.11.5}/examples/nvfp4-lora/03_watch.py +0 -0
  62. {letify-2.11.4 → letify-2.11.5}/examples/nvfp4-lora/README.md +0 -0
  63. {letify-2.11.4 → letify-2.11.5}/examples/nvfp4-lora/README_ko.md +0 -0
  64. {letify-2.11.4 → letify-2.11.5}/examples/nvfp4-lora/common.py +0 -0
  65. {letify-2.11.4 → letify-2.11.5}/examples/nvfp4-lora/recipe.py +0 -0
  66. {letify-2.11.4 → letify-2.11.5}/letify/cli.py +0 -0
  67. {letify-2.11.4 → letify-2.11.5}/letify/config/__init__.py +0 -0
  68. {letify-2.11.4 → letify-2.11.5}/letify/config/inventory.py +0 -0
  69. {letify-2.11.4 → letify-2.11.5}/letify/config/login.py +0 -0
  70. {letify-2.11.4 → letify-2.11.5}/letify/config/schema.py +0 -0
  71. {letify-2.11.4 → letify-2.11.5}/letify/config/secrets.py +0 -0
  72. {letify-2.11.4 → letify-2.11.5}/letify/config/writer.py +0 -0
  73. {letify-2.11.4 → letify-2.11.5}/letify/declare/__init__.py +0 -0
  74. {letify-2.11.4 → letify-2.11.5}/letify/declare/cache.py +0 -0
  75. {letify-2.11.4 → letify-2.11.5}/letify/declare/env.py +0 -0
  76. {letify-2.11.4 → letify-2.11.5}/letify/declare/exit.py +0 -0
  77. {letify-2.11.4 → letify-2.11.5}/letify/declare/function.py +0 -0
  78. {letify-2.11.4 → letify-2.11.5}/letify/declare/instance.py +0 -0
  79. {letify-2.11.4 → letify-2.11.5}/letify/declare/reduce.py +0 -0
  80. {letify-2.11.4 → letify-2.11.5}/letify/declare/replicas.py +0 -0
  81. {letify-2.11.4 → letify-2.11.5}/letify/errors.py +0 -0
  82. {letify-2.11.4 → letify-2.11.5}/letify/install.py +0 -0
  83. {letify-2.11.4 → letify-2.11.5}/letify/launcher.py +0 -0
  84. {letify-2.11.4 → letify-2.11.5}/letify/paths.py +0 -0
  85. {letify-2.11.4 → letify-2.11.5}/letify/protocol/__init__.py +0 -0
  86. {letify-2.11.4 → letify-2.11.5}/letify/protocol/codec.py +0 -0
  87. {letify-2.11.4 → letify-2.11.5}/letify/protocol/driver.py +0 -0
  88. {letify-2.11.4 → letify-2.11.5}/letify/protocol/handle.py +0 -0
  89. {letify-2.11.4 → letify-2.11.5}/letify/protocol/wire.py +0 -0
  90. {letify-2.11.4 → letify-2.11.5}/letify/protocol/worker.py +0 -0
  91. {letify-2.11.4 → letify-2.11.5}/letify/providers/__init__.py +0 -0
  92. {letify-2.11.4 → letify-2.11.5}/letify/providers/base.py +0 -0
  93. {letify-2.11.4 → letify-2.11.5}/letify/providers/colab.py +0 -0
  94. {letify-2.11.4 → letify-2.11.5}/letify/providers/colab_files.py +0 -0
  95. {letify-2.11.4 → letify-2.11.5}/letify/providers/colab_keepalive.py +0 -0
  96. {letify-2.11.4 → letify-2.11.5}/letify/providers/elice.py +0 -0
  97. {letify-2.11.4 → letify-2.11.5}/letify/providers/kaggle.py +0 -0
  98. {letify-2.11.4 → letify-2.11.5}/letify/providers/kaggle_adapter.py +0 -0
  99. {letify-2.11.4 → letify-2.11.5}/letify/providers/local.py +0 -0
  100. {letify-2.11.4 → letify-2.11.5}/letify/providers/modal.py +0 -0
  101. {letify-2.11.4 → letify-2.11.5}/letify/providers/modal_adapter.py +0 -0
  102. {letify-2.11.4 → letify-2.11.5}/letify/providers/naming.py +0 -0
  103. {letify-2.11.4 → letify-2.11.5}/letify/providers/shell.py +0 -0
  104. {letify-2.11.4 → letify-2.11.5}/letify/providers/tunnel.py +0 -0
  105. {letify-2.11.4 → letify-2.11.5}/letify/providers/usage.py +0 -0
  106. {letify-2.11.4 → letify-2.11.5}/letify/remoting/__init__.py +0 -0
  107. {letify-2.11.4 → letify-2.11.5}/letify/remoting/device/__init__.py +0 -0
  108. {letify-2.11.4 → letify-2.11.5}/letify/remoting/device/client.py +0 -0
  109. {letify-2.11.4 → letify-2.11.5}/letify/remoting/device/cuda.py +0 -0
  110. {letify-2.11.4 → letify-2.11.5}/letify/remoting/device/executor.py +0 -0
  111. {letify-2.11.4 → letify-2.11.5}/letify/remoting/device/frames.py +0 -0
  112. {letify-2.11.4 → letify-2.11.5}/letify/remoting/device/guard.py +0 -0
  113. {letify-2.11.4 → letify-2.11.5}/letify/remoting/device/tensor.py +0 -0
  114. {letify-2.11.4 → letify-2.11.5}/letify/remoting/device/trace.py +0 -0
  115. {letify-2.11.4 → letify-2.11.5}/letify/remoting/device/value.py +0 -0
  116. {letify-2.11.4 → letify-2.11.5}/letify/render.py +0 -0
  117. {letify-2.11.4 → letify-2.11.5}/letify/runtime/__init__.py +0 -0
  118. {letify-2.11.4 → letify-2.11.5}/letify/runtime/bootstrap.py +0 -0
  119. {letify-2.11.4 → letify-2.11.5}/letify/runtime/broker.py +0 -0
  120. {letify-2.11.4 → letify-2.11.5}/letify/runtime/channel.py +0 -0
  121. {letify-2.11.4 → letify-2.11.5}/letify/runtime/control.py +0 -0
  122. {letify-2.11.4 → letify-2.11.5}/letify/runtime/lease.py +0 -0
  123. {letify-2.11.4 → letify-2.11.5}/letify/runtime/pool.py +0 -0
  124. {letify-2.11.4 → letify-2.11.5}/letify/runtime/reattach.py +0 -0
  125. {letify-2.11.4 → letify-2.11.5}/letify/runtime/session.py +0 -0
  126. {letify-2.11.4 → letify-2.11.5}/letify/runtime/takeover.py +0 -0
  127. {letify-2.11.4 → letify-2.11.5}/letify/runtime/telemetry.py +0 -0
  128. {letify-2.11.4 → letify-2.11.5}/letify/runtime/workers.py +0 -0
  129. {letify-2.11.4 → letify-2.11.5}/letify/store/__init__.py +0 -0
  130. {letify-2.11.4 → letify-2.11.5}/letify/store/backends/__init__.py +0 -0
  131. {letify-2.11.4 → letify-2.11.5}/letify/store/backends/drive.py +0 -0
  132. {letify-2.11.4 → letify-2.11.5}/letify/store/backends/filesystem.py +0 -0
  133. {letify-2.11.4 → letify-2.11.5}/letify/store/backends/google_auth.py +0 -0
  134. {letify-2.11.4 → letify-2.11.5}/letify/store/backends/layout.py +0 -0
  135. {letify-2.11.4 → letify-2.11.5}/letify/store/backends/objects.py +0 -0
  136. {letify-2.11.4 → letify-2.11.5}/letify/store/cas.py +0 -0
  137. {letify-2.11.4 → letify-2.11.5}/letify/store/handoff.py +0 -0
  138. {letify-2.11.4 → letify-2.11.5}/letify/store/pathdata.py +0 -0
  139. {letify-2.11.4 → letify-2.11.5}/letify/store/sendorder.py +0 -0
  140. {letify-2.11.4 → letify-2.11.5}/letify/store/volume.py +0 -0
  141. {letify-2.11.4 → letify-2.11.5}/letify/stubs.py +0 -0
  142. {letify-2.11.4 → letify-2.11.5}/letify/tools.py +0 -0
  143. {letify-2.11.4 → letify-2.11.5}/letify/transport/__init__.py +0 -0
  144. {letify-2.11.4 → letify-2.11.5}/letify/transport/agent.py +0 -0
  145. {letify-2.11.4 → letify-2.11.5}/letify/transport/announce.py +0 -0
  146. {letify-2.11.4 → letify-2.11.5}/letify/transport/link.py +0 -0
  147. {letify-2.11.4 → letify-2.11.5}/letify/transport/linkagent.py +0 -0
  148. {letify-2.11.4 → letify-2.11.5}/letify/transport/linkd.py +0 -0
  149. {letify-2.11.4 → letify-2.11.5}/letify/transport/linkmailbox.py +0 -0
  150. {letify-2.11.4 → letify-2.11.5}/letify/transport/linkpump.py +0 -0
  151. {letify-2.11.4 → letify-2.11.5}/letify/transport/linkupload.py +0 -0
  152. {letify-2.11.4 → letify-2.11.5}/letify/transport/linkwebsocket.py +0 -0
  153. {letify-2.11.4 → letify-2.11.5}/letify/transport/nat.py +0 -0
  154. {letify-2.11.4 → letify-2.11.5}/letify/transport/pipeline.py +0 -0
  155. {letify-2.11.4 → letify-2.11.5}/letify/transport/portmap.py +0 -0
  156. {letify-2.11.4 → letify-2.11.5}/letify/transport/probe.py +0 -0
  157. {letify-2.11.4 → letify-2.11.5}/letify/transport/quic.py +0 -0
  158. {letify-2.11.4 → letify-2.11.5}/letify/transport/rendezvous.py +0 -0
  159. {letify-2.11.4 → letify-2.11.5}/letify/transport/setup.py +0 -0
  160. {letify-2.11.4 → letify-2.11.5}/letify/transport/sshopts.py +0 -0
  161. {letify-2.11.4 → letify-2.11.5}/letify/transport/strategies.py +0 -0
  162. {letify-2.11.4 → letify-2.11.5}/letify-core/.gitignore +0 -0
  163. {letify-2.11.4 → letify-2.11.5}/letify-core/build.py +0 -0
  164. {letify-2.11.4 → letify-2.11.5}/letify-core/letify/Cargo.toml +0 -0
  165. {letify-2.11.4 → letify-2.11.5}/letify-core/letify/LICENSE +0 -0
  166. {letify-2.11.4 → letify-2.11.5}/letify-core/letify/README.md +0 -0
  167. {letify-2.11.4 → letify-2.11.5}/letify-core/letify/src/lib.rs +0 -0
  168. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/Cargo.toml +0 -0
  169. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/examples/bench.rs +0 -0
  170. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/acceptor.rs +0 -0
  171. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/bin/letify-link.rs +0 -0
  172. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/config.rs +0 -0
  173. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/error.rs +0 -0
  174. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/frame.rs +0 -0
  175. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/handshake.rs +0 -0
  176. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/hysteresis.rs +0 -0
  177. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/identity.rs +0 -0
  178. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/keys.rs +0 -0
  179. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/lib.rs +0 -0
  180. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/observe.rs +0 -0
  181. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/paths.rs +0 -0
  182. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/plan.rs +0 -0
  183. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/policing.rs +0 -0
  184. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/record.rs +0 -0
  185. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/relay.rs +0 -0
  186. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/rendezvous.rs +0 -0
  187. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/replay.rs +0 -0
  188. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/session.rs +0 -0
  189. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/stream.rs +0 -0
  190. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/stun.rs +0 -0
  191. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/tcp.rs +0 -0
  192. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/trace.rs +0 -0
  193. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/src/udp.rs +0 -0
  194. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/acceptor.rs +0 -0
  195. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/api.rs +0 -0
  196. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/common/mod.rs +0 -0
  197. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/diag_sim.rs +0 -0
  198. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/fairness.rs +0 -0
  199. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/gauge.rs +0 -0
  200. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/handshake.rs +0 -0
  201. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/hysteresis.rs +0 -0
  202. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/keepalive.rs +0 -0
  203. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/mobile.rs +0 -0
  204. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/nat.rs +0 -0
  205. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/paths.rs +0 -0
  206. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/qad.rs +0 -0
  207. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/rekey.rs +0 -0
  208. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/relay.rs +0 -0
  209. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/relay_pairing.rs +0 -0
  210. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/rendezvous.rs +0 -0
  211. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/reorder.rs +0 -0
  212. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/replay.rs +0 -0
  213. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/resume.rs +0 -0
  214. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/revoke.rs +0 -0
  215. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/session.rs +0 -0
  216. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/startup.rs +0 -0
  217. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/subflows.rs +0 -0
  218. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/trace.rs +0 -0
  219. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/udp.rs +0 -0
  220. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-link/tests/udp_bench.rs +0 -0
  221. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-quic/Cargo.toml +0 -0
  222. {letify-2.11.4 → letify-2.11.5}/letify-core/letify-quic/src/main.rs +0 -0
  223. {letify-2.11.4 → letify-2.11.5}/letify-core/rust-toolchain.toml +0 -0
  224. {letify-2.11.4 → letify-2.11.5}/letify-ext/.vscodeignore +0 -0
  225. {letify-2.11.4 → letify-2.11.5}/letify-ext/LICENSE +0 -0
  226. {letify-2.11.4 → letify-2.11.5}/letify-ext/README.md +0 -0
  227. {letify-2.11.4 → letify-2.11.5}/letify-ext/media/icon.svg +0 -0
  228. {letify-2.11.4 → letify-2.11.5}/letify-ext/src/cli.ts +0 -0
  229. {letify-2.11.4 → letify-2.11.5}/letify-ext/src/extension.ts +0 -0
  230. {letify-2.11.4 → letify-2.11.5}/letify-ext/src/history.ts +0 -0
  231. {letify-2.11.4 → letify-2.11.5}/letify-ext/src/model.ts +0 -0
  232. {letify-2.11.4 → letify-2.11.5}/letify-ext/src/poll.ts +0 -0
  233. {letify-2.11.4 → letify-2.11.5}/letify-ext/src/render.ts +0 -0
  234. {letify-2.11.4 → letify-2.11.5}/letify-ext/test/cli.test.ts +0 -0
  235. {letify-2.11.4 → letify-2.11.5}/letify-ext/test/manifest.test.ts +0 -0
  236. {letify-2.11.4 → letify-2.11.5}/letify-ext/test/model.test.ts +0 -0
  237. {letify-2.11.4 → letify-2.11.5}/letify-ext/test/regressions.test.ts +0 -0
  238. {letify-2.11.4 → letify-2.11.5}/letify-ext/tsconfig.json +0 -0
  239. {letify-2.11.4 → letify-2.11.5}/letify-signal/README.md +0 -0
  240. {letify-2.11.4 → letify-2.11.5}/letify-signal/cloudflare.config.ts +0 -0
  241. {letify-2.11.4 → letify-2.11.5}/letify-signal/package-lock.json +0 -0
  242. {letify-2.11.4 → letify-2.11.5}/letify-signal/package.json +0 -0
  243. {letify-2.11.4 → letify-2.11.5}/letify-signal/src/auth.ts +0 -0
  244. {letify-2.11.4 → letify-2.11.5}/letify-signal/src/ed25519.ts +0 -0
  245. {letify-2.11.4 → letify-2.11.5}/letify-signal/src/handler.ts +0 -0
  246. {letify-2.11.4 → letify-2.11.5}/letify-signal/src/index.ts +0 -0
  247. {letify-2.11.4 → letify-2.11.5}/letify-signal/src/limiter.ts +0 -0
  248. {letify-2.11.4 → letify-2.11.5}/letify-signal/src/mailbox.ts +0 -0
  249. {letify-2.11.4 → letify-2.11.5}/letify-signal/src/objects.ts +0 -0
  250. {letify-2.11.4 → letify-2.11.5}/letify-signal/src/protocol.ts +0 -0
  251. {letify-2.11.4 → letify-2.11.5}/letify-signal/src/storage.ts +0 -0
  252. {letify-2.11.4 → letify-2.11.5}/letify-signal/test/auth.test.ts +0 -0
  253. {letify-2.11.4 → letify-2.11.5}/letify-signal/test/ed25519.test.ts +0 -0
  254. {letify-2.11.4 → letify-2.11.5}/letify-signal/test/helpers.ts +0 -0
  255. {letify-2.11.4 → letify-2.11.5}/letify-signal/test/interop.test.ts +0 -0
  256. {letify-2.11.4 → letify-2.11.5}/letify-signal/test/limiter.test.ts +0 -0
  257. {letify-2.11.4 → letify-2.11.5}/letify-signal/test/mailbox.test.ts +0 -0
  258. {letify-2.11.4 → letify-2.11.5}/letify-signal/test/objects.test.ts +0 -0
  259. {letify-2.11.4 → letify-2.11.5}/letify-signal/test/setup.ts +0 -0
  260. {letify-2.11.4 → letify-2.11.5}/letify-signal/test/worker.test.ts +0 -0
  261. {letify-2.11.4 → letify-2.11.5}/letify-signal/tsconfig.json +0 -0
  262. {letify-2.11.4 → letify-2.11.5}/letify-signal/vitest.config.ts +0 -0
  263. {letify-2.11.4 → letify-2.11.5}/letify_providers.py +0 -0
  264. {letify-2.11.4 → letify-2.11.5}/scripts/sync-main.sh +0 -0
  265. {letify-2.11.4 → letify-2.11.5}/scripts/version.py +0 -0
  266. {letify-2.11.4 → letify-2.11.5}/tests/conftest.py +0 -0
  267. {letify-2.11.4 → letify-2.11.5}/tests/fake_kaggle_adapter.py +0 -0
  268. {letify-2.11.4 → letify-2.11.5}/tests/fake_modal_adapter.py +0 -0
  269. {letify-2.11.4 → letify-2.11.5}/tests/test_cli.py +0 -0
  270. {letify-2.11.4 → letify-2.11.5}/tests/test_cli_output.py +0 -0
  271. {letify-2.11.4 → letify-2.11.5}/tests/test_colab_keepalive.py +0 -0
  272. {letify-2.11.4 → letify-2.11.5}/tests/test_config.py +0 -0
  273. {letify-2.11.4 → letify-2.11.5}/tests/test_core.py +0 -0
  274. {letify-2.11.4 → letify-2.11.5}/tests/test_data.py +0 -0
  275. {letify-2.11.4 → letify-2.11.5}/tests/test_data_in_place.py +0 -0
  276. {letify-2.11.4 → letify-2.11.5}/tests/test_data_streaming.py +0 -0
  277. {letify-2.11.4 → letify-2.11.5}/tests/test_declare.py +0 -0
  278. {letify-2.11.4 → letify-2.11.5}/tests/test_device.py +0 -0
  279. {letify-2.11.4 → letify-2.11.5}/tests/test_device_compile.py +0 -0
  280. {letify-2.11.4 → letify-2.11.5}/tests/test_distributed.py +0 -0
  281. {letify-2.11.4 → letify-2.11.5}/tests/test_drive_handoff.py +0 -0
  282. {letify-2.11.4 → letify-2.11.5}/tests/test_drive_store.py +0 -0
  283. {letify-2.11.4 → letify-2.11.5}/tests/test_editor_sessions.py +0 -0
  284. {letify-2.11.4 → letify-2.11.5}/tests/test_elice.py +0 -0
  285. {letify-2.11.4 → letify-2.11.5}/tests/test_frames.py +0 -0
  286. {letify-2.11.4 → letify-2.11.5}/tests/test_install.py +0 -0
  287. {letify-2.11.4 → letify-2.11.5}/tests/test_kaggle.py +0 -0
  288. {letify-2.11.4 → letify-2.11.5}/tests/test_kaggle_cookie.py +0 -0
  289. {letify-2.11.4 → letify-2.11.5}/tests/test_kaggle_link.py +0 -0
  290. {letify-2.11.4 → letify-2.11.5}/tests/test_link_agent.py +0 -0
  291. {letify-2.11.4 → letify-2.11.5}/tests/test_link_exec.py +0 -0
  292. {letify-2.11.4 → letify-2.11.5}/tests/test_link_log.py +0 -0
  293. {letify-2.11.4 → letify-2.11.5}/tests/test_link_opt_in.py +0 -0
  294. {letify-2.11.4 → letify-2.11.5}/tests/test_link_upload.py +0 -0
  295. {letify-2.11.4 → letify-2.11.5}/tests/test_linkd.py +0 -0
  296. {letify-2.11.4 → letify-2.11.5}/tests/test_notebook.py +0 -0
  297. {letify-2.11.4 → letify-2.11.5}/tests/test_parallel_placement.py +0 -0
  298. {letify-2.11.4 → letify-2.11.5}/tests/test_paths.py +0 -0
  299. {letify-2.11.4 → letify-2.11.5}/tests/test_portmap.py +0 -0
  300. {letify-2.11.4 → letify-2.11.5}/tests/test_protocol.py +0 -0
  301. {letify-2.11.4 → letify-2.11.5}/tests/test_providers.py +0 -0
  302. {letify-2.11.4 → letify-2.11.5}/tests/test_punch_sockets.py +0 -0
  303. {letify-2.11.4 → letify-2.11.5}/tests/test_quic.py +0 -0
  304. {letify-2.11.4 → letify-2.11.5}/tests/test_remoting.py +0 -0
  305. {letify-2.11.4 → letify-2.11.5}/tests/test_render.py +0 -0
  306. {letify-2.11.4 → letify-2.11.5}/tests/test_run_control.py +0 -0
  307. {letify-2.11.4 → letify-2.11.5}/tests/test_run_reattach.py +0 -0
  308. {letify-2.11.4 → letify-2.11.5}/tests/test_run_takeover.py +0 -0
  309. {letify-2.11.4 → letify-2.11.5}/tests/test_runtime.py +0 -0
  310. {letify-2.11.4 → letify-2.11.5}/tests/test_shell_workers.py +0 -0
  311. {letify-2.11.4 → letify-2.11.5}/tests/test_ship.py +0 -0
  312. {letify-2.11.4 → letify-2.11.5}/tests/test_store.py +0 -0
  313. {letify-2.11.4 → letify-2.11.5}/tests/test_strategies.py +0 -0
  314. {letify-2.11.4 → letify-2.11.5}/tests/test_stubs.py +0 -0
  315. {letify-2.11.4 → letify-2.11.5}/tests/test_transport.py +0 -0
  316. {letify-2.11.4 → letify-2.11.5}/tests/test_tunnel_setup.py +0 -0
  317. {letify-2.11.4 → letify-2.11.5}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: letify
3
- Version: 2.11.4
3
+ Version: 2.11.5
4
4
  Summary: Declarations that become infrastructure.
5
5
  Project-URL: Homepage, https://github.com/DarkPyonix/letify
6
6
  Project-URL: Documentation, https://github.com/DarkPyonix/letify/tree/main/docs
@@ -2228,7 +2228,7 @@ The library sends these message kinds over the trait, each as a kind byte follow
2228
2228
 
2229
2229
  A `PunchOffer` with no mappings is a punch with no sockets and nothing else. It is not a relay request, and a receiver must not treat it as one: the relay meeting has its own kind.
2230
2230
 
2231
- **Timing rule.** The initiator sets the start time to its clock plus a lead of 10 s (`DEFAULT_LEAD`) and the stop time to the start plus a window of 150 s (`DEFAULT_WINDOW`), the values of letify's Python TCP punch. The answer repeats the start time and reports the time at which the answerer stops. Both sides dial from the start time and stop at the earlier stop time, so neither spends a window the other has closed. The two clocks are assumed to agree within about a second.
2231
+ **Timing rule.** The initiator sets the start time to its clock plus a lead of 10 s (`DEFAULT_LEAD`) and the stop time to the start plus a window of 150 s (`DEFAULT_WINDOW`), the values of letify's Python TCP punch. The answer repeats the start time and reports the time at which the answerer stops. Both sides dial from the start time and stop at the earlier stop time, so neither spends a window the other has closed. The two clocks are assumed to agree within about a second. A responder that names its own start is described in [Sidecar interface](#link-sidecar), Offers.
2232
2232
 
2233
2233
  letify implements the trait with its provider bootstraps (ssh, `colab exec`, the Kaggle API and the Drive mailbox), and these are its default rendezvous. The owner also operates a signalling service at `letify.darkpyonix.dev`, a Cloudflare Worker, which letify uses as an auxiliary rendezvous in three cases: reconnection and resumption after the client changed (a new network or a new machine), pairing of two runtimes under `host="distributed"` without the client, and nodes that have no bootstrap. The service carries only small messages, signed address records and punch timing, and never session data, so its cost is small. When the service is unreachable, letify uses the bootstrap. That changes only how addresses are exchanged, not the path that carries data, so it is not a fallback to a slower path. A relay never runs on the service: a Worker cannot accept UDP, and a relay is a node role as the [Relay](#link-relay) subsection says. Another program implements it with its own signalling. darkpyonix Ember, for example, would use a hub that publishes pkarr signed packets. The library holds no provider-specific code.
2234
2234
 
@@ -2378,7 +2378,7 @@ The sidecar is a binary named `letify-link`, built for each wheel and installed
2378
2378
  |---|---|---|
2379
2379
  | `listen` | `allow`: node ids that may start a session; `bind`: optional TCP address to listen on | `listener`: integer; `addr`: the bound address when `bind` was given |
2380
2380
  | `open_session` | `peer`: node id; `candidates`: see below; `config`: optional `keepalive_ms`, `resume_window_s`, `handshake_timeout_ms`, `start_timeout_ms` (how long to wait for the first handshake, default 60000) | `session`: integer; `peer` |
2381
- | `punch` | `peer`: node id; `role`: `initiator` or `responder`; `sockets`: TCP sockets, 0 to 8 (default 4); `udp`: probing UDP sockets, 0 to 8 (default 0), of which a punch yields at most one UDP path; `observers`: where the mappings come from, see item 3; `public_ip`: optional address reported as the mapping of every socket when `observers` is absent (default `127.0.0.1`); `police`: optional `{"floor_bps", "burst_ms"}`, the initiator's policing check; `lead_ms`, `window_ms`: optional; `listener`: required for the responder | initiator: `punched`: names usable as candidates, `policed`: names of paths that were dropped, `nat`: this side's classification, `peer_nat`: the other side's, `mapped`: `{"tcp": [...], "udp": [...]}`, the addresses this side offered, `report`: the one-line account of [NAT traversal](#link-nat) item 8; responder: `sockets`: how many paths were punched, `nat`, `peer_nat`, `mapped` as for the initiator |
2381
+ | `punch` | `peer`: node id; `role`: `initiator` or `responder`; `sockets`: TCP sockets, 0 to 8 (default 4); `udp`: probing UDP sockets, 0 to 8 (default 0), of which a punch yields at most one UDP path; `observers`: where the mappings come from, see item 3; `public_ip`: optional address reported as the mapping of every socket when `observers` is absent (default `127.0.0.1`); `police`: optional `{"floor_bps", "burst_ms"}`, the initiator's policing check; `lead_ms`, `window_ms`: optional; `answer_margin_ms`: optional, responder only, see Offers; `listener`: required for the responder | initiator: `punched`: names usable as candidates, `policed`: names of paths that were dropped, `nat`: this side's classification, `peer_nat`: the other side's, `mapped`: `{"tcp": [...], "udp": [...]}`, the addresses this side offered, `report`: the one-line account of [NAT traversal](#link-nat) item 8; responder: `sockets`: how many paths were punched, `nat`, `peer_nat`, `mapped` as for the initiator |
2382
2382
  | `rendezvous_message` | `from`: node id; `message`: hex | none besides `ok` |
2383
2383
  | `paths` | `session` | `paths`: `[{"id","kind","sent_bytes","received_bytes","acked_bytes","rtt_ms","srtt_ms","window","probe_rate"}]`, where `kind` is `"tcp"`, `"udp"` or `"relay"`, the transport kind of the candidate the subflow came from, and null on a session the other side started |
2384
2384
  | `open_stream` | `session`; `priority`: optional, `interactive` (default) or `bulk`, as Session item 7 says | `stream`: integer; `socket`: local stream socket; `secret`: present only for a `tcp:` socket |
@@ -2404,6 +2404,7 @@ The sidecar is a binary named `letify-link`, built for each wheel and installed
2404
2404
  2. **Streams.** `open_stream` binds a local stream socket, replies with its address and waits up to 30 s for Python to connect to it. The address is `unix:<path>` or `tcp:127.0.0.1:<port>`. A Unix socket is `<private>/s<N>` with mode 0600, where `<private>` is a directory with mode 0700 that the sidecar creates inside `stream-dir` (which defaults to the directory of the control socket) and removes when it exits, and `N` counts from 1; on the loopback fallback it is a port. After the connection the sidecar copies bytes both ways between the local socket and the session stream. End of file on one side ends that direction of the other with a shutdown, and the sidecar removes the socket file once the connection is made. An incoming stream is announced with `stream_incoming`, which carries its own local socket and is connected the same way. A stream that nobody connects to within 30 s is closed. Python never sees a path. A `tcp:` stream socket is reachable by every local process, so it carries a `secret`: 64 lowercase hex characters from 32 random bytes of the operating system, new for each stream, in the `open_stream` reply and the `stream_incoming` event. The first 32 bytes a client sends on the socket must be those bytes. The sidecar compares them in constant time, closes a connection that sends other bytes or none within 5 s, and keeps waiting for the right one until the 30 s are over. Connections are checked concurrently, so a silent stray connection delays no other. The secret is required on every platform; a `unix:` socket has none, because its mode 0600 limits it to the owner.
2405
2405
  3. **Rendezvous.** In the sidecar, `ControlRendezvous` implements the `Rendezvous` trait: `send` emits `rendezvous_out` and `recv` returns what `rendezvous_message` supplied. `rendezvous_out` carries the message and the node it is for, and Python delivers it through whichever bootstrap reaches that node. `punch` is the one operation that uses it.
2406
2406
  - **Offers.** The initiator binds `sockets` TCP sockets and `udp` UDP sockets, works out their mappings, and sends one `PunchOffer` for TCP and one for UDP (each only when its count is above 0) with the same `start_at_ms` = now + `lead_ms` (default 2000) and `until_ms` = `start_at_ms` + `window_ms` (default 20000). Each offer carries the mappings, the sender's NAT type and a flag that says a policing check follows on every punched path. The responder takes the first offer and any other that arrives within 400 ms, answers each protocol it also has sockets for with its own mappings and NAT type, and ignores the others. Both then punch TCP and UDP at the same time with the earlier `until_ms`, and the punch succeeds when one protocol has at least one path. It fails with kind `infrastructure` only when none has.
2407
+ - **Answer start.** A responder whose request has `answer_margin_ms` names the start of the punch itself. It computes `now + answer_margin_ms` once, at the time it answers, and answers every protocol with `start_at_ms` = the earlier of that and the offered `start_at_ms`, and `until_ms` = that start plus the offered window (`until_ms` - `start_at_ms` of the offer). The initiator adopts the start of the answer when it is earlier than its own, and the earlier of the two `until_ms`. Both sides then dial from the answered start, so the wait for the offered `start_at_ms` ends when the answer is received, not at `lead_ms`. A responder with no `answer_margin_ms` repeats the offered start and stop times as before, so an older responder works with a newer initiator. A newer responder works with an older initiator because that initiator never sends `answer_margin_ms`. A start in the past is not an error: the side that holds the answer dials at once, and the other side retries until `until_ms`. The two clocks are assumed to agree within about a second, as before, because the start is an absolute unix time.
2407
2408
  - **Mappings.** With `observers` absent, the mappings are the bound addresses with `public_ip` in place of the local IP, which is exact on a network without a NAT. With `observers` set, the sidecar asks address observers (the `AddressObserver` list of this crate) from the first UDP socket, one after another, and classifies the NAT as [Rendezvous](#rendezvous) says. `observers` is `"default"`, which means the environment variable `LETIFY_LINK_STUN` (comma separated `host:port`, used by tests) and otherwise the default STUN servers, or a list of `host:port` STUN servers. Fewer than three answers fail the punch with kind `infrastructure` and the count that answered: the sidecar does not guess a mapping. Each UDP socket's mapping is what the first observer reports for it, and the first socket's is the last mapping of the classification. A TCP socket cannot be observed over UDP, so its mapping is the public IP of the UDP classification with the socket's own port. When the NAT is symmetric with a step other than 0, the offered port of TCP socket `i` is the first UDP mapping advanced by `step * (i + 1)`, so the peer's prediction aims at the port the NAT is expected to hand out next.
2408
2409
  - **UDP paths.** The UDP punch of [Rendezvous](#rendezvous) sends probes from the UDP sockets to the peer's mappings. The destinations are the peer's mapping when its NAT is not symmetric, and its predicted ports (`predicted_destinations`, 16 ports) when it is symmetric with a step. When the peer is symmetric with no step, this side sprays 256 random ports on the peer's IP, and when this side is also symmetric with no step it binds 256 sockets as well (the many-port birthday attempt). The initiator's socket that gets the first answer carries a QUIC connection to the address that answered, and the responder accepts it on whichever of its probing sockets the handshake reaches, as NAT traversal item 4 says and UDP paths, Session item 6, describes. The result is a candidate of kind `Udp`, one per punch.
2409
2410
  - **Policing.** When the initiator's offer has the policing flag, each punched path is checked before anything else uses it: the initiator runs the check of Policing detection as the client with the `floor_bps` and `burst_ms` of `police`, and the responder runs it as the server and sees a dropped path as a closed one. A path with a `Policed` verdict, or one on which the check fails, is closed, emits `path_policed` on the initiator, and is not returned or handed to the acceptor. The initiator's reply lists the dropped names in `policed`. When every path is dropped, the punch fails with kind `infrastructure` and a message that names the policing.
@@ -2455,6 +2456,7 @@ The sidecar is a binary named `letify-link`, built for each wheel and installed
2455
2456
  - **The mailbox.** `letify/transport/linkpump.py`, a standard-library program, is started once through the command channel as a detached process. It starts the shim of item 7 with pipes, appends every complete line the shim prints to an outbox file, and feeds every line appended to an inbox file to the shim's standard input, so the shim is unchanged. The local side then loops on the command channel: each call appends the pending lines to the inbox, waits up to 0.5 s for the outbox to grow past the byte offset the caller holds, and returns the new lines and the new offset. Each call is a poll and a send in one, so nothing is lost when a call is slow. `letify/transport/linkchannel.py` defines `Bootstrap`, with `send_line`, `recv_line`, `stderr_text` and `close`, and `connect` takes a function that returns one. An ssh command is one implementation (`PopenBootstrap`) and the mailbox is the other (`MailboxBootstrap`), so the rest of the connect is the same code for both. If the pump or the shim exits, the outbox ends with an `eof` line holding the tail of the shim's standard error, and the connect fails with that tail.
2456
2457
  - **Timing from the measured round trip.** After the pump starts, the local side makes 2 calls that wait for nothing and takes the longer as the bootstrap round trip `rtt`. A message from one sidecar reaches the other in at most one `rtt` (the call that carries it is in flight for at most `rtt` and the next one carries it), so a punch offer and its answer need at most 2 `rtt`. The rules are:
2457
2458
  - `lead_ms = max(2000, ceil(3 * rtt_ms))`, passed to the sidecar's `punch` in place of its default of 2000, so the offer is at the responder, and the answer back, before the start time.
2459
+ - `answer_margin_ms = max(500, ceil(rtt_ms))`, passed to the responder's `punch` through the shim (and through the agent's `punch` command), so the responder names its own start as the Answer start bullet of this section says. The answer needs at most one `rtt` to reach the initiator, so the initiator holds the start before it is due, and the wait after the answer arrives is at most the margin less the time the answer took. `lead_ms` stays the initiator's bound on how long it waits for the answer. A shim of an older letify ignores the field and the punch starts at `lead_ms` as before.
2458
2460
  - The shim gets `SHIM_TIMEOUT` (60 s) plus 10 `rtt` to print its ready line.
2459
2461
  - The window is `window_ms` 20000 for the first attempt.
2460
2462
  - **One retry.** When the first punch yields no usable path, the local side measures `rtt` again, and punches once more with `lead_ms` from the new `rtt` and `window_ms` 60000 (3 times the first), the birthday window of [Rendezvous](#rendezvous) for a symmetric NAT. It sends the shim a new `punch` command with the same two values. When the second attempt also yields no path, the connect fails with `<alias> has no address and no punched path connected` followed by both attempts, each as `attempt <n> (lead <lead> ms, window <window> ms): <reason>`. There is never a third attempt and never a path other than a punched one. An ssh bootstrap (item 7) keeps one attempt with the sidecar's default lead and window, because its round trip is not a rendezvous cost.
@@ -70,7 +70,7 @@ distributed: Final = Host.distributed
70
70
  # The enum class stays importable from letify.declare.instance for letify's own use.
71
71
  del Host
72
72
 
73
- __version__ = "2.11.4"
73
+ __version__ = "2.11.5"
74
74
 
75
75
 
76
76
  def fetch(tensor): # type: ignore[no-untyped-def]
@@ -50,6 +50,8 @@ RETRY_WINDOW_FACTOR = 3
50
50
  #: The least lead a punch gets, in milliseconds, and how many bootstrap round trips it is.
51
51
  PUNCH_LEAD_FLOOR_MS = 2000
52
52
  PUNCH_LEAD_ROUND_TRIPS = 3
53
+ #: The least time, in milliseconds, between a responder's answer and the start it names.
54
+ PUNCH_ANSWER_FLOOR_MS = 500
53
55
  #: Seconds the probe waits for every candidate of a session to join or be lost. Spec "Sidecar
54
56
  #: interface" item 8. A join takes a few round trips, so 10 s is many round trips of any link
55
57
  #: the floor admits.
@@ -96,6 +98,15 @@ def punch_lead_ms(rtt_s: float) -> int:
96
98
  return max(PUNCH_LEAD_FLOOR_MS, math.ceil(round(PUNCH_LEAD_ROUND_TRIPS * rtt_s * 1000, 6)))
97
99
 
98
100
 
101
+ def punch_answer_margin_ms(rtt_s: float) -> int:
102
+ """How long after it answers the responder names the start: one round trip, at least 0.5 s.
103
+
104
+ Spec "Sidecar interface" item 8. The answer needs at most one round trip to reach the
105
+ initiator, so a start named that far ahead is still ahead when the answer arrives.
106
+ """
107
+ return max(PUNCH_ANSWER_FLOOR_MS, math.ceil(round(rtt_s * 1000, 6)))
108
+
109
+
99
110
  class Bootstrap(Protocol):
100
111
  """The line stream between the local side and the shim until the hand-over.
101
112
 
@@ -914,6 +925,10 @@ def _punch(
914
925
  timing: dict[str, Any] = {}
915
926
  if window is not None:
916
927
  timing = {"lead_ms": punch_lead_ms(stream.rtt_s or 0.0), "window_ms": window}
928
+ # Only the responder reads the margin, and a shim of an older letify ignores it.
929
+ margin = {}
930
+ if window is not None:
931
+ margin = {"answer_margin_ms": punch_answer_margin_ms(stream.rtt_s or 0.0)}
917
932
  write(
918
933
  {
919
934
  "op": "punch",
@@ -922,6 +937,7 @@ def _punch(
922
937
  "udp": PUNCH_UDP,
923
938
  **where,
924
939
  **timing,
940
+ **margin,
925
941
  }
926
942
  )
927
943
  try:
@@ -1268,6 +1284,7 @@ __all__ = [
1268
1284
  "connect_signal",
1269
1285
  "letify_link_enabled",
1270
1286
  "prepare_binary",
1287
+ "punch_answer_margin_ms",
1271
1288
  "punch_lead_ms",
1272
1289
  "settle_paths",
1273
1290
  "shim_path",
@@ -459,7 +459,7 @@ class Shim:
459
459
  "public_ip": command.get("public_ip", "127.0.0.1"),
460
460
  "listener": self.listener,
461
461
  }
462
- for key in ("udp", "observers", "lead_ms", "window_ms"):
462
+ for key in ("udp", "observers", "lead_ms", "window_ms", "answer_margin_ms"):
463
463
  if key in command:
464
464
  request[key] = command[key]
465
465
  try:
@@ -803,7 +803,15 @@ class SignalAgent:
803
803
  if op == "rendezvous":
804
804
  return {"op": "rendezvous", "from": sender, "message": command.get("message", "")}
805
805
  if op == "punch":
806
- allowed = ("sockets", "udp", "observers", "public_ip", "lead_ms", "window_ms")
806
+ allowed = (
807
+ "sockets",
808
+ "udp",
809
+ "observers",
810
+ "public_ip",
811
+ "lead_ms",
812
+ "window_ms",
813
+ "answer_margin_ms",
814
+ )
807
815
  return {
808
816
  "op": "punch",
809
817
  "peer": sender,
@@ -396,11 +396,11 @@ dependencies = [
396
396
 
397
397
  [[package]]
398
398
  name = "letify"
399
- version = "2.11.4"
399
+ version = "2.11.5"
400
400
 
401
401
  [[package]]
402
402
  name = "letify-link"
403
- version = "2.11.4"
403
+ version = "2.11.5"
404
404
  dependencies = [
405
405
  "ed25519-dalek",
406
406
  "getrandom 0.2.17",
@@ -416,7 +416,7 @@ dependencies = [
416
416
 
417
417
  [[package]]
418
418
  name = "letify-quic"
419
- version = "2.11.4"
419
+ version = "2.11.5"
420
420
  dependencies = [
421
421
  "quinn",
422
422
  "rcgen",
@@ -8,7 +8,7 @@ resolver = "3"
8
8
  members = ["letify", "letify-quic", "letify-link"]
9
9
 
10
10
  [workspace.package]
11
- version = "2.11.4"
11
+ version = "2.11.5"
12
12
  edition = "2024"
13
13
  license = "MIT"
14
14
  repository = "https://github.com/DarkPyonix/letify"
@@ -57,6 +57,16 @@ impl Plan {
57
57
  }
58
58
  }
59
59
 
60
+ /// Adopt the times of the peer's answer: the earlier start, so a responder that names its
61
+ /// own start is not waited for until the offered one, and the earlier stop. An answer that
62
+ /// repeats the offer changes nothing.
63
+ pub fn with_answer(self, answer: &Punch) -> Plan {
64
+ Plan {
65
+ start_at_ms: self.start_at_ms.min(answer.start_at_ms),
66
+ until_ms: self.until_ms.min(answer.until_ms),
67
+ }
68
+ }
69
+
60
70
  /// Merge the sender's plan with the peer's reported stop: both sides stop at the earlier
61
71
  /// `until`, so neither spends a window the other has already closed.
62
72
  pub fn with_peer_until(self, peer_until_ms: u64) -> Plan {
@@ -1209,6 +1209,10 @@ async fn op_punch(shared: &Arc<Shared>, req: &Value) -> OpResult {
1209
1209
  };
1210
1210
  let lead = opt_u64(req, "lead_ms", DEFAULT_LEAD_MS)?;
1211
1211
  let window = opt_u64(req, "window_ms", DEFAULT_WINDOW_MS)?;
1212
+ let answer_margin = match req.get("answer_margin_ms") {
1213
+ None | Some(Value::Null) => None,
1214
+ Some(_) => Some(u64_field(req, "answer_margin_ms")?),
1215
+ };
1212
1216
  let acceptor = if initiator {
1213
1217
  None
1214
1218
  } else {
@@ -1310,18 +1314,10 @@ async fn op_punch(shared: &Arc<Shared>, req: &Value) -> OpResult {
1310
1314
  .map_or(NatType::Unknown, |(_, e)| e.nat);
1311
1315
  policed_by_offer = police.is_some();
1312
1316
  if let (Some(o), Some((a, _))) = (&tcp_offer, &answers.tcp) {
1313
- tcp_terms = Some((
1314
- a.mappings.clone(),
1315
- o.token,
1316
- Plan::of(o).with_peer_until(a.until_ms),
1317
- ));
1317
+ tcp_terms = Some((a.mappings.clone(), o.token, Plan::of(o).with_answer(a)));
1318
1318
  }
1319
1319
  if let (Some(o), Some((a, _))) = (&udp_offer, &answers.udp) {
1320
- udp_terms = Some((
1321
- a.mappings.clone(),
1322
- o.token,
1323
- Plan::of(o).with_peer_until(a.until_ms),
1324
- ));
1320
+ udp_terms = Some((a.mappings.clone(), o.token, Plan::of(o).with_answer(a)));
1325
1321
  }
1326
1322
  } else {
1327
1323
  let offers = await_offers(
@@ -1340,22 +1336,29 @@ async fn op_punch(shared: &Arc<Shared>, req: &Value) -> OpResult {
1340
1336
  .next()
1341
1337
  .map_or(NatType::Unknown, |(_, e)| e.nat);
1342
1338
  policed_by_offer = offers.tcp.iter().chain(&offers.udp).any(|(_, e)| e.police);
1339
+ // The start this side names, once, so TCP and UDP answers agree.
1340
+ let named_start = answer_margin.map(|m| punch::now_ms() + m);
1343
1341
  for (terms, maps, slot) in [
1344
1342
  (&offers.tcp, &own.tcp_maps, &mut tcp_terms),
1345
1343
  (&offers.udp, &own.udp_maps, &mut udp_terms),
1346
1344
  ] {
1347
1345
  let Some((o, e)) = terms else { continue };
1348
- let answer = Punch {
1346
+ let mut answer = Punch {
1349
1347
  proto: o.proto,
1350
1348
  token: o.token,
1351
1349
  start_at_ms: o.start_at_ms,
1352
1350
  until_ms: o.until_ms,
1353
1351
  mappings: maps.clone(),
1354
1352
  };
1353
+ if let Some(start) = named_start.filter(|s| *s < o.start_at_ms) {
1354
+ answer.until_ms = start + (o.until_ms - o.start_at_ms);
1355
+ answer.start_at_ms = start;
1356
+ }
1357
+ let plan = Plan::of(&answer);
1355
1358
  send_message(rdv, peer, &Message::PunchAnswerExt(answer, ext(e.police)))
1356
1359
  .await
1357
1360
  .map_err(|e| infra(e.to_string()))?;
1358
- *slot = Some((o.mappings.clone(), o.token, Plan::of(o)));
1361
+ *slot = Some((o.mappings.clone(), o.token, plan));
1359
1362
  }
1360
1363
  }
1361
1364
 
@@ -911,6 +911,17 @@ async fn punch_pair(
911
911
  tcp: u64,
912
912
  udp: u64,
913
913
  police: Option<Value>,
914
+ ) -> (Sidecar, Sidecar, Value, Value, Value) {
915
+ punch_pair_timed(tcp, udp, police, 300, None).await
916
+ }
917
+
918
+ /// `punch_pair` with the initiator's `lead_ms` and the responder's `answer_margin_ms`.
919
+ async fn punch_pair_timed(
920
+ tcp: u64,
921
+ udp: u64,
922
+ police: Option<Value>,
923
+ lead_ms: u64,
924
+ answer_margin_ms: Option<u64>,
914
925
  ) -> (Sidecar, Sidecar, Value, Value, Value) {
915
926
  let servers = open_nat().await;
916
927
  let env = [("LETIFY_LINK_STUN", join_addrs(&servers))];
@@ -922,22 +933,34 @@ async fn punch_pair(
922
933
  let (a_id, b_id) = (a.node_id.clone(), b.node_id.clone());
923
934
  let mut init = json!({
924
935
  "op": "punch", "peer": b_id, "role": "initiator", "sockets": tcp, "udp": udp,
925
- "observers": "default", "lead_ms": 300, "window_ms": 15000,
936
+ "observers": "default", "lead_ms": lead_ms, "window_ms": 15000,
926
937
  });
927
938
  if let Some(p) = police {
928
939
  init["police"] = p;
929
940
  }
930
- let (ra, rb) = tokio::join!(
931
- a.call(init),
932
- b.call(json!({
933
- "op": "punch", "peer": a_id, "role": "responder", "sockets": tcp, "udp": udp,
934
- "observers": "default", "listener": l["listener"], "lead_ms": 300,
935
- "window_ms": 15000,
936
- })),
937
- );
941
+ let mut resp = json!({
942
+ "op": "punch", "peer": a_id, "role": "responder", "sockets": tcp, "udp": udp,
943
+ "observers": "default", "listener": l["listener"], "lead_ms": lead_ms,
944
+ "window_ms": 15000,
945
+ });
946
+ if let Some(margin) = answer_margin_ms {
947
+ resp["answer_margin_ms"] = json!(margin);
948
+ }
949
+ let (ra, rb) = tokio::join!(a.call(init), b.call(resp));
938
950
  (a, b, ra, rb, l)
939
951
  }
940
952
 
953
+ fn answers_of(sidecar: &Sidecar) -> Vec<Punch> {
954
+ sidecar
955
+ .sent
956
+ .iter()
957
+ .filter_map(|m| match Message::decode(m) {
958
+ Ok(Message::PunchAnswerExt(p, _)) => Some(p),
959
+ _ => None,
960
+ })
961
+ .collect()
962
+ }
963
+
941
964
  async fn carries_a_stream(a: &mut Sidecar, b: &mut Sidecar, names: &[Value]) {
942
965
  let cands: Vec<Value> = names
943
966
  .iter()
@@ -1268,3 +1291,50 @@ async fn several_udp_sockets_still_give_the_two_sides_one_working_path() {
1268
1291
  "the UDP path was lost in rounds {lost:?} of 6"
1269
1292
  );
1270
1293
  }
1294
+
1295
+ // -- The responder names the start (spec "Sidecar interface" item 7, Answer start) ------------
1296
+
1297
+ #[tokio::test]
1298
+ async fn a_responder_that_names_a_start_makes_the_punch_begin_before_the_offered_lead() {
1299
+ let begin = std::time::Instant::now();
1300
+ let (a, b, ra, rb, _l) = punch_pair_timed(2, 0, None, 8000, Some(300)).await;
1301
+ let took = begin.elapsed();
1302
+ assert_eq!(ra["ok"], true, "{ra}");
1303
+ assert_eq!(rb["ok"], true, "{rb}");
1304
+ assert_eq!(ra["punched"].as_array().unwrap().len(), 2, "{ra}");
1305
+ assert!(
1306
+ took < Duration::from_secs(5),
1307
+ "the punch took {took:?} with an 8 s lead"
1308
+ );
1309
+ let offer = &offers_of(&a)[0].0;
1310
+ let answer = &answers_of(&b)[0];
1311
+ assert!(
1312
+ answer.start_at_ms + 5000 < offer.start_at_ms,
1313
+ "start not moved earlier"
1314
+ );
1315
+ assert_eq!(
1316
+ answer.until_ms - answer.start_at_ms,
1317
+ offer.until_ms - offer.start_at_ms,
1318
+ "the window is the offered one"
1319
+ );
1320
+ }
1321
+
1322
+ #[tokio::test]
1323
+ async fn a_responder_with_no_margin_repeats_the_offered_start() {
1324
+ let (a, b, ra, rb, _l) = punch_pair_timed(1, 0, None, 700, None).await;
1325
+ assert_eq!(ra["ok"], true, "{ra}");
1326
+ assert_eq!(rb["ok"], true, "{rb}");
1327
+ let offer = &offers_of(&a)[0].0;
1328
+ let answer = &answers_of(&b)[0];
1329
+ assert_eq!(answer.start_at_ms, offer.start_at_ms);
1330
+ assert_eq!(answer.until_ms, offer.until_ms);
1331
+ }
1332
+
1333
+ #[tokio::test]
1334
+ async fn a_margin_later_than_the_offered_start_does_not_delay_the_punch() {
1335
+ let (a, b, ra, rb, _l) = punch_pair_timed(1, 0, None, 400, Some(30_000)).await;
1336
+ assert_eq!(ra["ok"], true, "{ra}");
1337
+ assert_eq!(rb["ok"], true, "{rb}");
1338
+ let offer = &offers_of(&a)[0].0;
1339
+ assert_eq!(answers_of(&b)[0].start_at_ms, offer.start_at_ms);
1340
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "letify-status",
3
- "version": "2.11.4",
3
+ "version": "2.11.5",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "letify-status",
9
- "version": "2.11.4",
9
+ "version": "2.11.5",
10
10
  "license": "SEE LICENSE IN LICENSE",
11
11
  "devDependencies": {
12
12
  "@types/node": "^18.19.0",
@@ -2,7 +2,7 @@
2
2
  "name": "letify-status",
3
3
  "displayName": "letify Status",
4
4
  "description": "letify quota and GPU activity in the status bar, read from the letify CLI.",
5
- "version": "2.11.4",
5
+ "version": "2.11.5",
6
6
  "publisher": "darkpyonix",
7
7
  "license": "SEE LICENSE IN LICENSE",
8
8
  "repository": {
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "letify"
3
- version = "2.11.4"
3
+ version = "2.11.5"
4
4
  description = "Declarations that become infrastructure."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -715,6 +715,20 @@ def load_shim() -> Any:
715
715
  return module
716
716
 
717
717
 
718
+ def test_the_shim_hands_the_answer_margin_to_the_responders_punch() -> None:
719
+ shim = load_shim().Shim({"resume_s": 10, "wait_s": 60})
720
+ requests: list[dict[str, Any]] = []
721
+ shim.control = SimpleNamespace(request=lambda request: requests.append(request) or {})
722
+ shim.listener = 7
723
+ shim.emit = lambda **fields: None
724
+ shim.punch({"op": "punch", "peer": "ab", "lead_ms": 3000, "answer_margin_ms": 1000})
725
+ assert requests[0]["answer_margin_ms"] == 1000
726
+ assert requests[0]["role"] == "responder"
727
+ requests.clear()
728
+ shim.punch({"op": "punch", "peer": "ab", "lead_ms": 3000})
729
+ assert "answer_margin_ms" not in requests[0]
730
+
731
+
718
732
  def test_the_shim_leaves_when_no_session_has_a_path_for_the_resume_window() -> None:
719
733
  shim = load_shim().Shim({"resume_s": 10, "wait_s": 60})
720
734
  shim.started = time.monotonic()
@@ -250,6 +250,37 @@ def test_the_punch_lead_scales_with_the_measured_bootstrap_round_trip(
250
250
  assert linkchannel.punch_lead_ms(measured[1.2]) >= 3600
251
251
 
252
252
 
253
+ def test_the_answer_margin_is_one_round_trip_with_a_floor_of_half_a_second() -> None:
254
+ assert linkchannel.punch_answer_margin_ms(0.1) == 500
255
+ assert linkchannel.punch_answer_margin_ms(0.5) == 500
256
+ assert linkchannel.punch_answer_margin_ms(2.5) == 2500
257
+ assert linkchannel.punch_answer_margin_ms(1.2345) == 1235
258
+
259
+
260
+ def test_the_responder_is_told_the_answer_margin_with_every_punch_attempt(
261
+ sidecar_binary, isolated_home, tmp_path, monkeypatch
262
+ ) -> None:
263
+ monkeypatch.setattr(linkchannel, "POLICE", {"floor_bps": 1 << 50, "burst_ms": 200})
264
+ commands = FakeCommands(0.3, sidecar_binary)
265
+ provider = colab(tmp_path, commands, monkeypatch, link_binary=str(sidecar_binary))
266
+ sent: list[dict[str, Any]] = []
267
+ original = linkmailbox.MailboxBootstrap.send_line
268
+
269
+ def record(self, line):
270
+ text = line if isinstance(line, str) else line.decode()
271
+ if '"op": "punch"' in text:
272
+ sent.append(json.loads(text))
273
+ return original(self, line)
274
+
275
+ monkeypatch.setattr(linkmailbox.MailboxBootstrap, "send_line", record)
276
+ with pytest.raises(ProviderUnavailable):
277
+ provider.open_channel(runtime())
278
+ assert len(sent) == 2
279
+ for command in sent:
280
+ assert 500 <= command["answer_margin_ms"] <= command["lead_ms"]
281
+ provider.close_link(runtime())
282
+
283
+
253
284
  def test_a_missing_binary_on_the_runtime_fails_the_connect_naming_it(
254
285
  sidecar_binary, isolated_home, tmp_path, monkeypatch
255
286
  ) -> None:
@@ -339,6 +339,10 @@ def test_the_agent_passes_only_the_ops_a_bootstrap_needs_and_pins_the_peer(
339
339
  a.node_id, {"op": "punch", "peer": "00" * 32, "sockets": 4, "command": "touch /tmp/x"}
340
340
  )
341
341
  assert punch == {"op": "punch", "peer": a.node_id, "sockets": 4}
342
+ timed = agent.shim_command(
343
+ a.node_id, {"op": "punch", "lead_ms": 3000, "answer_margin_ms": 1000, "x": 1}
344
+ )
345
+ assert timed == {"op": "punch", "peer": a.node_id, "lead_ms": 3000, "answer_margin_ms": 1000}
342
346
  rendezvous = agent.shim_command(
343
347
  a.node_id, {"op": "rendezvous", "from": "00" * 32, "message": "ab"}
344
348
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes