pipeloom 0.1.0__tar.gz → 0.2.0__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 (385) hide show
  1. pipeloom-0.2.0/CHANGELOG.md +115 -0
  2. {pipeloom-0.1.0 → pipeloom-0.2.0}/PKG-INFO +13 -5
  3. pipeloom-0.2.0/README.pypi.md +19 -0
  4. pipeloom-0.2.0/pyproject.toml +174 -0
  5. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/api.py +12 -0
  6. pipeloom-0.2.0/src/pipeloom/artifacts/__init__.py +4 -0
  7. pipeloom-0.2.0/src/pipeloom/artifacts/finalize.py +75 -0
  8. pipeloom-0.2.0/src/pipeloom/artifacts/io.py +40 -0
  9. pipeloom-0.2.0/src/pipeloom/artifacts/layout.py +51 -0
  10. pipeloom-0.2.0/src/pipeloom/artifacts/results.py +183 -0
  11. pipeloom-0.2.0/src/pipeloom/builtins/filesystem.py +74 -0
  12. pipeloom-0.2.0/src/pipeloom/builtins/fs_table.py +254 -0
  13. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/cli/__init__.py +2 -0
  14. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/cli/_events.py +50 -0
  15. pipeloom-0.2.0/src/pipeloom/cli/run.py +179 -0
  16. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/config/bind.py +7 -4
  17. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/config/types.py +22 -1
  18. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/diagnostics/codes.py +85 -8
  19. pipeloom-0.2.0/src/pipeloom/engine/portable.py +107 -0
  20. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/engine/protocols.py +19 -2
  21. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/events/bus.py +36 -4
  22. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/events/model.py +147 -0
  23. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/events/sinks/buffered.py +1 -0
  24. pipeloom-0.2.0/src/pipeloom/events/sinks/console.py +237 -0
  25. pipeloom-0.2.0/src/pipeloom/events/sinks/runfile.py +56 -0
  26. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/graph/selectors.py +43 -1
  27. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/plugins/__init__.py +1 -1
  28. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/plugins/builtin.py +4 -0
  29. pipeloom-0.2.0/src/pipeloom/runtime/context.py +65 -0
  30. pipeloom-0.2.0/src/pipeloom/runtime/errors.py +102 -0
  31. pipeloom-0.2.0/src/pipeloom/runtime/executors/__init__.py +43 -0
  32. pipeloom-0.2.0/src/pipeloom/runtime/executors/process.py +243 -0
  33. pipeloom-0.2.0/src/pipeloom/runtime/executors/thread.py +40 -0
  34. pipeloom-0.2.0/src/pipeloom/runtime/loader.py +63 -0
  35. pipeloom-0.2.0/src/pipeloom/runtime/memo.py +68 -0
  36. pipeloom-0.2.0/src/pipeloom/runtime/run.py +598 -0
  37. pipeloom-0.2.0/src/pipeloom/runtime/runner.py +500 -0
  38. pipeloom-0.2.0/src/pipeloom/runtime/scheduler.py +261 -0
  39. pipeloom-0.2.0/src/pipeloom/runtime/states.py +51 -0
  40. pipeloom-0.2.0/src/pipeloom/state/__init__.py +4 -0
  41. pipeloom-0.2.0/src/pipeloom/state/codec.py +148 -0
  42. pipeloom-0.2.0/src/pipeloom/state/jsondir.py +328 -0
  43. pipeloom-0.2.0/src/pipeloom/state/lease.py +73 -0
  44. pipeloom-0.2.0/src/pipeloom/state/sqlite.py +283 -0
  45. pipeloom-0.2.0/src/pipeloom/state/types.py +110 -0
  46. pipeloom-0.2.0/src/pipeloom/testing/contract/__init__.py +1 -0
  47. pipeloom-0.2.0/src/pipeloom/testing/contract/engine.py +292 -0
  48. pipeloom-0.2.0/src/pipeloom/testing/contract/state.py +247 -0
  49. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/testing/memory.py +101 -15
  50. pipeloom-0.2.0/src/pipeloom/testing/sim.py +44 -0
  51. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/validate/__init__.py +2 -2
  52. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/validate/capabilities.py +29 -3
  53. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/validate/semantics.py +29 -1
  54. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/validate/static.py +44 -0
  55. pipeloom-0.2.0/tests/artifacts/test_artifacts.py +115 -0
  56. pipeloom-0.2.0/tests/cases/PLC503.yml +13 -0
  57. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLC507.yml +2 -1
  58. pipeloom-0.2.0/tests/cases/PLC509.yml +12 -0
  59. pipeloom-0.2.0/tests/cases/PLG306.yml +13 -0
  60. pipeloom-0.2.0/tests/cases/PLK603.yml +16 -0
  61. pipeloom-0.2.0/tests/cases/PLK605.yml +10 -0
  62. pipeloom-0.2.0/tests/cases/PLM201.yml +14 -0
  63. pipeloom-0.2.0/tests/cases/PLM204.yml +15 -0
  64. pipeloom-0.2.0/tests/cases/PLP409.yml +15 -0
  65. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLU001.yml +1 -1
  66. pipeloom-0.2.0/tests/cases/PLX101.yml +16 -0
  67. pipeloom-0.2.0/tests/cases/PLX103.yml +12 -0
  68. pipeloom-0.2.0/tests/cases/PLX105.yml +12 -0
  69. pipeloom-0.2.0/tests/cases/PLX106.yml +19 -0
  70. pipeloom-0.2.0/tests/cases/PLX107.yml +13 -0
  71. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/config/test_bind.py +19 -1
  72. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/config/test_cases.py +46 -1
  73. pipeloom-0.2.0/tests/events/test_console_run.py +119 -0
  74. pipeloom-0.2.0/tests/fixtures/smoke/models/models.yml +30 -0
  75. pipeloom-0.2.0/tests/fixtures/smoke/models/sources.yml +3 -0
  76. pipeloom-0.2.0/tests/fixtures/smoke/pipeloom.yml +11 -0
  77. pipeloom-0.2.0/tests/fixtures/smoke/raw/customers.csv +3 -0
  78. pipeloom-0.2.0/tests/fixtures/smoke/raw/orders.csv +4 -0
  79. pipeloom-0.2.0/tests/fixtures/smoke/src/smoke/__init__.py +1 -0
  80. pipeloom-0.2.0/tests/fixtures/smoke/src/smoke/models.py +18 -0
  81. pipeloom-0.2.0/tests/fixtures/smoke-pandas/models/models.yml +26 -0
  82. pipeloom-0.2.0/tests/fixtures/smoke-pandas/models/sources.yml +3 -0
  83. pipeloom-0.2.0/tests/fixtures/smoke-pandas/pipeloom.yml +11 -0
  84. pipeloom-0.2.0/tests/fixtures/smoke-pandas/raw/customers.csv +3 -0
  85. pipeloom-0.2.0/tests/fixtures/smoke-pandas/raw/orders.csv +4 -0
  86. pipeloom-0.2.0/tests/fixtures/smoke-pandas/src/smoke/__init__.py +1 -0
  87. pipeloom-0.2.0/tests/fixtures/smoke-pandas/src/smoke/models.py +33 -0
  88. pipeloom-0.2.0/tests/goldens/diagnostics/PLC503.json +17 -0
  89. pipeloom-0.2.0/tests/goldens/diagnostics/PLC503.txt +2 -0
  90. pipeloom-0.2.0/tests/goldens/diagnostics/PLC507.json +34 -0
  91. pipeloom-0.2.0/tests/goldens/diagnostics/PLC507.txt +4 -0
  92. pipeloom-0.1.0/tests/goldens/diagnostics/PLC507.json → pipeloom-0.2.0/tests/goldens/diagnostics/PLC509.json +4 -4
  93. pipeloom-0.2.0/tests/goldens/diagnostics/PLC509.txt +2 -0
  94. pipeloom-0.2.0/tests/goldens/diagnostics/PLG306.json +23 -0
  95. pipeloom-0.2.0/tests/goldens/diagnostics/PLG306.txt +1 -0
  96. pipeloom-0.2.0/tests/goldens/diagnostics/PLK603.json +18 -0
  97. pipeloom-0.2.0/tests/goldens/diagnostics/PLK603.txt +2 -0
  98. pipeloom-0.2.0/tests/goldens/diagnostics/PLK605.json +17 -0
  99. pipeloom-0.2.0/tests/goldens/diagnostics/PLK605.txt +2 -0
  100. pipeloom-0.2.0/tests/goldens/diagnostics/PLM201.json +18 -0
  101. pipeloom-0.2.0/tests/goldens/diagnostics/PLM201.txt +2 -0
  102. pipeloom-0.2.0/tests/goldens/diagnostics/PLM204.json +18 -0
  103. pipeloom-0.2.0/tests/goldens/diagnostics/PLM204.txt +2 -0
  104. pipeloom-0.2.0/tests/goldens/diagnostics/PLP402.json +33 -0
  105. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP402.txt +2 -0
  106. pipeloom-0.2.0/tests/goldens/diagnostics/PLP404.json +33 -0
  107. pipeloom-0.2.0/tests/goldens/diagnostics/PLP404.txt +4 -0
  108. pipeloom-0.2.0/tests/goldens/diagnostics/PLP409.json +17 -0
  109. pipeloom-0.2.0/tests/goldens/diagnostics/PLP409.txt +2 -0
  110. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLU001.json +4 -4
  111. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLU001.txt +1 -1
  112. pipeloom-0.2.0/tests/goldens/diagnostics/PLX101.json +18 -0
  113. pipeloom-0.2.0/tests/goldens/diagnostics/PLX101.txt +1 -0
  114. pipeloom-0.2.0/tests/goldens/diagnostics/PLX103.json +24 -0
  115. pipeloom-0.2.0/tests/goldens/diagnostics/PLX103.txt +1 -0
  116. pipeloom-0.2.0/tests/goldens/diagnostics/PLX105.json +14 -0
  117. pipeloom-0.2.0/tests/goldens/diagnostics/PLX105.txt +2 -0
  118. pipeloom-0.2.0/tests/goldens/diagnostics/PLX106.json +13 -0
  119. pipeloom-0.2.0/tests/goldens/diagnostics/PLX106.txt +2 -0
  120. pipeloom-0.2.0/tests/goldens/diagnostics/PLX107.json +26 -0
  121. pipeloom-0.2.0/tests/goldens/diagnostics/PLX107.txt +1 -0
  122. pipeloom-0.2.0/tests/goldens/events/console_run.txt +10 -0
  123. pipeloom-0.2.0/tests/goldens/events/console_unit.txt +4 -0
  124. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/manifest/shop-ci.json +5 -0
  125. pipeloom-0.2.0/tests/goldens/run_results/shop.json +363 -0
  126. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/schema/project.json +158 -12
  127. pipeloom-0.2.0/tests/graph/test_unit_selector.py +87 -0
  128. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/plugins/fakes.py +1 -1
  129. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/plugins/test_builtins.py +4 -3
  130. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/plugins/test_memory.py +45 -10
  131. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/plugins/test_registry.py +6 -6
  132. pipeloom-0.2.0/tests/runtime/__init__.py +0 -0
  133. pipeloom-0.2.0/tests/runtime/fakes.py +28 -0
  134. pipeloom-0.2.0/tests/runtime/test_frame_api.py +95 -0
  135. pipeloom-0.2.0/tests/runtime/test_process.py +268 -0
  136. pipeloom-0.2.0/tests/runtime/test_run_control.py +133 -0
  137. pipeloom-0.2.0/tests/runtime/test_runner.py +332 -0
  138. pipeloom-0.2.0/tests/runtime/test_scheduler.py +340 -0
  139. pipeloom-0.2.0/tests/runtime/test_support.py +118 -0
  140. pipeloom-0.2.0/tests/state/__init__.py +0 -0
  141. pipeloom-0.2.0/tests/state/test_stores.py +130 -0
  142. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/test_catalog.py +7 -5
  143. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/test_cli_compile.py +14 -4
  144. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/test_cli_plugins.py +3 -3
  145. pipeloom-0.2.0/tests/test_cli_run.py +408 -0
  146. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/test_cli_select.py +10 -2
  147. pipeloom-0.2.0/tests/test_engine_contract.py +53 -0
  148. pipeloom-0.2.0/tests/test_fs_table.py +222 -0
  149. pipeloom-0.2.0/tests/test_portable.py +123 -0
  150. pipeloom-0.2.0/tests/test_versions.py +87 -0
  151. pipeloom-0.2.0/tests/validate/__init__.py +0 -0
  152. pipeloom-0.2.0/tests/validate/test_sql_check.py +38 -0
  153. pipeloom-0.1.0/CHANGELOG.md +0 -66
  154. pipeloom-0.1.0/README.pypi.md +0 -18
  155. pipeloom-0.1.0/pyproject.toml +0 -76
  156. pipeloom-0.1.0/src/pipeloom/builtins/filesystem.py +0 -28
  157. pipeloom-0.1.0/src/pipeloom/events/sinks/console.py +0 -106
  158. pipeloom-0.1.0/src/pipeloom/runtime/context.py +0 -24
  159. pipeloom-0.1.0/tests/goldens/diagnostics/PLC507.txt +0 -2
  160. pipeloom-0.1.0/tests/goldens/diagnostics/PLP402.json +0 -17
  161. pipeloom-0.1.0/tests/goldens/diagnostics/PLP404.json +0 -17
  162. pipeloom-0.1.0/tests/goldens/diagnostics/PLP404.txt +0 -2
  163. {pipeloom-0.1.0 → pipeloom-0.2.0}/.gitignore +0 -0
  164. {pipeloom-0.1.0 → pipeloom-0.2.0}/LICENSE +0 -0
  165. {pipeloom-0.1.0 → pipeloom-0.2.0}/NOTICE +0 -0
  166. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/__init__.py +0 -0
  167. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/__main__.py +0 -0
  168. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/builtins/__init__.py +0 -0
  169. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/builtins/naming.py +0 -0
  170. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/builtins/secrets_env.py +0 -0
  171. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/cli/_options.py +0 -0
  172. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/cli/_select.py +0 -0
  173. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/cli/compile.py +0 -0
  174. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/cli/graph.py +0 -0
  175. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/cli/ls.py +0 -0
  176. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/cli/plugins.py +0 -0
  177. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/cli/schema.py +0 -0
  178. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/cli/validate.py +0 -0
  179. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/config/__init__.py +0 -0
  180. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/config/discover.py +0 -0
  181. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/config/errors.py +0 -0
  182. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/config/load.py +0 -0
  183. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/config/models.py +0 -0
  184. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/config/resolve.py +0 -0
  185. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/config/schema.py +0 -0
  186. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/config/yaml.py +0 -0
  187. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/diagnostics/__init__.py +0 -0
  188. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/engine/__init__.py +0 -0
  189. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/engine/types.py +0 -0
  190. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/events/__init__.py +0 -0
  191. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/events/sinks/__init__.py +0 -0
  192. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/events/sinks/jsonl.py +0 -0
  193. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/graph/__init__.py +0 -0
  194. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/graph/dag.py +0 -0
  195. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/plan/__init__.py +0 -0
  196. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/plan/compile.py +0 -0
  197. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/plan/manifest.py +0 -0
  198. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/plan/model.py +0 -0
  199. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/plan/units.py +0 -0
  200. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/platform.py +0 -0
  201. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/py.typed +0 -0
  202. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/runtime/__init__.py +0 -0
  203. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/secrets/__init__.py +0 -0
  204. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/secrets/interpolation.py +0 -0
  205. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/secrets/redaction.py +0 -0
  206. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/testing/__init__.py +0 -0
  207. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/testing/clock.py +0 -0
  208. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/testing/recording.py +0 -0
  209. {pipeloom-0.1.0 → pipeloom-0.2.0}/src/pipeloom/validate/references.py +0 -0
  210. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/__init__.py +0 -0
  211. {pipeloom-0.1.0/tests/config → pipeloom-0.2.0/tests/artifacts}/__init__.py +0 -0
  212. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLC501.yml +0 -0
  213. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLC502.yml +0 -0
  214. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLC504.yml +0 -0
  215. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLC505.yml +0 -0
  216. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLC506.yml +0 -0
  217. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLC508.yml +0 -0
  218. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLE401.yml +0 -0
  219. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLG301.yml +0 -0
  220. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLG302.yml +0 -0
  221. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLG303.yml +0 -0
  222. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLG304.yml +0 -0
  223. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLG305.yml +0 -0
  224. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLK601.yml +0 -0
  225. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLK602.yml +0 -0
  226. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLK604.yml +0 -0
  227. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLP401.yml +0 -0
  228. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLP402.yml +0 -0
  229. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLP403.yml +0 -0
  230. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLP404.yml +0 -0
  231. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLP405.yml +0 -0
  232. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLP406.yml +0 -0
  233. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLP407.yml +0 -0
  234. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLP408.yml +0 -0
  235. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLR201.yml +0 -0
  236. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLR202.yml +0 -0
  237. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLR203.yml +0 -0
  238. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLR204.yml +0 -0
  239. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLR205.yml +0 -0
  240. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLR206.yml +0 -0
  241. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLR207.yml +0 -0
  242. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLS101.yml +0 -0
  243. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLS102.yml +0 -0
  244. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLS103.yml +0 -0
  245. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLS104.yml +0 -0
  246. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLS105.yml +0 -0
  247. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLS106.yml +0 -0
  248. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLS107.yml +0 -0
  249. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLS108.yml +0 -0
  250. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLU002.yml +0 -0
  251. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLU003.yml +0 -0
  252. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLY001.yml +0 -0
  253. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLY002.yml +0 -0
  254. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLY003.yml +0 -0
  255. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/cases/PLY004.yml +0 -0
  256. {pipeloom-0.1.0/tests/events → pipeloom-0.2.0/tests/config}/__init__.py +0 -0
  257. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/config/test_errors.py +0 -0
  258. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/config/test_interpolation.py +0 -0
  259. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/config/test_load.py +0 -0
  260. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/config/test_models.py +0 -0
  261. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/config/test_resolve.py +0 -0
  262. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/config/test_schema.py +0 -0
  263. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/config/test_yaml.py +0 -0
  264. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/conftest.py +0 -0
  265. {pipeloom-0.1.0/tests/graph → pipeloom-0.2.0/tests/events}/__init__.py +0 -0
  266. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/events/fakes.py +0 -0
  267. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/events/test_bus.py +0 -0
  268. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/events/test_model.py +0 -0
  269. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/events/test_redaction.py +0 -0
  270. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/events/test_sinks.py +0 -0
  271. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/fixtures/minimal/models/_defaults.yml +0 -0
  272. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/fixtures/minimal/models/staging/orders.yml +0 -0
  273. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/fixtures/minimal/pipeloom.yml +0 -0
  274. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/fixtures/shop/models/marts/marts.yml +0 -0
  275. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/fixtures/shop/models/staging/_defaults.yml +0 -0
  276. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/fixtures/shop/models/staging/sources.yml +0 -0
  277. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/fixtures/shop/models/staging/stg.yml +0 -0
  278. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/fixtures/shop/pipeloom.yml +0 -0
  279. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/fixtures/shop/src/shop/__init__.py +0 -0
  280. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/fixtures/shop/src/shop/enrich.py +0 -0
  281. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/fixtures/shop/src/shop/marts.py +0 -0
  282. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC501.json +0 -0
  283. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC501.txt +0 -0
  284. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC502.json +0 -0
  285. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC502.txt +0 -0
  286. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC504.json +0 -0
  287. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC504.txt +0 -0
  288. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC505.json +0 -0
  289. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC505.txt +0 -0
  290. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC506.json +0 -0
  291. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC506.txt +0 -0
  292. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC508.json +0 -0
  293. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLC508.txt +0 -0
  294. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLE401.json +0 -0
  295. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLE401.txt +0 -0
  296. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLG301.json +0 -0
  297. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLG301.txt +0 -0
  298. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLG302.json +0 -0
  299. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLG302.txt +0 -0
  300. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLG303.json +0 -0
  301. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLG303.txt +0 -0
  302. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLG304.json +0 -0
  303. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLG304.txt +0 -0
  304. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLG305.json +0 -0
  305. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLG305.txt +0 -0
  306. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLK601.json +0 -0
  307. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLK601.txt +0 -0
  308. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLK602.json +0 -0
  309. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLK602.txt +0 -0
  310. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLK604.json +0 -0
  311. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLK604.txt +0 -0
  312. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP401.json +0 -0
  313. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP401.txt +0 -0
  314. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP403.json +0 -0
  315. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP403.txt +0 -0
  316. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP405.json +0 -0
  317. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP405.txt +0 -0
  318. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP406.json +0 -0
  319. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP406.txt +0 -0
  320. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP407.json +0 -0
  321. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP407.txt +0 -0
  322. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP408.json +0 -0
  323. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLP408.txt +0 -0
  324. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR201.json +0 -0
  325. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR201.txt +0 -0
  326. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR202.json +0 -0
  327. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR202.txt +0 -0
  328. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR203.json +0 -0
  329. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR203.txt +0 -0
  330. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR204.json +0 -0
  331. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR204.txt +0 -0
  332. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR205.json +0 -0
  333. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR205.txt +0 -0
  334. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR206.json +0 -0
  335. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR206.txt +0 -0
  336. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR207.json +0 -0
  337. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLR207.txt +0 -0
  338. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS101.json +0 -0
  339. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS101.txt +0 -0
  340. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS102.json +0 -0
  341. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS102.txt +0 -0
  342. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS103.json +0 -0
  343. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS103.txt +0 -0
  344. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS104.json +0 -0
  345. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS104.txt +0 -0
  346. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS105.json +0 -0
  347. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS105.txt +0 -0
  348. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS106.json +0 -0
  349. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS106.txt +0 -0
  350. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS107.json +0 -0
  351. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS107.txt +0 -0
  352. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS108.json +0 -0
  353. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLS108.txt +0 -0
  354. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLU002.json +0 -0
  355. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLU002.txt +0 -0
  356. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLU003.json +0 -0
  357. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLU003.txt +0 -0
  358. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLY001.json +0 -0
  359. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLY001.txt +0 -0
  360. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLY002.json +0 -0
  361. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLY002.txt +0 -0
  362. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLY003.json +0 -0
  363. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLY003.txt +0 -0
  364. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLY004.json +0 -0
  365. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/diagnostics/PLY004.txt +0 -0
  366. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/events/console.txt +0 -0
  367. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/graph/small.dot +0 -0
  368. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/graph/small.mmd +0 -0
  369. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/schema/defaults.json +0 -0
  370. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/schema/models.json +0 -0
  371. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/goldens/schema/project.plugins.json +0 -0
  372. {pipeloom-0.1.0/tests/plan → pipeloom-0.2.0/tests/graph}/__init__.py +0 -0
  373. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/graph/test_dag.py +0 -0
  374. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/graph/test_selectors.py +0 -0
  375. {pipeloom-0.1.0/tests/plugins → pipeloom-0.2.0/tests/plan}/__init__.py +0 -0
  376. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/plan/test_plan.py +0 -0
  377. {pipeloom-0.1.0/tests/validate → pipeloom-0.2.0/tests/plugins}/__init__.py +0 -0
  378. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/test_cli.py +0 -0
  379. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/test_cli_events.py +0 -0
  380. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/test_cli_validate.py +0 -0
  381. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/test_diagnostics.py +0 -0
  382. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/test_docs_hooks.py +0 -0
  383. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/test_platform.py +0 -0
  384. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/test_version.py +0 -0
  385. {pipeloom-0.1.0 → pipeloom-0.2.0}/tests/validate/test_validate.py +0 -0
