m8flow-core 1.0.0b1__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 (180) hide show
  1. m8flow_core-1.0.0b1/.gitignore +30 -0
  2. m8flow_core-1.0.0b1/CHANGELOG.md +168 -0
  3. m8flow_core-1.0.0b1/LICENSE +201 -0
  4. m8flow_core-1.0.0b1/Makefile +63 -0
  5. m8flow_core-1.0.0b1/NOTICE +48 -0
  6. m8flow_core-1.0.0b1/PKG-INFO +200 -0
  7. m8flow_core-1.0.0b1/README.md +166 -0
  8. m8flow_core-1.0.0b1/alembic/env.py +75 -0
  9. m8flow_core-1.0.0b1/alembic/script.py.mako +17 -0
  10. m8flow_core-1.0.0b1/alembic/versions/k2l3m4n5o6p7_baseline_1_0_schema.py +1153 -0
  11. m8flow_core-1.0.0b1/alembic.ini +3 -0
  12. m8flow_core-1.0.0b1/docs/README.md +86 -0
  13. m8flow_core-1.0.0b1/docs/explanation/architecture.md +109 -0
  14. m8flow_core-1.0.0b1/docs/explanation/authorization-and-tenancy.md +103 -0
  15. m8flow_core-1.0.0b1/docs/explanation/clean-room-review.md +108 -0
  16. m8flow_core-1.0.0b1/docs/explanation/sample-app-integration.md +135 -0
  17. m8flow_core-1.0.0b1/docs/explanation/scheduling.md +214 -0
  18. m8flow_core-1.0.0b1/docs/explanation/service-task-execution.md +136 -0
  19. m8flow_core-1.0.0b1/docs/explanation/workflow-data-model.md +124 -0
  20. m8flow_core-1.0.0b1/docs/how-to/build-and-install-the-package.md +81 -0
  21. m8flow_core-1.0.0b1/docs/how-to/call-external-services.md +135 -0
  22. m8flow_core-1.0.0b1/docs/how-to/customize-authorization.md +133 -0
  23. m8flow_core-1.0.0b1/docs/how-to/develop-and-test.md +169 -0
  24. m8flow_core-1.0.0b1/docs/how-to/embed-in-your-application.md +244 -0
  25. m8flow_core-1.0.0b1/docs/how-to/publish-a-release.md +111 -0
  26. m8flow_core-1.0.0b1/docs/how-to/run-the-examples.md +219 -0
  27. m8flow_core-1.0.0b1/docs/how-to/run-timers-and-retries.md +110 -0
  28. m8flow_core-1.0.0b1/docs/how-to/upgrade-to-1.0.md +217 -0
  29. m8flow_core-1.0.0b1/docs/images/architecture.svg +106 -0
  30. m8flow_core-1.0.0b1/docs/images/capabilities.svg +101 -0
  31. m8flow_core-1.0.0b1/docs/images/checks.gif +0 -0
  32. m8flow_core-1.0.0b1/docs/images/m8flow-logo.png +0 -0
  33. m8flow_core-1.0.0b1/docs/images/quick-start.gif +0 -0
  34. m8flow_core-1.0.0b1/docs/images/scheduler-lifecycle.svg +95 -0
  35. m8flow_core-1.0.0b1/docs/images/service-task-failure.svg +105 -0
  36. m8flow_core-1.0.0b1/docs/reference/api.md +603 -0
  37. m8flow_core-1.0.0b1/docs/reference/bpmn-support.md +106 -0
  38. m8flow_core-1.0.0b1/docs/reference/configuration.md +84 -0
  39. m8flow_core-1.0.0b1/docs/reference/database-schema.md +71 -0
  40. m8flow_core-1.0.0b1/docs/reference/limitations.md +165 -0
  41. m8flow_core-1.0.0b1/docs/reference/repository-layout.md +62 -0
  42. m8flow_core-1.0.0b1/docs/tutorials/quick-start.md +234 -0
  43. m8flow_core-1.0.0b1/examples/_postgres_example_launcher.sh +245 -0
  44. m8flow_core-1.0.0b1/examples/celery_scheduler.py +176 -0
  45. m8flow_core-1.0.0b1/examples/celery_scheduler_worker.ps1 +149 -0
  46. m8flow_core-1.0.0b1/examples/celery_scheduler_worker.sh +286 -0
  47. m8flow_core-1.0.0b1/examples/celery_timer.ps1 +345 -0
  48. m8flow_core-1.0.0b1/examples/celery_timer.py +19 -0
  49. m8flow_core-1.0.0b1/examples/celery_timer.sh +277 -0
  50. m8flow_core-1.0.0b1/examples/conditional_approval.ps1 +209 -0
  51. m8flow_core-1.0.0b1/examples/conditional_approval.py +2861 -0
  52. m8flow_core-1.0.0b1/examples/conditional_approval.sh +235 -0
  53. m8flow_core-1.0.0b1/examples/conditional_approval_rejection.ps1 +209 -0
  54. m8flow_core-1.0.0b1/examples/conditional_approval_rejection.py +26 -0
  55. m8flow_core-1.0.0b1/examples/conditional_approval_rejection.sh +235 -0
  56. m8flow_core-1.0.0b1/examples/errors_demo.py +354 -0
  57. m8flow_core-1.0.0b1/examples/parallel_review.py +388 -0
  58. m8flow_core-1.0.0b1/examples/scheduled_boundary_timer.ps1 +209 -0
  59. m8flow_core-1.0.0b1/examples/scheduled_boundary_timer.py +992 -0
  60. m8flow_core-1.0.0b1/examples/scheduled_boundary_timer.sh +28 -0
  61. m8flow_core-1.0.0b1/examples/scheduled_cycle_timer.ps1 +209 -0
  62. m8flow_core-1.0.0b1/examples/scheduled_cycle_timer.py +1119 -0
  63. m8flow_core-1.0.0b1/examples/scheduled_cycle_timer.sh +28 -0
  64. m8flow_core-1.0.0b1/examples/scheduled_retry.ps1 +209 -0
  65. m8flow_core-1.0.0b1/examples/scheduled_retry.py +1081 -0
  66. m8flow_core-1.0.0b1/examples/scheduled_retry.sh +28 -0
  67. m8flow_core-1.0.0b1/examples/scheduled_timer.ps1 +209 -0
  68. m8flow_core-1.0.0b1/examples/scheduled_timer.py +1076 -0
  69. m8flow_core-1.0.0b1/examples/scheduled_timer.sh +28 -0
  70. m8flow_core-1.0.0b1/examples/service_task_connector.ps1 +209 -0
  71. m8flow_core-1.0.0b1/examples/service_task_connector.py +1095 -0
  72. m8flow_core-1.0.0b1/examples/service_task_connector.sh +28 -0
  73. m8flow_core-1.0.0b1/examples/service_task_failure_retry.ps1 +209 -0
  74. m8flow_core-1.0.0b1/examples/service_task_failure_retry.py +1162 -0
  75. m8flow_core-1.0.0b1/examples/service_task_failure_retry.sh +28 -0
  76. m8flow_core-1.0.0b1/integration/conftest.py +137 -0
  77. m8flow_core-1.0.0b1/integration/test_postgres_integration.py +1039 -0
  78. m8flow_core-1.0.0b1/pyproject.toml +120 -0
  79. m8flow_core-1.0.0b1/sample.env +35 -0
  80. m8flow_core-1.0.0b1/src/m8flow_core/__init__.py +10 -0
  81. m8flow_core-1.0.0b1/src/m8flow_core/api.py +234 -0
  82. m8flow_core-1.0.0b1/src/m8flow_core/application/__init__.py +65 -0
  83. m8flow_core-1.0.0b1/src/m8flow_core/application/commands.py +149 -0
  84. m8flow_core-1.0.0b1/src/m8flow_core/application/dispatcher.py +274 -0
  85. m8flow_core-1.0.0b1/src/m8flow_core/application/queries.py +50 -0
  86. m8flow_core-1.0.0b1/src/m8flow_core/db.py +42 -0
  87. m8flow_core-1.0.0b1/src/m8flow_core/errors.py +51 -0
  88. m8flow_core-1.0.0b1/src/m8flow_core/models/__init__.py +86 -0
  89. m8flow_core-1.0.0b1/src/m8flow_core/models/base.py +40 -0
  90. m8flow_core-1.0.0b1/src/m8flow_core/models/bpmn_process.py +49 -0
  91. m8flow_core-1.0.0b1/src/m8flow_core/models/bpmn_process_definition.py +105 -0
  92. m8flow_core-1.0.0b1/src/m8flow_core/models/future_task.py +44 -0
  93. m8flow_core-1.0.0b1/src/m8flow_core/models/group.py +41 -0
  94. m8flow_core-1.0.0b1/src/m8flow_core/models/json_data.py +87 -0
  95. m8flow_core-1.0.0b1/src/m8flow_core/models/permission_assignment.py +67 -0
  96. m8flow_core-1.0.0b1/src/m8flow_core/models/permission_target.py +79 -0
  97. m8flow_core-1.0.0b1/src/m8flow_core/models/principal.py +49 -0
  98. m8flow_core-1.0.0b1/src/m8flow_core/models/process_instance.py +164 -0
  99. m8flow_core-1.0.0b1/src/m8flow_core/models/process_instance_event.py +145 -0
  100. m8flow_core-1.0.0b1/src/m8flow_core/models/process_instance_metadata.py +40 -0
  101. m8flow_core-1.0.0b1/src/m8flow_core/models/process_model_bpmn_version.py +31 -0
  102. m8flow_core-1.0.0b1/src/m8flow_core/models/scheduler_job.py +87 -0
  103. m8flow_core-1.0.0b1/src/m8flow_core/models/task.py +85 -0
  104. m8flow_core-1.0.0b1/src/m8flow_core/models/task_definition.py +46 -0
  105. m8flow_core-1.0.0b1/src/m8flow_core/models/task_types.py +6 -0
  106. m8flow_core-1.0.0b1/src/m8flow_core/models/tenant.py +45 -0
  107. m8flow_core-1.0.0b1/src/m8flow_core/models/tenant_scoped.py +16 -0
  108. m8flow_core-1.0.0b1/src/m8flow_core/models/user.py +49 -0
  109. m8flow_core-1.0.0b1/src/m8flow_core/models/user_group_assignment.py +40 -0
  110. m8flow_core-1.0.0b1/src/m8flow_core/models/work_item.py +122 -0
  111. m8flow_core-1.0.0b1/src/m8flow_core/models/work_item_user.py +66 -0
  112. m8flow_core-1.0.0b1/src/m8flow_core/services/__init__.py +81 -0
  113. m8flow_core-1.0.0b1/src/m8flow_core/services/authorization.py +888 -0
  114. m8flow_core-1.0.0b1/src/m8flow_core/services/connector_proxy_service_tasks.py +383 -0
  115. m8flow_core-1.0.0b1/src/m8flow_core/services/lane_assignment.py +499 -0
  116. m8flow_core-1.0.0b1/src/m8flow_core/services/process_definitions.py +278 -0
  117. m8flow_core-1.0.0b1/src/m8flow_core/services/process_instances.py +704 -0
  118. m8flow_core-1.0.0b1/src/m8flow_core/services/scheduler_jobs.py +142 -0
  119. m8flow_core-1.0.0b1/src/m8flow_core/services/scheduler_runtime.py +502 -0
  120. m8flow_core-1.0.0b1/src/m8flow_core/services/service_tasks.py +333 -0
  121. m8flow_core-1.0.0b1/src/m8flow_core/services/tasks.py +308 -0
  122. m8flow_core-1.0.0b1/src/m8flow_core/services/tenant_users.py +89 -0
  123. m8flow_core-1.0.0b1/src/m8flow_core/services/work_items.py +104 -0
  124. m8flow_core-1.0.0b1/src/m8flow_core/services/workflow_runtime.py +2465 -0
  125. m8flow_core-1.0.0b1/src/m8flow_core/settings.py +19 -0
  126. m8flow_core-1.0.0b1/src/m8flow_core/utils/__init__.py +2 -0
  127. m8flow_core-1.0.0b1/src/m8flow_core/utils/keycloak/__init__.py +24 -0
  128. m8flow_core-1.0.0b1/src/m8flow_core/utils/keycloak/config.py +53 -0
  129. m8flow_core-1.0.0b1/src/m8flow_core/utils/keycloak/service.py +882 -0
  130. m8flow_core-1.0.0b1/tests/conftest.py +38 -0
  131. m8flow_core-1.0.0b1/tests/fixtures/check_eligibility.dmn +38 -0
  132. m8flow_core-1.0.0b1/tests/fixtures/conditional-approval.bpmn +280 -0
  133. m8flow_core-1.0.0b1/tests/fixtures/invoice_approval_poc.bpmn +75 -0
  134. m8flow_core-1.0.0b1/tests/fixtures/parallel_review_poc.bpmn +282 -0
  135. m8flow_core-1.0.0b1/tests/fixtures/scheduled_boundary_timer_poc.bpmn +138 -0
  136. m8flow_core-1.0.0b1/tests/fixtures/scheduled_cycle_timer_poc.bpmn +92 -0
  137. m8flow_core-1.0.0b1/tests/fixtures/scheduled_retry_poc.bpmn +79 -0
  138. m8flow_core-1.0.0b1/tests/fixtures/scheduled_timer_poc.bpmn +92 -0
  139. m8flow_core-1.0.0b1/tests/fixtures/service_task_connector_poc.bpmn +158 -0
  140. m8flow_core-1.0.0b1/tests/fixtures/service_task_failure_retry_poc.bpmn +158 -0
  141. m8flow_core-1.0.0b1/tests/fixtures/service_task_runtime_poc.bpmn +68 -0
  142. m8flow_core-1.0.0b1/tests/test_api_surface.py +189 -0
  143. m8flow_core-1.0.0b1/tests/test_application_layer.py +836 -0
  144. m8flow_core-1.0.0b1/tests/test_authorization_concurrency.py +157 -0
  145. m8flow_core-1.0.0b1/tests/test_authorization_policy_hooks.py +249 -0
  146. m8flow_core-1.0.0b1/tests/test_authorization_service.py +474 -0
  147. m8flow_core-1.0.0b1/tests/test_authorization_structure.py +68 -0
  148. m8flow_core-1.0.0b1/tests/test_baseline_migration.py +180 -0
  149. m8flow_core-1.0.0b1/tests/test_bootstrap.py +23 -0
  150. m8flow_core-1.0.0b1/tests/test_bpmn_import_validation.py +119 -0
  151. m8flow_core-1.0.0b1/tests/test_command_authorization_enforcement.py +547 -0
  152. m8flow_core-1.0.0b1/tests/test_compatibility_contract.py +446 -0
  153. m8flow_core-1.0.0b1/tests/test_conditional_approval_backend_deployment.py +694 -0
  154. m8flow_core-1.0.0b1/tests/test_conditional_approval_poc.py +922 -0
  155. m8flow_core-1.0.0b1/tests/test_connector_proxy_service_tasks.py +253 -0
  156. m8flow_core-1.0.0b1/tests/test_documentation_contract.py +40 -0
  157. m8flow_core-1.0.0b1/tests/test_json_data_tenant_scope.py +63 -0
  158. m8flow_core-1.0.0b1/tests/test_keycloak_utility.py +216 -0
  159. m8flow_core-1.0.0b1/tests/test_lane_assignment.py +879 -0
  160. m8flow_core-1.0.0b1/tests/test_package_version.py +24 -0
  161. m8flow_core-1.0.0b1/tests/test_parallel_review_poc.py +540 -0
  162. m8flow_core-1.0.0b1/tests/test_pending_tasks.py +229 -0
  163. m8flow_core-1.0.0b1/tests/test_process_instance_status.py +77 -0
  164. m8flow_core-1.0.0b1/tests/test_rbac_models.py +166 -0
  165. m8flow_core-1.0.0b1/tests/test_sample_app_demo_fixture.py +200 -0
  166. m8flow_core-1.0.0b1/tests/test_scheduler_jobs.py +271 -0
  167. m8flow_core-1.0.0b1/tests/test_scheduler_runtime.py +1172 -0
  168. m8flow_core-1.0.0b1/tests/test_service_task_connector_poc.py +193 -0
  169. m8flow_core-1.0.0b1/tests/test_service_task_runtime.py +1242 -0
  170. m8flow_core-1.0.0b1/tests/test_service_tasks.py +159 -0
  171. m8flow_core-1.0.0b1/tests/test_task_lifecycle.py +196 -0
  172. m8flow_core-1.0.0b1/tests/test_task_ownership_validation.py +250 -0
  173. m8flow_core-1.0.0b1/tests/test_task_types.py +23 -0
  174. m8flow_core-1.0.0b1/tests/test_tenant_membership_validation.py +395 -0
  175. m8flow_core-1.0.0b1/tests/test_tenant_users.py +76 -0
  176. m8flow_core-1.0.0b1/tests/test_timer_scheduling.py +289 -0
  177. m8flow_core-1.0.0b1/tests/test_timer_start_scheduling.py +117 -0
  178. m8flow_core-1.0.0b1/tests/test_timestamp_compatibility.py +60 -0
  179. m8flow_core-1.0.0b1/tests/test_work_items.py +119 -0
  180. m8flow_core-1.0.0b1/tests/test_workflow_poc.py +742 -0
