@feltdb/core 0.15.0 → 0.16.1

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 (248) hide show
  1. package/dist/agent-state.d.ts +20 -0
  2. package/dist/agent-state.d.ts.map +1 -1
  3. package/dist/agent-state.js +36 -0
  4. package/dist/build-identity.json +12 -4
  5. package/dist/cli/commands.js +187 -4
  6. package/dist/cli/publish-engine.js +116 -16
  7. package/dist/collection.d.ts.map +1 -1
  8. package/dist/collection.js +20 -2
  9. package/dist/create/build-identity.json +12 -4
  10. package/dist/create/managed-account.js +93 -35
  11. package/dist/create/package-versions.js +1 -1
  12. package/dist/create/server-source/Cargo.lock +6 -509
  13. package/dist/create/server-source/Cargo.toml +2 -13
  14. package/dist/create/server-source/crates/feltdb-client/Cargo.toml +1 -1
  15. package/dist/create/server-source/crates/feltdb-server/Cargo.toml +1 -1
  16. package/dist/create/server-source/crates/feltdb-server/src/main.rs +356 -24
  17. package/dist/create/server-source/crates/feltdb-server/tests/rust_client.rs +10 -1
  18. package/dist/create/server-source/crates/feltdb-wasm/Cargo.toml +1 -1
  19. package/dist/db.d.ts +11 -1
  20. package/dist/db.d.ts.map +1 -1
  21. package/dist/db.js +15 -2
  22. package/dist/error-codes.d.ts +5 -0
  23. package/dist/error-codes.d.ts.map +1 -1
  24. package/dist/error-codes.js +9 -1
  25. package/dist/http-db.d.ts +16 -0
  26. package/dist/http-db.d.ts.map +1 -1
  27. package/dist/http-db.js +36 -6
  28. package/dist/managed-recovery.d.ts +6 -0
  29. package/dist/managed-recovery.d.ts.map +1 -1
  30. package/dist/managed-recovery.js +9 -0
  31. package/dist/studio-app/assets/{feltdb_wasm-BjM1ylL3.js → feltdb_wasm-BUIxCuTR.js} +1 -1
  32. package/dist/studio-app/assets/feltdb_wasm_bg-C3D6y6DK.wasm +0 -0
  33. package/dist/studio-app/assets/index-BhXYAhgS.js +37 -0
  34. package/dist/studio-app/index.html +1 -1
  35. package/dist/wasm/feltdb_wasm_bg.wasm +0 -0
  36. package/dist/wasm/package.json +1 -1
  37. package/dist/workload.d.ts +55 -3
  38. package/dist/workload.d.ts.map +1 -1
  39. package/dist/workload.js +23 -0
  40. package/dist/workspace/workspace-connection.d.ts.map +1 -1
  41. package/dist/workspace/workspace-connection.js +14 -3
  42. package/package.json +1 -1
  43. package/dist/create/server-source/crates/feltdb/Cargo.lock +0 -175
  44. package/dist/create/server-source/crates/feltdb/Cargo.toml +0 -102
  45. package/dist/create/server-source/crates/feltdb/LICENSE +0 -21
  46. package/dist/create/server-source/crates/feltdb/README.md +0 -75
  47. package/dist/create/server-source/crates/feltdb/benches/baselines/gate-13-redux.json +0 -370
  48. package/dist/create/server-source/crates/feltdb/benches/gate13_baseline.rs +0 -589
  49. package/dist/create/server-source/crates/feltdb/benches/gate13_phase_7_1_release_economics.rs +0 -247
  50. package/dist/create/server-source/crates/feltdb/benches/gate_13_redux.rs +0 -440
  51. package/dist/create/server-source/crates/feltdb/benches/gate_13_regression_runner.rs +0 -275
  52. package/dist/create/server-source/crates/feltdb/benches/gate_14a_concurrent_writer_scaling.rs +0 -381
  53. package/dist/create/server-source/crates/feltdb/benches/gate_14a_production_admission_revalidation.rs +0 -467
  54. package/dist/create/server-source/crates/feltdb/benches/gate_14a_rc2_admission_contract.rs +0 -489
  55. package/dist/create/server-source/crates/feltdb/benches/gate_14a_rc_root_cause.rs +0 -281
  56. package/dist/create/server-source/crates/feltdb/benches/gate_14a_sync1_queued_prototype.rs +0 -606
  57. package/dist/create/server-source/crates/feltdb/benches/gate_14a_sync_economics.rs +0 -531
  58. package/dist/create/server-source/crates/feltdb/benches/gate_14b_causal_backlog_scaling.rs +0 -462
  59. package/dist/create/server-source/crates/feltdb/benches/gate_14c_replication_contract_test.rs +0 -505
  60. package/dist/create/server-source/crates/feltdb/benches/gate_14c_replication_scaling.rs +0 -484
  61. package/dist/create/server-source/crates/feltdb/benches/gate_14d_combined_dimension_scaling.rs +0 -758
  62. package/dist/create/server-source/crates/feltdb/benches/phase_7_1_2_optimization_benchmark.rs +0 -421
  63. package/dist/create/server-source/crates/feltdb/benches/phase_7_1_3_crossover_analysis.rs +0 -329
  64. package/dist/create/server-source/crates/feltdb/src/acceptance_tests.rs +0 -1705
  65. package/dist/create/server-source/crates/feltdb/src/acquisition.rs +0 -286
  66. package/dist/create/server-source/crates/feltdb/src/admission.rs +0 -185
  67. package/dist/create/server-source/crates/feltdb/src/admission_contract_tests.rs +0 -507
  68. package/dist/create/server-source/crates/feltdb/src/adversarial_transport.rs +0 -539
  69. package/dist/create/server-source/crates/feltdb/src/agent_state.rs +0 -320
  70. package/dist/create/server-source/crates/feltdb/src/agent_transition_contract.rs +0 -1545
  71. package/dist/create/server-source/crates/feltdb/src/analytics.rs +0 -521
  72. package/dist/create/server-source/crates/feltdb/src/application.rs +0 -2674
  73. package/dist/create/server-source/crates/feltdb/src/application_runtime.rs +0 -1070
  74. package/dist/create/server-source/crates/feltdb/src/authority.rs +0 -479
  75. package/dist/create/server-source/crates/feltdb/src/authority_failover.rs +0 -847
  76. package/dist/create/server-source/crates/feltdb/src/authorization.rs +0 -1030
  77. package/dist/create/server-source/crates/feltdb/src/authorization_security_tests.rs +0 -1122
  78. package/dist/create/server-source/crates/feltdb/src/bin/feltdb-authority-client.rs +0 -32
  79. package/dist/create/server-source/crates/feltdb/src/bin/feltdb-authority.rs +0 -19
  80. package/dist/create/server-source/crates/feltdb/src/bin/feltdb_node.rs +0 -1474
  81. package/dist/create/server-source/crates/feltdb/src/capabilities/mod.rs +0 -8
  82. package/dist/create/server-source/crates/feltdb/src/capabilities/search.rs +0 -418
  83. package/dist/create/server-source/crates/feltdb/src/capabilities/vector.rs +0 -482
  84. package/dist/create/server-source/crates/feltdb/src/capability.rs +0 -903
  85. package/dist/create/server-source/crates/feltdb/src/cardinality_diagnostics.rs +0 -263
  86. package/dist/create/server-source/crates/feltdb/src/cardinality_endpoint.rs +0 -77
  87. package/dist/create/server-source/crates/feltdb/src/causal_backlog_bound.rs +0 -496
  88. package/dist/create/server-source/crates/feltdb/src/causal_dependency_barrier.rs +0 -2574
  89. package/dist/create/server-source/crates/feltdb/src/causal_dependency_barrier_phase_7_1.rs +0 -212
  90. package/dist/create/server-source/crates/feltdb/src/concurrency_fuzzing.rs +0 -422
  91. package/dist/create/server-source/crates/feltdb/src/consistency_contract.rs +0 -445
  92. package/dist/create/server-source/crates/feltdb/src/content_distribution.rs +0 -465
  93. package/dist/create/server-source/crates/feltdb/src/convergence.rs +0 -634
  94. package/dist/create/server-source/crates/feltdb/src/crash_atomic_boundary.rs +0 -427
  95. package/dist/create/server-source/crates/feltdb/src/crash_injection.rs +0 -376
  96. package/dist/create/server-source/crates/feltdb/src/crash_recovery_tests.rs +0 -365
  97. package/dist/create/server-source/crates/feltdb/src/cron.rs +0 -294
  98. package/dist/create/server-source/crates/feltdb/src/dedup_bound_investigation.rs +0 -483
  99. package/dist/create/server-source/crates/feltdb/src/distributed_indexing.rs +0 -477
  100. package/dist/create/server-source/crates/feltdb/src/distributed_tests.rs +0 -1003
  101. package/dist/create/server-source/crates/feltdb/src/distributed_transactions.rs +0 -1334
  102. package/dist/create/server-source/crates/feltdb/src/durability_guarantees.rs +0 -368
  103. package/dist/create/server-source/crates/feltdb/src/durable_dedup_set.rs +0 -231
  104. package/dist/create/server-source/crates/feltdb/src/durable_operation_identity.rs +0 -482
  105. package/dist/create/server-source/crates/feltdb/src/durable_operation_log.rs +0 -203
  106. package/dist/create/server-source/crates/feltdb/src/durable_sync.rs +0 -317
  107. package/dist/create/server-source/crates/feltdb/src/equality_index.rs +0 -595
  108. package/dist/create/server-source/crates/feltdb/src/execution.rs +0 -426
  109. package/dist/create/server-source/crates/feltdb/src/in_process_transport.rs +0 -214
  110. package/dist/create/server-source/crates/feltdb/src/indexing.rs +0 -776
  111. package/dist/create/server-source/crates/feltdb/src/lib.rs +0 -7365
  112. package/dist/create/server-source/crates/feltdb/src/managed_cas_tests.rs +0 -234
  113. package/dist/create/server-source/crates/feltdb/src/materialization.rs +0 -184
  114. package/dist/create/server-source/crates/feltdb/src/metrics.rs +0 -266
  115. package/dist/create/server-source/crates/feltdb/src/multi_node_convergence.rs +0 -310
  116. package/dist/create/server-source/crates/feltdb/src/multi_operation_transaction.rs +0 -736
  117. package/dist/create/server-source/crates/feltdb/src/observability.rs +0 -379
  118. package/dist/create/server-source/crates/feltdb/src/operation.rs +0 -290
  119. package/dist/create/server-source/crates/feltdb/src/operation_algebra.rs +0 -439
  120. package/dist/create/server-source/crates/feltdb/src/operation_log.rs +0 -349
  121. package/dist/create/server-source/crates/feltdb/src/p1_application_atomicity.rs +0 -332
  122. package/dist/create/server-source/crates/feltdb/src/p1_atomicity_acceptance.rs +0 -718
  123. package/dist/create/server-source/crates/feltdb/src/partition_reconciliation.rs +0 -487
  124. package/dist/create/server-source/crates/feltdb/src/peer_registry.rs +0 -166
  125. package/dist/create/server-source/crates/feltdb/src/permutation_scheduler.rs +0 -289
  126. package/dist/create/server-source/crates/feltdb/src/persistence_reality.rs +0 -566
  127. package/dist/create/server-source/crates/feltdb/src/phase1b_acceptance.rs +0 -3391
  128. package/dist/create/server-source/crates/feltdb/src/phase1c1_acceptance.rs +0 -203
  129. package/dist/create/server-source/crates/feltdb/src/phase1c2_acceptance.rs +0 -261
  130. package/dist/create/server-source/crates/feltdb/src/phase1c3_acceptance.rs +0 -502
  131. package/dist/create/server-source/crates/feltdb/src/phase1c_atomicity_proof.rs +0 -216
  132. package/dist/create/server-source/crates/feltdb/src/phase5_integration.rs +0 -303
  133. package/dist/create/server-source/crates/feltdb/src/phase5_scenarios.rs +0 -323
  134. package/dist/create/server-source/crates/feltdb/src/phase6_adversarial_scenarios.rs +0 -531
  135. package/dist/create/server-source/crates/feltdb/src/phase6_convergence_validator.rs +0 -406
  136. package/dist/create/server-source/crates/feltdb/src/phase6_persistence.rs +0 -436
  137. package/dist/create/server-source/crates/feltdb/src/phase_1c_real_tcp.rs +0 -387
  138. package/dist/create/server-source/crates/feltdb/src/phase_2a_failures.rs +0 -378
  139. package/dist/create/server-source/crates/feltdb/src/phase_2b_network.rs +0 -359
  140. package/dist/create/server-source/crates/feltdb/src/phase_2c_cascading.rs +0 -372
  141. package/dist/create/server-source/crates/feltdb/src/phase_3_durability.rs +0 -404
  142. package/dist/create/server-source/crates/feltdb/src/phase_4_baseline.rs +0 -376
  143. package/dist/create/server-source/crates/feltdb/src/phase_5_soak.rs +0 -461
  144. package/dist/create/server-source/crates/feltdb/src/policy_evaluation.rs +0 -2125
  145. package/dist/create/server-source/crates/feltdb/src/production_api.rs +0 -418
  146. package/dist/create/server-source/crates/feltdb/src/provenance.rs +0 -207
  147. package/dist/create/server-source/crates/feltdb/src/query_execution_diagnostics.rs +0 -126
  148. package/dist/create/server-source/crates/feltdb/src/query_performance.rs +0 -218
  149. package/dist/create/server-source/crates/feltdb/src/read_basis.rs +0 -257
  150. package/dist/create/server-source/crates/feltdb/src/references.rs +0 -404
  151. package/dist/create/server-source/crates/feltdb/src/replay_fuzzing.rs +0 -401
  152. package/dist/create/server-source/crates/feltdb/src/replica_acknowledgements.rs +0 -501
  153. package/dist/create/server-source/crates/feltdb/src/replica_membership.rs +0 -680
  154. package/dist/create/server-source/crates/feltdb/src/replication_manager.rs +0 -163
  155. package/dist/create/server-source/crates/feltdb/src/replication_protocol.rs +0 -133
  156. package/dist/create/server-source/crates/feltdb/src/routing.rs +0 -409
  157. package/dist/create/server-source/crates/feltdb/src/semantic_decision.rs +0 -2029
  158. package/dist/create/server-source/crates/feltdb/src/semantic_query.rs +0 -599
  159. package/dist/create/server-source/crates/feltdb/src/sharding.rs +0 -549
  160. package/dist/create/server-source/crates/feltdb/src/state_conflict_contract.rs +0 -516
  161. package/dist/create/server-source/crates/feltdb/src/state_contract.rs +0 -6003
  162. package/dist/create/server-source/crates/feltdb/src/state_diff_contract.rs +0 -222
  163. package/dist/create/server-source/crates/feltdb/src/state_facade.rs +0 -320
  164. package/dist/create/server-source/crates/feltdb/src/state_hash.rs +0 -291
  165. package/dist/create/server-source/crates/feltdb/src/state_model.rs +0 -4158
  166. package/dist/create/server-source/crates/feltdb/src/state_transition_store.rs +0 -379
  167. package/dist/create/server-source/crates/feltdb/src/state_trigger.rs +0 -673
  168. package/dist/create/server-source/crates/feltdb/src/storage.rs +0 -273
  169. package/dist/create/server-source/crates/feltdb/src/submission.rs +0 -471
  170. package/dist/create/server-source/crates/feltdb/src/sync.rs +0 -495
  171. package/dist/create/server-source/crates/feltdb/src/sync_contract.rs +0 -822
  172. package/dist/create/server-source/crates/feltdb/src/tcp_transport.rs +0 -433
  173. package/dist/create/server-source/crates/feltdb/src/transaction_api.rs +0 -462
  174. package/dist/create/server-source/crates/feltdb/src/transaction_invariants.rs +0 -965
  175. package/dist/create/server-source/crates/feltdb/src/transaction_preconditions.rs +0 -1120
  176. package/dist/create/server-source/crates/feltdb/src/transactions.rs +0 -643
  177. package/dist/create/server-source/crates/feltdb/src/trigger.rs +0 -390
  178. package/dist/create/server-source/crates/feltdb/src/trigger_contract.rs +0 -749
  179. package/dist/create/server-source/crates/feltdb/src/versioned_object_substrate.rs +0 -708
  180. package/dist/create/server-source/crates/feltdb/src/worker_mesh.rs +0 -1269
  181. package/dist/create/server-source/crates/feltdb/src/workflow.rs +0 -713
  182. package/dist/create/server-source/crates/feltdb/src/workflow_acceptance_tests.rs +0 -510
  183. package/dist/create/server-source/crates/feltdb/src/workflow_integration.rs +0 -354
  184. package/dist/create/server-source/crates/feltdb/src/workflow_runtime.rs +0 -594
  185. package/dist/create/server-source/crates/feltdb/src/workload.rs +0 -4222
  186. package/dist/create/server-source/crates/feltdb/src/workload_diagnostics.rs +0 -456
  187. package/dist/create/server-source/crates/feltdb/tests/agent_state_native.rs +0 -1188
  188. package/dist/create/server-source/crates/feltdb/tests/agent_transition_contract_conformance.rs +0 -2884
  189. package/dist/create/server-source/crates/feltdb/tests/authority_process.rs +0 -297
  190. package/dist/create/server-source/crates/feltdb/tests/authority_transaction_identity.rs +0 -534
  191. package/dist/create/server-source/crates/feltdb/tests/bounded_read_contract.rs +0 -132
  192. package/dist/create/server-source/crates/feltdb/tests/branching_evidence.rs +0 -299
  193. package/dist/create/server-source/crates/feltdb/tests/common/mod.rs +0 -96
  194. package/dist/create/server-source/crates/feltdb/tests/compaction_stall_contract.rs +0 -272
  195. package/dist/create/server-source/crates/feltdb/tests/crash_durability_contract.rs +0 -467
  196. package/dist/create/server-source/crates/feltdb/tests/current_revision_authority_evidence.rs +0 -309
  197. package/dist/create/server-source/crates/feltdb/tests/durable_backup_contract.rs +0 -445
  198. package/dist/create/server-source/crates/feltdb/tests/durable_corruption_contract.rs +0 -518
  199. package/dist/create/server-source/crates/feltdb/tests/durable_format_compatibility.rs +0 -392
  200. package/dist/create/server-source/crates/feltdb/tests/feltdb_state_boundary_tests.rs +0 -850
  201. package/dist/create/server-source/crates/feltdb/tests/fixtures/agent_transition_corpus.json +0 -23340
  202. package/dist/create/server-source/crates/feltdb/tests/fixtures/state_conflict_contract_corpus.json +0 -1916
  203. package/dist/create/server-source/crates/feltdb/tests/fixtures/state_diff_contract_corpus.json +0 -1878
  204. package/dist/create/server-source/crates/feltdb/tests/fixtures/trigger_contract_corpus.json +0 -1862
  205. package/dist/create/server-source/crates/feltdb/tests/generalized_version_control_evidence.rs +0 -123
  206. package/dist/create/server-source/crates/feltdb/tests/generalized_version_control_substrate_completion.rs +0 -299
  207. package/dist/create/server-source/crates/feltdb/tests/local_process_ownership.rs +0 -69
  208. package/dist/create/server-source/crates/feltdb/tests/managed_incident_regression.rs +0 -191
  209. package/dist/create/server-source/crates/feltdb/tests/operational_health_contract.rs +0 -278
  210. package/dist/create/server-source/crates/feltdb/tests/pr34_query_collection.rs +0 -234
  211. package/dist/create/server-source/crates/feltdb/tests/pr35_equality_index.rs +0 -947
  212. package/dist/create/server-source/crates/feltdb/tests/pr7_self_authorization_proof.rs +0 -404
  213. package/dist/create/server-source/crates/feltdb/tests/pr8_vocabulary_assessment.rs +0 -916
  214. package/dist/create/server-source/crates/feltdb/tests/pr9_phase2_boundary_tests.rs +0 -1045
  215. package/dist/create/server-source/crates/feltdb/tests/pr9_phase3a_path_a_tests.rs +0 -347
  216. package/dist/create/server-source/crates/feltdb/tests/pr9_phase3c_authorized_mutations.rs +0 -361
  217. package/dist/create/server-source/crates/feltdb/tests/pr9_phase3c_role_based_authorization.rs +0 -330
  218. package/dist/create/server-source/crates/feltdb/tests/pr9_phase3c_simple_auth_delete.rs +0 -93
  219. package/dist/create/server-source/crates/feltdb/tests/pr9_phase3c_team_delete_role_authorization.rs +0 -622
  220. package/dist/create/server-source/crates/feltdb/tests/pr9_teams_role_based_access.rs +0 -517
  221. package/dist/create/server-source/crates/feltdb/tests/production_certification.rs +0 -1153
  222. package/dist/create/server-source/crates/feltdb/tests/production_contract.rs +0 -771
  223. package/dist/create/server-source/crates/feltdb/tests/production_readiness_contract.rs +0 -1383
  224. package/dist/create/server-source/crates/feltdb/tests/reconciliation_application.rs +0 -868
  225. package/dist/create/server-source/crates/feltdb/tests/reconciliation_wire_format_evidence.rs +0 -221
  226. package/dist/create/server-source/crates/feltdb/tests/replicated_history_contract.rs +0 -417
  227. package/dist/create/server-source/crates/feltdb/tests/resource_scoped_revisions.rs +0 -338
  228. package/dist/create/server-source/crates/feltdb/tests/revision_identity_contract.rs +0 -1039
  229. package/dist/create/server-source/crates/feltdb/tests/revision_model_decision.rs +0 -739
  230. package/dist/create/server-source/crates/feltdb/tests/revision_retention_boundary_evidence.rs +0 -452
  231. package/dist/create/server-source/crates/feltdb/tests/saas_authorization_integration.rs +0 -81
  232. package/dist/create/server-source/crates/feltdb/tests/saas_invitation_lifecycle.rs +0 -438
  233. package/dist/create/server-source/crates/feltdb/tests/semantic_decision.rs +0 -1165
  234. package/dist/create/server-source/crates/feltdb/tests/semantic_query.rs +0 -767
  235. package/dist/create/server-source/crates/feltdb/tests/semantic_query_contract.rs +0 -363
  236. package/dist/create/server-source/crates/feltdb/tests/state_conflict_contract_conformance.rs +0 -1799
  237. package/dist/create/server-source/crates/feltdb/tests/state_diff_contract_conformance.rs +0 -1316
  238. package/dist/create/server-source/crates/feltdb/tests/state_model_integration.rs +0 -358
  239. package/dist/create/server-source/crates/feltdb/tests/state_persistence_integration.rs +0 -365
  240. package/dist/create/server-source/crates/feltdb/tests/state_ref_authority.rs +0 -918
  241. package/dist/create/server-source/crates/feltdb/tests/state_store_boundary_evidence.rs +0 -299
  242. package/dist/create/server-source/crates/feltdb/tests/storage_independent_versioned_object_substrate.rs +0 -328
  243. package/dist/create/server-source/crates/feltdb/tests/sync_divergence_evidence.rs +0 -255
  244. package/dist/create/server-source/crates/feltdb/tests/three_way_input_boundary_evidence.rs +0 -249
  245. package/dist/create/server-source/crates/feltdb/tests/trigger_contract_conformance.rs +0 -994
  246. package/dist/create/server-source/crates/feltdb/tests/workload_envelope_contract.rs +0 -484
  247. package/dist/studio-app/assets/feltdb_wasm_bg-TseJn2Ax.wasm +0 -0
  248. package/dist/studio-app/assets/index-1wd0uKua.js +0 -30
