Ashroot

An optional Rust table, secondary-index and relationship layer above the cdk-rsx SDK. Applications may continue to use SDK collections directly. Ashroot adds no dependency or runtime registration to them.

The crate provides private primary tables, automatically maintained ordered, descending, composite, sparse and unique indexes, and foreign keys with restrict or bounded cascading deletion, plus SetNull. Applications read rows and indexes through borrowed capabilities; writes go through the database. Separate transient business services can share a database without receiving its private memory keys.

Each table selects Nyxus, Hylix or hybrid Minima. A database can mix them. Explicit checked migrations rebuild indexes or move populated tables between engines; changing an alias alone does not admit incompatible persisted bytes. See engine selection and changes.

Start with the authoring guide, authoring obligations and runnable leaderboard example. Declaration macros are ordinary Rust conveniences; there is no external schema generator or runtime registry. Hylix and Minima are optional Cargo features, with neither enabled by default.

Schemas use static list! declarations with no fixed table/index arity cap. Writes include upsert, owned update factories, bounded prefix batches and atomic-or-trap composition. Lazy primary/index row iterators support ordinary Rust map/filter/take/fold operations within a borrowed read scope.

Migrations add/remove fields and tables, reorder tables, and change relationships and indexes in one synchronous upgrade. DTS may span rounds; application-level continuation messages and background migration state machines are deliberately excluded. See the single-upgrade policy.

Ashroot is the cdk-rsx-ashroot member of the CDK workspace. Rust applications import it as cdk_rsx_ashroot. It remains optional; using Store or Collections does not pull in Ashroot.

# From the harness root, using an exclusively owned target/cache.
source tools/env.sh
cargo test --manifest-path cdk-rsx/Cargo.toml -p cdk-rsx-ashroot \
  --all-features --offline --locked
cargo run --manifest-path cdk-rsx/Cargo.toml -p cdk-rsx-ashroot \
  --example leaderboard --offline --locked
cargo run --manifest-path cdk-rsx/Cargo.toml -p cdk-rsx-ashroot \
  --example treasury --features hylix --offline --locked

Crate-local native tests and examples stay here. Independent authoring checks belong to the crate-local authoring tools; actual Wasm lifecycle, migration and cost qualification uses the probe and its V3 evolution fixture.

The structural overhead benchmark compares logical operation counts, prepared collection work and independent direct integrity controls across Nyxus, Hylix and Minima. The schema-scale benchmark measures prepared Wasm growth across tables, indexes and relationships.

Dated design and qualification records retain their original source identities and measured limits. Source relocation requires fresh metadata/import/build checks and does not establish equal binary identity, persistence compatibility or measured performance.

Package guides

Authoring, Conventions, Engines and migration.

License

This crate is available under the ICP3V License.