You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Runtime clock injection through `RuntimeConfig::with_clock(...)`, `AppRunnerBuilder::clock(...)`, and `NodeContext::now_unix_ms()`.
17
+
- Optional node event metadata for `invocation_id` and `now_unix_ms` when runtime metadata is configured.
18
+
-`INVOCATION_END_SCOPE` and `AppRunner::finish_iterative_session(...)` for long-lived iterative event streams.
19
+
- Graph and run metadata helpers: `App::graph_metadata()`, `App::graph_definition_hash()`, `RuntimeConfig::config_hash()`, and `AppRunner::run_metadata()`.
20
+
-`Reducer::definition_label(...)` so graph metadata can distinguish reducer implementations, not only reducer counts.
21
+
- Replay conformance helpers in `weavegraph::runtimes::replay` for normalized event comparison, final-state comparison, and reusable replay assertions.
22
+
23
+
### Notes
24
+
- This feedback package ships as `0.5.0` rather than `0.4.1` because it changes the public runtime surface, adds public error enum variants/types, and extends public structs.
25
+
- New public metadata/context structs are marked `#[non_exhaustive]` where they are expected to grow before v1.
Copy file name to clipboardExpand all lines: README.md
+49-37Lines changed: 49 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,10 +21,13 @@ Weavegraph lets you build robust, concurrent, stateful workflows using a graph-b
21
21
- Concurrent graph execution with dependency resolution
22
22
- Type-safe, role-based message system
23
23
- Versioned state with snapshot isolation
24
+
- Typed state slots for schema-versioned JSON payloads
24
25
- Structured error handling and diagnostics
25
26
- Built-in event streaming and observability
26
-
- Flexible persistence: SQLite or in-memory
27
+
- Flexible persistence: SQLite, PostgreSQL, or in-memory
27
28
- Conditional routing and dynamic edges
29
+
- Iterative checkpointed sessions for repeated invocations
30
+
- Replay conformance helpers and deterministic graph/run metadata
28
31
- Ergonomic APIs and comprehensive examples
29
32
30
33
## Install
@@ -33,10 +36,10 @@ Add to your `Cargo.toml`:
33
36
34
37
```toml
35
38
[dependencies]
36
-
weavegraph = "0.3"
39
+
weavegraph = "0.5"
37
40
```
38
41
39
-
> **Note:** Examples and instructions in this README are current as of 0.3.x. For upgrading from 0.2.x, see [MIGRATION.md](docs/MIGRATION.md).
42
+
> **Note:** Examples and instructions in this README are current as of 0.5.x. For upgrade notes across pre-1.0 releases, see [MIGRATION.md](docs/MIGRATION.md).
40
43
41
44
## Dependency Compatibility
42
45
@@ -64,40 +67,40 @@ See [Cargo.toml](Cargo.toml) for complete dependency versions and feature config
Property-based testing with `proptest`ensures correctness across edge cases.
144
+
Property-based testing with `proptest`and fuzz harnesses under [fuzz/](fuzz/) exercise edge cases across graph routing, event serialization, replay comparison, and typed state slots.
133
145
134
146
## CI Parity
135
147
@@ -151,7 +163,7 @@ Before merging or cutting a release, run full local parity checks:
151
163
152
164
## Resources
153
165
154
-
-**[Migration Guide](docs/MIGRATION.md)** - Upgrade paths between releases (0.2.x → 0.3.x and beyond)
166
+
-**[Migration Guide](docs/MIGRATION.md)** - Upgrade paths between pre-1.0 releases
155
167
-**[Architecture Guide](docs/ARCHITECTURE.md)** - Deep dive into core design and internals
156
168
-**[Examples Directory](examples/)** - Runnable patterns: graph execution, scheduling, streaming, persistence, and more
Copy file name to clipboardExpand all lines: docs/MIGRATION.md
+110Lines changed: 110 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,116 @@ migration guidance for upgrading your code.
5
5
6
6
---
7
7
8
+
## v0.5.0
9
+
10
+
### Overview
11
+
12
+
v0.5.0 is the recommended target for the WeaveQuant production feedback work. The changes add new public runtime APIs and a public `RunnerError` variant, so they should not ship as a `0.4.1` patch.
13
+
14
+
### New Runtime APIs
15
+
16
+
Use `AppRunner::create_iterative_session(...)` and `AppRunner::invoke_next(...)` when one durable session should process many logical inputs:
`NodeKind::Start` resolves to the graph's normal Start outgoing frontier. A registered custom node can be supplied for narrower re-entry. `NodeKind::End` now returns `RunnerError::InvalidIterativeEntry` when used as an iterative entry.
29
+
30
+
When an `AppRunner` event stream is subscribed before iterative execution, each `invoke_next(...)` emits `INVOCATION_END_SCOPE` and keeps the stream open for the next logical input. Call `finish_iterative_session(...)` after the final input to emit the normal `STREAM_END_SCOPE` sentinel and close the stream.
31
+
32
+
### Typed State Slots
33
+
34
+
Typed state slots are a thin, JSON-compatible layer over `VersionedState.extra`. Define a reusable key in the domain crate, then read and write typed payloads without hand-rolled `serde_json` calls at every node boundary:
Inside a node, call `ctx.now_unix_ms()` and `ctx.invocation_id()`. `NodeContext::new(...)` is now the easiest way to construct contexts in tests.
77
+
78
+
### Metadata Helpers
79
+
80
+
Compiled graphs and runners expose deterministic metadata helpers for audit labels and replay manifests:
81
+
82
+
```rust
83
+
letgraph=app.graph_metadata();
84
+
letgraph_hash=app.graph_definition_hash();
85
+
letrun=runner.run_metadata();
86
+
```
87
+
88
+
The graph hash includes node kinds, edges, conditional edge registrations, and reducer definition labels. It does not inspect closure bodies for conditional predicates. Custom reducers can override `Reducer::definition_label(...)` when a durable audit label is preferable to the default Rust type path.
89
+
90
+
### Replay Conformance Helpers
91
+
92
+
Replay helpers live under `weavegraph::runtimes::replay` and are re-exported from `weavegraph::runtimes`:
`normalize_event(...)` strips runtime timestamps. Use `compare_event_sequences_with(...)` or `compare_replay_runs_with(...)` when domain events need semantic normalization.
104
+
105
+
### Compatibility Notes
106
+
107
+
-`App::invoke(...)`, `AppRunner::create_session(...)`, and `AppRunner::run_until_complete(...)` keep their existing behavior.
108
+
-`RunnerError` is an exhaustive public enum. Code that matches every variant must handle `InvalidIterativeEntry` after upgrading.
109
+
-`GraphMetadata`, `RunMetadata`, `ReplayRun`, `NodeContext`, and `SchedulerRunContext` are `#[non_exhaustive]`; use provided constructors/builders instead of external struct literals.
110
+
-`Reducer` gains a default `definition_label(...)` method for graph metadata. Existing reducer implementations do not need to change unless they want a custom stable label.
111
+
-`RuntimeConfig` gains a public `clock` field. Code using struct literals should add `clock: None` or switch to `RuntimeConfig::default()` / builder-style methods.
112
+
-`NodeContext` gains `clock` and `invocation_id` fields. Tests should prefer `NodeContext::new(...)` over struct literals.
113
+
- Direct calls to `Scheduler::superstep(...)` must pass the optional clock and invocation ID arguments.
114
+
- Iterative sessions keep step numbers monotonic across invocations and reload checkpoints through the existing checkpointer path.
0 commit comments