Skip to content

About

A local-first, collaborative behavior tree runtime built using Conflict-free Replicated Data Types (CRDTs).

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Behavior Tree

This Rust scaffold project has been automatically generated by Arachne, a code generator from Ecore metamodels to a composition of replicated data types.

It is the metamodel of a Behavior Tree.

Behavior Tree Ecore metamodel

Generated Artifacts

Arachne generated the classifiers.rs, references.rs, package.rs, and lib.rs files.

  • classifiers.rs: contains the replicated object hierarchy, i.e., the CRDTs reproducing the (concrete and abstract) classes, interfaces, enums, and owned features (attributes and containment references).
  • references.rs: contains the Typed Graph CRDT implementation. Manages the non-containment references between replicated objects.
  • package.rs: the root replicated object that contains both the object hierarchy and the typed graph. This is the object with which end-users interact.

Organization

.
├── bench-results/json # Fuzzer execution results
├── src/
│   ├── utils/ # Fuzzer implementation, helper functions...
│   ├── classifiers.rs # Automatically generated
│   ├── lib.rs # Automatically generated
│   ├── package.rs # Automatically generated
│   └── references.rs # Automatically generated
├── tests/
│   ├── fuzzer.rs # Fuzzer test
│   └── scenarios.rs # Test scenarios illustrating how conflicts are solved
├── behavior_tree.ecore # Ecore metamodel
└── behavior_tree.png # Ecore metamodel diagram

Running the project

Rust must be installed on your machine: https://rust-lang.org/tools/install. The commands assume a POSIX shell.

Running all the tests:

RUST_LOG=debug cargo test

Running the fuzzer:

RUST_LOG=debug cargo test --release -- --ignored --no-capture fuzz

Regeneration

Regenerating the model replaces the generated scaffold, including Cargo.toml and src/lib.rs. This case study also uses handwritten support code: retain pub mod utils; in the library entry point and the vf2 = "1.0.1" dependency for its graph view and convergence predicates. Fuzz support is handwritten: add moirai-fuzz, rand, any footprint dependencies such as deepsize, and the corresponding fuzz/test_utils feature wiring manually. Arachne does not generate these dependencies or fuzz implementations for the projection adapter.

The generated project's Cargo.lock is separate from Arachne's lockfile. If a Git release tag was corrected after the project resolved it, refresh the runtime with cargo update -p moirai-protocol in this project. The --locked option on cargo run -p arachne-cli only controls Arachne's own dependencies.

About

A local-first, collaborative behavior tree runtime built using Conflict-free Replicated Data Types (CRDTs).

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages