wtb 0.2.3__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 (172) hide show
  1. wtb-0.2.3/LICENSE +191 -0
  2. wtb-0.2.3/MANIFEST.in +22 -0
  3. wtb-0.2.3/PKG-INFO +387 -0
  4. wtb-0.2.3/README.md +310 -0
  5. wtb-0.2.3/pyproject.toml +130 -0
  6. wtb-0.2.3/setup.cfg +4 -0
  7. wtb-0.2.3/wtb/__init__.py +145 -0
  8. wtb-0.2.3/wtb/api/__init__.py +36 -0
  9. wtb-0.2.3/wtb/api/grpc/__init__.py +42 -0
  10. wtb-0.2.3/wtb/api/grpc/protos/wtb_service.proto +318 -0
  11. wtb-0.2.3/wtb/api/grpc/servicer.py +746 -0
  12. wtb-0.2.3/wtb/api/rest/__init__.py +92 -0
  13. wtb-0.2.3/wtb/api/rest/app.py +265 -0
  14. wtb-0.2.3/wtb/api/rest/dependencies.py +591 -0
  15. wtb-0.2.3/wtb/api/rest/models.py +592 -0
  16. wtb-0.2.3/wtb/api/rest/routes/__init__.py +24 -0
  17. wtb-0.2.3/wtb/api/rest/routes/audit.py +155 -0
  18. wtb-0.2.3/wtb/api/rest/routes/batch_tests.py +253 -0
  19. wtb-0.2.3/wtb/api/rest/routes/executions.py +501 -0
  20. wtb-0.2.3/wtb/api/rest/routes/health.py +85 -0
  21. wtb-0.2.3/wtb/api/rest/routes/workflows.py +312 -0
  22. wtb-0.2.3/wtb/api/websocket/__init__.py +21 -0
  23. wtb-0.2.3/wtb/api/websocket/handlers.py +317 -0
  24. wtb-0.2.3/wtb/application/__init__.py +19 -0
  25. wtb-0.2.3/wtb/application/factories.py +888 -0
  26. wtb-0.2.3/wtb/application/services/__init__.py +181 -0
  27. wtb-0.2.3/wtb/application/services/actor_lifecycle.py +1031 -0
  28. wtb-0.2.3/wtb/application/services/api_services.py +1215 -0
  29. wtb-0.2.3/wtb/application/services/async_execution_controller.py +599 -0
  30. wtb-0.2.3/wtb/application/services/batch_execution_coordinator.py +974 -0
  31. wtb-0.2.3/wtb/application/services/batch_test_runner.py +607 -0
  32. wtb-0.2.3/wtb/application/services/execution_controller.py +1017 -0
  33. wtb-0.2.3/wtb/application/services/external_storage.py +131 -0
  34. wtb-0.2.3/wtb/application/services/graph_loader.py +41 -0
  35. wtb-0.2.3/wtb/application/services/langgraph_node_replacer.py +672 -0
  36. wtb-0.2.3/wtb/application/services/node_replacer.py +297 -0
  37. wtb-0.2.3/wtb/application/services/outbox_controller_decorator.py +232 -0
  38. wtb-0.2.3/wtb/application/services/parity_checker.py +547 -0
  39. wtb-0.2.3/wtb/application/services/project_service.py +403 -0
  40. wtb-0.2.3/wtb/application/services/ray_batch_runner.py +2043 -0
  41. wtb-0.2.3/wtb/application/validators.py +430 -0
  42. wtb-0.2.3/wtb/config.py +707 -0
  43. wtb-0.2.3/wtb/domain/__init__.py +19 -0
  44. wtb-0.2.3/wtb/domain/events/__init__.py +220 -0
  45. wtb-0.2.3/wtb/domain/events/checkpoint_events.py +193 -0
  46. wtb-0.2.3/wtb/domain/events/environment_events.py +186 -0
  47. wtb-0.2.3/wtb/domain/events/execution_events.py +82 -0
  48. wtb-0.2.3/wtb/domain/events/file_processing_events.py +519 -0
  49. wtb-0.2.3/wtb/domain/events/langgraph_events.py +335 -0
  50. wtb-0.2.3/wtb/domain/events/node_events.py +59 -0
  51. wtb-0.2.3/wtb/domain/events/ray_events.py +432 -0
  52. wtb-0.2.3/wtb/domain/events/workspace_events.py +349 -0
  53. wtb-0.2.3/wtb/domain/interfaces/__init__.py +211 -0
  54. wtb-0.2.3/wtb/domain/interfaces/_deprecated.py +59 -0
  55. wtb-0.2.3/wtb/domain/interfaces/api_services.py +647 -0
  56. wtb-0.2.3/wtb/domain/interfaces/async_file_tracking.py +70 -0
  57. wtb-0.2.3/wtb/domain/interfaces/async_repositories.py +268 -0
  58. wtb-0.2.3/wtb/domain/interfaces/async_state_adapter.py +119 -0
  59. wtb-0.2.3/wtb/domain/interfaces/async_unit_of_work.py +91 -0
  60. wtb-0.2.3/wtb/domain/interfaces/batch_coordinator.py +437 -0
  61. wtb-0.2.3/wtb/domain/interfaces/batch_runner.py +215 -0
  62. wtb-0.2.3/wtb/domain/interfaces/checkpoint_store.py +198 -0
  63. wtb-0.2.3/wtb/domain/interfaces/evaluator.py +262 -0
  64. wtb-0.2.3/wtb/domain/interfaces/execution_controller.py +186 -0
  65. wtb-0.2.3/wtb/domain/interfaces/file_processing_repository.py +430 -0
  66. wtb-0.2.3/wtb/domain/interfaces/file_tracking.py +623 -0
  67. wtb-0.2.3/wtb/domain/interfaces/node_executor.py +140 -0
  68. wtb-0.2.3/wtb/domain/interfaces/node_replacer.py +189 -0
  69. wtb-0.2.3/wtb/domain/interfaces/repositories.py +510 -0
  70. wtb-0.2.3/wtb/domain/interfaces/state_adapter.py +425 -0
  71. wtb-0.2.3/wtb/domain/interfaces/unit_of_work.py +113 -0
  72. wtb-0.2.3/wtb/domain/models/__init__.py +138 -0
  73. wtb-0.2.3/wtb/domain/models/audit.py +26 -0
  74. wtb-0.2.3/wtb/domain/models/batch_test.py +367 -0
  75. wtb-0.2.3/wtb/domain/models/checkpoint.py +420 -0
  76. wtb-0.2.3/wtb/domain/models/evaluation.py +169 -0
  77. wtb-0.2.3/wtb/domain/models/file_processing/__init__.py +85 -0
  78. wtb-0.2.3/wtb/domain/models/file_processing/checkpoint_link.py +155 -0
  79. wtb-0.2.3/wtb/domain/models/file_processing/entities.py +454 -0
  80. wtb-0.2.3/wtb/domain/models/file_processing/exceptions.py +74 -0
  81. wtb-0.2.3/wtb/domain/models/file_processing/value_objects.py +181 -0
  82. wtb-0.2.3/wtb/domain/models/integrity.py +279 -0
  83. wtb-0.2.3/wtb/domain/models/node_boundary.py +218 -0
  84. wtb-0.2.3/wtb/domain/models/outbox.py +395 -0
  85. wtb-0.2.3/wtb/domain/models/workflow.py +759 -0
  86. wtb-0.2.3/wtb/domain/models/workspace.py +570 -0
  87. wtb-0.2.3/wtb/infrastructure/__init__.py +101 -0
  88. wtb-0.2.3/wtb/infrastructure/adapters/__init__.py +59 -0
  89. wtb-0.2.3/wtb/infrastructure/adapters/async_langgraph_state_adapter.py +584 -0
  90. wtb-0.2.3/wtb/infrastructure/adapters/inmemory_state_adapter.py +406 -0
  91. wtb-0.2.3/wtb/infrastructure/adapters/langgraph_state_adapter.py +881 -0
  92. wtb-0.2.3/wtb/infrastructure/database/__init__.py +68 -0
  93. wtb-0.2.3/wtb/infrastructure/database/async_repositories/__init__.py +30 -0
  94. wtb-0.2.3/wtb/infrastructure/database/async_repositories/async_core_repositories.py +59 -0
  95. wtb-0.2.3/wtb/infrastructure/database/async_repositories/async_file_processing_repository.py +574 -0
  96. wtb-0.2.3/wtb/infrastructure/database/async_repositories/async_outbox_repository.py +93 -0
  97. wtb-0.2.3/wtb/infrastructure/database/async_repositories/base.py +76 -0
  98. wtb-0.2.3/wtb/infrastructure/database/async_unit_of_work.py +132 -0
  99. wtb-0.2.3/wtb/infrastructure/database/config.py +220 -0
  100. wtb-0.2.3/wtb/infrastructure/database/engine_cache.py +24 -0
  101. wtb-0.2.3/wtb/infrastructure/database/factory.py +148 -0
  102. wtb-0.2.3/wtb/infrastructure/database/file_processing_orm.py +230 -0
  103. wtb-0.2.3/wtb/infrastructure/database/inmemory_unit_of_work.py +663 -0
  104. wtb-0.2.3/wtb/infrastructure/database/mappers/__init__.py +27 -0
  105. wtb-0.2.3/wtb/infrastructure/database/mappers/blob_storage_core.py +329 -0
  106. wtb-0.2.3/wtb/infrastructure/database/mappers/outbox_mapper.py +193 -0
  107. wtb-0.2.3/wtb/infrastructure/database/migrations/002_batch_tests.sql +90 -0
  108. wtb-0.2.3/wtb/infrastructure/database/migrations/003_postgresql_production.sql +156 -0
  109. wtb-0.2.3/wtb/infrastructure/database/migrations/004_consolidate_checkpoint_files.sql +46 -0
  110. wtb-0.2.3/wtb/infrastructure/database/migrations/005_node_boundary_cleanup.sql +36 -0
  111. wtb-0.2.3/wtb/infrastructure/database/migrations/__init__.py +6 -0
  112. wtb-0.2.3/wtb/infrastructure/database/models.py +375 -0
  113. wtb-0.2.3/wtb/infrastructure/database/repositories/__init__.py +34 -0
  114. wtb-0.2.3/wtb/infrastructure/database/repositories/audit_repository.py +123 -0
  115. wtb-0.2.3/wtb/infrastructure/database/repositories/base.py +81 -0
  116. wtb-0.2.3/wtb/infrastructure/database/repositories/batch_test_repository.py +98 -0
  117. wtb-0.2.3/wtb/infrastructure/database/repositories/evaluation_result_repository.py +84 -0
  118. wtb-0.2.3/wtb/infrastructure/database/repositories/execution_repository.py +102 -0
  119. wtb-0.2.3/wtb/infrastructure/database/repositories/file_processing_repository.py +718 -0
  120. wtb-0.2.3/wtb/infrastructure/database/repositories/node_boundary_repository.py +210 -0
  121. wtb-0.2.3/wtb/infrastructure/database/repositories/node_variant_repository.py +128 -0
  122. wtb-0.2.3/wtb/infrastructure/database/repositories/outbox_repository.py +137 -0
  123. wtb-0.2.3/wtb/infrastructure/database/repositories/workflow_repository.py +80 -0
  124. wtb-0.2.3/wtb/infrastructure/database/setup.py +245 -0
  125. wtb-0.2.3/wtb/infrastructure/database/unit_of_work.py +121 -0
  126. wtb-0.2.3/wtb/infrastructure/environment/__init__.py +23 -0
  127. wtb-0.2.3/wtb/infrastructure/environment/providers.py +780 -0
  128. wtb-0.2.3/wtb/infrastructure/environment/uv_manager/__init__.py +40 -0
  129. wtb-0.2.3/wtb/infrastructure/environment/uv_manager/grpc_generated/__init__.py +0 -0
  130. wtb-0.2.3/wtb/infrastructure/environment/uv_manager/grpc_generated/env_manager_pb2.py +86 -0
  131. wtb-0.2.3/wtb/infrastructure/environment/uv_manager/grpc_generated/env_manager_pb2.pyi +336 -0
  132. wtb-0.2.3/wtb/infrastructure/environment/uv_manager/grpc_generated/env_manager_pb2_grpc.py +613 -0
  133. wtb-0.2.3/wtb/infrastructure/environment/venv_cache.py +684 -0
  134. wtb-0.2.3/wtb/infrastructure/events/__init__.py +87 -0
  135. wtb-0.2.3/wtb/infrastructure/events/langgraph_event_bridge.py +625 -0
  136. wtb-0.2.3/wtb/infrastructure/events/metrics_event_listener.py +428 -0
  137. wtb-0.2.3/wtb/infrastructure/events/ray_event_bridge.py +893 -0
  138. wtb-0.2.3/wtb/infrastructure/events/stream_mode_config.py +304 -0
  139. wtb-0.2.3/wtb/infrastructure/events/wtb_audit_trail.py +860 -0
  140. wtb-0.2.3/wtb/infrastructure/events/wtb_event_bus.py +379 -0
  141. wtb-0.2.3/wtb/infrastructure/file_tracking/__init__.py +62 -0
  142. wtb-0.2.3/wtb/infrastructure/file_tracking/async_filetracker_service.py +150 -0
  143. wtb-0.2.3/wtb/infrastructure/file_tracking/async_orphan_cleaner.py +95 -0
  144. wtb-0.2.3/wtb/infrastructure/file_tracking/cleanup_service.py +387 -0
  145. wtb-0.2.3/wtb/infrastructure/file_tracking/filetracker_service.py +831 -0
  146. wtb-0.2.3/wtb/infrastructure/file_tracking/mock_service.py +427 -0
  147. wtb-0.2.3/wtb/infrastructure/file_tracking/ray_filetracker_service.py +359 -0
  148. wtb-0.2.3/wtb/infrastructure/file_tracking/sqlite_service.py +801 -0
  149. wtb-0.2.3/wtb/infrastructure/integrity/__init__.py +6 -0
  150. wtb-0.2.3/wtb/infrastructure/integrity/checker.py +326 -0
  151. wtb-0.2.3/wtb/infrastructure/llm/__init__.py +19 -0
  152. wtb-0.2.3/wtb/infrastructure/llm/openai_langchain.py +462 -0
  153. wtb-0.2.3/wtb/infrastructure/outbox/__init__.py +24 -0
  154. wtb-0.2.3/wtb/infrastructure/outbox/lifecycle.py +455 -0
  155. wtb-0.2.3/wtb/infrastructure/outbox/processor.py +1451 -0
  156. wtb-0.2.3/wtb/infrastructure/stores/__init__.py +19 -0
  157. wtb-0.2.3/wtb/infrastructure/stores/inmemory_checkpoint_store.py +213 -0
  158. wtb-0.2.3/wtb/infrastructure/stores/langgraph_checkpoint_store.py +432 -0
  159. wtb-0.2.3/wtb/infrastructure/workspace/__init__.py +31 -0
  160. wtb-0.2.3/wtb/infrastructure/workspace/manager.py +838 -0
  161. wtb-0.2.3/wtb/py.typed +1 -0
  162. wtb-0.2.3/wtb/sdk/__init__.py +109 -0
  163. wtb-0.2.3/wtb/sdk/_example_graphs.py +51 -0
  164. wtb-0.2.3/wtb/sdk/test_bench.py +1096 -0
  165. wtb-0.2.3/wtb/sdk/workflow_project.py +894 -0
  166. wtb-0.2.3/wtb/testing/__init__.py +22 -0
  167. wtb-0.2.3/wtb/testing/fixtures.py +354 -0
  168. wtb-0.2.3/wtb.egg-info/PKG-INFO +387 -0
  169. wtb-0.2.3/wtb.egg-info/SOURCES.txt +170 -0
  170. wtb-0.2.3/wtb.egg-info/dependency_links.txt +1 -0
  171. wtb-0.2.3/wtb.egg-info/requires.txt +67 -0
  172. wtb-0.2.3/wtb.egg-info/top_level.txt +1 -0