@@ -0,0 +1,115 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
+ [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.0] - 2026-11-04
10
+
11
+ pipeloom 0.2 runs plans: a scheduler, thread and process executors, polars and pandas engines, a filesystem catalog, state stores and run artifacts.
12
+
13
+ ### Added
14
+
15
+ - PLK603 (SQL reads a table that is not an input alias or a CTE) and PLK605 (SQL not parseable), both warnings. They run only when sqlglot is installed (extra `pipeloom[sqlglot]`); without it nothing is imported or reported.
16
+ - Docs: the guide `Running a pipeline`, the reference `Run artifacts`, a quickstart that runs on polars, and the 0.2 edits of the architecture document and the state machine diagram.
17
+ - `pipeloom-polars`, the first plugin distribution (`plugins/pipeloom-polars/`, install with `pipeloom[polars]`): the polars engine on lazy frames, SQL and views through `pl.SQLContext`, tables on the filesystem catalog with exact token replay. It passes `EngineContract`; see `docs/plugins/polars.md`.
18
+ - `pipeloom-pandas` (`plugins/pipeloom-pandas/`, install with `pipeloom[pandas]`): the pandas engine on eager DataFrames with Arrow-backed reads, tables on the filesystem catalog with exact token replay. No SQL models and no views in 0.2 (PLC502, PLC507). It passes `EngineContract`; see `docs/plugins/pandas.md`.
19
+ - `tests/fixtures/smoke-pandas`: the smoke project on the pandas target (Python models only); CI runs it from the built wheels.
20
+ - uv workspace (`members = ["plugins/*"]`) with one lockfile; the `polars` extra of `pipeloom` pins `pipeloom-polars` to the same version.
21
+ - `frame_api: narwhals` is wired in the runner: models receive Narwhals frames and a Narwhals result is converted back. PLC508 still rejects it on a non-portable engine.
22
+ - `tools/versions.py` (`check [--tag vX.Y.Z]` and `bump X.Y.Z`) keeps every distribution on one version.
23
+ - `tests/fixtures/smoke`: a small project on the polars engine that CI runs from the built wheels.
24
+ - CI builds every distribution, smoke tests the core wheel alone and all wheels together, and covers the plugin in typecheck and coverage. The release workflow builds each distribution into `dist/<name>/` and publishes each with its own step. ADR-0023.
25
+ - `pipeloom run`: runs the selected models with `-s/--select`, `--exclude`, `--manifest`, `--expect-plan-hash`, `--run-id`, `--full-refresh [true|false]`, `--fail-fast`, `--no-lock`, `--workers` (`PIPELOOM_WORKERS`), `--boundary` and `--warn-error`. Exit codes: 0, 1, 2 and 130.
26
+ - Process executor for `boundary: task`: each unit runs as `python -m pipeloom run --select unit:<id>`, its events are relayed to the parent with their original invocation id and sequence, and its logs go to `runs/<run_id>/logs/`.
27
+ - Unit mode (`--select unit:<id>`): no lock, no `run.*` events and no results file. The `unit:` selector method and `apply_to_plan` select over a manifest.
28
+ - Run console output with one line per unit, a summary, the failure block and the artifacts line.
29
+ - Diagnostics PLX103 (plan hash mismatch), PLX105 (run lock held), PLX106 (unit process died without a result), PLX107 (manifest invalid) and PLG306 (unknown unit).
30
+ - `pipeloom.testing.contract.engine`: `EngineHarness`, `requires` and `EngineContract`, gated by the capabilities an engine declares. `EventBus.forward` relays events from another process, and a per-invocation run file sink writes `runs/<run_id>/events/<invocation_id>.jsonl`.
31
+ - Filesystem table format (`pipeloom.builtins.fs_table`): part files plus an atomically replaced `_pipeloom/commit.json` with a format version, an idempotency token log (last 100), overwrite garbage collection and view definitions. ADR-0022.
32
+ - The `filesystem` catalog is implemented, with options `root` and `format` (`parquet`, `csv` or `ndjson`); it works with the polars and pandas engines.
33
+ - `pipeloom.engine.portable`: Narwhals helpers (`to_frame_api`, `from_frame_api`, `schema`, `count`, `max_value`, `filter_since`, `logical_dtype`). `narwhals>=2.0` is a core dependency, and an import-linter contract keeps it confined to that module.
34
+ - State stores in `pipeloom.state`: `StateKey`, `Watermark`, `RunRecord`, `UnitRecord`, `LockInfo`, `LockHeld` and the `StateStore` protocol, with a JSON codec and a run lock that is a 60 s lease renewed by a heartbeat thread every 20 s.
35
+ - Built-in `sqlite` state store (WAL, one connection per call, schema version 1) and `json` directory state store (atomic file replace, `O_EXCL` lock files, stale lock takeover). `sqlite` is local to one machine; `json` is shared.
36
+ - The `state` block of a target is bound and validated; without one, `sqlite` at `.pipeloom/state.db` is used. Relative state paths resolve against the project directory.
37
+ - PLC503: `boundary: task` with a state store that is not shared.
38
+ - `pipeloom.testing.contract.state.StateStoreContract`, a pytest suite state store plugins subclass.
39
+ - Import contracts (layers, `pipeloom.testing` isolation, no dataframe or SQL parsing library in the core) checked by `uv run lint-imports` in the `lint` CI job and `make lint`.
40
+ - Unit state machine with a checked transition table, and a ready-queue scheduler with skip-downstream, `--fail-fast` and stop requests.
41
+ - Thread executor and a simulated executor for tests; `unit.queued`, `unit.skipped` and `unit.cancelled` event payloads.
42
+ - ADR-0020, the execution model for 0.2.
43
+ - Model runner: `pipeloom.runtime.runner.ModelRunner` runs one unit (reads inputs, runs a SQL or Python body, writes a table or creates a view, records the attempt). `ModelContext`, `CallableLoader` (puts `python_paths` on `sys.path` for the run only), `EphemeralMemo` (an ephemeral model shared by several units is computed once) and `ErrorInfo` with a trace excerpt and a transient or permanent category.
44
+ - `Project.run(RunOptions, bus)` and `pipeloom.runtime.run.execute_run` run the selected units on the thread executor, take the run lock, record the run in the state store and finalize. Reusing a run id continues the run.
45
+ - Run artifacts in `pipeloom.artifacts`: `RunPaths`, `write_json_atomic`, `run_results.json` (`pipeloom.run_results/1`, one row per persisted model) and finalize, which copies `manifest.json` and `run_results.json` to the artifacts root (`target` by default).
46
+ - Events `run.started`, `run.compiled`, `run.completed`, `unit.started`, `unit.succeeded`, `unit.failed`, `model.input_read`, `model.written` and `model.log`.
47
+ - Codes PLX101 (model raised), PLM201 (write failed), PLM204 (input read failed), PLC509 (materialization unsupported by the engine) and PLP409 (a view must be plain SQL).
48
+ - `MemoryCatalog(root=...)` and the memory engine option `root` keep tables as JSON files, so tests can share them between processes. The memory engine supports views.
49
+ - ADR-0021, the plugin API (0, 2).
50
+
51
+ ### Changed
52
+
53
+ - Plugin API version is (0, 2): `Engine.version`, `Engine.session(ctx, *, catalog)`, and `EngineSession.relation`, `persist` and `create_view`. Plugins built for (0, 1) fail with PLU001.
54
+ - A model with a materialization the engine does not declare (`incremental`, `intermediate`) is rejected with PLC509.
55
+ - The import-linter layers include `pipeloom.artifacts` next to `pipeloom.state`, and imports under `TYPE_CHECKING` are ignored.
56
+
57
+ ## [0.1.0] - 2026-11-04
58
+
59
+ First functional release: configuration, layered validation, the dependency graph, selectors,
60
+ the plan and manifest, the event bus and the CLI. Running plans comes in 0.2.
61
+
62
+ ### Added
63
+
64
+ - Diagnostics package with the full error-code catalog (active and reserved codes), text and JSON rendering.
65
+ - YAML loader with YAML 1.2 core scalars, source marks, duplicate-key detection, merge keys and an alias expansion limit (ADR-0019).
66
+ - `${env:...}` and `${var:...}` interpolation, and a secret-like field check (PLS104).
67
+ - Pydantic configuration models for `pipeloom.yml`, model files and `_defaults.yml`, with schema errors mapped to file locations and did-you-mean hints.
68
+ - `pipeloom validate` with `--project-dir` (`PIPELOOM_PROJECT_DIR`), `--vars` and `--warn-error`; exit codes 0, 1, 2 and 130.
69
+ - Python API: `pipeloom.api.Project` and `ProjectOptions`; `pipeloom.platform` clock and identity seams.
70
+ - Plugin system: `pipeloom.plugins` with `PluginSpec`, `PluginRegistry`, `API_VERSION` and `check_api`; entry-point discovery that reads metadata only, `--plugin module:attr`, `PIPELOOM_DISABLE_PLUGIN_AUTOLOAD`, and codes PLU001 to PLU003 (ADR-0017).
71
+ - Built-in plugins from a lazy in-code table: `memory` engine and catalog, `none`, `prefix` and `per_user` naming, `env` secret provider, and the `filesystem` catalog spec (implementation in 0.2).
72
+ - Engine contracts: `pipeloom.engine` types and protocols, `RuntimeContext`, and `pipeloom.testing.memory` (MemoryEngine and MemoryCatalog on sqlite3).
73
+ - Target binding: `--target` (`PIPELOOM_TARGET`), `default_target`, runtime merge and plugin option validation, with codes PLR204 and PLR207. `Project.bind()` in the API.
74
+ - `pipeloom schema export` writes JSON Schemas for `pipeloom.yml`, model files and `_defaults.yml`, with plugin options as `oneOf` branches.
75
+ - `pipeloom plugins list` with `--group`, `--output`, `--check` and `--plugin`.
76
+ - Model settings resolution: `_defaults.yml` cascades from the model's folder up to its model_paths root, then `defaults.models`; mappings merge deeply, lists replace and `tags` is a deduplicated union. Unique ids `model.<project>.<name>` and `source.<project>.<name>`.
77
+ - L2 reference checks (PLR201, PLR202, PLR203, PLR205) with did-you-mean hints.
78
+ - Dependency graph with deterministic topological order, depth-limited ancestors and descendants, and cycle detection (PLG301, PLG302).
79
+ - Selector engine: space union, comma intersection, `N+` and `+N` graph operators, and the `name`, `tag`, `path` and `materialized` methods (PLG303 to PLG305).
80
+ - `Project.resolve()` in the API runs load, bind, resolve, L2 and graph.
81
+ - `pipeloom ls` (`--output text|json`) and `pipeloom graph` (`--output text|dot|mermaid|json`), both with repeatable `-s/--select` and `--exclude`. A malformed selector (PLG304, PLG305) exits 2; a selector that matches nothing (PLG303) is a warning.
82
+ - Typed events (`pipeloom.event/1`) and a synchronous event bus with failure budgets, redaction and context-manager close; `console`, `jsonl` and buffered sinks; code PLE401 (ADR-0018).
83
+ - `--log-format text|json` (`PIPELOOM_LOG_FORMAT`) on every command; `console` and `jsonl` sinks configurable under `events.sinks`.
84
+ - `pipeloom.testing.RecordingSink` and `FakeClock`.
85
+ - Plan model (`pipeloom.plan`): frozen `Plan`, `PlanNode`, `ExecutionUnit`; one unit per non-ephemeral model with its inlined ephemeral ancestors, identical for both boundaries; target relations from the bound naming strategy.
86
+ - Manifest `pipeloom.manifest/1` with `plan_hash` and per-node checksums (CRLF read as LF), `write_manifest`, `read_manifest` and `compute_plan_hash`.
87
+ - L4 plan semantics (PLP401 to PLP408), L5 capability checks read from the engine spec without importing it (PLC501, PLC502, PLC504 to PLC508) and L6 static checks of Python callables (PLK601, PLK602, PLK604).
88
+ - `Project.validate()` and `Project.compile(selection, boundary)` in the API; `pipeloom validate` now runs L0 to L6.
89
+ - `pipeloom compile` with the selection options, `--boundary`, `--out` and `--warn-error`; it emits `plan.compiled` and `artifact.written`.
90
+ - Generated docs: error codes, JSON Schemas under `schema/v1/`, the command-line reference, a quickstart and the schema guide.
91
+
92
+ ### Changed
93
+
94
+ - `pipeloom validate` binds the selected target and checks plugin options, and accepts `--target` and `--plugin`.
95
+ - Diagnostics and the run summary go to stderr through the event bus; the summary line now reads `<command> finished in N ms | exit C | E error(s), W warning(s)`. `rich>=13.7` is a new dependency.
96
+ - PLS104 matches secret words in key segments (`max_tokens` is no longer flagged) and ignores booleans.
97
+ - The CLI needs `click>=8.2`; runtime dependencies now include pydantic and PyYAML.
98
+ - CI tests Python 3.11 to 3.14 on Ubuntu, Windows and macOS now that the repository is public.
99
+ - PLE401 names the exception type and the sink's configured path instead of the OS error text.
100
+
101
+ ## [0.0.2] - 2026-10-29
102
+
103
+ 0.0.1 was never published: PyPI rejects that file name because an unrelated, deleted project
104
+ once used it.
105
+
106
+ ### Added
107
+
108
+ - Package skeleton with `pipeloom --version` and `__version__`.
109
+ - CI, release and docs workflows.
110
+ - Apache-2.0 license, contributing guide, code of conduct, security policy and governance.
111
+
112
+ [Unreleased]: https://github.com/emanuel-luis/pipeloom/compare/v0.2.0...HEAD
113
+ [0.2.0]: https://github.com/emanuel-luis/pipeloom/compare/v0.1.0...v0.2.0
114
+ [0.1.0]: https://github.com/emanuel-luis/pipeloom/compare/v0.0.2...v0.1.0
115
+ [0.0.2]: https://github.com/emanuel-luis/pipeloom/releases/tag/v0.0.2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pipeloom
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Declarative, engine-agnostic data pipelines in YAML.
5
5
  Project-URL: Repository, https://github.com/emanuel-luis/pipeloom
