letify 2.12.5__tar.gz → 2.12.6__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 (324) hide show
  1. {letify-2.12.5 → letify-2.12.6}/PKG-INFO +1 -1
  2. {letify-2.12.5 → letify-2.12.6}/docs/SPEC.md +1 -1
  3. {letify-2.12.5 → letify-2.12.6}/letify/__init__.py +1 -1
  4. {letify-2.12.5 → letify-2.12.6}/letify/transport/linkpump.py +8 -0
  5. {letify-2.12.5 → letify-2.12.6}/letify-core/Cargo.lock +3 -3
  6. {letify-2.12.5 → letify-2.12.6}/letify-core/Cargo.toml +1 -1
  7. {letify-2.12.5 → letify-2.12.6}/letify-ext/package-lock.json +2 -2
  8. {letify-2.12.5 → letify-2.12.6}/letify-ext/package.json +1 -1
  9. {letify-2.12.5 → letify-2.12.6}/pyproject.toml +1 -1
  10. {letify-2.12.5 → letify-2.12.6}/tests/conftest.py +187 -0
  11. {letify-2.12.5 → letify-2.12.6}/tests/test_link_agent.py +3 -0
  12. {letify-2.12.5 → letify-2.12.6}/tests/test_link_mailbox_close.py +44 -1
  13. {letify-2.12.5 → letify-2.12.6}/tests/test_link_signal.py +3 -0
  14. letify-2.12.6/tests/test_network_guard.py +59 -0
  15. {letify-2.12.5 → letify-2.12.6}/tests/test_run_takeover.py +6 -0
  16. letify-2.12.6/tests/test_suite_guards.py +46 -0
  17. {letify-2.12.5 → letify-2.12.6}/tests/test_transport.py +4 -2
  18. {letify-2.12.5 → letify-2.12.6}/tests/test_tunnel_setup.py +5 -1
  19. {letify-2.12.5 → letify-2.12.6}/.github/workflows/ci.yml +0 -0
  20. {letify-2.12.5 → letify-2.12.6}/.github/workflows/docs.yml +0 -0
  21. {letify-2.12.5 → letify-2.12.6}/.github/workflows/letify-link.yml +0 -0
  22. {letify-2.12.5 → letify-2.12.6}/.github/workflows/publish-crates.yml +0 -0
  23. {letify-2.12.5 → letify-2.12.6}/.github/workflows/publish.yml +0 -0
  24. {letify-2.12.5 → letify-2.12.6}/.github/workflows/reserve-crates.yml +0 -0
  25. {letify-2.12.5 → letify-2.12.6}/.gitignore +0 -0
  26. {letify-2.12.5 → letify-2.12.6}/.researchtree +0 -0
  27. {letify-2.12.5 → letify-2.12.6}/CLAUDE.md +0 -0
  28. {letify-2.12.5 → letify-2.12.6}/LICENSE +0 -0
  29. {letify-2.12.5 → letify-2.12.6}/PROJECT.md +0 -0
  30. {letify-2.12.5 → letify-2.12.6}/README.md +0 -0
  31. {letify-2.12.5 → letify-2.12.6}/docs/COMPONENT.md +0 -0
  32. {letify-2.12.5 → letify-2.12.6}/docs/INTENT.md +0 -0
  33. {letify-2.12.5 → letify-2.12.6}/docs/NETWORK.md +0 -0
  34. {letify-2.12.5 → letify-2.12.6}/docs/ROADMAP-3.0.md +0 -0
  35. {letify-2.12.5 → letify-2.12.6}/docs/guide/01-getting-started.md +0 -0
  36. {letify-2.12.5 → letify-2.12.6}/docs/guide/02-providers.md +0 -0
  37. {letify-2.12.5 → letify-2.12.6}/docs/guide/03-execution-modes.md +0 -0
  38. {letify-2.12.5 → letify-2.12.6}/docs/guide/04-environments-and-data.md +0 -0
  39. {letify-2.12.5 → letify-2.12.6}/docs/guide/05-concurrency.md +0 -0
  40. {letify-2.12.5 → letify-2.12.6}/docs/guide/06-cost.md +0 -0
  41. {letify-2.12.5 → letify-2.12.6}/docs/guide/07-troubleshooting.md +0 -0
  42. {letify-2.12.5 → letify-2.12.6}/docs/guide/08-releasing.md +0 -0
  43. {letify-2.12.5 → letify-2.12.6}/docs/guide/09-agent.md +0 -0
  44. {letify-2.12.5 → letify-2.12.6}/docs/guide/README.md +0 -0
  45. {letify-2.12.5 → letify-2.12.6}/docs/guide/ko/01-/354/213/234/354/236/221/355/225/230/352/270/260.md" +0 -0
  46. {letify-2.12.5 → letify-2.12.6}/docs/guide/ko/02-/355/224/204/353/241/234/353/260/224/354/235/264/353/215/224.md" +0 -0
  47. {letify-2.12.5 → letify-2.12.6}/docs/guide/ko/03-/354/213/244/355/226/211-/353/260/251/354/213/235.md" +0 -0
  48. {letify-2.12.5 → letify-2.12.6}/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
  49. {letify-2.12.5 → letify-2.12.6}/docs/guide/ko/05-/353/217/231/354/213/234-/354/213/244/355/226/211.md" +0 -0
  50. {letify-2.12.5 → letify-2.12.6}/docs/guide/ko/06-/353/271/204/354/232/251.md" +0 -0
  51. {letify-2.12.5 → letify-2.12.6}/docs/guide/ko/07-/353/254/270/354/240/234-/355/225/264/352/262/260.md" +0 -0
  52. {letify-2.12.5 → letify-2.12.6}/docs/guide/ko/08-/353/246/264/353/246/254/354/212/244.md" +0 -0
  53. {letify-2.12.5 → letify-2.12.6}/docs/guide/ko/09-/354/227/220/354/235/264/354/240/204/355/212/270.md" +0 -0
  54. {letify-2.12.5 → letify-2.12.6}/docs/guide/ko/README.md +0 -0
  55. {letify-2.12.5 → letify-2.12.6}/docs/locales/README_ko.md +0 -0
  56. {letify-2.12.5 → letify-2.12.6}/docs/mkdocs.yml +0 -0
  57. {letify-2.12.5 → letify-2.12.6}/examples/README.md +0 -0
  58. {letify-2.12.5 → letify-2.12.6}/examples/nvfp4-lora/.letify.example +0 -0
  59. {letify-2.12.5 → letify-2.12.6}/examples/nvfp4-lora/00_smoke.py +0 -0
  60. {letify-2.12.5 → letify-2.12.6}/examples/nvfp4-lora/01_sweep.py +0 -0
  61. {letify-2.12.5 → letify-2.12.6}/examples/nvfp4-lora/02_resume.py +0 -0
  62. {letify-2.12.5 → letify-2.12.6}/examples/nvfp4-lora/03_watch.py +0 -0
  63. {letify-2.12.5 → letify-2.12.6}/examples/nvfp4-lora/README.md +0 -0
  64. {letify-2.12.5 → letify-2.12.6}/examples/nvfp4-lora/README_ko.md +0 -0
  65. {letify-2.12.5 → letify-2.12.6}/examples/nvfp4-lora/common.py +0 -0
  66. {letify-2.12.5 → letify-2.12.6}/examples/nvfp4-lora/recipe.py +0 -0
  67. {letify-2.12.5 → letify-2.12.6}/letify/cli.py +0 -0
  68. {letify-2.12.5 → letify-2.12.6}/letify/config/__init__.py +0 -0
  69. {letify-2.12.5 → letify-2.12.6}/letify/config/inventory.py +0 -0
  70. {letify-2.12.5 → letify-2.12.6}/letify/config/login.py +0 -0
  71. {letify-2.12.5 → letify-2.12.6}/letify/config/schema.py +0 -0
  72. {letify-2.12.5 → letify-2.12.6}/letify/config/secrets.py +0 -0
  73. {letify-2.12.5 → letify-2.12.6}/letify/config/writer.py +0 -0
  74. {letify-2.12.5 → letify-2.12.6}/letify/declare/__init__.py +0 -0
  75. {letify-2.12.5 → letify-2.12.6}/letify/declare/cache.py +0 -0
  76. {letify-2.12.5 → letify-2.12.6}/letify/declare/env.py +0 -0
  77. {letify-2.12.5 → letify-2.12.6}/letify/declare/exit.py +0 -0
  78. {letify-2.12.5 → letify-2.12.6}/letify/declare/function.py +0 -0
  79. {letify-2.12.5 → letify-2.12.6}/letify/declare/instance.py +0 -0
  80. {letify-2.12.5 → letify-2.12.6}/letify/declare/reduce.py +0 -0
  81. {letify-2.12.5 → letify-2.12.6}/letify/declare/replicas.py +0 -0
  82. {letify-2.12.5 → letify-2.12.6}/letify/errors.py +0 -0
  83. {letify-2.12.5 → letify-2.12.6}/letify/install.py +0 -0
  84. {letify-2.12.5 → letify-2.12.6}/letify/launcher.py +0 -0
  85. {letify-2.12.5 → letify-2.12.6}/letify/paths.py +0 -0
  86. {letify-2.12.5 → letify-2.12.6}/letify/protocol/__init__.py +0 -0
  87. {letify-2.12.5 → letify-2.12.6}/letify/protocol/codec.py +0 -0
  88. {letify-2.12.5 → letify-2.12.6}/letify/protocol/driver.py +0 -0
  89. {letify-2.12.5 → letify-2.12.6}/letify/protocol/handle.py +0 -0
  90. {letify-2.12.5 → letify-2.12.6}/letify/protocol/wire.py +0 -0
  91. {letify-2.12.5 → letify-2.12.6}/letify/protocol/worker.py +0 -0
  92. {letify-2.12.5 → letify-2.12.6}/letify/providers/__init__.py +0 -0
  93. {letify-2.12.5 → letify-2.12.6}/letify/providers/base.py +0 -0
  94. {letify-2.12.5 → letify-2.12.6}/letify/providers/colab.py +0 -0
  95. {letify-2.12.5 → letify-2.12.6}/letify/providers/colab_files.py +0 -0
  96. {letify-2.12.5 → letify-2.12.6}/letify/providers/colab_keepalive.py +0 -0
  97. {letify-2.12.5 → letify-2.12.6}/letify/providers/elice.py +0 -0
  98. {letify-2.12.5 → letify-2.12.6}/letify/providers/kaggle.py +0 -0
  99. {letify-2.12.5 → letify-2.12.6}/letify/providers/kaggle_adapter.py +0 -0
  100. {letify-2.12.5 → letify-2.12.6}/letify/providers/local.py +0 -0
  101. {letify-2.12.5 → letify-2.12.6}/letify/providers/modal.py +0 -0
  102. {letify-2.12.5 → letify-2.12.6}/letify/providers/modal_adapter.py +0 -0
  103. {letify-2.12.5 → letify-2.12.6}/letify/providers/naming.py +0 -0
  104. {letify-2.12.5 → letify-2.12.6}/letify/providers/shell.py +0 -0
  105. {letify-2.12.5 → letify-2.12.6}/letify/providers/tunnel.py +0 -0
  106. {letify-2.12.5 → letify-2.12.6}/letify/providers/usage.py +0 -0
  107. {letify-2.12.5 → letify-2.12.6}/letify/remoting/__init__.py +0 -0
  108. {letify-2.12.5 → letify-2.12.6}/letify/remoting/device/__init__.py +0 -0
  109. {letify-2.12.5 → letify-2.12.6}/letify/remoting/device/client.py +0 -0
  110. {letify-2.12.5 → letify-2.12.6}/letify/remoting/device/cuda.py +0 -0
  111. {letify-2.12.5 → letify-2.12.6}/letify/remoting/device/executor.py +0 -0
  112. {letify-2.12.5 → letify-2.12.6}/letify/remoting/device/frames.py +0 -0
  113. {letify-2.12.5 → letify-2.12.6}/letify/remoting/device/guard.py +0 -0
  114. {letify-2.12.5 → letify-2.12.6}/letify/remoting/device/tensor.py +0 -0
  115. {letify-2.12.5 → letify-2.12.6}/letify/remoting/device/trace.py +0 -0
  116. {letify-2.12.5 → letify-2.12.6}/letify/remoting/device/value.py +0 -0
  117. {letify-2.12.5 → letify-2.12.6}/letify/render.py +0 -0
  118. {letify-2.12.5 → letify-2.12.6}/letify/runtime/__init__.py +0 -0
  119. {letify-2.12.5 → letify-2.12.6}/letify/runtime/bootstrap.py +0 -0
  120. {letify-2.12.5 → letify-2.12.6}/letify/runtime/broker.py +0 -0
  121. {letify-2.12.5 → letify-2.12.6}/letify/runtime/channel.py +0 -0
  122. {letify-2.12.5 → letify-2.12.6}/letify/runtime/control.py +0 -0
  123. {letify-2.12.5 → letify-2.12.6}/letify/runtime/lease.py +0 -0
  124. {letify-2.12.5 → letify-2.12.6}/letify/runtime/pool.py +0 -0
  125. {letify-2.12.5 → letify-2.12.6}/letify/runtime/reattach.py +0 -0
  126. {letify-2.12.5 → letify-2.12.6}/letify/runtime/session.py +0 -0
  127. {letify-2.12.5 → letify-2.12.6}/letify/runtime/takeover.py +0 -0
  128. {letify-2.12.5 → letify-2.12.6}/letify/runtime/telemetry.py +0 -0
  129. {letify-2.12.5 → letify-2.12.6}/letify/runtime/workers.py +0 -0
  130. {letify-2.12.5 → letify-2.12.6}/letify/store/__init__.py +0 -0
  131. {letify-2.12.5 → letify-2.12.6}/letify/store/backends/__init__.py +0 -0
  132. {letify-2.12.5 → letify-2.12.6}/letify/store/backends/drive.py +0 -0
  133. {letify-2.12.5 → letify-2.12.6}/letify/store/backends/filesystem.py +0 -0
  134. {letify-2.12.5 → letify-2.12.6}/letify/store/backends/google_auth.py +0 -0
  135. {letify-2.12.5 → letify-2.12.6}/letify/store/backends/layout.py +0 -0
  136. {letify-2.12.5 → letify-2.12.6}/letify/store/backends/objects.py +0 -0
  137. {letify-2.12.5 → letify-2.12.6}/letify/store/cas.py +0 -0
  138. {letify-2.12.5 → letify-2.12.6}/letify/store/handoff.py +0 -0
  139. {letify-2.12.5 → letify-2.12.6}/letify/store/pathdata.py +0 -0
  140. {letify-2.12.5 → letify-2.12.6}/letify/store/sendorder.py +0 -0
  141. {letify-2.12.5 → letify-2.12.6}/letify/store/volume.py +0 -0
  142. {letify-2.12.5 → letify-2.12.6}/letify/stubs.py +0 -0
  143. {letify-2.12.5 → letify-2.12.6}/letify/tools.py +0 -0
  144. {letify-2.12.5 → letify-2.12.6}/letify/transport/__init__.py +0 -0
  145. {letify-2.12.5 → letify-2.12.6}/letify/transport/agent.py +0 -0
  146. {letify-2.12.5 → letify-2.12.6}/letify/transport/announce.py +0 -0
  147. {letify-2.12.5 → letify-2.12.6}/letify/transport/link.py +0 -0
  148. {letify-2.12.5 → letify-2.12.6}/letify/transport/linkagent.py +0 -0
  149. {letify-2.12.5 → letify-2.12.6}/letify/transport/linkchannel.py +0 -0
  150. {letify-2.12.5 → letify-2.12.6}/letify/transport/linkd.py +0 -0
  151. {letify-2.12.5 → letify-2.12.6}/letify/transport/linkmailbox.py +0 -0
  152. {letify-2.12.5 → letify-2.12.6}/letify/transport/linkshim.py +0 -0
  153. {letify-2.12.5 → letify-2.12.6}/letify/transport/linksignal.py +0 -0
  154. {letify-2.12.5 → letify-2.12.6}/letify/transport/linkupload.py +0 -0
  155. {letify-2.12.5 → letify-2.12.6}/letify/transport/linkwebsocket.py +0 -0
  156. {letify-2.12.5 → letify-2.12.6}/letify/transport/nat.py +0 -0
  157. {letify-2.12.5 → letify-2.12.6}/letify/transport/pipeline.py +0 -0
  158. {letify-2.12.5 → letify-2.12.6}/letify/transport/portmap.py +0 -0
  159. {letify-2.12.5 → letify-2.12.6}/letify/transport/probe.py +0 -0
  160. {letify-2.12.5 → letify-2.12.6}/letify/transport/quic.py +0 -0
  161. {letify-2.12.5 → letify-2.12.6}/letify/transport/rendezvous.py +0 -0
  162. {letify-2.12.5 → letify-2.12.6}/letify/transport/setup.py +0 -0
  163. {letify-2.12.5 → letify-2.12.6}/letify/transport/sshopts.py +0 -0
  164. {letify-2.12.5 → letify-2.12.6}/letify/transport/strategies.py +0 -0
  165. {letify-2.12.5 → letify-2.12.6}/letify/useragent.py +0 -0
  166. {letify-2.12.5 → letify-2.12.6}/letify-core/.gitignore +0 -0
  167. {letify-2.12.5 → letify-2.12.6}/letify-core/build.py +0 -0
  168. {letify-2.12.5 → letify-2.12.6}/letify-core/letify/Cargo.toml +0 -0
  169. {letify-2.12.5 → letify-2.12.6}/letify-core/letify/LICENSE +0 -0
  170. {letify-2.12.5 → letify-2.12.6}/letify-core/letify/README.md +0 -0
  171. {letify-2.12.5 → letify-2.12.6}/letify-core/letify/src/lib.rs +0 -0
  172. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/Cargo.toml +0 -0
  173. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/examples/bench.rs +0 -0
  174. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/acceptor.rs +0 -0
  175. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/bin/letify-link.rs +0 -0
  176. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/config.rs +0 -0
  177. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/error.rs +0 -0
  178. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/frame.rs +0 -0
  179. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/handshake.rs +0 -0
  180. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/hysteresis.rs +0 -0
  181. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/identity.rs +0 -0
  182. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/keys.rs +0 -0
  183. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/lib.rs +0 -0
  184. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/observe.rs +0 -0
  185. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/paths.rs +0 -0
  186. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/plan.rs +0 -0
  187. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/policing.rs +0 -0
  188. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/punch.rs +0 -0
  189. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/record.rs +0 -0
  190. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/relay.rs +0 -0
  191. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/rendezvous.rs +0 -0
  192. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/replay.rs +0 -0
  193. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/session.rs +0 -0
  194. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/sidecar.rs +0 -0
  195. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/stream.rs +0 -0
  196. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/stun.rs +0 -0
  197. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/tcp.rs +0 -0
  198. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/trace.rs +0 -0
  199. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/src/udp.rs +0 -0
  200. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/acceptor.rs +0 -0
  201. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/api.rs +0 -0
  202. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/common/mod.rs +0 -0
  203. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/diag_sim.rs +0 -0
  204. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/fairness.rs +0 -0
  205. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/gauge.rs +0 -0
  206. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/handshake.rs +0 -0
  207. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/hysteresis.rs +0 -0
  208. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/keepalive.rs +0 -0
  209. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/mobile.rs +0 -0
  210. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/nat.rs +0 -0
  211. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/paths.rs +0 -0
  212. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/qad.rs +0 -0
  213. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/rekey.rs +0 -0
  214. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/relay.rs +0 -0
  215. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/relay_pairing.rs +0 -0
  216. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/rendezvous.rs +0 -0
  217. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/reorder.rs +0 -0
  218. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/replay.rs +0 -0
  219. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/resume.rs +0 -0
  220. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/revoke.rs +0 -0
  221. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/session.rs +0 -0
  222. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/sidecar.rs +0 -0
  223. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/startup.rs +0 -0
  224. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/subflows.rs +0 -0
  225. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/trace.rs +0 -0
  226. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/udp.rs +0 -0
  227. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-link/tests/udp_bench.rs +0 -0
  228. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-quic/Cargo.toml +0 -0
  229. {letify-2.12.5 → letify-2.12.6}/letify-core/letify-quic/src/main.rs +0 -0
  230. {letify-2.12.5 → letify-2.12.6}/letify-core/rust-toolchain.toml +0 -0
  231. {letify-2.12.5 → letify-2.12.6}/letify-ext/.vscodeignore +0 -0
  232. {letify-2.12.5 → letify-2.12.6}/letify-ext/LICENSE +0 -0
  233. {letify-2.12.5 → letify-2.12.6}/letify-ext/README.md +0 -0
  234. {letify-2.12.5 → letify-2.12.6}/letify-ext/media/icon.svg +0 -0
  235. {letify-2.12.5 → letify-2.12.6}/letify-ext/src/cli.ts +0 -0
  236. {letify-2.12.5 → letify-2.12.6}/letify-ext/src/extension.ts +0 -0
  237. {letify-2.12.5 → letify-2.12.6}/letify-ext/src/history.ts +0 -0
  238. {letify-2.12.5 → letify-2.12.6}/letify-ext/src/model.ts +0 -0
  239. {letify-2.12.5 → letify-2.12.6}/letify-ext/src/poll.ts +0 -0
  240. {letify-2.12.5 → letify-2.12.6}/letify-ext/src/render.ts +0 -0
  241. {letify-2.12.5 → letify-2.12.6}/letify-ext/test/cli.test.ts +0 -0
  242. {letify-2.12.5 → letify-2.12.6}/letify-ext/test/manifest.test.ts +0 -0
  243. {letify-2.12.5 → letify-2.12.6}/letify-ext/test/model.test.ts +0 -0
  244. {letify-2.12.5 → letify-2.12.6}/letify-ext/test/regressions.test.ts +0 -0
  245. {letify-2.12.5 → letify-2.12.6}/letify-ext/tsconfig.json +0 -0
  246. {letify-2.12.5 → letify-2.12.6}/letify-signal/README.md +0 -0
  247. {letify-2.12.5 → letify-2.12.6}/letify-signal/cloudflare.config.ts +0 -0
  248. {letify-2.12.5 → letify-2.12.6}/letify-signal/package-lock.json +0 -0
  249. {letify-2.12.5 → letify-2.12.6}/letify-signal/package.json +0 -0
  250. {letify-2.12.5 → letify-2.12.6}/letify-signal/src/auth.ts +0 -0
  251. {letify-2.12.5 → letify-2.12.6}/letify-signal/src/ed25519.ts +0 -0
  252. {letify-2.12.5 → letify-2.12.6}/letify-signal/src/handler.ts +0 -0
  253. {letify-2.12.5 → letify-2.12.6}/letify-signal/src/index.ts +0 -0
  254. {letify-2.12.5 → letify-2.12.6}/letify-signal/src/limiter.ts +0 -0
  255. {letify-2.12.5 → letify-2.12.6}/letify-signal/src/mailbox.ts +0 -0
  256. {letify-2.12.5 → letify-2.12.6}/letify-signal/src/objects.ts +0 -0
  257. {letify-2.12.5 → letify-2.12.6}/letify-signal/src/protocol.ts +0 -0
  258. {letify-2.12.5 → letify-2.12.6}/letify-signal/src/storage.ts +0 -0
  259. {letify-2.12.5 → letify-2.12.6}/letify-signal/test/auth.test.ts +0 -0
  260. {letify-2.12.5 → letify-2.12.6}/letify-signal/test/ed25519.test.ts +0 -0
  261. {letify-2.12.5 → letify-2.12.6}/letify-signal/test/helpers.ts +0 -0
  262. {letify-2.12.5 → letify-2.12.6}/letify-signal/test/interop.test.ts +0 -0
  263. {letify-2.12.5 → letify-2.12.6}/letify-signal/test/limiter.test.ts +0 -0
  264. {letify-2.12.5 → letify-2.12.6}/letify-signal/test/mailbox.test.ts +0 -0
  265. {letify-2.12.5 → letify-2.12.6}/letify-signal/test/objects.test.ts +0 -0
  266. {letify-2.12.5 → letify-2.12.6}/letify-signal/test/setup.ts +0 -0
  267. {letify-2.12.5 → letify-2.12.6}/letify-signal/test/worker.test.ts +0 -0
  268. {letify-2.12.5 → letify-2.12.6}/letify-signal/tsconfig.json +0 -0
  269. {letify-2.12.5 → letify-2.12.6}/letify-signal/vitest.config.ts +0 -0
  270. {letify-2.12.5 → letify-2.12.6}/letify_providers.py +0 -0
  271. {letify-2.12.5 → letify-2.12.6}/scripts/sync-main.sh +0 -0
  272. {letify-2.12.5 → letify-2.12.6}/scripts/version.py +0 -0
  273. {letify-2.12.5 → letify-2.12.6}/tests/fake_kaggle_adapter.py +0 -0
  274. {letify-2.12.5 → letify-2.12.6}/tests/fake_modal_adapter.py +0 -0
  275. {letify-2.12.5 → letify-2.12.6}/tests/test_cli.py +0 -0
  276. {letify-2.12.5 → letify-2.12.6}/tests/test_cli_output.py +0 -0
  277. {letify-2.12.5 → letify-2.12.6}/tests/test_colab_keepalive.py +0 -0
  278. {letify-2.12.5 → letify-2.12.6}/tests/test_config.py +0 -0
  279. {letify-2.12.5 → letify-2.12.6}/tests/test_core.py +0 -0
  280. {letify-2.12.5 → letify-2.12.6}/tests/test_data.py +0 -0
  281. {letify-2.12.5 → letify-2.12.6}/tests/test_data_in_place.py +0 -0
  282. {letify-2.12.5 → letify-2.12.6}/tests/test_data_streaming.py +0 -0
  283. {letify-2.12.5 → letify-2.12.6}/tests/test_declare.py +0 -0
  284. {letify-2.12.5 → letify-2.12.6}/tests/test_device.py +0 -0
  285. {letify-2.12.5 → letify-2.12.6}/tests/test_device_compile.py +0 -0
  286. {letify-2.12.5 → letify-2.12.6}/tests/test_distributed.py +0 -0
  287. {letify-2.12.5 → letify-2.12.6}/tests/test_drive_handoff.py +0 -0
  288. {letify-2.12.5 → letify-2.12.6}/tests/test_drive_store.py +0 -0
  289. {letify-2.12.5 → letify-2.12.6}/tests/test_editor_sessions.py +0 -0
  290. {letify-2.12.5 → letify-2.12.6}/tests/test_elice.py +0 -0
  291. {letify-2.12.5 → letify-2.12.6}/tests/test_frames.py +0 -0
  292. {letify-2.12.5 → letify-2.12.6}/tests/test_install.py +0 -0
  293. {letify-2.12.5 → letify-2.12.6}/tests/test_kaggle.py +0 -0
  294. {letify-2.12.5 → letify-2.12.6}/tests/test_kaggle_cookie.py +0 -0
  295. {letify-2.12.5 → letify-2.12.6}/tests/test_kaggle_link.py +0 -0
  296. {letify-2.12.5 → letify-2.12.6}/tests/test_link_channel.py +0 -0
  297. {letify-2.12.5 → letify-2.12.6}/tests/test_link_command_channel.py +0 -0
  298. {letify-2.12.5 → letify-2.12.6}/tests/test_link_exec.py +0 -0
  299. {letify-2.12.5 → letify-2.12.6}/tests/test_link_log.py +0 -0
  300. {letify-2.12.5 → letify-2.12.6}/tests/test_link_opt_in.py +0 -0
  301. {letify-2.12.5 → letify-2.12.6}/tests/test_link_ssh_stream.py +0 -0
  302. {letify-2.12.5 → letify-2.12.6}/tests/test_link_upload.py +0 -0
  303. {letify-2.12.5 → letify-2.12.6}/tests/test_linkd.py +0 -0
  304. {letify-2.12.5 → letify-2.12.6}/tests/test_notebook.py +0 -0
  305. {letify-2.12.5 → letify-2.12.6}/tests/test_parallel_placement.py +0 -0
  306. {letify-2.12.5 → letify-2.12.6}/tests/test_paths.py +0 -0
  307. {letify-2.12.5 → letify-2.12.6}/tests/test_portmap.py +0 -0
  308. {letify-2.12.5 → letify-2.12.6}/tests/test_protocol.py +0 -0
  309. {letify-2.12.5 → letify-2.12.6}/tests/test_providers.py +0 -0
  310. {letify-2.12.5 → letify-2.12.6}/tests/test_punch_sockets.py +0 -0
  311. {letify-2.12.5 → letify-2.12.6}/tests/test_quic.py +0 -0
  312. {letify-2.12.5 → letify-2.12.6}/tests/test_remoting.py +0 -0
  313. {letify-2.12.5 → letify-2.12.6}/tests/test_render.py +0 -0
  314. {letify-2.12.5 → letify-2.12.6}/tests/test_run_control.py +0 -0
  315. {letify-2.12.5 → letify-2.12.6}/tests/test_run_reattach.py +0 -0
  316. {letify-2.12.5 → letify-2.12.6}/tests/test_runtime.py +0 -0
  317. {letify-2.12.5 → letify-2.12.6}/tests/test_shell_workers.py +0 -0
  318. {letify-2.12.5 → letify-2.12.6}/tests/test_ship.py +0 -0
  319. {letify-2.12.5 → letify-2.12.6}/tests/test_store.py +0 -0
  320. {letify-2.12.5 → letify-2.12.6}/tests/test_strategies.py +0 -0
  321. {letify-2.12.5 → letify-2.12.6}/tests/test_stubs.py +0 -0
  322. {letify-2.12.5 → letify-2.12.6}/tests/test_tunnel_agent_login.py +0 -0
  323. {letify-2.12.5 → letify-2.12.6}/tests/test_user_agent.py +0 -0
  324. {letify-2.12.5 → letify-2.12.6}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: letify
