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. The overlay modality set is fixed at six (graph, vector, tensor, semantic, document, spatial) per ADR-0014; a seventh is an ontology change, not a config edit. 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 the
README.adocTier 2 section (overlay modality set, storage, status) and the vocabulary table in the README (anchoroctad-vocabulary). The README no longer has an "Octad: Eight Modalities" table. Note that a new overlay changes the set’s membership and so needs an ADR, not just a README edit (ADR-0014 §14.3).
Documentation is treated as an interface: if a guide tells someone to run a
command, that command has to work. The RSR templates this repo started from
referenced recipes from other projects, so several guides shipped instructions
that failed with Justfile does not contain recipe.
-
Only reference recipes that the Justfile (or an imported
*.just) defines.just --listis authoritative. -
just doc-recipesrunsscripts/check-doc-recipes.sh, which fails if any.adoccode block mentions an undefined recipe. Run it after editing docs. -
Do not add a recipe just to satisfy a doc. ADR-0002 removed aspirational recipes that wrapped things which did not exist; the fix direction is to correct the docs, not to invent the recipe.
Known non-recipes, with the real alternative:
| Mentioned in old docs | Actually |
|---|---|
|
|
|
No error-code catalogue exists in this repo |
|
|
|
|
|
read |
|
|
|
|
|
Not present |
Template artifacts that are sync-managed from hyperpolymath/standards
(docs/RSR_OUTLINE.adoc, container/, .machine_readable/*) still describe
the template’s own recipes; just doc-recipes reports and skips the one it
scans rather than rewriting synced content.
-
Vocabulary (ADR-0014): unqualified
Octadmeans VeriSimiser’s fixed eight-concern model; writeVeriSimDB’s Octadfor the upstream eight-modality API/model. Tier 2 uses overlay modality set for the fixed six and enabled overlays for a manifest’s selection — not "modality profile". Do not rename schema, CLI, or manifest fields to match a doc change; that needs its own compatibility decision. -
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.