@@ -0,0 +1,30 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .coverage
8
+ htmlcov/
9
+ build/
10
+ dist/
11
+ .venv/
12
+ .uv-cache/
13
+ .env
14
+ .env.*
15
+ *.sqlite3
16
+ *.db
17
+ *.sqlite
18
+ /reference/
19
+ .*
20
+ !.gitleaks.toml
21
+ !.pre-commit-config.yaml
22
+ !/.github/
23
+ !/.github/codeql/
24
+ !/.github/codeql/*.yml
25
+ !/.github/dependabot.yml
26
+ !/.github/workflows/
27
+ !/.github/workflows/*.yml
28
+ sample_app/vendor/*.whl
29
+ !sample_app/uv.lock
30
+ node_modules/
@@ -0,0 +1,168 @@
1
+ # Changelog
2
+
3
+ All notable changes to m8flow-core are recorded in this file. The format
4
+ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Each release
5
+ lists its changes under **Added**, **Changed**, **Deprecated**, **Removed**,
6
+ **Fixed**, and **Security**.
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [1.0.0] - 2026-10-22
11
+
12
+ The first stable release, and the first under the name m8flow-core. Versions
13
+ 0.1.x to 0.2.1 were untagged development builds named `m8flow-bpmn-core`;
14
+ their changes are included here. To move from any of them, follow
15
+ [Upgrade to 1.0](docs/how-to/upgrade-to-1.0.md). This release changes the
16
+ package name, the public API, and the database schema, so upgrade the library
17
+ and m8flow together.
18
+
19
+ ### Added
20
+
21
+ - Public in-process API in `m8flow_core.api`, with separate commands and
22
+ queries, `execute_command` and `execute_query` dispatchers that accept a
23
+ caller-owned `Session` or `Connection`, and the `BpmnCoreError` error
24
+ hierarchy.
25
+ - BPMN and DMN definition import, process instance start, human task
26
+ worklists, claim and completion, process metadata, and event history.
27
+ - Lifecycle commands to suspend, resume, error, retry, and terminate process
28
+ instances.
29
+ - Tenant-aware command authorization with built-in `user`, `manager`, and
30
+ `admin` roles and pluggable policies.
31
+ - Persisted scheduler jobs for timer start events, recurring `timeCycle`
32
+ timers, intermediate and interrupting boundary timers, and scheduled
33
+ retries, run through `run_due_scheduler_jobs`.
34
+ - Synchronous BPMN service tasks through pluggable connectors, including an
35
+ adapter for `m8flow-connector-proxy`. A failure on start, timer wake-up, or
36
+ retry is saved for retry even if the caller rolls back.
37
+ - The `work_item` table and `WorkItemModel` for human-task claim state, with
38
+ compare-and-set claims that are safe under concurrency.
39
+ - `ProcessLifecycleEventType`, `TaskEventType`, and
40
+ `ProcessInstanceEventCategory`, with a non-null `category` on every event.
41
+ - `assign_pending_tasks_for_user`, to add potential owners to waiting work
42
+ items after a directory sync. `lane_owners` is now optional.
43
+ - `properties_json["initiator_lanes"]`, a list of lanes whose tasks go to the
44
+ user who started the instance. Import validates it and raises
45
+ `ValidationError` for a non-list value, an empty or non-string entry, a lane
46
+ that isn't in the BPMN, or a lane that also has a `lane_owners` key.
47
+ - Support for dates beyond 2038.
48
+ - A sample host application in `sample_app/` that consumes the library as a
49
+ wheel.
50
+ - Runnable examples for conditional approval, parallel review, timers,
51
+ retries, service tasks, and error handling. Most interactive examples also
52
+ run on SQLite with `--sqlite`.
53
+ - Apache License 2.0 `LICENSE` and `NOTICE` files, and license metadata in the
54
+ package.
55
+ - Contributing guide, code of conduct, security policy,
56
+ support page, issue and pull request templates, and CI for lint, type, and
57
+ security checks, CodeQL, secret scanning, and dependency review.
58
+ - A manual workflow that publishes betas and releases to PyPI through trusted
59
+ publishing, with build attestations and a vulnerability scan. A release
60
+ publishes only from the commit its GitHub Release tag points at.
61
+ - Documentation organized as tutorials, how-to guides, reference, and
62
+ explanation, with a quick start, an upgrade guide, a database schema
63
+ reference, and diagrams.
64
+
65
+ ### Changed
66
+
67
+ - **Breaking:** renamed the distribution from `m8flow-bpmn-core` to
68
+ `m8flow-core`, and the import package from `m8flow_bpmn_core` to
69
+ `m8flow_core`.
70
+ - **Breaking:** the Alembic history is a single baseline revision,
71
+ `k2l3m4n5o6p7`, that creates the 1.0 schema on an empty database. It
72
+ doesn't convert 0.x databases: bring them to the 0.x head with the 0.x
73
+ migrations, convert them to the 1.0 schema with your own migrations, then
74
+ run `alembic stamp k2l3m4n5o6p7`. See
75
+ [Upgrade to 1.0](docs/how-to/upgrade-to-1.0.md).
76
+ - **Breaking:** every timestamp is a timezone-aware UTC `datetime`. Public
77
+ parameters such as `started_at_in_seconds` are now `started_at`, persisted
78
+ epoch columns are now `DateTime` columns such as `created_at`, `run_at`, and
79
+ `occurred_at`, and `run_due_scheduler_jobs` takes `now` instead of
80
+ `now_in_seconds`.
81
+ - **Breaking:** `ClaimTaskCommand` and `CompleteTaskCommand` take
82
+ `work_item_id` and return `WorkItemModel`. `GetPendingTasksQuery` returns
83
+ work items.
84
+ - **Breaking:** permission targets are exact `(resource_type, resource_id)`
85
+ pairs, with type-wide grants when `resource_id` is `NULL`.
86
+ `AuthorizationRequest` carries `resource_type` and `resource_id`.
87
+ - **Breaking:** `json_data` is keyed by `(m8f_tenant_id, hash)`, so payloads
88
+ are never shared across tenants. Every read and write includes the tenant.
89
+ - **Breaking:** user identity fields are `realm_identifier`,
90
+ `external_org_id`, and `external_user_id`; the group table is `m8f_group`;
91
+ `spiff_serializer_version` is `workflow_engine_version`; and process digests
92
+ are one `process_xml_digest`.
93
+ - **Breaking:** the Celery example reads `M8FLOW_CORE_CELERY_*` variables
94
+ instead of `M8FLOW_BPMN_CORE_CELERY_*`, and the examples publish to the
95
+ `m8flow-core-examples` process group.
96
+ - **Breaking:** the example scripts dropped their `_poc` suffix, for example
97
+ `examples/conditional_approval.py` instead of
98
+ `examples/conditional_approval_poc.py`.
99
+ - **Breaking:** initiator lanes are declared with
100
+ `properties_json["initiator_lanes"]`. A lane is no longer routed to the
101
+ process initiator because its name looks like "process initiator"; tasks
102
+ with no lane, or in an unnamed lane, still go to the initiator.
103
+ - **Breaking:** `WorkItemUserAddedBy` has three members, `process_initiator`,
104
+ `lane_owner`, and `lane_assignment`. Writing any other `added_by` value
105
+ raises `ValidationError`; `None` is allowed. Rows that already hold other
106
+ labels load and work unchanged.
107
+ - Lane owners are matched by username, email, or `service_id`, with lane
108
+ names compared after trimming outer whitespace, ignoring case. Owners that
109
+ match no user in the tenant are skipped with a logged warning instead of
110
+ failing the process. Named owners are added to the tenant's lane group, a
111
+ user appears at most once per work item, and resuming or retrying an
112
+ instance adds users who now qualify without removing existing potential
113
+ owners.
114
+ - `resolve_lane_assignment_id` takes an optional `tenant_id`, so equal lane
115
+ names in different tenants never share a group.
116
+ - Constraints and indexes use the `m8f_*` namespace.
117
+ - The model, authorization, event, and lane-assignment code was redesigned
118
+ independently of spiff-arena.
119
+ [About the clean-room review](docs/explanation/clean-room-review.md)
120
+ records the review.
121
+ - `NOTICE` states SpiffWorkflow's license as LGPL-3.0-or-later, notes the
122
+ native libraries bundled by psycopg-binary, and describes the obligations of
123
+ applications that redistribute m8flow-core with its dependencies.
124
+ - The source distribution includes only the library, its tests, docs,
125
+ examples, and migrations.
126
+
127
+ ### Removed
128
+
129
+ - **Breaking:** `ProcessInstanceEventType`, replaced by the split event enums.
130
+ - **Breaking:** the `human_task` and `human_task_user` tables and
131
+ `HumanTaskModel`, replaced by `work_item` and `work_item_user`.
132
+ - **Breaking:** URI permission targets and URI matching.
133
+ - **Breaking:** legacy `*_in_seconds` columns. The 1.0 schema has no epoch
134
+ columns.
135
+ - **Breaking:** the `ProcessInstanceModel` status helpers `can_submit_task`,
136
+ `allowed_to_run`, `can_receive_message`, `is_immediately_runnable`,
137
+ `terminal_statuses`, `non_terminal_statuses` and
138
+ `immediately_runnable_statuses`. `has_terminal_status()` and
139
+ `active_statuses()` remain.
140
+ - **Breaking:** `ClaimTaskCommand.added_by` and the `added_by` parameter of
141
+ `claim_task`. Claiming never adds or relabels potential owners.
142
+ - **Breaking:** the `guest` and `manual` members of `WorkItemUserAddedBy`.
143
+ - **Breaking:** `FutureTaskModel.insert_or_update`. Create or change
144
+ `future_task` rows with ordinary ORM operations.
145
+ - **Breaking:** the event type values `process_instance_force_run`,
146
+ `process_instance_migrated`, `process_instance_rewound_to_task`,
147
+ `process_instance_suspended_for_error`, `task_data_edited`,
148
+ `task_executed_manually` and `task_skipped`, and their
149
+ `ProcessLifecycleEventType` and `TaskEventType` members. Recording one of
150
+ them raises `ValidationError`. Existing event rows that hold them are
151
+ unaffected and read back as stored.
152
+
153
+ ### Fixed
154
+
155
+ - The interactive examples crashed when printing a task, because they read
156
+ its lazy-loaded name after the session had closed.
157
+ - Authorization race conditions when two requests create the same permission
158
+ rows at once.
159
+ - The sample app's lockfile, which was missing the `defusedxml` dependency.
160
+
161
+ ### Security
162
+
163
+ - Process and task payloads are isolated per tenant. Before, two tenants with
164
+ equal payload content shared one `json_data` row.
165
+ - The library reads BPMN source XML with `defusedxml`.
166
+
167
+ [Unreleased]: https://github.com/AOT-Technologies/m8flow-core/compare/1.0.0...HEAD
168
+ [1.0.0]: https://github.com/AOT-Technologies/m8flow-core/releases/tag/1.0.0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 AOT Technologies Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,63 @@
1
+ .DEFAULT_GOAL := help
2
+
3
+ UV ?= uv
4
+ SRC_DIR := src
5
+ TEST_DIR := tests
6
+ ALEMBIC_DIR := alembic/versions
7
+
8
+ .PHONY: help sync sync-postgresql lint lint-fix typecheck security precommit-install test test-integration build package package-wheel package-sdist
9
+
10
+ help:
11
+ @echo "Targets:"
12
+ @echo " make sync Sync project dependencies"
13
+ @echo " make sync-postgresql Sync dependencies with the Postgres extra"
14
+ @echo " make lint Run Ruff"
15
+ @echo " make lint-fix Run Ruff with --fix"
16
+ @echo " make typecheck Run mypy on the core package"
17
+ @echo " make security Run Bandit on the core and sample-app source trees"
18
+ @echo " make precommit-install Install the local pre-commit and commit-msg hooks"
19
+ @echo " make test Run the unit test suite"
20
+ @echo " make test-integration Run the Postgres integration test"
21
+ @echo " make build Build wheel and sdist artifacts into dist/"
22
+ @echo " make package Alias for build"
23
+ @echo " make package-wheel Build only the wheel artifact"
24
+ @echo " make package-sdist Build only the source distribution"
25
+
26
+ sync:
27
+ $(UV) sync
28
+
29
+ sync-postgresql:
30
+ $(UV) sync --extra postgresql
31
+
32
+ lint:
33
+ $(UV) run ruff check $(SRC_DIR) $(TEST_DIR) $(ALEMBIC_DIR)
34
+
35
+ lint-fix:
36
+ $(UV) run ruff check --fix $(SRC_DIR) $(TEST_DIR) $(ALEMBIC_DIR)
37
+
38
+ typecheck:
39
+ $(UV) run mypy
40
+
41
+ security:
42
+ $(UV) run bandit -c pyproject.toml -r $(SRC_DIR) sample_app/src
43
+
44
+ precommit-install:
45
+ $(UV) run pre-commit install --hook-type pre-commit --hook-type commit-msg
46
+
47
+ test:
48
+ $(UV) run pytest
49
+
50
+ test-integration:
51
+ $(UV) sync --extra postgresql
52
+ $(UV) run pytest integration/test_postgres_integration.py
53
+
54
+ build:
55
+ $(UV) build
56
+
57
+ package: build
58
+
59
+ package-wheel:
60
+ $(UV) build --wheel
61
+
62
+ package-sdist:
63
+ $(UV) build --sdist
@@ -0,0 +1,48 @@
1
+ m8flow-core
2
+
3
+ Copyright 2026 AOT Technologies Inc.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License").
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+
14
+ ------------------------------------------------------------------------
15
+ Third-party components
16
+ ------------------------------------------------------------------------
17
+
18
+ m8flow-core depends on third-party Python packages that are distributed
19
+ under their own licenses. None of them is bundled in this repository, the
20
+ source distribution, or the built wheel. The following components carry
21
+ notable obligations:
22
+
23
+ * SpiffWorkflow (https://github.com/sartography/SpiffWorkflow) is licensed
24
+ under the GNU Lesser General Public License, version 3.0 or later
25
+ (LGPL-3.0-or-later). m8flow-core imports it as an unmodified, separately
26
+ installed and replaceable Python package.
27
+
28
+ * psycopg (https://www.psycopg.org), installed by the optional `postgresql`
29
+ extra, is licensed under the LGPL-3.0. It is installed as an unmodified,
30
+ separately replaceable Python package. The psycopg-binary wheels it pulls
31
+ in bundle native libraries, such as libpq and OpenSSL, that are distributed
32
+ under their own licenses.
33
+
34
+ All other runtime dependencies are under permissive licenses (MIT, BSD,
35
+ Apache-2.0, or PSF-2.0).
36
+
37
+ Applications that redistribute m8flow-core together with its dependencies,
38
+ for example in a container image or a frozen executable, must meet the
39
+ license terms of each bundled dependency, including the LGPL terms for
40
+ SpiffWorkflow and psycopg.
41
+
42
+ m8flow-core is not affiliated with or endorsed by Sartography, which
43
+ maintains SpiffWorkflow.
44
+
45
+ The BPMN and DMN files tests/fixtures/conditional-approval.bpmn and
46
+ tests/fixtures/check_eligibility.dmn are adapted from the m8flow sample
47
+ templates (https://github.com/AOT-Technologies/m8flow), Copyright 2026 AOT
48
+ Technologies Inc., licensed under the Apache License 2.0.