6
6
  Project-URL: Documentation, https://emanuel-luis.github.io/pipeloom/
@@ -21,22 +21,30 @@ Classifier: Programming Language :: Python :: 3.14
21
21
  Classifier: Typing :: Typed
22
22
  Requires-Python: >=3.11
23
23
  Requires-Dist: click>=8.2
24
+ Requires-Dist: narwhals>=2.0
24
25
  Requires-Dist: pydantic>=2.12
25
26
  Requires-Dist: pyyaml>=6.0.2
26
27
  Requires-Dist: rich>=13.7
28
+ Provides-Extra: pandas
29
+ Requires-Dist: pipeloom-pandas==0.2.0; extra == 'pandas'
30
+ Provides-Extra: polars
31
+ Requires-Dist: pipeloom-polars==0.2.0; extra == 'polars'
32
+ Provides-Extra: sqlglot
33
+ Requires-Dist: sqlglot>=26; extra == 'sqlglot'
27
34
  Description-Content-Type: text/markdown
28
35
 
29
36
  # pipeloom
30
37
 
31
38
  Declarative, engine-agnostic data pipelines in YAML.
32
39
 
33
- pipeloom 0.1 reads a YAML project, validates it in layers, builds the dependency graph and
34
- compiles the execution plan into a manifest. Running the plan comes in 0.2.
40
+ pipeloom 0.2 reads a YAML project, validates it in layers, builds the dependency graph, compiles
41
+ the execution plan into a manifest and runs it on polars or pandas. Every run writes
42
+ `run_results.json` with one row per model.
35
43
 
36
44
  ```console
37
- $ pip install pipeloom
45
+ $ pip install "pipeloom[polars]" # or pipeloom[pandas]
38
46
  $ pipeloom validate
39
- $ pipeloom compile
47
+ $ pipeloom run
40
48
  ```
41
49
 
42
50
  Documentation: https://emanuel-luis.github.io/pipeloom/latest/
@@ -0,0 +1,19 @@
1
+ # pipeloom
2
+
3
+ Declarative, engine-agnostic data pipelines in YAML.
4
+
5
+ pipeloom 0.2 reads a YAML project, validates it in layers, builds the dependency graph, compiles
6
+ the execution plan into a manifest and runs it on polars or pandas. Every run writes
7
+ `run_results.json` with one row per model.
8
+
9
+ ```console
10
+ $ pip install "pipeloom[polars]" # or pipeloom[pandas]
11
+ $ pipeloom validate
12
+ $ pipeloom run
13
+ ```
14
+
15
+ Documentation: https://emanuel-luis.github.io/pipeloom/latest/
16
+
17
+ Source: https://github.com/emanuel-luis/pipeloom
18
+
19
+ License: Apache-2.0.
@@ -0,0 +1,174 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "pipeloom"
7
+ version = "0.2.0"
8
+ description = "Declarative, engine-agnostic data pipelines in YAML."
9
+ readme = "README.pypi.md"
10
+ requires-python = ">=3.11"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE", "NOTICE"]
13
+ authors = [{ name = "Emanuel Luis", email = "emanuel.filho08@gmail.com" }]
14
+ keywords = ["data-engineering", "pipelines", "yaml", "declarative", "etl", "orchestration"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3 :: Only",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Programming Language :: Python :: 3.14",
24
+ "Typing :: Typed",
25
+ ]
26
+ dependencies = [
27
+ "click>=8.2",
28
+ "narwhals>=2.0",
29
+ "pydantic>=2.12",
30
+ "pyyaml>=6.0.2",
31
+ "rich>=13.7",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ polars = ["pipeloom-polars==0.2.0"]
36
+ pandas = ["pipeloom-pandas==0.2.0"]
37
+ sqlglot = ["sqlglot>=26"]
38
+
39
+ [project.urls]
40
+ Repository = "https://github.com/emanuel-luis/pipeloom"
41
+ Documentation = "https://emanuel-luis.github.io/pipeloom/"
42
+ Changelog = "https://github.com/emanuel-luis/pipeloom/blob/main/CHANGELOG.md"
43
+
44
+ [project.scripts]
45
+ pipeloom = "pipeloom.cli:main"
46
+
47
+ [dependency-groups]
48
+ dev = [
49
+ "pytest",
50
+ "pytest-cov",
51
+ "mypy",
52
+ "ruff",
53
+ "pre-commit",
54
+ "hypothesis>=6.170.14",
55
+ "pytest-timeout>=2.4.0",
56
+ "types-pyyaml>=6.0.12.20261103",
57
+ "jsonschema>=4.26.0",
58
+ "import-linter>=2.15",
59
+ "polars>=2.1.0",
60
+ "pandas>=3.1.0",
61
+ "pyarrow>=26.0.1",
62
+ "sqlglot>=26",
63
+ ]
64
+ docs = ["mkdocs-material", "mkdocstrings[python]", "mkdocs-click", "mike"]
65
+
66
+ [tool.uv.workspace]
67
+ members = ["plugins/*"]
68
+
69
+ [tool.uv.sources]
70
+ pipeloom-polars = { workspace = true }
71
+ pipeloom-pandas = { workspace = true }
72
+
73
+ [tool.hatch.build.targets.wheel]
74
+ packages = ["src/pipeloom"]
75
+
76
+ [tool.hatch.build.targets.sdist]
77
+ only-include = ["src", "tests", "CHANGELOG.md"]
78
+
79
+ [tool.ruff]
80
+ extend-exclude = ["docs"]
81
+ line-length = 100
82
+ src = ["src", "tests", "plugins/pipeloom-polars/src", "plugins/pipeloom-pandas/src"]
83
+
84
+ [tool.ruff.lint]
85
+ extend-select = ["BLE", "I", "UP", "B"]
86
+
87
+ [tool.mypy]
88
+ strict = true
89
+ files = [
90
+ "src",
91
+ "tests",
92
+ "plugins/pipeloom-polars/src",
93
+ "plugins/pipeloom-polars/tests",
94
+ "plugins/pipeloom-pandas/src",
95
+ "plugins/pipeloom-pandas/tests",
96
+ ]
97
+
98
+ [[tool.mypy.overrides]]
99
+ module = ["pandas", "pandas.*", "pyarrow", "pyarrow.*"]
100
+ ignore_missing_imports = true
101
+
102
+ [tool.pytest.ini_options]
103
+ addopts = "-ra --strict-markers --strict-config --import-mode=importlib"
104
+ timeout = 60
105
+ testpaths = ["tests", "plugins/pipeloom-polars/tests", "plugins/pipeloom-pandas/tests"]
106
+ pythonpath = ["."]
107
+
108
+ [tool.importlinter]
109
+ root_package = "pipeloom"
110
+ include_external_packages = true
111
+ exclude_type_checking_imports = true
112
+
113
+ # Top to bottom. A layer may import the ones below it. `:` marks siblings that import each other
114
+ # today (config, secrets and events form a cycle in 0.1). `pipeloom.runtime` is listed before the
115
+ # scheduler lands; `pipeloom.artifacts` joins the `state` layer with the PR that creates it
116
+ # (import-linter rejects a layer whose module does not exist). Imports under TYPE_CHECKING are
117
+ # ignored, so protocols may name runtime types in signatures. `pipeloom.testing` is outside the
118
+ # layers: it may import anything, and the second contract keeps the rest from importing it.
119
+ [[tool.importlinter.contracts]]
120
+ name = "Layers"
121
+ type = "layers"
122
+ layers = [
123
+ "pipeloom.cli",
124
+ "pipeloom.api",
125
+ "pipeloom.runtime",
126
+ "pipeloom.artifacts | pipeloom.state | pipeloom.builtins",
127
+ "pipeloom.plan",
128
+ "pipeloom.validate",
129
+ "pipeloom.graph",
130
+ "pipeloom.config : pipeloom.secrets : pipeloom.events",
131
+ "pipeloom.plugins",
132
+ "pipeloom.engine",
133
+ "pipeloom.diagnostics | pipeloom.platform",
134
+ ]
135
+ exhaustive = false
136
+
137
+ [[tool.importlinter.contracts]]
138
+ name = "Only pipeloom.testing imports pipeloom.testing"
139
+ type = "forbidden"
140
+ # Every top-level module except testing: with `pipeloom` as the source, testing would be one too.
141
+ source_modules = [
142
+ "pipeloom.__main__",
143
+ "pipeloom.api",
144
+ "pipeloom.artifacts",
145
+ "pipeloom.builtins",
146
+ "pipeloom.cli",
147
+ "pipeloom.config",
148
+ "pipeloom.diagnostics",
149
+ "pipeloom.engine",
150
+ "pipeloom.events",
151
+ "pipeloom.graph",
152
+ "pipeloom.plan",
153
+ "pipeloom.platform",
154
+ "pipeloom.plugins",
155
+ "pipeloom.runtime",
156
+ "pipeloom.secrets",
157
+ "pipeloom.state",
158
+ "pipeloom.validate",
159
+ ]
160
+ forbidden_modules = ["pipeloom.testing"]
161
+
162
+ [[tool.importlinter.contracts]]
163
+ name = "No dataframe or SQL parsing library in the core"
164
+ type = "forbidden"
165
+ source_modules = ["pipeloom"]
166
+ forbidden_modules = ["polars", "pandas", "pyarrow", "sqlglot"]
167
+ ignore_imports = ["pipeloom.validate.static -> sqlglot"]
168
+
169
+ [[tool.importlinter.contracts]]
170
+ name = "Only pipeloom.engine.portable imports narwhals"
171
+ type = "forbidden"
172
+ source_modules = ["pipeloom"]
173
+ forbidden_modules = ["narwhals"]
174
+ ignore_imports = ["pipeloom.engine.portable -> narwhals"]
@@ -9,12 +9,14 @@ from pipeloom.config.bind import BoundProject, bind_project
9
9
  from pipeloom.config.load import LoadedProject, ProjectOptions, load_project
10
10
  from pipeloom.config.resolve import resolve_project
11
11
  from pipeloom.diagnostics import Diagnostic, Outcome, Report
12
+ from pipeloom.events.bus import EventBus
12
13
  from pipeloom.graph.dag import ProjectGraph, build_graph
13
14
  from pipeloom.graph.selectors import Selection
14
15
  from pipeloom.plan.compile import compile_plan
15
16
  from pipeloom.plan.model import Plan
16
17
  from pipeloom.platform import Clock, Identity, IdentityProvider, LocalIdentity, SystemClock
17
18
  from pipeloom.plugins import PluginRegistry
19
+ from pipeloom.runtime.run import RunOptions, RunOutcome, execute_run
18
20
  from pipeloom.validate import validate_project
19
21
  from pipeloom.validate.references import check_references
20
22
 
@@ -133,3 +135,13 @@ class Project:
133
135
  )
