loom-core 0.1.5__tar.gz → 0.1.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. {loom_core-0.1.5 → loom_core-0.1.6}/PKG-INFO +1 -1
  2. {loom_core-0.1.5 → loom_core-0.1.6}/loom/core/context.py +30 -0
  3. {loom_core-0.1.5 → loom_core-0.1.6}/loom_core.egg-info/PKG-INFO +1 -1
  4. {loom_core-0.1.5 → loom_core-0.1.6}/pyproject.toml +1 -1
  5. {loom_core-0.1.5 → loom_core-0.1.6}/LICENSE +0 -0
  6. {loom_core-0.1.5 → loom_core-0.1.6}/MANIFEST.in +0 -0
  7. {loom_core-0.1.5 → loom_core-0.1.6}/QUICKSTART.md +0 -0
  8. {loom_core-0.1.5 → loom_core-0.1.6}/README.md +0 -0
  9. {loom_core-0.1.5 → loom_core-0.1.6}/loom/__init__.py +0 -0
  10. {loom_core-0.1.5 → loom_core-0.1.6}/loom/cli/__init__.py +0 -0
  11. {loom_core-0.1.5 → loom_core-0.1.6}/loom/cli/cli.py +0 -0
  12. {loom_core-0.1.5 → loom_core-0.1.6}/loom/common/activity.py +0 -0
  13. {loom_core-0.1.5 → loom_core-0.1.6}/loom/common/config.py +0 -0
  14. {loom_core-0.1.5 → loom_core-0.1.6}/loom/common/errors.py +0 -0
  15. {loom_core-0.1.5 → loom_core-0.1.6}/loom/common/workflow.py +0 -0
  16. {loom_core-0.1.5 → loom_core-0.1.6}/loom/core/__init__.py +0 -0
  17. {loom_core-0.1.5 → loom_core-0.1.6}/loom/core/compiled.py +0 -0
  18. {loom_core-0.1.5 → loom_core-0.1.6}/loom/core/engine.py +0 -0
  19. {loom_core-0.1.5 → loom_core-0.1.6}/loom/core/handle.py +0 -0
  20. {loom_core-0.1.5 → loom_core-0.1.6}/loom/core/logger.py +0 -0
  21. {loom_core-0.1.5 → loom_core-0.1.6}/loom/core/runner.py +0 -0
  22. {loom_core-0.1.5 → loom_core-0.1.6}/loom/core/state.py +0 -0
  23. {loom_core-0.1.5 → loom_core-0.1.6}/loom/core/worker.py +0 -0
  24. {loom_core-0.1.5 → loom_core-0.1.6}/loom/core/workflow.py +0 -0
  25. {loom_core-0.1.5 → loom_core-0.1.6}/loom/database/__init__.py +0 -0
  26. {loom_core-0.1.5 → loom_core-0.1.6}/loom/database/db.py +0 -0
  27. {loom_core-0.1.5 → loom_core-0.1.6}/loom/decorators/__init__.py +0 -0
  28. {loom_core-0.1.5 → loom_core-0.1.6}/loom/decorators/activity.py +0 -0
  29. {loom_core-0.1.5 → loom_core-0.1.6}/loom/decorators/workflow.py +0 -0
  30. {loom_core-0.1.5 → loom_core-0.1.6}/loom/lib/progress.py +0 -0
  31. {loom_core-0.1.5 → loom_core-0.1.6}/loom/lib/utils.py +0 -0
  32. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/down/001_setup_pragma.sql +0 -0
  33. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/down/002_create_workflows.sql +0 -0
  34. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/down/003.create_events.sql +0 -0
  35. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/down/004.create_tasks.sql +0 -0
  36. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/down/005.create_indexes.sql +0 -0
  37. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/down/006_auto_update_triggers.sql +0 -0
  38. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/down/007_create_logs.sql +0 -0
  39. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/up/001_setup_pragma.sql +0 -0
  40. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/up/002_create_workflows.sql +0 -0
  41. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/up/003_create_events.sql +0 -0
  42. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/up/004_create_tasks.sql +0 -0
  43. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/up/005_create_indexes.sql +0 -0
  44. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/up/006_auto_update_triggers.sql +0 -0
  45. {loom_core-0.1.5 → loom_core-0.1.6}/loom/migrations/up/007_create_logs.sql +0 -0
  46. {loom_core-0.1.5 → loom_core-0.1.6}/loom/schemas/__init__.py +0 -0
  47. {loom_core-0.1.5 → loom_core-0.1.6}/loom/schemas/activity.py +0 -0
  48. {loom_core-0.1.5 → loom_core-0.1.6}/loom/schemas/database.py +0 -0
  49. {loom_core-0.1.5 → loom_core-0.1.6}/loom/schemas/events.py +0 -0
  50. {loom_core-0.1.5 → loom_core-0.1.6}/loom/schemas/tasks.py +0 -0
  51. {loom_core-0.1.5 → loom_core-0.1.6}/loom/schemas/workflow.py +0 -0
  52. {loom_core-0.1.5 → loom_core-0.1.6}/loom_core.egg-info/SOURCES.txt +0 -0
  53. {loom_core-0.1.5 → loom_core-0.1.6}/loom_core.egg-info/dependency_links.txt +0 -0
  54. {loom_core-0.1.5 → loom_core-0.1.6}/loom_core.egg-info/entry_points.txt +0 -0
  55. {loom_core-0.1.5 → loom_core-0.1.6}/loom_core.egg-info/requires.txt +0 -0
  56. {loom_core-0.1.5 → loom_core-0.1.6}/loom_core.egg-info/top_level.txt +0 -0
  57. {loom_core-0.1.5 → loom_core-0.1.6}/setup.cfg +0 -0
  58. {loom_core-0.1.5 → loom_core-0.1.6}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: loom-core
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Durable workflow orchestration engine for Python
5
5
  Home-page: https://github.com/satadeep3927/loom
