Rust implementation of GraphReFly's clean-slate reactive graph engine and reusable application-infrastructure surface.
GraphReFly is a reactive universal reduction layer: high fan-in/fan-out,
information reduction, then push. The language-neutral authority for protocol,
decisions, conformance, formal models, and phase sequencing lives in
~/src/graphrefly; this repository implements the Rust package.
The active crate is crates/graphrefly (lib name graphrefly, package
graphrefly-rs). The old port-model crates under crates/graphrefly-core,
crates/graphrefly-graph, crates/graphrefly-operators,
crates/graphrefly-storage, crates/graphrefly-structures, and old JS/WASM
bindings are frozen reference material and are excluded from the workspace.
The clean-slate crate includes:
- Sync wave-protocol substrate: protocol, node, dispatcher, ctx, batch, rewire.
- Graph-layer Rust API:
graph, state/producer/derived/effect/mount helpers, describe/observe/profile, operators, sources, and passive storage helpers. - Composition and diagnostics helpers such as
pipe,stratify, andtopology_diff, all derived from declared graph topology ordescribe()snapshots. - Reactive data structures and views:
reactive_list,reactive_log,reactive_index,reactive_map, pull-driven snapshots, and graph-visibleReactiveViewhelper nodes. - CSP-10 baseline app-infra: messaging, work queue, scheduled readiness, CQRS/process recipes, graph-visible environment adapters, and resilience policy/status bundles.
- Native host binding foundation for Python under
crates/graphrefly-bindings-py.
This repo owns Rust package-local documentation: rustdoc on exported crate
items, examples, crate README material, development docs, crate release notes,
docs.rs output, and Rust package-local docs checks. The package-local policy is
recorded in docs/docs.jsonl, with D32 and D563 as the
governing decisions.
Shared public docs for graphrefly.dev, shared guide records, public blog
storage/rendering, protocol authority, and maintainer dashboard/control views
belong to ~/src/graphrefly. Those shared docs may link to Rust package docs,
but this repo must not hand-maintain mirrors of shared docs, TypeScript docs,
Python docs, public blog posts, or generated dashboard state.
The baseline app-infra surface is intentionally reusable and graph-visible. It does not add protocol tiers/messages, hidden schedulers, provider runtimes, or product-specific WorkItem/Canvas/agent semantics.
Useful entry points:
graphrefly::pipe,graphrefly::stratify, andgraphrefly::topology_difffor Rust-native composition and snapshot diagnostics.graphrefly::reactive_list,graphrefly::reactive_log,graphrefly::reactive_index, andgraphrefly::reactive_mapfor collection deltas, lazy snapshots, and retained views.graphrefly::first_sync_value_from,graphrefly::single_sync_value_from,graphrefly::from_http,graphrefly::from_sse, and the graph-ownedLocalHttpStreamDriverboundary for source/IO ergonomics without a hidden runtime.graphrefly::message_bus,graphrefly::to_topic, topic/catalog/cursor facts.graphrefly::TopicMessage,graphrefly::JsonSchema,graphrefly::STANDARD_TOPICS, and explicitgraphrefly::validate_topic_message_payloadhelpers for passive topic vocabulary. The bus does not auto-validate schemas or own topic auth, expiration, compatibility, registry, storage, or provider behavior.graphrefly::work_queueplusgraphrefly::work_queue_scheduled_readiness_projector,graphrefly::work_queue_readiness_handoff_projector, andgraphrefly::work_queue_lease_expiration_command_projector.graphrefly::scheduled_readiness_projectorwith canonicalsubject_refs+ready_at_msschedule facts.- Focused recipe modules:
graphrefly::cqrs::messaging,graphrefly::cqrs::work_queue,graphrefly::process::messaging, andgraphrefly::process::work_queue. graphrefly::EnvironmentDrivers,graphrefly::to_http,graphrefly::to_process,graphrefly::to_websocket, andgraphrefly::websocket_sessionfor graph-local environment boundaries.graphrefly::BackoffPolicy,graphrefly::RetryPolicy,graphrefly::retry_status_node,graphrefly::breaker_status_node,graphrefly::rate_limit_bundle, andgraphrefly::timeout_bundle.
Run the app-infra example:
mise exec -- cargo run -p graphrefly-rs --example csp10_baseline_app_infraThe example wires messaging -> work queue -> scheduled readiness -> CQRS queue disposition, and includes focused process work-queue recipe composition without making queue completion domain truth.
Semantic and agentic-memory utilities are also available as passive/domain facts and graph-visible bundles: lower memory fragments, retrieval, KG reducers, agentic records, retention, consolidation, context packing, and the D172 persistence sidecar. Real LLM/vector/provider runtimes, ontology policy, alias/provenance repair, multi-writer conflict repair, provider-specific context adapters, and vertical solution runtimes remain explicit follow-ups, not hidden crate behavior.
Toolchains are managed with mise:
mise trust
mise installRust is also pinned by rust-toolchain.toml for direct rustup users.
Preferred agent/developer commands:
mise exec -- cargo test -p graphrefly-rs
mise exec -- cargo clippy -p graphrefly-rs --all-targets
mise exec -- cargo build -p graphrefly-rsFocused CSP-10 checks:
mise exec -- cargo test -p graphrefly-rs --test acceptance public_crate_root_d566
mise exec -- cargo test -p graphrefly-rs --test csp10_recipes
mise exec -- cargo run -p graphrefly-rs --example csp10_baseline_app_infraOptional runtime-driver features:
mise exec -- cargo test -p graphrefly-rs --features tokio-http,tokio-websocket
mise exec -- cargo test -p graphrefly-rs --features tokio-workerRust API docs are package-local rustdoc. The public docs gate is:
RUSTDOCFLAGS="-D warnings" mise exec -- cargo doc -p graphrefly-rs --all-features --no-depsIf the public surface grows and rustdoc reports missing docs, use the mechanical comment generator instead of hand-editing large comment batches:
scripts/generate-rustdoc-comments.py --apply
mise exec -- cargo fmt --allThe generator is idempotent and uses rustdoc's own missing_docs diagnostics as
the source of truth; when the crate is already covered it exits without editing.
Docs.rs builds use the crate metadata in crates/graphrefly/Cargo.toml; GitHub Pages
builds the same rustdoc via .github/workflows/pages.yml. Package release notes and
crate-specific development notes stay in this repo, while shared docs/blog content
stays in ~/src/graphrefly.
When code and docs disagree with ~/src/graphrefly, the authority repo wins.
Important clean-slate guardrails:
- The wave-protocol core is synchronous; async lives only at source, pool, driver, or wire-bridge boundaries.
- All node functions go through the dispatcher.
- A graph is a single-thread causal/concurrency domain.
- Cross-runtime parity is behavioral conformance, not structural symbol parity.
- Environment/resilience adapters expose graph-visible attempts, status, errors, lifecycle, and bounded retry material.
- Scheduled readiness projects eligibility only; domain projectors own claiming, materialization, cancellation, and execution.
Dual-licensed under MIT OR Apache-2.0, at your option.