wtb-0.2.3/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2026 WTB Contributors
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
wtb-0.2.3/MANIFEST.in ADDED
@@ -0,0 +1,22 @@
1
+ # Include package data files
2
+ recursive-include wtb *.sql
3
+ recursive-include wtb *.proto
4
+
5
+ # Include documentation
6
+ include README.md
7
+ include LICENSE
8
+
9
+ # Exclude non-package directories
10
+ prune examples
11
+ prune docs
12
+ prune tests
13
+ prune uv_venv_manager
14
+ prune .cursor
15
+ prune .git
16
+
17
+ # Exclude build artifacts
18
+ global-exclude *.pyc
19
+ global-exclude *.pyo
20
+ global-exclude __pycache__
21
+ global-exclude *.egg-info
22
+ global-exclude .DS_Store
wtb-0.2.3/PKG-INFO ADDED
@@ -0,0 +1,387 @@
1
+ Metadata-Version: 2.4
2
+ Name: wtb
3
+ Version: 0.2.3
4
+ Summary: Workflow Test Bench (WTB) - SDK for workflow testing, debugging, and orchestration
5
+ Author: KataDavidXD
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/KataDavidXD/agentgit-workflow-testbench
8
+ Project-URL: Repository, https://github.com/KataDavidXD/agentgit-workflow-testbench
9
+ Project-URL: Issues, https://github.com/KataDavidXD/agentgit-workflow-testbench/issues
10
+ Keywords: workflow,testing,langgraph,checkpoint,debugging,ray,agentgit
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Testing
17
+ Requires-Python: <3.14,>=3.11
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: sqlalchemy>=2.0.0
21
+ Requires-Dist: langgraph>=0.2.60
22
+ Requires-Dist: langgraph-checkpoint>=2.0.10
23
+ Requires-Dist: aiofiles>=24.1.0
24
+ Requires-Dist: aiosqlite>=0.20.0
25
+ Provides-Extra: ray
26
+ Requires-Dist: ray>=2.9.0; extra == "ray"
27
+ Requires-Dist: dill>=0.3.7; extra == "ray"
28
+ Provides-Extra: langgraph-sqlite
29
+ Requires-Dist: langgraph-checkpoint-sqlite>=2.0.5; extra == "langgraph-sqlite"
30
+ Provides-Extra: langgraph-postgres
31
+ Requires-Dist: langgraph-checkpoint-postgres>=2.0.15; extra == "langgraph-postgres"
32
+ Requires-Dist: psycopg[binary]>=3.1.0; extra == "langgraph-postgres"
33
+ Provides-Extra: llm
34
+ Requires-Dist: openai>=1.0.0; extra == "llm"
35
+ Requires-Dist: langchain-openai>=0.0.5; extra == "llm"
36
+ Provides-Extra: api
37
+ Requires-Dist: fastapi>=0.109.0; extra == "api"
38
+ Requires-Dist: uvicorn[standard]>=0.27.0; extra == "api"
39
+ Requires-Dist: websockets>=12.0; extra == "api"
40
+ Requires-Dist: pydantic>=2.5.0; extra == "api"
41
+ Provides-Extra: grpc
42
+ Requires-Dist: grpcio>=1.60.0; extra == "grpc"
43
+ Requires-Dist: grpcio-tools>=1.60.0; extra == "grpc"
44
+ Requires-Dist: protobuf>=4.25.0; extra == "grpc"
45
+ Provides-Extra: venv
46
+ Requires-Dist: uv-venv-manager>=0.1.0; extra == "venv"
47
+ Requires-Dist: grpcio>=1.60.0; extra == "venv"
48
+ Requires-Dist: protobuf>=4.25.0; extra == "venv"
49
+ Provides-Extra: observability
50
+ Requires-Dist: opentelemetry-api>=1.22.0; extra == "observability"
51
+ Requires-Dist: opentelemetry-sdk>=1.22.0; extra == "observability"
52
+ Requires-Dist: opentelemetry-instrumentation-fastapi>=0.43b0; extra == "observability"
53
+ Requires-Dist: opentelemetry-exporter-otlp>=1.22.0; extra == "observability"
54
+ Requires-Dist: prometheus-client>=0.17.0; extra == "observability"
55
+ Provides-Extra: dev
56
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
57
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
58
+ Requires-Dist: httpx>=0.26.0; extra == "dev"
59
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
60
+ Provides-Extra: test
61
+ Requires-Dist: pytest>=7.0.0; extra == "test"
62
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "test"
63
+ Requires-Dist: pytest-env>=1.1.0; extra == "test"
64
+ Requires-Dist: httpx>=0.26.0; extra == "test"
65
+ Requires-Dist: ray>=2.9.0; extra == "test"
66
+ Requires-Dist: dill>=0.3.7; extra == "test"
67
+ Requires-Dist: grpcio>=1.60.0; extra == "test"
68
+ Requires-Dist: grpcio-tools>=1.60.0; extra == "test"
69
+ Requires-Dist: langgraph-checkpoint-sqlite>=2.0.5; extra == "test"
70
+ Requires-Dist: openai>=1.0.0; extra == "test"
71
+ Requires-Dist: langchain-openai>=0.0.5; extra == "test"
72
+ Requires-Dist: fastapi>=0.109.0; extra == "test"
73
+ Requires-Dist: uvicorn[standard]>=0.27.0; extra == "test"
74
+ Provides-Extra: all
75
+ Requires-Dist: wtb[api,grpc,langgraph-postgres,langgraph-sqlite,llm,observability,ray,venv]; extra == "all"
76
+ Dynamic: license-file
77
+
78
+ <h1 align="center">WTB: Workflow Test Bench for Agentic Workflows</h1>
79
+
80
+ <p align="center">Built as the production release of <a href="https://github.com/HKU-MAS-Infra-Layer/Agent-Git">Agent Git</a>.</p>
81
+
82
+ <div align="center">
83
+
84
+ [![GitHub stars](https://img.shields.io/github/stars/KataDavidXD/WTB-AgenticWorkflowTestBench?logo=github&logoColor=auto)](https://github.com/KataDavidXD/WTB-AgenticWorkflowTestBench/stargazers)
85
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
86
+ [![Python](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/)
87
+
88
+ </div>
89
+
90
+ <p align="center">
91
+ <a href="#overview">Overview</a>
92
+ &nbsp;&nbsp;&bull;&nbsp;&nbsp;
93
+ <a href="#architecture">Architecture</a>
94
+ &nbsp;&nbsp;&bull;&nbsp;&nbsp;
95
+ <a href="#installation">Installation</a>
96
+ &nbsp;&nbsp;&bull;&nbsp;&nbsp;
97
+ <a href="#quick-start">Quick Start</a>
98
+ &nbsp;&nbsp;&bull;&nbsp;&nbsp;
99
+ <a href="#core-operations">Core Operations</a>
100
+ </p>
101
+
102
+ ##
103
+
104
+ **WTB (Workflow Test Bench)** is a production-grade testing, debugging, and benchmarking framework for agentic workflows. It ensures **transactional integrity**, **reproducibility**, and **observability** for complex AI agent systems by combining LangGraph orchestration, Ray distributed computing, content-addressable storage, and UV environment isolation.
105
+
106
+ > **The Problem:** Modern agentic systems (RAG, autonomous agents) are not just "read-only" chat interfaces. They persist state, modify data, and evolve. Testing them requires more than simple input/output matching -- it requires a rig that understands state, side effects, and concurrency.
107
+
108
+ ## Overview
109
+
110
+ - **Checkpoint & Rollback**: Create restore points at every node boundary and travel back in execution history
111
+ - **Forking (A/B Testing)**: Create independent execution branches from any checkpoint for variant comparison
112
+ - **Batch Testing**: Run multiple test cases and variant combinations in parallel via Ray
113
+ - **File Version Control**: Track all generated files with content-addressable storage (SHA-256 hashing)
114
+ - **Environment Isolation**: Per-node virtual environments via UV for dependency safety
115
+
116
+ ## Architecture
117
+
118
+ ```
119
+ ┌──────────────────────────┐
120
+ │ WTBTestBench │
121
+ │ (SDK Entry Point) │
122
+ └─────┬──────────┬─────────┘
123
+ │ │
124
+ single run │ │ batch test
125
+ ▼ ▼
126
+ ┌─────────────────┐ ┌──────────────────────┐
127
+ │ ExecutionCtrl │ │ RayBatchTestRunner │
128
+ │ (run, pause, │ │ │
129
+ │ rollback, │ │ Actor 0 │ Actor 1 │
130
+ │ fork) │ │ Actor 2 │ Actor N │
131
+ └───────┬─────────┘ └──────────┬───────────┘
132
+ │ │
133
+ ┌────────────┴────────────────────────┘
134
+
135
+ ┌──────────────────────────────────────────────────────────┐
136
+ │ Infrastructure │
137
+ │ │
138
+ │ LangGraph CAS UV │
139
+ │ Checkpointer (SHA-256 Venv Manager │
140
+ │ ┌──────────┐ File Hashing) ┌──────────┐ │
141
+ │ │ Memory │ ┌──────────┐ │ per-node │ │
142
+ │ │ SQLite │ │ BlobId │ │ per-var │ │
143
+ │ │ Postgres │ │ CommitId │ │ isolated │ │
144
+ │ └──────────┘ └──────────┘ └──────────┘ │
145
+ │ │
146
+ │ SQLAlchemy Unit of Work (ACID transactions) │
147
+ └──────────────────────────────────────────────────────────┘
148
+ ```
149
+
150
+ ## Timeline
151
+
152
+ [Jan 2026]: v0.2.0 -- Ray batch execution, LangGraph checkpoint integration, content-addressable file tracking, workspace isolation, and batch rollback/fork coordination.
153
+
154
+ ## Installation
155
+
156
+ ### Using uv (Recommended)
157
+
158
+ ```bash
159
+ # Install core package
160
+ uv pip install wtb
161
+
162
+ # Install with Ray support for distributed batch testing
163
+ uv pip install "wtb[ray]"
164
+
165
+ # Install with all features (Ray, LangGraph SQLite/Postgres, API, Observability)
166
+ uv pip install "wtb[all]"
167
+ ```
168
+
169
+ ### Using pip
170
+
171
+ ```bash
172
+ pip install wtb
173
+
174
+ # With Ray support
175
+ pip install "wtb[ray]"
176
+ ```
177
+
178
+ ### From Source
179
+
180
+ ```bash
181
+ git clone https://github.com/KataDavidXD/WTB-AgenticWorkflowTestBench.git
182
+ cd WTB-AgenticWorkflowTestBench
183
+
184
+ # Install with uv
185
+ uv pip install -e ".[all]"
186
+
187
+ # Or with pip
188
+ pip install -e ".[all]"
189
+ ```
190
+
191
+ ## Quick Start
192
+
193
+ > All examples import only from `wtb.sdk`. The Ray batch runner and LangGraph adapter are configured internally by the SDK.
194
+
195
+ ### 1. Batch Testing with Ray (Recommended)
196
+
197
+ `bench.run_batch_test()` internally delegates to `RayBatchTestRunner`, which distributes variant combinations across a Ray ActorPool. Configure Ray through `ExecutionConfig` on your `WorkflowProject`.
198
+
199
+ ```python
200
+ from wtb.sdk import (
201
+ WTBTestBench,
202
+ WorkflowProject,
203
+ ExecutionConfig,
204
+ RayConfig,
205
+ FileTrackingConfig,
206
+ EnvironmentConfig,
207
+ EnvSpec,
208
+ )
209
+
210
+ # 1. Create bench (LangGraph checkpointer + SQLite configured internally)
211
+ bench = WTBTestBench.create(mode="development", data_dir="data")
212
+
213
+ # 2. Register project with Ray configuration
214
+ project = WorkflowProject(
215
+ name="rag_pipeline",
216
+ graph_factory=create_rag_graph, # your LangGraph factory function
217
+ execution=ExecutionConfig(
218
+ batch_executor="ray",
219
+ ray_config=RayConfig(address="auto", max_retries=3),
220
+ checkpoint_strategy="per_node",
221
+ checkpoint_storage="sqlite",
222
+ ),
223
+ file_tracking=FileTrackingConfig(enabled=True, tracked_paths=["workspace/"]),
224
+ environment=EnvironmentConfig(
225
+ granularity="node",
226
+ default_env=EnvSpec(python_version="3.12", dependencies=["openai>=1.0.0"]),
227
+ ),
228
+ )
229
+ bench.register_project(project)
230
+
231
+ # 3. Run batch test (Ray actors execute variants in parallel)
232
+ batch = bench.run_batch_test(
233
+ project="rag_pipeline",
234
+ variant_matrix=[
235
+ {"retriever": "bm25", "generator": "gpt4"},
236
+ {"retriever": "dense", "generator": "gpt4"},
237
+ {"retriever": "hybrid", "generator": "gpt4o-mini"},
238
+ ],
239
+ test_cases=[
240
+ {"query": "What is the revenue?", "result": ""},
241
+ {"query": "List the competitors", "result": ""},
242
+ ],
243
+ )
244
+
245
+ # 4. Inspect results
246
+ print(f"Batch status: {batch.status}")
247
+ for r in batch.results:
248
+ print(f" {r.combination_name}: success={r.success}, score={r.overall_score}")
249
+
250
+ # 5. Rollback or fork any result
251
+ bench.rollback_batch_result(batch.results[0])
252
+ fork = bench.fork_batch_result(batch.results[0], new_state={"temperature": 0.5})
253
+ ```
254
+
255
+ ### 2. Single Execution with LangGraph Checkpointing
256
+
257
+ `WTBTestBench.create(mode="development")` automatically configures a `LangGraphStateAdapter` with SQLite persistence. You never need to import the adapter directly.
258
+
259
+ ```python
260
+ from langgraph.graph import StateGraph, END
261
+ from wtb.sdk import WTBTestBench, WorkflowProject
262
+
263
+ # 1. Define your LangGraph workflow
264
+ def create_graph():
265
+ from typing import TypedDict
266
+
267
+ class State(TypedDict):
268
+ query: str
269
+ result: str
270
+
271
+ def process_node(state: State) -> dict:
272
+ return {"result": f"Processed: {state['query']}"}
273
+
274
+ graph = StateGraph(State)
275
+ graph.add_node("process", process_node)
276
+ graph.set_entry_point("process")
277
+ graph.add_edge("process", END)
278
+ return graph
279
+
280
+ # 2. Create bench and register project
281
+ bench = WTBTestBench.create(mode="development", data_dir="data")
282
+ project = WorkflowProject(name="my_workflow", graph_factory=create_graph)
283
+ bench.register_project(project)
284
+
285
+ # 3. Run workflow (LangGraph checkpoints at each super-step automatically)
286
+ execution = bench.run(
287
+ project="my_workflow",
288
+ initial_state={"query": "Hello, WTB!", "result": ""},
289
+ )
290
+ print(f"Status: {execution.status}")
291
+
292
+ # 4. Inspect checkpoints
293
+ checkpoints = bench.get_checkpoints(execution.id)
294
+ for cp in checkpoints:
295
+ print(f" Step {cp.step}: next={cp.next_nodes}")
296
+
297
+ # 5. Rollback
298
+ if checkpoints:
299
+ result = bench.rollback(execution.id, checkpoint_id=str(checkpoints[0].id))
300
+ print(f"Rollback success: {result.success}")
301
+
302
+ # 6. Fork for A/B comparison
303
+ if checkpoints:
304
+ fork = bench.fork(execution.id, checkpoint_id=str(checkpoints[0].id),
305
+ new_initial_state={"query": "Alternative input", "result": ""})
306
+ print(f"Fork ID: {fork.fork_execution_id}")
307
+ ```
308
+
309
+ ## Core Operations
310
+
311
+ ### Checkpointing
312
+
313
+ ```python
314
+ execution = bench.run(project="my_workflow", initial_state={...})
315
+ checkpoints = bench.get_checkpoints(execution.id)
316
+
317
+ for cp in checkpoints:
318
+ print(f"Step {cp.step}: next={cp.next_nodes}, keys={list(cp.state_values.keys())}")
319
+ ```
320
+
321
+ ### Rollback
322
+
323
+ ```python
324
+ result = bench.rollback(execution_id=execution.id, checkpoint_id=str(cp.id))
325
+
326
+ # Rollback to after a specific node
327
+ result = bench.rollback_to_node(execution_id=execution.id, node_id="retriever")
328
+ ```
329
+
330
+ ### Forking (A/B Testing)
331
+
332
+ ```python
333
+ fork_a = bench.fork(execution.id, checkpoint_id=str(cp.id), new_initial_state={"model": "gpt-4o"})
334
+ fork_b = bench.fork(execution.id, checkpoint_id=str(cp.id), new_initial_state={"model": "gpt-4o-mini"})
335
+
336
+ exec_a = bench.resume(fork_a.fork_execution_id)
337
+ exec_b = bench.resume(fork_b.fork_execution_id)
338
+ ```
339
+
340
+ ### Batch Testing
341
+
342
+ ```python
343
+ batch = bench.run_batch_test(
344
+ project="my_workflow",
345
+ variant_matrix=[
346
+ {"retriever": "bm25", "generator": "gpt4"},
347
+ {"retriever": "dense", "generator": "gpt4"},
348
+ ],
349
+ test_cases=[{"query": "What is the revenue?"}],
350
+ )
351
+
352
+ for r in batch.results:
353
+ print(f" {r.combination_name}: score={r.overall_score}")
354
+
355
+ bench.rollback_batch_result(batch.results[0])
356
+ ```
357
+
358
+ ## Environment Configuration
359
+
360
+ ```bash
361
+ # Required (if your workflows use OpenAI)
362
+ export OPENAI_API_KEY="sk-..."
363
+
364
+ # Optional: Ray cluster
365
+ export RAY_ADDRESS="auto"
366
+
367
+ # Optional: Database
368
+ export WTB_DB_URL="sqlite:///data/wtb.db"
369
+ export WTB_CHECKPOINT_DB="data/wtb_checkpoints.db"
370
+ ```
371
+
372
+ ## Contributing
373
+
374
+ We welcome contributions! WTB is open source and actively seeking:
375
+
376
+ - Bug reports and feature requests
377
+ - New state adapter implementations
378
+ - Documentation improvements
379
+ - Performance optimizations
380
+
381
+ Partner: HKU CAMO Lab
382
+
383
+ ## License
384
+
385
+ Apache License 2.0. See [LICENSE](LICENSE) for details.
386
+
387
+ ---