This guide is for contributors making code changes to verisimiser. For
repository-wide RSR conventions (commit signing, file layout, contractiles)
see .github/CONTRIBUTING.md.
Three common contribution shapes get a checklist each:
-
Adding a new database backend
-
Adding a new drift category
-
Adding a new Tier 2 overlay
git clone git@github.com:hyperpolymath/verisimiser.git
cd verisimiser
cargo build
cargo test --lib --bins
cargo clippy --all-targets -- -D warningsThe full cargo test runs integration tests under tests/. On Windows those
hit a TOML path-escape issue and fail spuriously; CI is the source of truth.
The Justfile lists shorthand recipes for the common loops (just test,
just quality, etc.). New Justfile recipes are only added once their
underlying command works — see docs/decisions/0002-no-aspirational-justfile-recipes.adoc.
Adding a backend (say, MySQL) means making the entire codegen + interception pipeline aware of it. Checklist:
-
Add a variant to
enum DatabaseBackendinsrc/abi/mod.rs. -
Update
DatabaseBackend::from_strto recognise the new name plus common aliases. -
Update
DatabaseBackend::as_str(and anyDisplayimpl) for the new variant. -
Decide the interception strategy (binlog CDC, change streams, WAL monitoring, application middleware …) and document it on the enum variant doc comment.
-
Add the dialect to
src/codegen/query.rs::build_entity_id_exprso the no-PK fallback row identifier is correct (e.g. SQLite usesrowid, Postgres usesctid). -
Add a dialect branch to any other backend-aware site in
src/codegen/— search forDatabaseBackend::usages. -
If the backend needs a separate sidecar dialect, extend
src/codegen/overlay.rsto emit the rightCREATE TABLEsyntax. -
Add a unit test in
src/codegen/query.rs::testscovering the new variant for at least one interceptor type. -
Update
Cargo.tomlonly if the backend needs a new connector crate (e.g.mysql_async). Prefer interception via the database’s replication interface; pull in connector crates only as a fallback. -
If the backend belongs in the published interception list, add it to
README.adocunder Interception methods. Otherwise leave it inROADMAP.adoc.
The drift system is V-L1-E (see #48 for the eight-category ADR). Each category is an isolated detector with input type, distance function, and threshold.
-
Open an ADR in
docs/decisions/documenting the category’s input type, distance function, and default threshold. -
Add a variant to
DriftCategoryinsrc/tier1/drift.rs. -
Implement a
measure(prior, current) → f64function returning a distance in[0.0, 1.0]. -
Wire the measurement into the
DriftReportaggregator. -
Add unit tests for: identical inputs → 0.0; maximally different inputs → 1.0; threshold-edge cases.
-
Update
docs/architecture/THREAT-MODEL.adocif the category has adversarial implications.
Tier 2 overlays require additional storage alongside the target database (graph, vector, tensor, semantic, …). New overlays are not the same as new backends.
-
Add a boolean field to
Tier2Configinsrc/manifest/mod.rs(and itsDefaultimpl) for the manifest toggle. -
Decide the sidecar storage technology (pure Rust, HNSW, ndarray, …) and document it on the
Tier2Configfield doc comment. -
Add overlay DDL emission in
src/codegen/overlay.rsbehind the new flag. -
Add an interceptor in
src/codegen/query.rsthat routes the right queries to the overlay. -
Add a round-trip test in
src/codegen/overlay.rs::testscovering the flag both on and off. -
Update `README.adoc’s Octad: Eight Modalities table to reflect the new overlay’s tier and storage.
-
Treat
cargo clippy --all-targets — -D warningsas part ofcargo build. The crate has no blanket#![allow(…)]blocks (docs/decisions/0001and 0002 keep the surface clean). -
Public items used as the library API should be
pub; binary-only helpers stay private. -
All commits are SSH-signed (see
.github/CONTRIBUTING.md). -
PRs target
main. Auto-merge with--squashis the norm.