134
136
  self._plans[key] = Outcome(plan, report.sorted())
135
137
  return self._plans[key]
138
+
139
+ def run(self, opts: RunOptions | None = None, bus: EventBus | None = None) -> RunOutcome:
140
+ """Validate, plan and run the selected units. Events go to `bus`; without one they are dropped."""
141
+ own = bus is None
142
+ events = bus or EventBus([], clock=self.clock, invocation_id=self.invocation_id)
143
+ try:
144
+ return execute_run(self, opts or RunOptions(), events)
145
+ finally:
146
+ if own:
147
+ events.close()
@@ -0,0 +1,4 @@
1
+ """Run artifacts: the run folder layout, atomic JSON writes, run_results.json and finalize.
2
+
3
+ Import from the submodules; nothing is re-exported here.
4
+ """
@@ -0,0 +1,75 @@
1
+ """Merge the unit attempts of a run into `run_results.json` and publish the run's files."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import shutil
7
+ from collections.abc import Collection, Mapping
8
+ from dataclasses import dataclass
9
+ from pathlib import Path
10
+ from typing import Any
11
+
12
+ from pipeloom.artifacts.io import write_json_atomic
13
+ from pipeloom.artifacts.layout import RunPaths
14
+ from pipeloom.artifacts.results import RunHeader, build_run_results, result_row
15
+
16
+
17
+ @dataclass(frozen=True)
18
+ class Finalized:
19
+ run_results: dict[str, Any]
20
+ written: tuple[Path, ...]
21
+ """The run's `run_results.json` and the copies under the artifacts root."""
22
+
23
+
24
+ def latest_attempts(paths: RunPaths) -> dict[str, dict[str, Any]]:
25
+ """The newest attempt file of every unit in the run folder."""
26
+ out: dict[str, dict[str, Any]] = {}
27
+ if not paths.units_dir.is_dir():
28
+ return out
29
+ for folder in sorted(paths.units_dir.iterdir(), key=lambda p: p.name):
30
+ numbers = paths.attempt_numbers(folder.name)
31
+ if numbers:
32
+ raw = paths.attempt(folder.name, numbers[-1]).read_bytes().decode("utf-8")
33
+ out[folder.name] = json.loads(raw)
34
+ return out
35
+
36
+
37
+ def finalize(
38
+ paths: RunPaths,
39
+ header: RunHeader,
40
+ *,
41
+ unit_nodes: Mapping[str, str],
42
+ skipped: Mapping[str, tuple[str, str | None]],
43
+ cancelled: Collection[str],
44
+ unfinished: Collection[str] = (),
45
+ crashed: Mapping[str, dict[str, Any]] | None = None,
46
+ ) -> Finalized:
47
+ """Write `run_results.json` into the run folder and copy it, with the manifest, to the root.
48
+
49
+ `unit_nodes` maps unit id to the unique id of its persisted model. A skipped or cancelled
50
+ verdict of this invocation wins over an attempt file; every other unit uses its newest
51
+ attempt, including units of earlier invocations that reused the run id. `unfinished` units
52
+ (an internal error stopped the run) are reported as cancelled. `crashed` rows replace the
53
+ attempt of a unit whose runner failed before it could write one.
54
+ """
55
+ rows = latest_attempts(paths)
56
+ for unit_id, (reason, _upstream) in skipped.items():
57
+ rows[unit_id] = result_row(
58
+ unique_id=unit_nodes[unit_id], unit_id=unit_id, status="skipped", skip_reason=reason
59
+ )
60
+ for unit_id in (*cancelled, *unfinished):
61
+ rows[unit_id] = result_row(
62
+ unique_id=unit_nodes[unit_id], unit_id=unit_id, status="cancelled"
63
+ )
64
+ rows.update(crashed or {})
65
+ results = build_run_results(header, list(rows.values()))
66
+ write_json_atomic(paths.run_results, results)
67
+ written = [paths.run_results]
68
+ if paths.manifest.is_file():
69
+ for src in (paths.manifest, paths.run_results):
70
+ dest = paths.root / src.name
71
+ tmp = dest.with_name(f"{dest.name}.copy.tmp")
72
+ shutil.copyfile(src, tmp)
73
+ tmp.replace(dest)
74
+ written.append(dest)
75
+ return Finalized(results, tuple(written))
@@ -0,0 +1,40 @@
1
+ """Atomic JSON files."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import os
7
+ import sys
8
+ import time
9
+ import uuid
10
+ from pathlib import Path
11
+ from typing import Any
12
+
13
+ REPLACE_RETRIES = 10
14
+ REPLACE_BACKOFF = 0.05
15
+
16
+
17
+ def json_bytes(data: Any) -> bytes:
18
+ """Indented by 2, UTF-8, LF, with a trailing newline."""
19
+ return (json.dumps(data, indent=2, allow_nan=False, ensure_ascii=False) + "\n").encode("utf-8")
20
+
21
+
22
+ def write_json_atomic(path: Path, data: Any) -> int:
23
+ """Write `data` next to `path`, then replace it. Returns the bytes written."""
24
+ content = json_bytes(data)
25
+ path.parent.mkdir(parents=True, exist_ok=True)
26
+ tmp = path.with_name(f"{path.name}.{uuid.uuid4().hex}.tmp")
27
+ tmp.write_bytes(content)
28
+ try:
29
+ for attempt in range(REPLACE_RETRIES):
30
+ try:
31
+ os.replace(tmp, path)
32
+ break
33
+ except PermissionError: # Windows: a reader holds the file
34
+ if sys.platform != "win32" or attempt == REPLACE_RETRIES - 1:
35
+ raise
36
+ time.sleep(REPLACE_BACKOFF)
37
+ except BaseException:
38
+ tmp.unlink(missing_ok=True)
39
+ raise
40
+ return len(content)
@@ -0,0 +1,51 @@
1
+ """Where a run's files live: `<root>/runs/<run_id>/`."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import re
6
+ from dataclasses import dataclass
7
+ from pathlib import Path
8
+
9
+
10
+ @dataclass(frozen=True)
11
+ class RunPaths:
12
+ root: Path
13
+ """The artifacts root, for example `<project>/target`."""
14
+ run_id: str
15
+
16
+ @property
17
+ def run_dir(self) -> Path:
18
+ return self.root / "runs" / self.run_id
19
+
20
+ @property
21
+ def manifest(self) -> Path:
22
+ return self.run_dir / "manifest.json"
23
+
24
+ @property
25
+ def run_results(self) -> Path:
26
+ return self.run_dir / "run_results.json"
27
+
28
+ @property
29
+ def units_dir(self) -> Path:
30
+ return self.run_dir / "units"
31
+
32
+ def events(self, invocation_id: str) -> Path:
33
+ return self.run_dir / "events" / f"{invocation_id}.jsonl"
34
+
35
+ def attempt(self, unit_id: str, n: int) -> Path:
36
+ return self.units_dir / unit_id / f"attempt-{n}.json"
37
+
38
+ def log(self, unit_id: str, n: int) -> Path:
39
+ return self.run_dir / "logs" / f"{unit_id}-attempt-{n}.log"
40
+
41
+ def attempt_numbers(self, unit_id: str) -> list[int]:
42
+ folder = self.units_dir / unit_id
43
+ if not folder.is_dir():
44
+ return []
45
+ found = (re.fullmatch(r"attempt-(\d+)\.json", p.name) for p in folder.iterdir())
46
+ return sorted(int(m.group(1)) for m in found if m)
47
+
48
+ def next_attempt(self, unit_id: str) -> int:
49
+ """One above the highest attempt file: a reused run id keeps counting."""
50
+ numbers = self.attempt_numbers(unit_id)
51
+ return numbers[-1] + 1 if numbers else 1