6
6
  Author: Satadeep Dasgupta
@@ -82,6 +82,19 @@ class WorkflowContext(Generic[InputT, StateT]):
82
82
  self.cursor += 1
83
83
  return event
84
84
 
85
+ def _skip_step_events(self) -> None:
86
+ """Skip over STEP_START and STEP_END events during replay.
87
+
88
+ These are internal workflow management events that don't affect
89
+ the deterministic execution logic.
90
+ """
91
+ while True:
92
+ event = self._peek()
93
+ if event and event["type"] in ("STEP_START", "STEP_END"):
94
+ self._consume()
95
+ else:
96
+ break
97
+
85
98
  def _match_event(self, expected_type: str) -> Event | None:
86
99
  """
87
100
  Safe helper to check if the NEXT event matches what we expect.
@@ -145,6 +158,8 @@ class WorkflowContext(Generic[InputT, StateT]):
145
158
  ) -> FuncReturn:
146
159
  metadata = self._extract_activity_metadata(fn, args)
147
160
 
161
+ # Skip any step events first
162
+ self._skip_step_events()
148
163
  scheduled_event = self._match_event("ACTIVITY_SCHEDULED")
149
164
 
150
165
  if scheduled_event:
@@ -156,6 +171,8 @@ class WorkflowContext(Generic[InputT, StateT]):
156
171
 
157
172
  self._consume()
158
173
 
174
+ # Skip step events before checking for completion
175
+ self._skip_step_events()
159
176
  completed_event = self._match_event("ACTIVITY_COMPLETED")
160
177
 
161
178
  if completed_event:
@@ -164,6 +181,8 @@ class WorkflowContext(Generic[InputT, StateT]):
164
181
 
165
182
  raise StopReplay
166
183
 
184
+ # Skip step events before checking for unexpected events
185
+ self._skip_step_events()
167
186
  unexpected_event = self._peek()
168
187
  if unexpected_event:
169
188
  raise NonDeterministicWorkflowError(
@@ -189,11 +208,16 @@ class WorkflowContext(Generic[InputT, StateT]):
189
208
  datetime.datetime.now(datetime.timezone.utc) + delta if delta else until # type: ignore
190
209
  )
191
210
 
211
+ # Skip any step events first
212
+ self._skip_step_events()
213
+
192
214
  scheduled_event = self._match_event("TIMER_SCHEDULED")
193
215
 
194
216
  if scheduled_event:
195
217
  self._consume()
196
218
 
219
+ # Skip step events before checking for timer fired
220
+ self._skip_step_events()
197
221
  fired_event = self._match_event("TIMER_FIRED")
198
222
  if fired_event:
199
223
  self._consume()
@@ -201,6 +225,8 @@ class WorkflowContext(Generic[InputT, StateT]):
201
225
 
202
226
  raise StopReplay
203
227
 
228
+ # Skip step events before checking for unexpected events
229
+ self._skip_step_events()
204
230
  unexpected_event = self._peek()
205
231
  if unexpected_event:
206
232
  raise NonDeterministicWorkflowError(
@@ -219,6 +245,8 @@ class WorkflowContext(Generic[InputT, StateT]):
219
245
  If the signal is already in history (replay), it returns the data immediately.
220
246
  If not, it raises StopReplay to suspend execution until the signal arrives.
221
247
  """
248
+ # Skip any step events first
249
+ self._skip_step_events()
222
250
  # 1. Check if the signal is next in history
223
251
  event = self._match_event("SIGNAL_RECEIVED")
224
252
 
@@ -235,6 +263,8 @@ class WorkflowContext(Generic[InputT, StateT]):
235
263
  self._consume()
236
264
  return event["payload"]["data"]
237
265
 
266
+ # Skip step events before checking for unexpected events
267
+ self._skip_step_events()
238
268
  unexpected_event = self._peek()
239
269
  if unexpected_event:
240
270
  raise NonDeterministicWorkflowError(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: loom-core
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Durable workflow orchestration engine for Python
5
5
  Home-page: https://github.com/satadeep3927/loom
6
6
  Author: Satadeep Dasgupta
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "loom-core"
7
- version = "0.1.5"
7
+ version = "0.1.6"
8
8
  description = "Durable workflow orchestration engine for Python"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes