macrame-db 0.6.0

A Bitemporal Graph Ledger on libSQL · Embedded knowledge database
Documentation
[package]
# `macrame` is taken on crates.io — an unrelated wasm-bindgen macro crate at
# 0.0.1 — so the *package* is published as `macrame-db`. The `[lib]` name below
# keeps the import path `use macrame::…` unchanged, so this is a registry name
# and not a rename of the crate anyone writes against.
name = "macrame-db"
version = "0.6.0"
edition = "2021"
# Measured, not declared: `cargo +1.88.0 check --all-features --all-targets`
# passes and 1.85 does not.
#
# **This floor is not ours.** Macrame's own code needs 1.73 (`div_ceil`; 1.70
# for `Option::is_some_and`). The binding constraint is `home@0.5.12` at 1.88,
# reached through `libsql-ffi`'s *build*-dependency on bindgen -> which -> home
# — and a build-dependency binds consumers too, because libsql-ffi compiles the
# amalgamation on every downstream build. Lowering it means pinning that chain
# (`cargo update home --precise …`), not changing anything here.
rust-version = "1.88"
authors = ["opticsWolf"]
description = "A Bitemporal Graph Ledger on libSQL · Embedded knowledge database"
# crates.io only *warns* locally when these are missing — `cargo publish
# --dry-run` passes without them — but the registry API rejects an upload with
# no license, so the first real publish would fail after a full verify build.
license = "MIT OR Apache-2.0"
repository = "https://github.com/opticsWolf/Macrame"
readme = "README.md"
keywords = ["bitemporal", "graph", "libsql", "ledger", "database"]
categories = ["database", "database-implementations", "data-structures"]

# The import path stays `macrame`, independent of the registry name above.
# Without this a dependent would have to write `use macrame_db::…`, and every
# rustdoc link, doc-test and example in the crate says `macrame`.
[lib]
name = "macrame"
path = "src/lib.rs"

[dependencies]
libsql = "0.9.30"

tokio = { version = "1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
bincode = "1.3"
zstd = "0.13"
thiserror = "1.0"
tracing = "0.1"
ulid = "1.1"

[dev-dependencies]
tempfile = "3.8"
tokio-test = "0.4"
proptest = "1"
# §9's harness (D-055). `default-features = false` drops the plotting and HTML
# report stack, which is most of criterion's dependency tree and none of the
# measurement — the numbers come out on stdout and into `target/criterion` either
# way.
criterion = { version = "0.5", default-features = false, features = [
    "async_tokio",
    "cargo_bench_support",
] }

[features]
default = []

# The generated-history test binaries. Off by default, as the second half of
# the R15 mitigation — the first half is `RUST_TEST_THREADS = "1"` in
# .cargo/config.toml, which alone takes the rest of the suite to 0 bad runs in
# 30. These do not follow it there: a property case needs its own database, and
# `doctrine_property_tests` still faults ~3/25 serialised. A suite that fails
# for reasons unrelated to the code under test trains people to ignore red, so
# the residue is quarantined rather than tolerated.
#
# Quarantined, not silenced. These are the tests that found D-035, they run as
# their own step, and `.proptest-regressions` replays every failure ever found
# before a single new case is generated.
#
#     cargo test --features property-tests
property-tests = []

# Write-actor latency counters (T1.4, D-079). Off by default.
#
# Off is the right default because the crate's contract is a latency bound and
# the instrumentation is not free of *risk* even where it is free of cost — but
# it is close to free of cost: with the feature off `HoldTimer` reads no clock
# and `ActorMetrics` is a ZST whose methods are empty, so the actor loop compiles
# to what it compiled to before. See `src/metrics.rs` for why that is arranged as
# two impls of one type rather than `#[cfg]` inside the loop.
#
#     cargo test --features metrics
metrics = []

[[test]]
name = "actor_metrics_tests"
required-features = ["metrics"]

# T1.1's evidence. Needs `metrics` because the question is what the *actor* held
# for, and wall time on the caller's side includes queueing.
[[example]]
name = "archive_window_diag"
required-features = ["metrics"]

# T1.3's evidence, for the same reason.
[[example]]
name = "bulk_atomic_diag"
required-features = ["metrics"]

# T3.4's evidence: the hold must not move while the total does.
[[example]]
name = "pipeline_diag"
required-features = ["metrics"]

# T1.2's evidence. The question is the longest single *turn*, which only the
# actor's own counters can answer.
[[example]]
name = "shadow_rebuild_diag"
required-features = ["metrics"]

[[test]]
name = "integrity_property_tests"
required-features = ["property-tests"]

[[test]]
name = "doctrine_property_tests"
required-features = ["property-tests"]

[[test]]
name = "graph_property_tests"
required-features = ["property-tests"]

# §9's budgets, measured (D-055). Not a CI gate — see the note at the top of the
# file for why absolute durations on arbitrary hardware are the wrong shape, and
# what criterion baselines do instead.
[[bench]]
name = "budgets"
harness = false