Repository navigation
Tags
Tags
chore(deps): bump the cargo group across 1 directory with 7 updates (#63 ) Bumps the cargo group with 7 updates in the / directory: | Package | From | To | | --- | --- | --- | | [serde-saphyr](https://github.com/bourumir-wyngs/serde-saphyr) | `2.1.1` | `2.2.0` | | [uuid](https://github.com/uuid-rs/uuid) | `1.29.2` | `1.29.3` | | [regex](https://github.com/rust-lang/regex) | `1.13.1` | `1.13.2` | | [clap](https://github.com/clap-rs/clap) | `4.6.7` | `4.6.9` | | [sqlx](https://github.com/launchbadge/sqlx) | `0.9.0` | `0.9.1` | | [bytes](https://github.com/tokio-rs/bytes) | `1.12.1` | `1.12.2` | | [trybuild](https://github.com/dtolnay/trybuild) | `1.0.123` | `1.0.125` | Updates `serde-saphyr` from 2.1.1 to 2.2.0 - [Release notes](https://github.com/bourumir-wyngs/serde-saphyr/releases) - [Changelog](https://github.com/bourumir-wyngs/serde-saphyr/blob/master/CHANGELOG.md) - [Commits](bourumir-wyngs/serde-saphyr@2.1.1...2.2.0) Updates `uuid` from 1.29.2 to 1.29.3 - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](uuid-rs/uuid@v1.29.2...v1.29.3) Updates `regex` from 1.13.1 to 1.13.2 - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](rust-lang/regex@1.13.1...1.13.2) Updates `clap` from 4.6.7 to 4.6.9 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/main/CHANGELOG.md) - [Commits](clap-rs/clap@clap_complete-v4.6.7...clap_complete-v4.6.9) Updates `sqlx` from 0.9.0 to 0.9.1 - [Changelog](https://github.com/transact-rs/sqlx/blob/main/CHANGELOG.md) - [Commits](transact-rs/sqlx@v0.9.0...v0.9.1) Updates `bytes` from 1.12.1 to 1.12.2 - [Release notes](https://github.com/tokio-rs/bytes/releases) - [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md) - [Commits](tokio-rs/bytes@v1.12.1...v1.12.2) Updates `trybuild` from 1.0.123 to 1.0.125 - [Release notes](https://github.com/dtolnay/trybuild/releases) - [Commits](dtolnay/trybuild@1.0.123...1.0.125) --- updated-dependencies: - dependency-name: bytes dependency-version: 1.12.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo - dependency-name: clap dependency-version: 4.6.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo - dependency-name: regex dependency-version: 1.13.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo - dependency-name: serde-saphyr dependency-version: 2.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: cargo - dependency-name: sqlx dependency-version: 0.9.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo - dependency-name: trybuild dependency-version: 1.0.125 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo - dependency-name: uuid dependency-version: 1.29.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Descriptive spans, OpenTelemetry trace context and more metrics (0.2.… …5) (#58) * chore: bump version to 0.2.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(observe): descriptive spans for every step, attempt and YAML task Spans now set otel.name, so a trace viewer shows what each span did (`call charge`, `sleep 5s`, `attempt 2`, `for items`) instead of `step` everywhere, and carry the context to drill down: - workflow span: name, version, engine, run, parent instance, outcome and error st 10BC8 atus - step span: covers the whole live step (TaskStarted to its record and TaskCompleted), with seq, ordinal, key, call site, timeout, outcome, cache hit, child instance id and payload sizes - attempt, retry backoff, limit wait and persist spans under a step - one replay span per resume, with an event per replayed step - spans for signals, updates, queries and events sent to an instance, schedule ticks, lease renewal, recovery and replay checks - every Event is logged in the span it happened in - ctx.start and recovered instances get traces of their own - YAML engine: workflow span, a span per task (nested as in the workflow, with its JSON pointer), a span per for-loop iteration - the span and subscriber now follow blocking calls (Redb stores) and script output readers - EngineBuilder::trace_payloads(max_bytes) puts truncated step inputs and outputs on spans (off by default) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(observe): client and server spans, otel trace context, more metrics - executor spans for HTTP calls (method, URL without query, status), scripts, shell commands and containers, in both engines - request spans for HTTP and gRPC listeners (SERVER kind, route, status) - feature `otel`: a request carrying a W3C traceparent continues the caller's trace, and HTTP calls carry the current one on, through the propagator the application installs - every store call is timed (debug span, latency and error metrics), and the YAML engine's events are logged in the span they happen in - metrics: workflow duration, running and resumed instances, continue-as-new, step outcome and timeouts, replayed steps, task attempts, heartbeat timeouts, cache hits, limit waits, active tasks, persistence, leases, messages, emitted events, schedule ticks and lag, replay divergences, listener requests, jq evaluations - fields that change are recorded once, with their final value, since trace backends keep every value an attribute is given - tests/otel_export.rs checks what an OpenTelemetry exporter receives Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(cli): send traces over OTLP and serve Prometheus metrics `jackdaw run --otlp-endpoint URL` (or OTEL_EXPORTER_OTLP_ENDPOINT) sends spans to an OpenTelemetry collector over OTLP/HTTP as service `jackdaw`, with W3C trace context as the propagator; JACKDAW_OTLP_FILTER picks the spans (default info). `--metrics-addr ADDR` serves the engine's metrics at /metrics, with histogram buckets for the *_seconds metrics. Both are behind the CLI's `telemetry` feature, on by default. The persistence metrics' `backend` label now names the store (RedbPersistence, ...) rather than the trait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: observability guide chapter, changelog for 0.2.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: a YAML run's opening event comes before its task events The mirror of a YAML run read task events from the store before taking the run's opening event from its channel, and its poll tick raced the channel, so TaskStarted could be reported before WorkflowStarted. The channel now comes first, and the store is read once the opening event is in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A workflow's input is its configuration: derive(Config), Layers, Prog… …ram (#53) * feat: a workflow's input is its configuration (derive(Config), Layers, Program) #[derive(Config)] gives a workflow's input type command line flags, config::Layers reads it from defaults, files, the environment and flags, and runner::Program is main for a workflow. The README, docs and examples use the pattern. Version 0.2.4. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * docs: don't link to feature-gated items from the crate docs Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Run workflows as programs with jackdaw::runner; move jackdaw run onto… … it (#52) * feat: run workflows as programs with jackdaw::runner, and move jackdaw run onto it Add `jackdaw::runner`: a `Runner` that starts, resumes or restarts a run by id and shows its progress through a `Reporter` (`Headless`, `Lines`, `Json`, and with the `terminal` feature `Terminal`). The `cli` feature adds `RunnerArgs` for clap programs. indicatif and clap are optional; the default build gains no dependency. `jackdaw run` now reports from the run's events: a progress bar on a terminal, plain lines when piped, the result on standard output. New flags: --quiet, --json, --plain, --id, --restart. Failures go to standard error. Library changes the CLI needed for YAML workflows: - a YAML run's events include its tasks as they happen, with steps done before a resume marked as replayed - execute_with on the id of an existing YAML instance continues it or returns its stored outcome, and purge works for finished YAML instances - InstanceDetails::input Bump to 0.2.3. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * fix: stub jackdaw-cli's test targets in the Dockerfile, and don't link to feature-gated items in docs The image build's dependency layer only created the dummy test files for jackdaw; the jackdaw-cli manifest now declares a [[test]] target too. The docs job failed on intra-doc links to Terminal and RunnerArgs, which exist only with their features. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Release 0.2.2: parallel task calls, named task limits, late lease ren… …ewal warning (#43) * feat: parallel task calls, named task limits, late lease renewal warning - Each async task call runs as a tokio task of its own, so the calls a workflow makes at once (try_join!, join_all, for_each(..).concurrency(n)) run in parallel instead of sharing the workflow's thread. Dropping the call's future still stops it. - Named limits: #[task(limit = "name")] on async, blocking and #[tasks] method tasks; EngineBuilder::limit(name, permits) defines one for the whole engine, and EngineBuilder::blocking_limit(n) covers blocking tasks that name none. Calls wait for a permit in order without holding a thread; a blocking call keeps its permit until its thread is done. YAML `call:`s of Rust tasks wait too. build() rejects an undefined limit or one with no permits. The heartbeat timeout starts once a call has its permit. With `metrics`, jackdaw_task_limit_waiting counts the waiters. - The lease loop warns when it wakes more than a quarter of the lease TTL late (the runtime's threads were busy), pointing at blocking code in async tasks. Specs: tasks/task_limits.feature (11 scenarios) and operations/lease_renewal.feature (2), written before the implementation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: release 0.2.2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Release 0.2.1: no printing, YAML leases and listen, OpenAPI validatio… …n, spec fixes (#42) * fix: listener path parameters, #[catalog] without yaml, slim docs; add semver and deny checks - The YAML interpreter's HTTP listener names path parameters after the route and adds the query string, for every method, instead of reporting the last segment of a GET or DELETE as `petId`. Both HTTP listeners now build a request's input with one helper (`listeners::request_input`). - `#[catalog]` wraps its expansion in `__private::catalog!`, which is a compile_error naming the `yaml` feature when jackdaw is built without it. The slim-build spec checks the message. - Links to feature-gated items no longer warn in docs built without those features; CI builds the docs without features too. - CI: `cargo semver-checks` against the latest release (`just semver`) and `cargo deny` for licenses, wildcards and sources (`deny.toml`, `just deny`). The semver scenario is now `@external`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: vendor the Open Workflow SDK's unit tests `just update-dsl` now also copies the SDK's `core/src/lib.rs` unit tests into `jackdaw/src/dsl/unit_tests.rs` (dropping its `mod models;` line and using serde-saphyr in place of serde_yaml), and the library runs them as `dsl_unit_tests`. serde-saphyr's `serialize` feature is enabled for tests only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: the library no longer prints; YAML instances are listed and leased Trace: - The YAML interpreter's trace, script output and listener startup are `tracing` events on the `jackdaw::yaml` target (documented in the events chapter). A YAML script task's output used to go to the host process's stdout and stderr. - `set_yaml_trace` is deprecated and does nothing. The gRPC listener and OpenAPI caller log at DEBUG. - `console` is no longer a library dependency. The CLI renders the trace (`jackdaw-cli/src/trace.rs`) as before, and now also logs warnings to stderr (debug with `--verbose`, `RUST_LOG` overrides). - YAML runs, script output readers and listener servers spawn with the caller's subscriber (`api::observe::spawn`). YAML instances: - `Engine::list`, `status` and `describe` include YAML instances, read from the interpreter's stored events. - With `EngineBuilder::lease`, YAML instances are leased: - an engine takes the lease on start or resume, and renews it with the Rust instances' leases; - it stops the run if another engine takes the lease, and releases the lease on a terminal event; - `recover` skips an instance whose lease another engine holds. - New specs: "YAML instances are listed and described like Rust ones" and "A YAML instance is owned by one engine at a time". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(yaml): listen filters match patterns and correlate; resumed listeners see missed events - `with` strings are regular expressions the whole attribute must match. A runtime expression is evaluated against the workflow's data, and its value is matched the same way. Other values must be equal. - `correlate`: `from` is evaluated against each event and must equal `expect`, or, without `expect`, the value from the first matching event. - The interpreter keeps every published event in the store's `__jackdaw_emitted__` stream. The stream has events and no checkpoint, so it is never listed as an instance. - A listen task that resumes after a restart first offers the events emitted since it first started, then live ones. Duplicates are dropped by `source` and `id`. - YAML `emit` stamps `time` from the engine's clock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: fix the SQL-store stall with concurrent scenarios The spec harness opened SQLite and Postgres stores with `block_in_place` and `Handle::block_on`, on the thread that polls every scenario. That nested `block_on` parks on the thread's own parker, so it took the wakeups meant for the other scenarios, and they were never polled again. A run with 8 SQL-store scenarios at a time stalled within minutes. Stores now open on a thread of their own (`open_blocking`). With scenarios running concurrently, "A crash during compensation finishes the compensation" could also crash before SQLite had stored the result of the parallel `ReleaseStock`, which then rightly ran again. The step now waits for that result to be stored before it crashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(listener): validate requests against the OpenAPI document `Listener::openapi` now compiles, for each operation: - its parameters: path, query and header, with the path item's parameters overridden by the operation's; - its JSON request body schema, with local `$ref`s resolved against `components`; - schemas as JSON Schema draft 4 for 3.0 documents and 2020-12 for 3.1. Each request is checked against them before a workflow starts. A parameter value passes if it matches as text or as the JSON it spells. A mismatch gets a 400 whose `problems` list each one. An invalid schema fails `Listener::openapi`. Uses `jsonschema` without default features (no remote references, no C code) under `http-listener`. `deny.toml` allows MIT-0 (borrow-or-share) and drops the BlueOak allowance, which only dev-dependencies needed. The listener docs say TLS is for a proxy or sidecar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: run the SQLite specs concurrently in CI; harden two store-timing steps With the harness stall fixed, the SQLite spec job runs 8 scenarios at a time. Postgres stays at one: with several at once, the subscription-billing scenarios still lose cycles to the clock race. - "Dropping the engine flushes the store" pins Redb, which it is about. - The YAML listener step waits for the workflow's completion to be stored, not only the task's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: move virtual time only while the store is idle; run the SQL specs concurrently The spec harness moved its clock once task calls had been quiet for a few polls. Under load, a Postgres write between a charge and the next `sleep` could outlast that, and the clock jumped before the workflow had registered its next timer. That is how the subscription-billing scenarios lost cycles when several scenarios ran at once. Each durable store a scenario opens is now wrapped in `support::Tracked`, which counts the operations in flight and started. Time moves only when task calls, store operations and timers started have not changed for a few polls, and no store operation is running. Lease and message polls, which engines with leases make all the time, are not counted. With this and the earlier stall fix, Postgres passes the full specs 8 at a time, so the SQL-store CI job no longer limits the concurrency. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(yaml): fence the interpreter's writes, prune published events, validate its HTTP requests - Lease fence: with `EngineBuilder::lease`, the YAML interpreter writes through `api::fence::LeaseFence`. - Before each write for an instance, it checks the instance's lease, renewing it once less than half is left. - It refuses the write when another engine holds the lease. - The engine's own `__jackdaw*` records pass through. - Retention: published events are kept in one store stream per day (`__jackdaw_emitted__/<date>`). - `Engine::sweep` deletes the days older than the retention period. - It also purges finished YAML instances, which it used to skip. - Clock: the interpreter now takes every stored timestamp from the engine's clock (`ExecutionServices::clock`). Some events used the wall clock, so instances had timestamps from two clocks, and a sweep on a custom clock misjudged their age. - HTTP validation: the interpreter's HTTP listener checks requests against the listen task's OpenAPI document with the engine listener's rules. - `RequestRules::for_route` picks the operation whose path the listen URI's path ends with, or the body schema named by `resource.name`. - An unreadable document is skipped with a warning. - Tests: the YAML trace test gets its own test binary. Sharing a process with tests that run YAML workflows without a subscriber made tracing's per-callsite interest race, and the test sometimes missed events. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: crash steps wait for the blocked call, not any running one "A loop resumes at the iteration it was in" crashed once any `tick` call was running, which on a loaded machine could be an earlier iteration than the blocked one. A crash just after that call returned, before its record was stored, rightly ran it again, and the scenario failed. It now waits for the blocked iteration. The `for_each` row of "Every kind of step resumes without repeating completed work" had the same race, plus another: items run beside the blocked one. It now waits until the blocked item runs, every other item that started has finished, and their results are stored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: build http-listener without yaml (for_route is the YAML listener's) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: release 0.2.1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: add a top-level README Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(yaml): pass the interpreter's records through the payload codec With `EngineBuilder::codec`, the YAML interpreter's store is wrapped in `api::fence::CodecStore`, under the lease fence. It encodes event payloads (inputs, task results, outputs, published events) and checkpoint data, and decodes them on read. Before, only Rust instances' journals and history were encoded, so a YAML workflow's data was stored as plain JSON. Records without the codec envelope still read. `Engine::list`, `describe` and `recover` decode the YAML records they read, as `history` already did. New spec: "A YAML workflow's payloads go through the codec too". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
build: redb 4, sha2 0.11, prost 0.14, prost-reflect 0.16, protox 0.10 (… …#41) Replaces the four Dependabot PRs (#35 prost, #36 redb, #37 protox, #38 sha2), which failed because each moved one crate of a set that has to move together. - prost, prost-types, prost-reflect and protox move as one family (protox 0.10 needs prost 0.14 and prost-reflect 0.16). tonic-reflection 0.14 already used prost 0.14, so the lockfile no longer builds two prosts. - redb 4: `Database::begin_read` comes from the `ReadableDatabase` trait. redb 3 dropped the v2 file format that redb 2 wrote, so a Redb database from 0.1 cannot be opened (changelog). - sha2 0.11: the digest no longer implements `LowerHex`; the cache key is formatted byte by byte to the same string, pinned by a new test, so stored cache entries still match. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
feat: github action workflow for PRs and releases (#11) * feat: github action workflow for PRs and releases * fix: tweak PR checks * Update .github/workflows/pr.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: versions * fix: docker build and test * fix: clippy lints * fix: test * fix: remove audit * fix: release * fix: update ctk --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>