Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
471 lines (413 loc) · 18 KB
/
Copy pathCargo.toml
File metadata and controls
471 lines (413 loc) · 18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
[package]
name = "conductor-sdk"
version = "0.2.0"
edition = "2021"
rust-version = "1.85"
description = "Rust SDK for Netflix Conductor workflow orchestration"
license = "Apache-2.0"
repository = "https://github.com/conductor-oss/rust-sdk"
homepage = "https://conductor-oss.org"
documentation = "https://docs.rs/conductor-sdk"
authors = ["Orkes, Inc. <info@orkes.io>"]
keywords = ["conductor", "workflow", "orchestration", "microservices"]
categories = ["api-bindings", "asynchronous"]
readme = "README.md"
exclude = [
".github/*",
".gitignore",
"PUBLISHING.md",
"DESIGN.md",
"SDK_COMPARISON.md",
"WORKER_COMPARISON.md",
"EXAMPLES_COMPARISON.md",
"launch_blog.md",
]
# Lint configuration for production-ready code
[lints.rust]
unsafe_code = "forbid"
[lints.clippy]
# Broad groups -- individual lints below override these where we've made an explicit call.
pedantic = { level = "warn", priority = -1 }
restriction = { level = "warn", priority = -1 }
# --- Disabled: fights idiomatic Rust as actually written in this crate ---
# Its own machine-applicable fix is provably broken: rewrites async trait-impl methods into
# `return async fn execute(...) { ... }`, which doesn't even parse. Confirmed via
# `cargo clippy --fix`.
implicit_return = "allow"
# Blanket #[inline] on every public item hurts compile times/binary size without profiling
# data; not how this crate or most Rust code is written.
missing_inline_in_public_items = "allow"
# Forces one canonical member order crate-wide for zero functional benefit and high
# merge-conflict risk.
arbitrary_source_item_ordering = "allow"
# Flags use of `?` itself -- one of Rust's core idioms, used pervasively and correctly
# throughout this crate.
question_mark_used = "allow"
# This crate deliberately re-exports common types at the crate root (an established,
# intentional pattern -- see src/lib.rs).
pub_use = "allow"
# This is a `std` crate (tokio, reqwest, full std), not `no_std` -- inapplicable. Its
# machine-applicable fix is provably broken: rewrites `std::` paths to `alloc::` without any
# `alloc`-only setup, which fails to resolve. Confirmed via `cargo clippy --fix`.
std_instead_of_core = "allow"
std_instead_of_alloc = "allow"
# Contradicts the `foo/mod.rs` layout already used throughout (src/agents/mod.rs, etc.).
mod_module_files = "allow"
# Public module entry points and schema helpers live in `mod.rs` by design;
# moving each item to a separate file would fragment the established layout.
definition_in_module_root = "allow"
# Fires on every `#[cfg(test)] mod tests { ... }` block -- this crate's universal
# test-organization convention.
inline_modules = "allow"
# Wants every once-called private helper inlined into its caller; usually hurts readability
# and contradicts the extract-a-well-named-helper style used throughout.
single_call_fn = "allow"
# Wants every trait method re-implemented even when the provided default is exactly what's
# wanted.
missing_trait_methods = "allow"
# Variable shadowing (`let x = x.field()`) is idiomatic and used throughout.
shadow_reuse = "allow"
shadow_unrelated = "allow"
# Very opinionated about deref patterns in `match`; low signal-to-noise here.
pattern_type_mismatch = "allow"
# Matching an error variant while ignoring its unrelated fields keeps control-flow
# checks readable and resilient to new fields on those variants.
rest_pattern_accessible_field = "allow"
# Flags idiomatic short names (`i`, `e`, `k`, `v` in loops/closures/comprehensions).
min_ident_chars = "allow"
# A catch-all `_ =>` arm is sometimes deliberate (forward-compatibility with new variants),
# not always an oversight -- case-by-case, not a blanket lint.
wildcard_enum_match_arm = "allow"
# Low-value stylistic opinions.
ref_patterns = "allow"
unused_self = "allow"
field_scoped_visibility_modifiers = "allow"
single_char_lifetime_names = "allow"
# Flags any `/` or `%` on integers, unconditionally -- same category as `question_mark_used`
# above: a completely normal, pervasive Rust operation, not a code smell.
integer_division_remainder_used = "allow"
# `restriction` bundles two genuinely mutually-exclusive lint pairs (each explicitly a
# "pick at most one" style choice, not a bug on either side): `separated_literal_suffix` vs.
# `unseparated_literal_suffix` (`1_u64` vs. `1u64`), and `semicolon_outside_block` vs.
# `semicolon_inside_block`/`semicolon_if_nothing_returned` (2-vs-1, so we standardize on
# semicolon-inside and disable the outlier). Keeping one side of each active and disabling the
# other, rather than disabling both, so the crate still gets a consistent style enforced.
separated_literal_suffix = "allow"
semicolon_outside_block = "allow"
# --- Disabled: test/example-code-only findings (`--tests --examples`), inapplicable there ---
# `println!`/`eprintln!` in `examples/*.rs` demo programs *is* the point -- that's how an example
# shows a user what the SDK does. Also fires on test-failure diagnostics in `tests/*.rs`.
print_stdout = "allow"
print_stderr = "allow"
# `{:?}` formatting in a test assertion/failure message or an example's demo output is normal;
# this lint is really aimed at debug-formatting leaking into production log/user-facing output.
use_debug = "allow"
# `.ok()` to discard a `Result`'s error in test teardown/cleanup code (e.g. "delete this
# workflow if it exists, don't fail the test either way") is a deliberate, common pattern, not
# an oversight.
unused_result_ok = "allow"
# `assert!(collection.is_empty())` states the test condition directly; the
# replacement can require noisy type annotations and may expose credentials.
assert_is_empty = "allow"
# Every `tests/*.rs` integration-test file is its own crate by Cargo convention, with top-level
# `#[test]` fns -- there is no nested `#[cfg(test)] mod tests` to put them in (that convention
# is for unit tests colocated in `src/`, and those already follow it).
tests_outside_test_module = "allow"
# Wants every `#[test] fn test_foo()` renamed to `fn foo()` (644 sites across the test suite).
# Purely cosmetic, and mechanically renaming risks name collisions within a module; not worth
# the blast radius for the benefit.
redundant_test_prefix = "allow"
# Same fix already applied to real doc comments in `src/` (see the `missing_errors_doc`/
# `doc_markdown` work); doc comments on test helpers/example code don't carry the same
# public-API-documentation motivation. Revisit if desired.
doc_paragraphs_missing_punctuation = "allow"
# --- Disabled for now: open questions, not yet decided -- see PR description ---
# Wants by-value builder/setter params (e.g. `with_metadata(HashMap<...>)`) taken by reference
# instead, since the body only serializes/moves them once. Fixing this changes public builder
# signatures crate-wide for a micro-optimization; needs an explicit call on whether that
# breaking change is worth it.
needless_pass_by_value = "allow"
# Fires on every deliberate `let _ = expr;` fire-and-forget discard (dropped `Result`s from
# best-effort calls like `dotenvy::dotenv()`). "Fixing" means spelling out verbose types for no
# clarity gain; needs a call on whether that's actually wanted here.
let_underscore_untyped = "allow"
# Wants a trailing no-op `else {}` on every `if`/`else if` chain, even ones that already handle
# every case via side effects. Same "forced exhaustiveness for its own sake" category as
# `wildcard_enum_match_arm` above, but not yet triaged as thoroughly.
else_if_without_else = "allow"
# Flags match arms with identical bodies (e.g. `Api {..} => Ok(false)` and
# `Server { status: 404, .. } => Ok(false)`) as mergeable. Merging loses the documentation value
# of naming each error variant explicitly; needs a call on whether that trade-off is acceptable.
match_same_arms = "allow"
# Wants every `#[expect(lint)]`/`#[allow(lint)]` to carry a `reason = "..."` string. Mechanical
# to add, but needs a call on wording/verbosity convention before doing it crate-wide.
allow_attributes_without_reason = "allow"
# Wants every bare numeric literal type-suffixed or explicitly annotated (`1` -> `1_i32`).
# Crate-wide, this would be a large, highly visible style change; needs an explicit call.
default_numeric_fallback = "allow"
# Wants `impl Trait` params rewritten as explicit generics (`fn f(x: impl Into<String>)` ->
# `fn f<T: Into<String>>(x: T)`). Used pervasively and intentionally throughout this crate's
# public builder APIs; rewriting is enormous, purely cosmetic churn.
impl_trait_in_params = "allow"
# Wants a doc comment on every private field/fn/struct/etc, crate-wide (357 sites). Worth doing
# as a deliberate documentation pass, not as a side effect of enabling a lint group.
missing_docs_in_private_items = "allow"
# Wants long-path references (`crate::error::ConductorError::agent(...)`) rewritten to short,
# `use`-imported names. Used throughout for clarity at error-construction call sites; not a
# defect.
absolute_paths = "allow"
# Wants every public struct/enum marked `#[non_exhaustive]`. A real API-design decision for a
# published SDK (affects whether callers can use struct-literal/exhaustive-match syntax against
# us) -- needs an explicit call, not a blanket application.
exhaustive_structs = "allow"
exhaustive_enums = "allow"
# Flags e.g. `mod tool { struct ToolDef }` naming overlap between a module and its contents --
# an established, intentional naming convention throughout this crate (`agents::AgentDef` in
# `agents/def.rs`, etc.).
module_name_repetitions = "allow"
# Flags intentionally-parallel names (`js_script`/`jq_script`, `handle`/`handler`) as "too
# similar" -- that's the point of the parallel naming, not a mixup.
similar_names = "allow"
# Flags any `+`/`-`/`*` on integers as potentially overflowing/panicking, unconditionally.
# Selectively fixing real overflow risk sites is worth doing deliberately, not as a side effect
# of a blanket lint pass.
arithmetic_side_effects = "allow"
float_arithmetic = "allow"
integer_division = "allow"
modulo_arithmetic = "allow"
# Flags every `as` cast unconditionally, including provably lossless ones. Selective review is
# worth doing deliberately; see `cast_possible_truncation`/`cast_precision_loss` below for the
# same reasoning applied to the numeric-cast-specific subset.
as_conversions = "allow"
cast_possible_truncation = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
cast_possible_wrap = "allow"
# Flags `v[i]`/slicing that could panic on out-of-bounds access. Same "selective review, not
# blanket" reasoning as `arithmetic_side_effects` above.
indexing_slicing = "allow"
# Flags byte-index string slicing (`&s[0..5]`), which can panic on a non-UTF8 boundary. Same
# reasoning as `indexing_slicing` above.
string_slice = "allow"
# Flags `unreachable!()`/`panic!()` macro usage unconditionally. Each existing use documents a
# genuine invariant (e.g. "framework_payload always returns an object"); reviewing whether each
# one should instead return a `Result` is a deliberate exercise, not a blanket lint fix.
unreachable = "allow"
panic = "allow"
# Function-length/complexity metrics -- flagging them is useful, but splitting up the flagged
# functions is a refactor, not a lint fix; do that as its own deliberate pass.
too_many_lines = "allow"
cognitive_complexity = "allow"
# Wants iteration order over `HashMap`/`HashSet` acknowledged/avoided everywhere (env vars,
# HTTP headers, docker volume mounts, credential-placeholder checks) -- in every current case
# order doesn't affect the result, but that's worth confirming lint-by-lint rather than
# blanket-suppressing the signal.
iter_over_hash_type = "allow"
# Wants public generic functions/structs over `HashMap` generalized over the hasher type
# (`fn f<S: BuildHasher>(m: &HashMap<K, V, S>)`). Real API-design question for a published SDK;
# needs an explicit call, not a blanket application.
implicit_hasher = "allow"
# Wants every struct with a mix of `pub` and non-`pub` fields to be all-or-nothing. The mix is
# intentional in every current case (public tunables alongside private invariant-preserving
# state) -- same category as `field_scoped_visibility_modifiers` above.
partial_pub_fields = "allow"
# Wants `pub(super)`/`pub(crate)` shorthand spelled out as `pub(in super)`/`pub(in crate)`.
# Fights the near-universal idiom for restricted visibility; same category as
# `single_char_lifetime_names` above.
pub_with_shorthand = "allow"
# Wants a bool-heavy config struct (`WorkerConfig`) redesigned around enums/a state machine.
# Real design question, and changing it breaks every existing struct-literal construction site;
# needs an explicit call.
struct_excessive_bools = "allow"
# Wants a type split into a single `impl` block. Used intentionally here to group methods by
# concern (e.g. public constructors vs. internal helpers, or by doc-comment topic); not a
# defect.
multiple_inherent_impl = "allow"
# Clippy's own meta-lint warning that blanket-enabling `restriction` is generally discouraged.
# Expected and already accounted for -- that's exactly what the rest of this section documents
# doing deliberately, lint-by-lint.
blanket_clippy_restriction_lints = "allow"
# Fires on every deliberate `let _ = expr;` discard of a `#[must_use]` value (dropped `Result`s
# from best-effort calls like `tx.send(...)` after the receiver may already be gone, or
# `write!` to a `String`, which never fails). Same reasoning as `let_underscore_untyped` above.
let_underscore_must_use = "allow"
# Critical: Prevent panics in production
unwrap_used = "warn"
expect_used = "warn"
# Performance
redundant_clone = "warn"
needless_borrow = "warn"
# Code quality
large_enum_variant = "warn"
clone_on_copy = "warn"
[workspace]
members = [".", "conductor-macros", "harness"]
[dependencies]
# Async runtime
tokio = { version = "1.35", features = ["full", "macros", "rt-multi-thread", "sync", "time"] }
tokio-util = { version = "0.7", features = ["rt"] }
# HTTP client
reqwest = { version = "0.11", features = ["json", "rustls-tls", "stream"], default-features = false }
hyper = { version = "0.14", features = ["server", "http1", "http2", "tcp"] }
urlencoding = "2.1"
bytes = "1"
# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["preserve_order"] }
# Error handling
thiserror = "1.0"
anyhow = "1.0"
# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# Metrics
prometheus = "0.13"
# Utilities
async-trait = "0.1"
uuid = { version = "1.6", features = ["v4"] }
chrono = { version = "0.4", features = ["serde"] }
hostname = "0.3"
once_cell = "1.19"
parking_lot = "0.12"
dashmap = "5.5"
futures = "0.3"
# Environment/Config
dotenvy = "0.15"
# JSON Schema generation
schemars = "0.8"
# Procedural macros (optional feature)
conductor-macros = { version = "0.2.0", path = "conductor-macros", optional = true }
# Guardrail pattern matching (agents feature)
regex = { version = "1", optional = true }
[dev-dependencies]
tokio-test = "0.4"
wiremock = "0.5"
mockall = "0.12"
[features]
default = []
macros = ["conductor-macros"]
agents = ["macros", "regex"]
[[example]]
name = "hello_world"
path = "examples/hello_world.rs"
[[example]]
name = "async_workers"
path = "examples/async_workers.rs"
[[example]]
name = "dynamic_workflow"
path = "examples/dynamic_workflow.rs"
[[example]]
name = "kitchensink"
path = "examples/kitchensink.rs"
[[example]]
name = "worker_example"
path = "examples/worker_example.rs"
[[example]]
name = "task_workers"
path = "examples/task_workers.rs"
[[example]]
name = "workflow_ops"
path = "examples/workflow_ops.rs"
[[example]]
name = "test_workflows"
path = "examples/test_workflows.rs"
[[example]]
name = "metadata_journey"
path = "examples/metadata_journey.rs"
[[example]]
name = "schedule_journey"
path = "examples/schedule_journey.rs"
[[example]]
name = "authorization_example"
path = "examples/authorization_example.rs"
[[example]]
name = "secret_example"
path = "examples/secret_example.rs"
[[example]]
name = "task_context_example"
path = "examples/task_context_example.rs"
[[example]]
name = "worker_config_example"
path = "examples/worker_config_example.rs"
[[example]]
name = "event_listener_example"
path = "examples/event_listener_example.rs"
[[example]]
name = "metrics_example"
path = "examples/metrics_example.rs"
[[example]]
name = "worker_macro_example"
path = "examples/worker_macro_example.rs"
required-features = ["macros"]
[[example]]
name = "agent_config_example"
path = "examples/agent_config_example.rs"
required-features = ["agents"]
# Orkes AI/LLM examples
[[example]]
name = "openai_helloworld"
path = "examples/openai_helloworld.rs"
[[example]]
name = "llm_chat_example"
path = "examples/llm_chat_example.rs"
[[example]]
name = "vector_db_example"
path = "examples/vector_db_example.rs"
# Advanced workflow examples
[[example]]
name = "http_poll_example"
path = "examples/http_poll_example.rs"
[[example]]
name = "wait_for_webhook_example"
path = "examples/wait_for_webhook_example.rs"
[[example]]
name = "sync_state_update_example"
path = "examples/sync_state_update_example.rs"
[[example]]
name = "workflow_rerun_example"
path = "examples/workflow_rerun_example.rs"
[[example]]
name = "fork_join_script_example"
path = "examples/fork_join_script_example.rs"
[[example]]
name = "task_status_audit_example"
path = "examples/task_status_audit_example.rs"
# New AI/LLM examples
[[example]]
name = "prompt_journey"
path = "examples/prompt_journey.rs"
[[example]]
name = "rag_workflow"
path = "examples/rag_workflow.rs"
[[example]]
name = "agentic_workflow"
path = "examples/agentic_workflow.rs"
[[example]]
name = "function_calling_example"
path = "examples/function_calling_example.rs"
[[example]]
name = "multiagent_chat"
path = "examples/multiagent_chat.rs"
[[example]]
name = "llm_chat_human_in_loop"
path = "examples/llm_chat_human_in_loop.rs"
# Configuration examples
[[example]]
name = "task_configure"
path = "examples/task_configure.rs"
[[example]]
name = "workflow_status_listener"
path = "examples/workflow_status_listener.rs"
[[example]]
name = "connection_config_example"
path = "examples/connection_config_example.rs"
[[example]]
name = "kitchensink_workers"
path = "examples/kitchensink_workers.rs"
[[test]]
name = "agent_client_tests"
path = "tests/agent_client_tests.rs"
required-features = ["agents"]
[lib]
name = "conductor"
path = "src/lib.rs"