3
- Version: 2.12.5
3
+ Version: 2.12.6
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
@@ -2467,7 +2467,7 @@ The sidecar is a binary named `letify-link`, built for each wheel and installed
2467
2467
  8. **Bootstrap over a command channel (Colab and Kaggle).** `link = "letify-link"` on a `colab` or `kaggle` account carries the worker channel and the transfer streams over a session, with no ssh server, no strategy race and no Tailcat. These runtimes have no inbound TCP and no address, so the session starts from punched candidates only, as item 7 says for an account with no address. The bootstrap is the provider's own command channel, which runs one Python program on the runtime and returns what it printed: `colab exec` for Colab, and `eval` on the open kernel bridge for Kaggle. That channel costs seconds per call and has no standard input, so three pieces replace the ssh command of item 7.
2468
2468
  - **The binary.** The same as item 7: the account's `link_binary`, or `letify-link` taken out of the wheel of letify's own version by running `install.remote_link_source` through the command channel, as `CommandRendezvous` does for `letify-quic`. A missing or non-executable file fails the connect with `<alias> cannot connect over letify-link: letify-link is not at <path>`.
2469
2469
  - **Development upload.** The account's `link_binary_upload` (or `LETIFY_LINK_UPLOAD`) of item 7 applies to `colab` and `kaggle` accounts, and the binary goes through the command channel in chunks as item 7 describes.