@@ -1,713 +0,0 @@
1
- use crate::FlowRef;
2
- /// Workflow module for durable, reactive distributed workflows
3
- ///
4
- /// A workflow is a durable graph of intents and references that can execute
5
- /// wherever the required capabilities exist, without the workflow owning execution location.
6
- use serde::{Deserialize, Serialize};
7
- use std::collections::{HashMap, HashSet};
8
- use std::fmt::{Display, Formatter};
9
-
10
- /// Reference to a workflow - addressable object in the fabric
11
- ///
12
- /// WorkflowRef {
13
- /// namespace: "workflows",
14
- /// workflow_id: "order-processing",
15
- /// version: 1,
16
- /// }
17
- ///
18
- /// For example:
19
- /// - flow://workflow/order-processing@1
20
- /// - flow://workflow/document-ingestion@2
21
- /// - flow://workflow/research@1
22
- #[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq, Hash)]
23
- pub struct WorkflowRef {
24
- /// Namespace for workflows (typically "workflow")
25
- pub namespace: String,
26
- /// Unique identifier for the workflow
27
- pub workflow_id: String,
28
- /// Version of the workflow
29
- pub version: u64,
30
- }
31
-
32
- impl WorkflowRef {
33
- /// Create a new WorkflowRef
34
- pub fn new(namespace: impl Into<String>, workflow_id: impl Into<String>, version: u64) -> Self {
35
- Self {
36
- namespace: namespace.into(),
37
- workflow_id: workflow_id.into(),
38
- version,
39
- }
40
- }
41
-
42
- /// Get canonical string representation
43
- pub fn canonical(&self) -> String {
44
- format!(
45
- "flow://{}/{}@{}",
46
- self.namespace, self.workflow_id, self.version
47
- )
48
- }
49
-
50
- /// Parse from canonical form
51
- pub fn from_canonical(s: &str) -> Option<Self> {
52
- if !s.starts_with("flow://") {
53
- return None;
54
- }
55
- let s = &s[7..]; // Remove "flow://"
56
-
57
- let (namespace, rest) = s.split_once('/')?;
58
- let (workflow_id, version_str) = rest.split_once('@')?;
59
- let version = version_str.parse().ok()?;
60
-
61
- Some(Self {
62
- namespace: namespace.to_string(),
63
- workflow_id: workflow_id.to_string(),
64
- version,
65
- })
66
- }
67
- }
68
-
69
- impl Display for WorkflowRef {
70
- fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
71
- write!(f, "{}", self.canonical())
72
- }
73
- }
74
-
75
- /// Reference to a step within a workflow
76
- ///
77
- /// Provides stable identity for workflow steps across peer failures and migrations.
78
- #[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq, Hash)]
79
- pub struct WorkflowStepRef {
80
- /// Reference to the parent workflow
81
- pub workflow_ref: WorkflowRef,
82
- /// Step identifier within the workflow (e.g., "step-1", "extract", "join-results")
83
- pub step_id: String,
84
- }
85
-
86
- impl WorkflowStepRef {
87
- /// Create a new WorkflowStepRef
88
- pub fn new(workflow_ref: WorkflowRef, step_id: impl Into<String>) -> Self {
89
- Self {
90
- workflow_ref,
91
- step_id: step_id.into(),
92
- }
93
- }
94
-
95
- /// Get canonical string representation
96
- pub fn canonical(&self) -> String {
97
- format!("{}/{}", self.workflow_ref.canonical(), self.step_id)
98
- }
99
-
100
- /// Parse from canonical form
101
- pub fn from_canonical(s: &str) -> Option<Self> {
102
- // Expected format: flow://workflow/workflow-id@version/step-id
103
- if !s.starts_with("flow://") {
104
- return None;
105
- }
106
-
107
- let s = &s[7..]; // Remove "flow://"
108
-
109
- // Find the last '/' to separate workflow part from step-id
110
- let last_slash_idx = s.rfind('/')?;
111
- let workflow_str = &s[..last_slash_idx];
112
- let step_id = &s[last_slash_idx + 1..];
113
-
114
- // Parse the workflow part
115
- let (namespace, rest) = workflow_str.split_once('/')?;
116
- let (workflow_id, version_str) = rest.split_once('@')?;
117
- let version = version_str.parse().ok()?;
118
-
119
- Some(Self {
120
- workflow_ref: WorkflowRef {
121
- namespace: namespace.to_string(),
122
- workflow_id: workflow_id.to_string(),
123
- version,
124
- },
125
- step_id: step_id.to_string(),
126
- })
127
- }
128
- }
129
-
130
- impl Display for WorkflowStepRef {
131
- fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
132
- write!(f, "{}", self.canonical())
133
- }
134
- }
135
-
136
- /// State of a workflow step in the durable execution model
137
- #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
138
- pub enum WorkflowStepState {
139
- /// Waiting for dependencies to be satisfied
140
- Pending,
141
- /// Dependencies satisfied, ready to execute
142
- Ready,
143
- /// Step has been claimed by a peer for execution
144
- Claimed,
145
- /// Step is currently executing
146
- Running,
147
- /// Step completed successfully
148
- Completed,
149
- /// Step failed during execution
150
- Failed,
151
- /// Step scheduled for retry after failure
152
- Retrying,
153
- /// Step is blocked, waiting for external input
154
- Blocked,
155
- }
156
-
157
- impl Display for WorkflowStepState {
158
- fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
159
- match self {
160
- Self::Pending => write!(f, "Pending"),
161
- Self::Ready => write!(f, "Ready"),
162
- Self::Claimed => write!(f, "Claimed"),
163
- Self::Running => write!(f, "Running"),
164
- Self::Completed => write!(f, "Completed"),
165
- Self::Failed => write!(f, "Failed"),
166
- Self::Retrying => write!(f, "Retrying"),
167
- Self::Blocked => write!(f, "Blocked"),
168
- }
169
- }
170
- }
171
-
172
- /// Reason a workflow step is blocked
173
- #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
174
- pub enum BlockedReason {
175
- /// Awaiting human approval
176
- AwaitingApproval(String),
177
- /// Awaiting human input
178
- AwaitingInput(String),
179
- /// Required capability not available
180
- AwaitingCapability(String),
181
- /// Insufficient resources
182
- AwaitingResource(String),
183
- /// Custom blocking reason
184
- Custom(String),
185
- }
186
-
187
- impl Display for BlockedReason {
188
- fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
189
- match self {
190
- Self::AwaitingApproval(msg) => write!(f, "AwaitingApproval: {}", msg),
191
- Self::AwaitingInput(msg) => write!(f, "AwaitingInput: {}", msg),
192
- Self::AwaitingCapability(cap) => write!(f, "AwaitingCapability: {}", cap),
193
- Self::AwaitingResource(res) => write!(f, "AwaitingResource: {}", res),
194
- Self::Custom(msg) => write!(f, "Custom: {}", msg),
195
- }
196
- }
197
- }
198
-
199
- /// State of a workflow
200
- #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
201
- pub enum WorkflowState {
202
- /// Workflow has been created but not started
203
- Created,
204
- /// Workflow is currently executing
205
- Running,
206
- /// Workflow completed successfully
207
- Completed,
208
- /// Workflow failed
209
- Failed,
210
- }
211
-
212
- impl Display for WorkflowState {
213
- fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
214
- match self {
215
- Self::Created => write!(f, "Created"),
216
- Self::Running => write!(f, "Running"),
217
- Self::Completed => write!(f, "Completed"),
218
- Self::Failed => write!(f, "Failed"),
219
- }
220
- }
221
- }
222
-
223
- /// Workflow lifecycle event - becomes a durable operation
224
- #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
225
- pub enum WorkflowOperation {
226
- /// Workflow was created
227
- Created { workflow_ref: WorkflowRef },
228
- /// Workflow started execution
229
- Started { workflow_ref: WorkflowRef },
230
- /// A step became ready to execute
231
- StepReady { step_ref: WorkflowStepRef },
232
- /// A step was claimed by a peer
233
- StepClaimed {
234
- step_ref: WorkflowStepRef,
235
- claimed_by: String,
236
- },
237
- /// A step started executing
238
- StepExecuting {
239
- step_ref: WorkflowStepRef,
240
- claimed_by: String,
241
- },
242
- /// A step completed successfully
243
- StepCompleted {
244
- step_ref: WorkflowStepRef,
245
- result_ref: Option<FlowRef>,
246
- },
247
- /// A step failed
248
- StepFailed {
249
- step_ref: WorkflowStepRef,
250
- error: String,
251
- attempt: u32,
252
- },
253
- /// A step is blocked pending external input
254
- StepBlocked {
255
- step_ref: WorkflowStepRef,
256
- reason: BlockedReason,
257
- },
258
- /// A step retry was scheduled
259
- StepRetrying {
260
- step_ref: WorkflowStepRef,
261
- attempt: u32,
262
- },
263
- /// Workflow completed
264
- Completed { workflow_ref: WorkflowRef },
265
- /// Workflow failed
266
- Failed {
267
- workflow_ref: WorkflowRef,
268
- error: String,
269
- },
270
- }
271
-
272
- impl WorkflowOperation {
273
- /// Get the affected workflow reference
274
- pub fn workflow_ref(&self) -> Option<&WorkflowRef> {
275
- match self {
276
- Self::Created { workflow_ref } => Some(workflow_ref),
277
- Self::Started { workflow_ref } => Some(workflow_ref),
278
- Self::Completed { workflow_ref } => Some(workflow_ref),
279
- Self::Failed { workflow_ref, .. } => Some(workflow_ref),
280
- _ => None,
281
- }
282
- }
283
-
284
- /// Get the affected step reference
285
- pub fn step_ref(&self) -> Option<&WorkflowStepRef> {
286
- match self {
287
- Self::StepReady { step_ref } => Some(step_ref),
288
- Self::StepClaimed { step_ref, .. } => Some(step_ref),
289
- Self::StepExecuting { step_ref, .. } => Some(step_ref),
290
- Self::StepCompleted { step_ref, .. } => Some(step_ref),
291
- Self::StepFailed { step_ref, .. } => Some(step_ref),
292
- Self::StepBlocked { step_ref, .. } => Some(step_ref),
293
- Self::StepRetrying { step_ref, .. } => Some(step_ref),
294
- _ => None,
295
- }
296
- }
297
- }
298
-
299
- /// Workflow graph node - represents a capability to execute
300
- #[derive(Debug, Clone, Serialize, Deserialize)]
301
- pub struct WorkflowNode {
302
- /// Step identifier (e.g., "extract", "embed", "classify")
303
- pub step_id: String,
304
- /// Capability to execute (reference to a CapabilityRef)
305
- pub capability: String,
306
- /// Input references required for this step
307
- pub inputs: Vec<String>, // Step IDs or input slot names
308
- /// Output slot names produced by this step
309
- pub outputs: Vec<String>,
310
- /// State requirements for this step
311
- pub state_requirements: HashMap<String, String>,
312
- /// Metadata about this node
313
- pub metadata: HashMap<String, serde_json::Value>,
314
- }
315
-
316
- impl WorkflowNode {
317
- /// Create a new workflow node
318
- pub fn new(step_id: impl Into<String>, capability: impl Into<String>) -> Self {
319
- Self {
320
- step_id: step_id.into(),
321
- capability: capability.into(),
322
- inputs: Vec::new(),
323
- outputs: Vec::new(),
324
- state_requirements: HashMap::new(),
325
- metadata: HashMap::new(),
326
- }
327
- }
328
-
329
- /// Add an input dependency
330
- pub fn with_input(mut self, input: impl Into<String>) -> Self {
331
- self.inputs.push(input.into());
332
- self
333
- }
334
-
335
- /// Add an output slot
336
- pub fn with_output(mut self, output: impl Into<String>) -> Self {
337
- self.outputs.push(output.into());
338
- self
339
- }
340
-
341
- /// Add a state requirement
342
- pub fn with_state_requirement(
343
- mut self,
344
- key: impl Into<String>,
345
- value: impl Into<String>,
346
- ) -> Self {
347
- self.state_requirements.insert(key.into(), value.into());
348
- self
349
- }
350
- }
351
-
352
- /// Workflow graph definition - durable DAG structure
353
- #[derive(Debug, Clone, Serialize, Deserialize)]
354
- pub struct WorkflowGraph {
355
- /// Workflow reference
356
- pub workflow_ref: WorkflowRef,
357
- /// Nodes in the workflow
358
- pub nodes: HashMap<String, WorkflowNode>,
359
- /// Edges: from_step_id -> to_step_id
360
- pub edges: HashMap<String, Vec<String>>,
361
- /// Input references for the entire workflow
362
- pub inputs: Vec<FlowRef>,
363
- /// Output slot definitions
364
- pub outputs: Vec<String>,
365
- /// Metadata
366
- pub metadata: HashMap<String, serde_json::Value>,
367
- }
368
-
369
- impl WorkflowGraph {
370
- /// Create a new workflow graph
371
- pub fn new(workflow_ref: WorkflowRef) -> Self {
372
- Self {
373
- workflow_ref,
374
- nodes: HashMap::new(),
375
- edges: HashMap::new(),
376
- inputs: Vec::new(),
377
- outputs: Vec::new(),
378
- metadata: HashMap::new(),
379
- }
380
- }
381
-
382
- /// Add a node to the graph
383
- pub fn add_node(mut self, node: WorkflowNode) -> Self {
384
- self.nodes.insert(node.step_id.clone(), node);
385
- self
386
- }
387
-
388
- /// Add an edge from one step to another
389
- pub fn add_edge(mut self, from_step: impl Into<String>, to_step: impl Into<String>) -> Self {
390
- let from = from_step.into();
391
- let to = to_step.into();
392
- self.edges.entry(from).or_insert_with(Vec::new).push(to);
393
- self
394
- }
395
-
396
- /// Add an input reference
397
- pub fn with_input(mut self, input: FlowRef) -> Self {
398
- self.inputs.push(input);
399
- self
400
- }
401
-
402
- /// Validate the graph structure (basic DAG check)
403
- pub fn validate(&self) -> Result<(), String> {
404
- // Check all edges reference existing nodes
405
- for (from, tos) in &self.edges {
406
- if !self.nodes.contains_key(from) {
407
- return Err(format!("Edge source '{}' does not exist", from));
408
- }
409
- for to in tos {
410
- if !self.nodes.contains_key(to) {
411
- return Err(format!("Edge target '{}' does not exist", to));
412
- }
413
- }
414
- }
415
-
416
- // Check input dependencies reference existing nodes or inputs
417
- for node in self.nodes.values() {
418
- for input in &node.inputs {
419
- if !self.nodes.contains_key(input) && !input.starts_with("input:") {
420
- return Err(format!(
421
- "Node '{}' has input dependency '{}' that doesn't exist",
422
- node.step_id, input
423
- ));
424
- }
425
- }
426
- }
427
-
428
- // Simple cycle detection using DFS
429
- self.detect_cycles()?;
430
-
431
- Ok(())
432
- }
433
-
434
- /// Detect cycles in the graph using DFS
435
- fn detect_cycles(&self) -> Result<(), String> {
436
- let mut visited: HashSet<String> = HashSet::new();
437
- let mut rec_stack: HashSet<String> = HashSet::new();
438
-
439
- for node_id in self.nodes.keys() {
440
- if !visited.contains(node_id) {
441
- self.dfs(node_id, &mut visited, &mut rec_stack)?;
442
- }
443
- }
444
-
445
- Ok(())
446
- }
447
-
448
- /// DFS helper for cycle detection
449
- fn dfs(
450
- &self,
451
- node_id: &str,
452
- visited: &mut HashSet<String>,
453
- rec_stack: &mut HashSet<String>,
454
- ) -> Result<(), String> {
455
- visited.insert(node_id.to_string());
456
- rec_stack.insert(node_id.to_string());
457
-
458
- if let Some(neighbors) = self.edges.get(node_id) {
459
- for neighbor in neighbors {
460
- if !visited.contains(neighbor) {
461
- self.dfs(neighbor, visited, rec_stack)?;
462
- } else if rec_stack.contains(neighbor) {
463
- return Err(format!("Cycle detected: {} -> {}", node_id, neighbor));
464
- }
465
- }
466
- }
467
-
468
- rec_stack.remove(node_id);
469
- Ok(())
470
- }
471
-
472
- /// Get nodes with no dependencies (entry points)
473
- pub fn entry_nodes(&self) -> Vec<String> {
474
- self.nodes
475
- .keys()
476
- .filter(|node_id| {
477
- if let Some(node) = self.nodes.get(*node_id) {
478
- // A node is an entry point if all its inputs come from workflow inputs
479
- node.inputs.is_empty()
480
- || node.inputs.iter().all(|inp| inp.starts_with("input:"))
481
- } else {
482
- false
483
- }
484
- })
485
- .cloned()
486
- .collect()
487
- }
488
-
489
- /// Get nodes that depend on a given step
490
- pub fn dependents(&self, step_id: &str) -> Vec<String> {
491
- self.edges
492
- .get(step_id)
493
- .map(|deps| deps.clone())
494
- .unwrap_or_default()
495
- }
496
-
497
- /// Get nodes that a given step depends on
498
- pub fn dependencies(&self, step_id: &str) -> Vec<String> {
499
- if let Some(node) = self.nodes.get(step_id) {
500
- node.inputs
501
- .iter()
502
- .filter(|inp| !inp.starts_with("input:"))
503
- .cloned()
504
- .collect()
505
- } else {
506
- Vec::new()
507
- }
508
- }
509
- }
510
-
511
- /// Runtime state for a workflow instance
512
- #[derive(Debug, Clone, Serialize, Deserialize)]
513
- pub struct WorkflowInstance {
514
- /// Reference to the workflow definition
515
- pub workflow_ref: WorkflowRef,
516
- /// Unique instance ID for this execution
517
- pub instance_id: String,
518
- /// Overall workflow state
519
- pub state: WorkflowState,
520
- /// Current state of each step
521
- pub step_states: HashMap<String, WorkflowStepState>,
522
- /// Which peer claimed each step
523
- pub step_claims: HashMap<String, String>,
524
- /// Results produced by each step
525
- pub step_results: HashMap<String, FlowRef>,
526
- /// Failed attempts for each step
527
- pub step_failures: HashMap<String, Vec<String>>,
528
- /// Blocked reason for each step
529
- pub step_blocked_reasons: HashMap<String, BlockedReason>,
530
- /// Timestamp created (ms since UNIX epoch)
531
- pub created_ms: u128,
532
- /// Timestamp started (ms since UNIX epoch)
533
- pub started_ms: Option<u128>,
534
- /// Timestamp completed (ms since UNIX epoch)
535
- pub completed_ms: Option<u128>,
536
- }
537
-
538
- impl WorkflowInstance {
539
- /// Create a new workflow instance
540
- pub fn new(workflow_ref: WorkflowRef, instance_id: impl Into<String>) -> Self {
541
- Self {
542
- workflow_ref,
543
- instance_id: instance_id.into(),
544
- state: WorkflowState::Created,
545
- step_states: HashMap::new(),
546
- step_claims: HashMap::new(),
547
- step_results: HashMap::new(),
548
- step_failures: HashMap::new(),
549
- step_blocked_reasons: HashMap::new(),
550
- created_ms: crate::now_ms(),
551
- started_ms: None,
552
- completed_ms: None,
553
- }
554
- }
555
-
556
- /// Get the state of a step
557
- pub fn get_step_state(&self, step_id: &str) -> Option<WorkflowStepState> {
558
- self.step_states.get(step_id).copied()
559
- }
560
-
561
- /// Set the state of a step
562
- pub fn set_step_state(&mut self, step_id: impl Into<String>, state: WorkflowStepState) {
563
- self.step_states.insert(step_id.into(), state);
564
- }
565
-
566
- /// Mark a step as claimed
567
- pub fn claim_step(
568
- &mut self,
569
- step_id: impl Into<String>,
570
- claimed_by: impl Into<String>,
571
- ) -> Result<(), String> {
572
- let step_id = step_id.into();
573
- let claimed_by = claimed_by.into();
574
-
575
- match self.get_step_state(&step_id) {
576
- Some(WorkflowStepState::Ready) => {
577
- self.set_step_state(step_id.clone(), WorkflowStepState::Claimed);
578
- self.step_claims.insert(step_id, claimed_by);
579
- Ok(())
580
- }
581
- Some(state) => Err(format!("Cannot claim step in state {}", state)),
582
- None => Err(format!("Step not found: {}", step_id)),
583
- }
584
- }
585
-
586
- /// Record a step completion
587
- pub fn complete_step(
588
- &mut self,
589
- step_id: impl Into<String>,
590
- result_ref: FlowRef,
591
- ) -> Result<(), String> {
592
- let step_id = step_id.into();
593
- self.set_step_state(step_id.clone(), WorkflowStepState::Completed);
594
- self.step_results.insert(step_id, result_ref);
595
- Ok(())
596
- }
597
-
598
- /// Record a step failure
599
- pub fn fail_step(&mut self, step_id: impl Into<String>, error: String) -> Result<(), String> {
600
- let step_id = step_id.into();
601
- self.set_step_state(step_id.clone(), WorkflowStepState::Failed);
602
- self.step_failures
603
- .entry(step_id)
604
- .or_insert_with(Vec::new)
605
- .push(error);
606
- Ok(())
607
- }
608
-
609
- /// Check if workflow is terminal (won't change state)
610
- pub fn is_terminal(&self) -> bool {
611
- matches!(self.state, WorkflowState::Completed | WorkflowState::Failed)
612
- }
613
- }
614
-
615
- #[cfg(test)]
616
- mod tests {
617
- use super::*;
618
-
619
- #[test]
620
- fn test_workflow_ref_canonical() {
621
- let r = WorkflowRef::new("workflow", "order-processing", 1);
622
- assert_eq!(r.canonical(), "flow://workflow/order-processing@1");
623
- }
624
-
625
- #[test]
626
- fn test_workflow_ref_parse() {
627
- let s = "flow://workflow/order-processing@1";
628
- let r = WorkflowRef::from_canonical(s).unwrap();
629
- assert_eq!(r.namespace, "workflow");
630
- assert_eq!(r.workflow_id, "order-processing");
631
- assert_eq!(r.version, 1);
632
- }
633
-
634
- #[test]
635
- fn test_workflow_step_ref_canonical() {
636
- let wf = WorkflowRef::new("workflow", "test", 1);
637
- let step = WorkflowStepRef::new(wf, "step-1");
638
- assert_eq!(step.canonical(), "flow://workflow/test@1/step-1");
639
- }
640
-
641
- #[test]
642
- fn test_workflow_step_ref_parse() {
643
- let s = "flow://workflow/test@1/step-1";
644
- let step = WorkflowStepRef::from_canonical(s).unwrap();
645
- assert_eq!(step.step_id, "step-1");
646
- assert_eq!(step.workflow_ref.workflow_id, "test");
647
- }
648
-
649
- #[test]
650
- fn test_workflow_graph_validation() {
651
- let wf = WorkflowRef::new("workflow", "test", 1);
652
- let graph = WorkflowGraph::new(wf)
653
- .add_node(WorkflowNode::new("step-1", "capability-a"))
654
- .add_node(WorkflowNode::new("step-2", "capability-b").with_input("step-1"))
655
- .add_edge("step-1", "step-2");
656
-
657
- assert!(graph.validate().is_ok());
658
- }
659
-
660
- #[test]
661
- fn test_workflow_graph_cycle_detection() {
662
- let wf = WorkflowRef::new("workflow", "test", 1);
663
- let graph = WorkflowGraph::new(wf)
664
- .add_node(WorkflowNode::new("step-1", "capability-a"))
665
- .add_node(WorkflowNode::new("step-2", "capability-b"))
666
- .add_edge("step-1", "step-2")
667
- .add_edge("step-2", "step-1");
668
-
669
- assert!(graph.validate().is_err());
670
- }
671
-
672
- #[test]
673
- fn test_workflow_graph_entry_nodes() {
674
- let wf = WorkflowRef::new("workflow", "test", 1);
675
- let graph = WorkflowGraph::new(wf)
676
- .add_node(WorkflowNode::new("step-1", "capability-a"))
677
- .add_node(WorkflowNode::new("step-2", "capability-b").with_input("step-1"))
678
- .add_edge("step-1", "step-2");
679
-
680
- let entries = graph.entry_nodes();
681
- assert_eq!(entries.len(), 1);
682
- assert!(entries.contains(&"step-1".to_string()));
683
- }
684
-
685
- #[test]
686
- fn test_workflow_instance_lifecycle() {
687
- let wf = WorkflowRef::new("workflow", "test", 1);
688
- let mut instance = WorkflowInstance::new(wf, "instance-1");
689
-
690
- instance.set_step_state("step-1", WorkflowStepState::Pending);
691
- assert_eq!(
692
- instance.get_step_state("step-1"),
693
- Some(WorkflowStepState::Pending)
694
- );
695
-
696
- instance.set_step_state("step-1", WorkflowStepState::Ready);
697
- let claim_result = instance.claim_step("step-1", "peer-a");
698
- assert!(claim_result.is_ok());
699
- assert_eq!(
700
- instance.get_step_state("step-1"),
701
- Some(WorkflowStepState::Claimed)
702
- );
703
- }
704
-
705
- #[test]
706
- fn test_workflow_blocked_reason() {
707
- let reason = BlockedReason::AwaitingApproval("Needs manager approval".to_string());
708
- assert_eq!(
709
- reason.to_string(),
710
- "AwaitingApproval: Needs manager approval"
711
- );
712
- }
713
- }