Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

criv.toml configuration reference

criv.toml sits at the repository root. Every key has a default, so the file can be empty, and criv init writes a working one.

The CLI is the reference for commands and flags, as ADR-0134 decided. Configuration keys have no --help surface, so they are described here.

[vault]

KeyTypeDefaultMeaning
docsstringdocsThe directory that holds vault notes.
adrstringadrThe decision directory, relative to docs.

Both paths stay inside the repository. An absolute path or a .. component is refused.

[vault]
docs = "documentation"
adr = "decisions"

[source]

KeyTypeDefaultMeaning
rootsarray of strings["src", "lib"]Directories criv indexes for the source graph.
excludearray of glob strings["**/target/**", "**/node_modules/**"]Paths the source walk skips.

An exclude glob that matches a directory prunes the whole subtree, so a large build directory costs nothing to skip.

[source]
roots = ["src", "crates"]
exclude = ["**/target/**", "**/node_modules/**", "**/generated/**"]

[index]

KeyTypeDefaultMeaning
sourcebooleantrueWhether to build the source graph at all.

Set source = false for a documentation-only vault. Every criv query that needs source data then returns nothing.

[state]

KeyTypeDefaultMeaning
keepinteger20How many state snapshots to retain under .criv/snapshots/.

keep must be one or more. See the state reference for what a snapshot holds.

[enforce]

KeyTypeDefaultMeaning
stagesarray of strings["commit", "push", "ci"]Which stages criv enforce will run.

criv enforce --stage <name> fails when the stage is not listed. Remove a stage to disable its gate without uninstalling the hook.

[enforce]
stages = ["commit", "ci"]

enforce.import_policies

An import policy fails the enforcement gate when a file in scope imports something in deny. Each entry needs all three keys.

KeyTypeMeaning
idstringThe identifier reported with the violation.
scopearray of glob stringsFiles the policy applies to.
denyarray of stringsImport targets the scope must not use. A plain string matches the module or any child of it, so tokio also denies tokio::net. A glob matches the module path with :: written as /.
enforce.import_policies
id = "domain-stays-pure"
scope = ["src/domain/**"]
deny = ["reqwest", "tokio/net/*"]

A match reports the import-policy-violation code, and the repair is either to remove the import or to widen the policy. criv enforce --stage ci --format json carries the code and the repair as fields.

Removed keys

[patterns.*] is refused. Persistent named patterns belong in an ADR policy.patterns entry, addressed as ADR-NNNN/local-id. criv reports the replacement when it finds the old table.