2470
- - **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. **Close ends the runtime side.** `MailboxBootstrap.close` makes one last call, `op` `close`. The pump then stops the shim, which stops its sidecar, and removes its directory. When the shim has already said `handed_over`, the pump leaves the shim alone, because it serves the session and ends by itself under the idle rules of item 7, and only removes the directory and exits. A pump that no call has reached for `IDLE_S` (120 s) does the same, so a client that died leaves nothing behind. The shim, when its standard input ends before the hand-over, stops its sidecar before it exits. After a close before the hand-over, no process the bootstrap started is alive and its directory is gone within 5 s, and a test pins it.
2470
+ - **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. **Close ends the runtime side.** `MailboxBootstrap.close` makes one last call, `op` `close`. The pump then stops the shim, which stops its sidecar, and removes its directory. When the shim has already said `handed_over`, which the pump knows from reading that line before it makes the line readable, so a close that follows at once is too late to end the shim, the pump leaves the shim alone, because it serves the session and ends by itself under the idle rules of item 7, and only removes the directory and exits. A pump that no call has reached for `IDLE_S` (120 s) does the same, so a client that died leaves nothing behind. The shim, when its standard input ends before the hand-over, stops its sidecar before it exits. After a close before the hand-over, no process the bootstrap started is alive and its directory is gone within 5 s, and a test pins it.
2471
2471
  - **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:
2472
2472
  - `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.
2473
2473
  - `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.
@@ -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.12.5"
73
+ __version__ = "2.12.6"
74
74
 
75
75
 
76
76
  def fetch(tensor): # type: ignore[no-untyped-def]
@@ -131,6 +131,14 @@ def pump(directory):
131
131
  threading.Thread(target=watch, daemon=True).start()
132
132
  with open(os.path.join(directory, "outbox"), "ab") as outbox:
133
133
  for line in shim.stdout:
134
+ if b"handed_over" in line:
135
+ # Known before the client can read the line, so that a close that follows at
136
+ # once finds the shim handed over and leaves it, and what it started, alone.
137
+ try:
138
+ if json.loads(line).get("event") == "handed_over":
139
+ state["handed"] = True
140
+ except ValueError:
141
+ pass
134
142
  outbox.write(line)
135
143
  outbox.flush()
136
144
  try:
@@ -396,11 +396,11 @@ dependencies = [
396
396
 
397
397
  [[package]]
398
398
  name = "letify"
399
- version = "2.12.5"
399
+ version = "2.12.6"
400
400
 
401
401
  [[package]]
402
402
  name = "letify-link"
403
- version = "2.12.5"
403
+ version = "2.12.6"
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.12.5"
419
+ version = "2.12.6"
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.12.5"
11
+ version = "2.12.6"
12
12
  edition = "2024"
13
13
  license = "MIT"
14
14
  repository = "https://github.com/DarkPyonix/letify"
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "letify-status",
3
- "version": "2.12.5",
3
+ "version": "2.12.6",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "letify-status",
9
- "version": "2.12.5",
9
+ "version": "2.12.6",
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.12.5",
5
+ "version": "2.12.6",
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.12.5"
3
+ version = "2.12.6"
4
4
  description = "Declarations that become infrastructure."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -14,6 +14,7 @@ from __future__ import annotations
14
14
 
15
15
  import base64
16
16
  import contextlib
17
+ import ipaddress
17
18
  import json
18
19
  import os
19
20
  import shutil
@@ -107,6 +108,192 @@ def private_letify_home(monkeypatch, tmp_path: Path) -> Path:
107
108
  return home
108
109
 
109
110
 
111
+ class PublicNetworkAccess(AssertionError):
112
+ """A test reached for an address that is not on this machine."""
113
+
114
+
115
+ _public_network_attempts: list[str] = []
116
+ _current_test: list[str] = ["<outside a test>"]
117
+ _real_socket_methods = {
118
+ name: getattr(socket.socket, name) for name in ("connect", "connect_ex", "sendto")
119
+ }
120
+ _real_getaddrinfo = socket.getaddrinfo
121
+
122
+
123
+ _DOCUMENTATION_NETWORKS = [
124
+ ipaddress.ip_network(net) for net in ("192.0.2.0/24", "198.51.100.0/24", "203.0.113.0/24")
125
+ ]
126
+
127
+
128
+ def _is_local_host(host: Any) -> bool:
129
+ if isinstance(host, bytes):
130
+ host = host.decode("ascii", "replace")
131
+ if host in (None, "", "localhost", "ip6-localhost", "<broadcast>"):
132
+ return True
133
+ host = str(host).split("%", 1)[0]
134
+ try:
135
+ address = ipaddress.ip_address(host)
136
+ except ValueError:
137
+ return host.endswith(".localhost")
138
+ if address.is_loopback or host in ("0.0.0.0", "::"):
139
+ return True
140
+ # RFC 5737 documentation ranges are never routed, so a packet to one reaches no service.
141
+ # Tests use them as a peer that answers nothing, which loopback cannot imitate.
142
+ return any(address in net for net in _DOCUMENTATION_NETWORKS)
143
+
144
+
145
+ def _refuse(host: Any, port: Any) -> None:
146
+ message = (
147
+ f"{_current_test[0]} reached for the public address {host}:{port}. The suite has no "
148
+ "public network: use the stun_server fixture, FakeSignalService or a loopback server, "
149
+ "or mark the test with @pytest.mark.network and say why."
150
+ )
151
+ _public_network_attempts.append(message)
152
+ raise PublicNetworkAccess(message)
153
+
154
+
155
+ def _guarded_method(name: str):
156
+ real = _real_socket_methods[name]
157
+
158
+ def guarded(self: socket.socket, *args: Any):
159
+ address = args[-1]
160
+ inet = self.family in (socket.AF_INET, socket.AF_INET6) and isinstance(address, tuple)
161
+ if inet and not _is_local_host(address[0]) and not _current_test_allows_network():
162
+ _refuse(address[0], address[1] if len(address) > 1 else "")
163
+ return real(self, *args)
164
+
165
+ guarded.__name__ = name
166
+ return guarded
167
+
168
+
169
+ def _guarded_getaddrinfo(host, port, *args: Any, **kwargs: Any):
170
+ if not _is_local_host(host) and not _current_test_allows_network():
171
+ _refuse(host, port)
172
+ return _real_getaddrinfo(host, port, *args, **kwargs)
173
+
174
+
175
+ _network_allowed = [False]
176
+
177
+
178
+ def _current_test_allows_network() -> bool:
179
+ return _network_allowed[0]
180
+
181
+
182
+ def pytest_configure(config) -> None:
183
+ config.addinivalue_line(
184
+ "markers", "network: the test genuinely needs the public network (say why in the marker)"
185
+ )
186
+ for name in _real_socket_methods:
187
+ setattr(socket.socket, name, _guarded_method(name))
188
+ # create_connection resolves through socket.getaddrinfo and then connects, so both are covered.
189
+ socket.getaddrinfo = _guarded_getaddrinfo
190
+
191
+
192
+ @pytest.fixture(autouse=True)
193
+ def no_public_network(request, monkeypatch) -> Any:
194
+ """Make a connection to any address that is not loopback fail the test.
195
+
196
+ The guard patches ``socket.socket.connect``, ``connect_ex``, ``sendto`` and
197
+ ``socket.getaddrinfo`` for the whole run, so ``create_connection``, ``urllib`` and
198
+ ``http.client`` are covered. The exception is an AssertionError rather than an OSError
199
+ so code that handles a network failure does not swallow it, and each attempt is
200
+ recorded so a test that swallows it anyway still fails at teardown. Subprocesses are
201
+ not covered by an in-process guard, so the environment variables letify honours are
202
+ pointed at loopback: the STUN list of the sidecar and the signalling service URL.
203
+ A test marked ``network`` is exempt.
204
+ """
205
+ _current_test[0] = request.node.nodeid
206
+ _network_allowed[0] = request.node.get_closest_marker("network") is not None
207
+ _public_network_attempts.clear()
208
+ monkeypatch.setenv("LETIFY_LINK_STUN", "127.0.0.1:9")
209
+ monkeypatch.setenv("LETIFY_SIGNAL_URL", "http://127.0.0.1:9")
210
+ yield
211
+ attempts = list(_public_network_attempts)
212
+ _public_network_attempts.clear()
213
+ _network_allowed[0] = False
214
+ _current_test[0] = "<outside a test>"
215
+ if attempts:
216
+ pytest.fail("\n".join(attempts), pytrace=False)
217
+
218
+
219
+ #: The environment variable that names the test a process was started under. Every process a
220
+ #: test starts, detached or not, inherits it, so the teardown can find what the test left.
221
+ TEST_MARK = "LETIFY_TEST_MARK"
222
+
223
+
224
+ def leaked_link_processes(mark: str, wait: float = 5.0) -> dict[int, str]:
225
+ """The letify-link processes still running that were started under ``mark``.
226
+
227
+ A sidecar, a shim and a mailbox pump all carry ``letify-link`` in their command line. A
228
+ process gets ``wait`` seconds to exit, because a close returns before the process is
229
+ reaped. Zombies are not running and are skipped.
230
+ """
231
+ import time
232
+
233
+ needle = f"{TEST_MARK}={mark}".encode()
234
+ deadline = time.monotonic() + wait
235
+ while True:
236
+ found: dict[int, str] = {}
237
+ for entry in Path("/proc").iterdir():
238
+ if not entry.name.isdigit() or int(entry.name) == os.getpid():
239
+ continue
240
+ try:
241
+ state = (entry / "stat").read_text().rsplit(")", 1)[1].split()[0]
242
+ environ = (entry / "environ").read_bytes().split(b"\0")
243
+ raw = (entry / "cmdline").read_bytes()
244
+ except (OSError, IndexError):
245
+ continue
246
+ command = raw.replace(b"\0", b" ").decode("utf-8", "replace")
247
+ if state != "Z" and needle in environ and "letify-link" in command:
248
+ found[int(entry.name)] = command[:120]
249
+ if not found or time.monotonic() >= deadline:
250
+ return found
251
+ time.sleep(0.1)
252
+
253
+
254
+ def end_link_processes(mark: str | None = None, wait: float = 5.0) -> dict[int, str]:
255
+ """Kill by pid the letify-link processes started under ``mark``, this test's by default.
256
+
257
+ Returns what was still running. A test that must end a process the product keeps by
258
+ design, such as the shim that serves a taken-over run for its lease window, calls this
259
+ and says why.
260
+ """
261
+ import signal
262
+
263
+ found = leaked_link_processes(mark or os.environ[TEST_MARK], wait)
264
+ for pid in found:
265
+ with contextlib.suppress(OSError):
266
+ os.kill(pid, signal.SIGKILL)
267
+ return found
268
+
269
+
270
+ @pytest.fixture(autouse=True)
271
+ def no_link_process_survives(request) -> Any:
272
+ """Fail a test that leaves a letify-link process it started running at teardown.
273
+
274
+ The sidecar of a session, the shim that serves it on the remote side and the mailbox
275
+ pump are started by the test or by a process the test started. A test that does not
276
+ close what it opened leaves them for the lease window (300 s), and a full run then ends
277
+ with orphans. The leftovers are killed by pid so they cannot pile up, and the test fails.
278
+ """
279
+ import uuid
280
+
281
+ mark = f"{request.node.nodeid}#{uuid.uuid4().hex}"
282
+ os.environ[TEST_MARK] = mark
283
+ try:
284
+ yield
285
+ finally:
286
+ os.environ.pop(TEST_MARK, None)
287
+ left = end_link_processes(mark) if sys.platform == "linux" else {}
288
+ if left:
289
+ listing = "\n".join(f" {pid}: {command}" for pid, command in left.items())
290
+ pytest.fail(
291
+ f"{request.node.nodeid} left letify-link processes running (now killed):\n{listing}\n"
292
+ "Close the LinkRemote, LinkChannel or bootstrap the test opened.",
293
+ pytrace=False,
294
+ )
295
+
296
+
110
297
  @pytest.fixture
111
298
  def isolated_home(monkeypatch, tmp_path: Path) -> Path:
112
299
  """Point Path.home, "~" expansion and the working directory at empty directories.
@@ -450,6 +450,9 @@ def test_a_paired_node_connects_end_to_end_and_unpairing_stops_the_next_connect(
450
450
  )
451
451
  finally:
452
452
  channel.close()
453
+ # The channel does not own the remote: closing it ends the session, so the shim
454
+ # leaves at once instead of waiting out the resume window.
455
+ remote.close()
453
456
  agent.home.paired.remove(local.node_id)
454
457
  assert wait_for(lambda: any(line.startswith("unpaired") for line in agent.lines), 15)
455
458
  with pytest.raises(ProviderUnavailable, match="did not answer"):
@@ -16,7 +16,7 @@ from pathlib import Path
16
16
 
17
17
  import pytest
18
18
 
19
- from letify.transport import linkd, linkmailbox
19
+ from letify.transport import linkd, linkmailbox, linkpump
20
20
 
21
21
 
22
22
  @pytest.fixture
@@ -165,3 +165,46 @@ def test_a_child_of_a_shim_that_ignores_its_input_ending_is_still_ended() -> Non
165
165
  finally:
166
166
  if alive(child):
167
167
  os.kill(child, 9)
168
+
169
+
170
+ HANDING_SHIM = '''
171
+ import json, os, subprocess, sys, time
172
+ child = subprocess.Popen(["sleep", "300"])
173
+ sys.stdin.readline()
174
+ print(json.dumps({"event": "handed_over", "child": child.pid, "shim": os.getpid()}), flush=True)
175
+ devnull = os.open(os.devnull, os.O_RDWR)
176
+ os.dup2(devnull, 0)
177
+ os.dup2(devnull, 1)
178
+ while True:
179
+ time.sleep(1)
180
+ '''
181
+
182
+
183
+ def test_closing_right_after_the_hand_over_leaves_the_shim_and_its_children_running() -> None:
184
+ """Spec "Sidecar interface" item 8: a pump leaves a shim that said handed_over alone.
185
+
186
+ The client closes the mailbox as soon as it reads the line, which is before the shim's
187
+ closed standard output has been seen for ``EXIT_WAIT_S``. The shim and the sidecar it
188
+ started must outlive that close.
189
+ """
190
+ bootstrap = linkmailbox.MailboxBootstrap(run_here, python=sys.executable, shim=HANDING_SHIM)
191
+ bootstrap.start()
192
+ bootstrap.send_line("{}")
193
+ said = {}
194
+ while not said:
195
+ line = bootstrap.recv_line()
196
+ assert line is not None, bootstrap.stderr_text()
197
+ said = json.loads(line)
198
+ child, shim = int(said["child"]), int(said["shim"])
199
+ directory = bootstrap._directory
200
+ try:
201
+ bootstrap.close()
202
+ # Past every wait the pump has (the shim's exit wait and the stop wait).
203
+ time.sleep(linkpump.EXIT_WAIT_S + linkpump.STOP_WAIT_S + 1.0)
204
+ assert alive(shim), "the pump ended a shim that had handed over"
205
+ assert alive(child), "the pump's sweep ended what the shim started"
206
+ assert wait_until(lambda: not os.path.exists(directory)), "the directory stays"
207
+ finally:
208
+ for pid in (shim, child):
209
+ if alive(pid):
210
+ os.kill(pid, 9)
@@ -469,6 +469,9 @@ def test_an_address_less_machine_is_reached_through_the_mailbox_with_no_ssh_and_
469
469
  assert {method for method, _, _ in signal_service.requests} <= {"GET", "POST"}
470
470
  finally:
471
471
  channel.close()
472
+ # The channel does not own the remote. Closing it ends the session, so the shim
473
+ # on the agent's side leaves at once instead of waiting out the resume window.
474
+ remote.close()
472
475
  agent.stop()
473
476
  thread.join(timeout=15)
474
477
  finally:
@@ -0,0 +1,59 @@
1
+ """The suite must not reach a public network address.
2
+
3
+ Pins the autouse ``no_public_network`` fixture in conftest.py. A test that talks to a
4
+ public service passes on a machine that can reach it and fails, or leaks, elsewhere.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import socket
10
+
11
+ import pytest
12
+ from conftest import PublicNetworkAccess
13
+
14
+ from letify.transport import nat
15
+
16
+
17
+ def test_the_suite_cannot_reach_a_public_address() -> None:
18
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
19
+ try:
20
+ with pytest.raises(PublicNetworkAccess, match=r"test_the_suite_cannot.*8\.8\.8\.8"):
21
+ sock.connect(("8.8.8.8", 443))
22
+ finally:
23
+ sock.close()
24
+ # The violation is also recorded, so code that swallows the exception still fails the test.
25
+ from conftest import _public_network_attempts
26
+
27
+ _public_network_attempts.clear()
28
+
29
+
30
+ def test_the_suite_cannot_ask_the_default_stun_server() -> None:
31
+ from conftest import _public_network_attempts
32
+
33
+ udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
34
+ try:
35
+ with pytest.raises(PublicNetworkAccess, match=r"stun\.nextcloud\.com"):
36
+ udp.sendto(b"x", nat.DEFAULT_STUN)
37
+ with pytest.raises(PublicNetworkAccess, match=r"stun\.nextcloud\.com"):
38
+ socket.getaddrinfo(*nat.DEFAULT_STUN)
39
+ finally:
40
+ udp.close()
41
+ _public_network_attempts.clear()
42
+
43
+
44
+ def test_loopback_and_unix_sockets_stay_reachable(tmp_path) -> None:
45
+ server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
46
+ server.bind(("127.0.0.1", 0))
47
+ server.listen(1)
48
+ client = socket.create_connection(server.getsockname())
49
+ client.close()
50
+ server.close()
51
+ assert socket.getaddrinfo("localhost", 80)
52
+ path = str(tmp_path / "s.sock")
53
+ unix = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
54
+ unix.bind(path)
55
+ unix.listen(1)
56
+ peer = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
57
+ peer.connect(path)
58
+ peer.close()
59
+ unix.close()
@@ -685,6 +685,12 @@ def test_a_link_run_is_taken_over_by_a_second_process(
685
685
  assert taking.error is None
686
686
  assert taking.value == 42
687
687
  until(lambda: gone(owner.worker), "the new owner to end the session")
688
+ # The shim serves every owner's session and leaves only after the resume window with no
689
+ # live path (Spec "Sidecar interface" item 7). The old owner was killed without closing
690
+ # its session, so the test ends the shim itself.
691
+ from conftest import end_link_processes
692
+
693
+ assert end_link_processes(), "the shim of the run should still be serving"
688
694
 
689
695
 
690
696
  def test_a_link_run_is_not_taken_over_by_another_node(
@@ -0,0 +1,46 @@
1
+ """The suite must not leave letify-link processes behind.
2
+
3
+ Pins the autouse ``no_link_process_survives`` fixture in conftest.py. A sidecar, shim or
4
+ pump that outlives its test stays for the lease window, and a full run ends with orphans.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import contextlib
10
+ import os
11
+ import signal
12
+ import subprocess
13
+ import sys
14
+ import time
15
+ from pathlib import Path
16
+
17
+ from conftest import TEST_MARK, leaked_link_processes
18
+
19
+
20
+ def _fake_sidecar(directory: Path, env: dict[str, str] | None = None) -> subprocess.Popen[bytes]:
21
+ """A detached process whose command line names letify-link, as a leaked sidecar's does."""
22
+ script = directory / "letify-link"
23
+ script.write_text("import time\ntime.sleep(60)\n", encoding="utf-8")
24
+ return subprocess.Popen([sys.executable, str(script)], env=env, start_new_session=True)
25
+
26
+
27
+ def test_a_link_process_left_running_by_a_test_is_found(tmp_path) -> None:
28
+ leaked = _fake_sidecar(tmp_path)
29
+ try:
30
+ found = leaked_link_processes(os.environ[TEST_MARK], wait=0.2)
31
+ assert list(found) == [leaked.pid]
32
+ finally:
33
+ leaked.kill()
34
+ leaked.wait()
35
+ assert leaked_link_processes(os.environ[TEST_MARK], wait=1.0) == {}
36
+
37
+
38
+ def test_a_process_started_under_another_mark_is_not_counted(tmp_path) -> None:
39
+ other = _fake_sidecar(tmp_path, dict(os.environ, **{TEST_MARK: "another-test"}))
40
+ try:
41
+ time.sleep(0.2)
42
+ assert leaked_link_processes(os.environ[TEST_MARK], wait=0.2) == {}
43
+ finally:
44
+ with contextlib.suppress(OSError):
45
+ os.kill(other.pid, signal.SIGKILL)
46
+ other.wait()
@@ -851,11 +851,13 @@ def test_a_punch_whose_window_has_already_closed_fails_at_once() -> None:
851
851
  assert "window" in str(raised.value)
852
852
 
853
853
 
854
- def test_the_remote_half_reports_when_it_stops_punching() -> None:
854
+ def test_the_remote_half_reports_when_it_stops_punching(stun_server: StunServer) -> None:
855
855
  # Spec "the simultaneous open": punch_until travels in the answer so both sides stop
856
- # together.
856
+ # together. begin asks a STUN server for its mapping, so the test names the loopback
857
+ # one and never reaches the public default.
857
858
  answer, _ = nat.begin(
858
859
  {
860
+ "stun": list(stun_server.address),
859
861
  "kind": "tcp_punch",
860
862
  "mapping": ["203.0.113.7", 41000],
861
863
  "token": ("a" * 32),
@@ -26,6 +26,7 @@ from letify.config import login
26
26
  from letify.providers import shell as shell_module
27
27
  from letify.providers.tunnel import Tunnel
28
28
  from letify.transport import agent as agent_module
29
+ from letify.transport import portmap as portmap_module
29
30
  from letify.transport import setup
30
31
  from letify.transport import strategies as strategies_module
31
32
  from letify.transport.pipeline import Pipeline
@@ -408,8 +409,11 @@ def test_a_tunnel_account_naming_tailcat_needs_no_address() -> None:
408
409
 
409
410
 
410
411
  def test_letify_check_on_a_tunnel_account_runs_over_tailcat(
411
- isolated_home, patch_which, patch_run, patch_popen, capsys
412
+ isolated_home, patch_which, patch_run, patch_popen, capsys, monkeypatch
412
413
  ) -> None:
414
+ # The router of the machine that runs the suite is not asked for a port mapping (NAT-PMP
415
+ # to the gateway, UPnP over multicast); a router that grants none gives the same answer.
416
+ monkeypatch.setattr(portmap_module, "request", lambda port: None)
413
417
  (Path.home() / ".letify" / "config.toml").write_text(
414
418
  "[home_box]\n"
415
419
  'kind = "tunnel"\n'
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