Do these constraints hold for this data? If not, here are the rows that broke them.
Deterministic constraint evaluation for the epistemic spine and factory runtime.
verify evaluates declared constraints against one or more named relations and
emits a deterministic report of passes, failures, and refusals.
It answers one narrow question:
Do these declared constraints hold for these bound inputs?
Build from source:
cargo build --release -p verify-cli
./target/release/verify --helpArity-1 shortcut (compile and evaluate in one step):
./target/release/verify fixtures/inputs/arity1/loans.csv \
--rules fixtures/authoring/arity1/not_null_loans.yaml \
--jsonGeneral batch path:
./target/release/verify run fixtures/constraints/query_rules/orphan_rows.verify.json \
--bind property=fixtures/inputs/arity_n/property_no_orphans.csv \
--bind tenants=fixtures/inputs/arity_n/tenants.csv \
--jsonBinding-qualified batch predicate over positionally aligned composite keys:
./target/release/verify run \
fixtures/constraints/binding_qualified/maturity_date_immutable.verify.json \
--bind current=fixtures/inputs/binding_qualified/current.csv \
--bind prior=fixtures/inputs/binding_qualified/prior_matching.csv \
--jsonPreview the first few localized failures directly in human output:
./target/release/verify run fixtures/constraints/query_rules/orphan_rows.verify.json \
--bind property=fixtures/inputs/arity_n/property.csv \
--bind tenants=fixtures/inputs/arity_n/tenants.csv \
--sample-affected 3Compile authoring to a constraint artifact:
./target/release/verify compile fixtures/authoring/arity1/not_null_loans.yaml \
--out /tmp/not_null_loans.verify.jsonValidate a compiled artifact:
./target/release/verify validate fixtures/constraints/arity1/not_null_loans.verify.jsonInspect the embedded schemas and local witness log:
./target/release/verify --schema > /tmp/verify.report.v1.schema.json
./target/release/verify compile --schema > /tmp/verify.constraint.v1.schema.json
./target/release/verify witness last --jsonInspect the read-only doctor surface for agents and automation:
./target/release/verify doctor triage --json
./target/release/verify capabilities --json
./target/release/verify robot-docs guide
./target/release/verify --describe
./target/release/verify doctor health
./target/release/verify doctor capabilities --json
./target/release/verify doctor robot-docsverify doctor triage --json is the fastest read-only machine entrypoint for
automation. verify capabilities --json prints the operator.v1 contract:
the same document as verify --describe (exit codes, witness behavior, formats,
side effects, pipeline, CRV1 canonical relation boundary). verify robot-docs guide prints the agent-facing quick guide. Every doctor report is
cmdrvl.doctor.v1; the doctor exits 0 when healthy, 1 when unhealthy, and
2 only for usage errors.
Deprecated aliases, still working: verify --robot-triage and
verify doctor --robot-triage (both mean doctor triage --json). The old
per-tool schema ids (verify.doctor.{health,capabilities,triage}.v1,
verify.capabilities.v1) are replaced by cmdrvl.doctor.v1 and operator.v1;
key on schema_version.
The spine and factory both need the same constraint primitive:
- one canonical compiled constraint artifact
- one canonical report artifact
- deterministic evaluation semantics
- reusable execution across batch and embedded contexts
You provide:
- one compiled
verify.constraint.v1artifact - one or more named bindings
- optional lockfiles for trusted-input verification
verify returns:
- one deterministic
verify.report.v1report - localized failures by binding, and when available by key and field
- explicit
PASS,FAIL, orREFUSALoutcomes - one protocol usable in both CLI and embedded runtime contexts
- One primitive, not two products. Single-input validation and cross-input validation are the same protocol with different arity.
- One compiled contract. JSON/YAML authoring and SQL authoring both compile
into
verify.constraint.v1. - Portable and batch-only rules are explicit. Portable rules mean the same thing in batch and embedded execution. Batch-only query rules and binding-qualified predicates never silently downgrade.
- Failure localization is first-class. Reports identify failing rules, implicated bindings, and when possible keys, rows, and fields.
- Deterministic reports. Same compiled constraints plus same bound inputs yield the same ordered report bytes.
- Clean spine boundaries.
verifychecks declared constraints. It does not score correctness, choose winners, or make proceed/block decisions.
verify sits in the constraint layer of the spine:
normalize / materialize -> verify -> assess -> pack
It also has a factory role:
twinning / decoding -> embedded verify -> assess / routing
Related tools:
| If you need... | Use |
|---|---|
| Structural comparability before comparison | shape |
| Numeric and content deltas between aligned datasets | rvl |
| Gold-set accuracy scoring | benchmark |
| Proceed / escalate / block decisions | assess |
| Evidence sealing | pack |
verify only answers:
Which declared constraints passed, which failed, and where did they fail?
verify emits exactly one domain outcome:
| Exit | Outcome | Meaning |
|---|---|---|
0 |
PASS |
all rules passed |
1 |
FAIL |
one or more rules failed |
2 |
REFUSAL |
the tool could not evaluate safely |
Outcome discipline:
PASSmeans every rule result passed andfailed_rules = 0FAILmeans at least one rule result failedREFUSALmeans no partial "best effort" report masquerades as evaluation
Other exit codes, per the family contract (spine-rules/docs/exit-codes.md):
verify doctorexits1when it finds an unhealthy diagnostic (this was2before 0.5.2;2now means a usage error only). Under the contract1is therefore "FAIL (doctor: unhealthy)".- Read commands never exit
1for an empty result.verify witness queryprints[],witness countprints{"count":0}andwitness lastprintsnull, all with exit0(this was exit1before 0.5.2). Narrow a query with--outcome PASS|FAIL|REFUSAL,--command run|compile|...and--limit N.
set -e scripts: a constraint FAIL is exit 1 by design and aborts the
script. Guard it when you want to read the report afterwards:
verify run constraints.verify.json --bind input=data.csv --json > report.json || [ $? -eq 1 ]A witness query on an empty ledger no longer needs that guard. A mistyped
subcommand (verify docter) is refused with exit 2 and a "did you mean
doctor" hint instead of being parsed as a dataset path.
verify run <COMPILED_CONSTRAINTS> --bind <NAME=PATH> [--lock <LOCKFILE>] [--json] [--sample-affected <N>] [--explicit] [--no-witness]
verify <DATASET> --rules <AUTHORING> [--key <FIELD>] [--json] [--sample-affected <N>] [--explicit] [--no-witness]
verify ground <CLAIMS_JSONL> --bind <NAME=DOCUMENT> --lock <LOCKFILE> [--json] [--explicit] [--no-witness]
verify compile <AUTHORING> [--out <OUTPUT>] [--check] [--json]
verify compile --schema
verify validate <COMPILED_CONSTRAINTS> [--json]
verify witness <query|last|count> [--outcome <OUTCOME>] [--command <COMMAND>] [--limit <N>] [--json]
verify doctor triage --json
verify capabilities --json
verify robot-docs guide
verify doctor health [--json]
verify doctor capabilities --json
verify doctor robot-docs
verify --robot-triage # deprecated alias of `doctor triage --json`
verify doctor --robot-triage # deprecated alias of `doctor triage --json`
verify --schema
verify --describe
The doctor surface is read-only. It does not read bound inputs, execute rules,
load DuckDB, write output artifacts, append witness records, create witness
directories, or expose doctor --fix.
Configuration footprint:
- Shared witness ledger fallback:
~/.cmdrvl/state/witness/witness.jsonl - Explicit override:
EPISTEMIC_WITNESSfor an operator-supplied ledger path - First use copies legacy
~/.epistemic/witness.jsonlor.epistemic/witness.jsonlinto the canonical location, leaves legacy files in place, and writes path-only records to~/.cmdrvl/migrations/applied.jsonland~/.cmdrvl/notices/deprecated-paths.jsonl
verify.constraint.v1 is the compiled artifact:
{
"version": "verify.constraint.v1",
"constraint_set_id": "example.not_null_loans",
"bindings": [
{
"name": "input",
"kind": "relation",
"key_fields": ["loan_id"]
}
],
"rules": [
{
"id": "INPUT_LOAN_ID_PRESENT",
"severity": "error",
"portability": "portable",
"check": {
"op": "not_null",
"binding": "input",
"columns": ["loan_id"]
}
}
]
}Portable rule ops:
uniquenot_nullpredicaterow_countaggregate_compareforeign_key
aggregate_compare sum and avg add exactly, so row order cannot change a verdict. A decimal fraction means the number a report prints for it: 0.1 + 0.2 equals 0.3. Until numbers are loaded exactly, a sum or avg refuses when a summed value, a threshold or the tolerance is a fraction-form number of magnitude 2^53 or more, because it may already have been rounded. verify run reports the refusal as E_BAD_CONSTRAINTS, embedded evaluation as E_BAD_EXPR. This does not make loading exact: a decimal already rounded when it was read stays rounded.
Batch-only execution cases:
query_zero_rowspredicatewhen any column reference names a binding other than its anchor
A predicate column reference may optionally include binding:
{
"id": "MATURITY_DATE_IMMUTABLE",
"severity": "error",
"portability": "batch_only",
"check": {
"op": "predicate",
"binding": "current",
"expr": {
"eq": [
{ "column": "maturity_date" },
{ "binding": "prior", "column": "maturity_date" }
]
}
}
}check.binding remains the anchor. Omitted reference bindings resolve to that
anchor. Every participating binding must declare a non-empty key_fields
tuple of equal arity; physical key names may differ because tuples align by
position. The batch executor evaluates each anchor row once, ignores rows found
only in non-anchor bindings, and refuses ambiguous or missing counterparts.
Structural and scalar defects use stable refusal codes:
E_FIELD_NOT_FOUNDfor missing key or operand fieldsE_KEY_INVALIDfor null, non-scalar, unrepresentable, or type-incompatible keysE_KEY_AMBIGUOUSfor duplicate participant keysE_KEY_UNMATCHEDfor an anchor key without a counterpartE_BAD_EXPRfor incomparable predicate operands
Same-family temporal column-to-column predicates over date, timestamp,
time, and interval values use DuckDB-native comparison after explicit type
checks, without widening verify.report.v1 values. Temporal fields remain
invalid as key_fields because join identity and localization keys must be
protocol scalars. A failing temporal predicate renders an unambiguous anchor
field value through an explicit report-only cast.
SQL authoring compiles into batch-only rules. Embedded execution refuses
all batch-only rules with E_BATCH_ONLY_RULE; it does not approximate
binding-qualified predicates. Portable cross-binding lowering is deferred.
JSON report shape (verify.report.v1):
{
"tool": "verify",
"version": "verify.report.v1",
"execution_mode": "batch",
"outcome": "FAIL",
"constraint_set_id": "example.not_null_loans",
"constraint_hash": "sha256:...",
"bindings": {
"input": {
"kind": "relation",
"source": "tape.csv",
"content_hash": "sha256:...",
"input_verification": null
}
},
"summary": {
"total_rules": 1,
"passed_rules": 0,
"failed_rules": 1,
"by_severity": { "error": 1, "warn": 0 }
},
"policy_signals": {
"severity_band": "ERROR_PRESENT"
},
"results": [
{
"rule_id": "INPUT_LOAN_ID_PRESENT",
"severity": "error",
"status": "fail",
"violation_count": 1,
"affected": [
{
"binding": "input",
"key": { "loan_id": "LN-42" },
"field": "loan_id",
"value": null
}
]
}
],
"refusal": null
}This shows every field. Default command output omits content_hash, or shows it keyed, and a ground report treats constraint_hash the same way; --explicit prints both as above. See Redaction.
Human output:
VERIFY FAIL
constraint_set: example.not_null_loans
binding: input=tape.csv
passed_rules: 0
failed_rules: 1
severity_band: ERROR_PRESENT
FAIL INPUT_LOAN_ID_PRESENT binding=input key.loan_id=LN-42 field=loan_id value=null
When a failing rule has many localized rows, --sample-affected <N> limits the human output to the first N affected entries per failing rule and adds a preview note when additional entries were omitted. JSON output is unchanged.
A CSV column the reader cannot type stays text, and text is compared character by character: 01/15/2025 comes before 12/31/2024. One empty cell is enough. Released 0.7.6 and 0.8.0 pass false rules over such columns. On main, many of these passes are now refused with E_UNRELIABLE_COLUMN, but some false rules still PASS: see CSV columns held as text under the changes since 0.8.0.
--bind tape=report.xlsx#loans binds one worksheet, by name or 0-based index (digits select an index unless a sheet has that exact name). The worksheet is read by the shared cmdrvl-tabular reader and loaded exactly like a CSV of the same data, so identical rules give identical results over CSV, Parquet and XLSX (golden tests in tests/xlsx_bindings.rs). A workbook with more than one sheet and no #Sheet refuses with E_FORMAT_DETECT (the detail names E_AMBIGUOUS_SHEET and lists the sheet names); an unknown sheet refuses the same way (E_SHEET_NOT_FOUND). Cells are rendered as canonical text (numbers 2000.0 and 2000 both become 2000; date cells render as YYYY-MM-DD or a datetime); duration cells, error cells and some out-of-range values refuse. The exact rules are in the tabular README. The sheet selector works with --bind only: the verify DATASET --rules shortcut can open a one-sheet workbook but cannot select a sheet. Locks hash the .xlsx file bytes, not the worksheet. Not covered: the temporal and decimal behaviour of the tabular v1 reader beyond what its own tests prove, and workbooks whose values depend on volatile formulas.
--lock <LOCKFILE> (repeatable) checks each bound input against a lockfile before any rule runs. It reads the canonical lock.v0 manifest that vacuum | hashbytes | lock writes: each members[].bytes_hash is sha256:<hex> or blake3:<hex> of the raw file bytes, and verify hashes the bound file with the member's own algorithm. Different bytes refuse with E_INPUT_DRIFT, a bound input with no member refuses with E_INPUT_NOT_LOCKED, and an unknown hash algorithm, a member with no bytes_hash, or an unknown lock version refuses with E_IO (exit 2). The old verify-private lock.input.v1 format (content_hash, sha256 only) is still read and is deprecated. Not checked: the lock's own lock_hash self-hash.
Which members speak for an input is the same rule in verify run and verify ground:
- Every leading
./is dropped from the bound path as typed and from member paths. Nothing else is rewritten: no trimming, and no removing of trailing/. A\is an ordinary character. On Windows only,\in the typed path is read as/; member paths are never converted. - The candidates are the members whose path equals the typed path. If there are none, they are the members whose file name (the part after the last
/) equals the input's file name, provided they all have one path (real locks store paths relative to the vacuum root). Candidates are taken across all the--lockfiles. No candidate, or one file name on two or more different member paths, isE_INPUT_NOT_LOCKED. - Every candidate must agree with the input. One that differs is
E_INPUT_DRIFT, even when another matches;expected_hashis the first differing candidate in--lockorder. A passing report lists every lock with a candidate.
Changed after 0.7.6. Release 0.7.6 passed an input that matched any one candidate, so with two locks that each listed loans.csv, current=dec/loans.csv and prior=nov/loans.csv passed with the files exchanged. It also trimmed member paths, dropped their trailing separators and split them on \. Some inputs it passed are now refused, and a few it refused as not locked now pass.
To lock two periods whose files share a name, make one lock over the folder that holds both, so the member paths are dec/loans.csv and nov/loans.csv, and bind those paths as written in the lock. Each input then has exactly one candidate, and exchanged files are refused. Two per-period locks that both list loans.csv with different hashes, passed together, refuse every input, including correct ones.
verify ground checks citations against raw source-document bytes that are pinned by a required, repeatable --lock (lock.v0) argument. The claims input is JSONL; each line requires claim_id, source, and quote, with an optional half-open raw byte span and optional numeric value, unit, and scale:
{"claim_id":"loan-amount","source":"filing","quote":"95000000.00000000","byte_span":{"start":123,"end":140},"value":95,"scale":"millions"}The binary describes its own inputs, with no other arguments needed: verify ground --schema (or --describe, --input-schema) prints the JSON Schema of one claims line (verify.claims.v1), verify compile --input-schema the schema of YAML or JSON rule authoring (verify.authoring.v1), and verify compile --schema the compiled artifact's schema. verify ground --help and verify robot-docs guide show the fields with copy-paste examples.
The rules below are stricter than released 0.7.6, which passes many unsupported claims, including a quote that cuts a word or number and a unit the document never states. They apply from the first release that includes them.
Text. The pure-Rust engine drops HTML tags and comments and the contents of script and style, decodes common named entities and numeric character references, removes soft hyphens and zero-width characters, and collapses whitespace to one space. Styling tags (span, b, i, font, a, inline XBRL and the like) join the text around them; every other tag, including table cells, br, sup and XML elements, separates it. A < that does not start a tag name is ordinary text.
Quotes. A quote must stand on its own: it may not start or end inside a word (including hyphenated words and contractions) or inside a number, and may not leave out a sign, parenthesis, scale word or percent sign that belongs to a number it quotes. It also may not start or end inside a currency marker: letters joined to a currency sign (C$, US$, CN¥, E£, Cdn.$, U.S.$; up to three letters per part) or a currency name written after a number (Canadian dollars). US, U.S., CA, Cdn, Cdn., CDN, HK, NZ and AU, written in exactly those letters one space before a $ (including a line break, a non-breaking space, a tag or a table cell), are part of the marker too. A sentence that ends in U.S. right before an amount cannot be told apart from that prefix, so it is treated as one. A quote may still leave out a currency altogether. Other prefixes typed apart from the sign, including single letters (C $, A $), are not recognised: they read as a bare $. Without byte_span, exactly one such match is required. Zero is E_QUOTE_NOT_FOUND; several refuse with E_BAD_AUTHORING and detail code E_QUOTE_AMBIGUOUS plus match_count. A byte_span is held to the same rules, and the bytes in it must read on their own as they do in the document.
Numbers. A numeric claim passes only when all of these hold:
- The quote contains exactly one number. Digits that are part of a name (
Q3,10-K,10-year,3.5x) do not count. No number isE_NUMBER_NOT_IN_SPAN; several, including a date beside an amount, isE_NUMBER_UNBOUND. Quote less text. - Its value, sign and scale can be read from the document around it, not just from the quote. Otherwise it is
E_NUMBER_UNBOUND. This covers, among others: parentheses; a spaced or ambiguous dash;MM,mil,hundredand other magnitudes that no claim scale expresses; a loneM($8M: thousands to some writers, millions to others),BorT, orkwithout a currency;tnwithout a currency (it may be tonnes); billions and trillions in a document that also uses a long-scale word (milliard, which coversMilliardeandMilliarden, orBillionen,billonesorbillón); ranges, lists that share a scale, dates, ratios and fractions; unusual digit grouping; a footnote or exponent beside the digits; a scale in another HTML element; and, for a number with no scale of its own, any document that declares one ("in thousands", "US$'000"). - The value matches in exact decimal arithmetic, and a percentage or basis-point figure is claimed as
percentorbps(a plain quantity is not). OtherwiseE_SCALE_MISMATCH. The claim'sscaleisunits,thousands,millions,billions,trillions,percentorbps, and any equivalent one matches:$1.3 billionpasses as 1300millions. The document'sbillion,billions,bn,trillion,trillionsandtrnare read as the English short scale, andtnonly next to a currency. - If the claim has a
unit, the document states that unit on the number itself: otherwiseE_UNIT_NOT_ESTABLISHED. A currency code orUS$establishesUSD;€,£,₹and the currency names next to a number establish theirs. A bare$does not establishUSD(or any other dollar): claim"unit":"$"for it.¥works the same way. A sign with other letters joined to it (E£,CN¥,Cdn.$,U.S.$) is not the plain currency and establishes none of these. A spaced prefix (US $,CA $) establishes no unit by itself, neither a bare$nor a code, because the words in front of a$may be prose; with a matching code on the same number (CA $41.2 million CAD) that code is established. Besides currencies, onlypercent/%andbpscan be established; other units, such asshares, do not pass.
Where these rules differ from released 0.7.6 is listed under Behaviour changes from released 0.7.6.
A PASS does not show any of the following.
Currency:
- A single letter before a spaced
$can be cut off. FromC $41.2 million(orA $,S $), the quote$41.2 millionpasses, even with unit$. These are left alone becauseClass A $5 millionwould otherwise be refused. - A quote may leave the currency out when the claim states no unit.
41.2 millionquoted fromC$41.2 millionpasses. A claimed unit is still checked against the document. - Other spellings of a spaced prefix are not recognised and can be cut off the same way: for example
U.Swithout its last dot,A.U.,(US),US:,US-,Can,NT, or a footnote marker between the prefix and the$. - A quote with no digits may end just after the
$in$USor$CAD. Rs.is not recognised as a currency, so41.2 millioncan be quoted fromRs.41.2 million.- A currency name that does not follow a number can be cut:
Amounts are in Canadianpasses againstAmounts are in Canadian dollars.
Words and meaning:
- A scale phrase can be cut in a quote with no digits, such as
cent appliedfromper cent applied. No numeric claim can bind to such a quote. - Meaning outside the quote is not read: "not", "up to" or "more than" left outside the quote are not checked, so quote enough text to carry them.
- Text hidden by CSS is still searched. A quote may run across adjacent table cells or blocks. In a plain-text file, anything shaped like a tag is removed.
- Scale words assume the English short scale.
billionis read as a thousand million andtrillionas a million millions, in any letter case (Billiontoo, as English headings write it). In a long-scale languageBillionmeans a million millions. Only a document that also usesmilliard(which coversMilliardeandMilliarden),Billionen,billonesorbillónis refused. verify does not detect the language, so a German text whose only such word is1 Billionpasses a claim of 1billions, a thousand times less than it says. - Scale words are recognised in English and a few other forms only. Text written without spaces between words, such as Chinese or Japanese, can only be quoted in whole runs.
- A second magnitude word is recognised in English only.
5 thousand millonespasses a claim of 5thousands, as do the same words withMILLONES,milliardsorMillionen; 0.7.6 passes these too. The English5 thousand millionsnow fails that claim (E_NUMBER_UNBOUND), where 0.7.6 passed it.5 mil millonesfails in both, withE_SCALE_MISMATCHon 0.7.6 andE_NUMBER_UNBOUNDnow.
The command reuses verify.report.v1 and the existing redaction: failing quote and value details are ordinal refs by default and raw only with --explicit.
Call these out in the release notes.
Released 0.7.6 passes each of these examples; they no longer pass:
- A quote that cuts a number or a word, such as
$41from$41.2 million, orconvertiblefromnonconvertible. - A quote that cuts a currency marker, such as
$41.2 millionfromC$41.2 millionor fromUS $41.2 million. - A bare
$claimed asUSD. Claim"unit":"$", or use a document that statesUSDorUS$. - A unit the document does not state on the number, such as
sharesfor$41.2 million. Besides currencies, onlypercentandbpscan be established. - A lone
M.$8Mclaimed as 8millionsis nowE_NUMBER_UNBOUND, because some writers useMfor thousands.$8Kis still thousands. - A quote with more than one number, such as a date beside the amount. Quote only the text around the amount.
- A figure in parentheses claimed as positive, such as
(412)in a table cell claimed as 412, or5.0quoted from inside(5.0) millionclaimed as 5units. Its sign is not established. 0.7.6 already failed some other such claims. - A number without its own scale word in a document that declares a scale, such as
(in thousands). - Two magnitude words read as the first, such as
5 thousand millionsclaimed as 5thousands. - A number before
Milliarde,millón,milhão,milhaoorthousandth, claimed without that magnitude, such as1 Milliardeas 1units. - A number before an accented scale word in capitals (
MILLÓN,MILHÃO,BILLÓN,MILHÕES), claimed without that magnitude.
The rules for ground refuse more than these.
ground now accepts claims in billions and trillions: 0.7.6 refused the scale billions as E_BAD_AUTHORING, and failed $1.3 billion claimed as 1300 millions. Both now pass. bn is read the same way, and tn only next to a currency. A lone B and the claim scale b are still not accepted.
These scale words assume the English short scale. billion is a thousand million and trillion a million millions, in any letter case, including title case ($1.3 Billion). A document that also uses milliard, Milliarde, Milliarden, Billionen, billones or billón cannot pass a billion claim. Without such a word the English reading applies whatever the language: German 1 Billion, which means a million millions, is read as a thousand million, so a claim of 1 billions passes.
Every candidate lock member must now agree with its input; see Input locks. 0.7.6 passed an input that matched any one candidate. Two per-period locks that list the same file name with different hashes, passed together, now refuse even correct files: use one lock over the parent folder. Member paths with a backslash, surrounding spaces or a trailing / are no longer rewritten, so loans.csv no longer matches them.
Keys are matched exactly instead of through a floating-point cast. 0.7.6 joined the integer key 9007199254740993 to 9007199254740992; it is now E_KEY_UNMATCHED. A FLOAT or DOUBLE key of 2^53 or more now matches only another float, never an integer or decimal key (0.7.6 joined them), because such a float may already be rounded. Smaller keys such as 1.0 and 1 still join.
- A rule file with a repeated key can now be refused, even though it compiled before. 0.7.6 accepted a dataset name declared twice under
bindings(in YAML or JSON), an operator written twice in oneexprtest, orcolumnwritten twice in one reference. It silently kept the last value, so{gt: [..., 0], gt: [..., 100]}compiled as only the> 100test.compileand the one-step command now refuse these withE_BAD_AUTHORING, naming the repeated key with its line and column. To fix such a file, remove the repeated key, keeping the value you meant: to keep what 0.7.6 compiled, keep the last one. A repeated key incompareor a repeated rule field was already refused by 0.7.6. compileand the one-step command refuse.nanand.infwithE_BAD_AUTHORING. 0.7.6 compiled them tonull, and a rule could then pass. An artifact compiled by 0.7.6 still holds thenull: recompile it from its source.- A one-step
--keythat disagrees with the authoredkey_fieldsisE_KEY_CONFLICT. 0.7.6 silently used the--key, even when it named a missing column.
A DECIMAL with more digits or a larger scale than 0.7.6 could convert made it abort with no report. It now answers with a report: for example, a rule reading a Parquet column that holds 9999999999999999999999999999.5 refuses with E_SQL_ERROR.
ground --schema (or --describe, --input-schema) and compile --input-schema now print the schemas of what you write, with no other arguments. compile --schema now prints the compiled artifact's schema; 0.7.6 printed the report schema there. --schema and --describe also work before ground and compile. verify --schema is unchanged.
These are on main and not in a release yet. Call them out in the next release notes.
content_hashis gone from default output ofrun, the one-step command andground. WithVERIFY_REDACTION_KEYset it is shown asredacted:hmac-sha256:<32 hex>.--explicitprints the plain hash, as 0.8.0 did.- So is the
constraint_hashof agroundreport, which is the hash of the claims file. Theconstraint_hashof arunor one-step report names the compiled constraints and is unchanged. - An
E_INPUT_DRIFTrefusal follows the same rule for the expected and observed hashes. Without a key they are left out ofdetail, and arunmessage readsbinding <name> content hash drifted. - Anything that reads these fields must change. It can pass
--explicit, which also prints the raw values of failing rows, or set a key and compare markers. A consumer that requires a plaingroundconstraint_hashrejects default reports, keyed or not. pack0.7.2 is such a consumer. Checked with the released macOS x86_64packbinaries onPASSandFAILgroundreports: 0.7.2sealaccepts a default report and exits 0, butpack verifythen finds the packINVALID(SCHEMA_VIOLATIONonconstraint_hash), with or without a key. It finds packs of--explicitgroundreports and ofrunreportsOK.pack0.8.0 finds all of theseOK. Upgradepackto 0.8.0 or later before this version ofverify.- Code that uses the library must change where it touches these two fields:
VerifyReport.constraint_hashandBindingReport.content_hashare nowOption<String>. Code that reads one must handleNone, which is what a report without the field deserializes to. Code that builds either struct field by field must wrap the value inSome(...).VerifyReport::newandVerifyReport::refusaltake the same arguments as before, and the embedded executor still reports the hashes its caller supplies.
- Verdicts can change, in both directions. 0.8.0 added floating-point numbers in row order and rounded as it went, so the same rows could pass in one order and fail in another,
0.1 + 0.2counted as greater than0.3, and100.10 + 200.20 + 300.30did not equal600.6. The sum is now exact, reading a decimal fraction as the number a report prints for it, and an average is compared without a rounded division. - Some reported values change. A sum of integers too large for a floating-point number to hold is now reported exactly, where it fits in an integer: for example
9007199254741001where 0.8.0 reported9007199254741000.0. With a redaction key set, the marker for such a value changes too. - Some rules that 0.8.0 answered are now refused. A
sumoravgrefuses when a summed value, a threshold or the tolerance is a fraction-form number of magnitude 2^53 (9007199254740992) or more, because it may already have been rounded. This includes a value loaded from aDECIMALor CSV column as such a number.verify runreportsE_BAD_CONSTRAINTS; embedded evaluation reportsE_BAD_EXPR. This is an interim rule until numbers are loaded exactly.
- Verdicts can change. 0.8.0 compared numbers as floating point, so
9007199254740993equalled9007199254740992, and a rule that should fail could pass. Predicates,row_countandaggregate_comparethresholds, and tolerances now compare the numbers as received. - Wide JSON integers load. JSON and JSON Lines integers above 9223372036854775807, up to 18446744073709551615, were refused with
E_IO. - One new refusal. An integer is not compared with a fraction-form number of magnitude 2^53 or more that it rounds to, for example
9007199254740993against9007199254740992.0, because that number may already have been rounded. Predicates reportE_BAD_EXPR;verify runreportsE_BAD_CONSTRAINTSfor an aggregate threshold. - Still passes, although the rule is false: two decimals that were already rounded to one value when they were read, such as
DECIMALvalues with more digits than a floating-point number holds, and aforeign_keybetween two such columns.
- Where the rules declare no
key_fields, a--keythat names no column of the data now refuses withE_FIELD_NOT_FOUND, and an empty--key=withE_BAD_CONSTRAINTS. 0.8.0 could pass both. - Not covered:
key_fieldswritten in the rules themselves that name no column can still pass when no rule needs a key.
verify 0.8.0 reads some JSON and JSON Lines strings as dates, times or UUIDs, so two different strings can compare equal. Its eq passes between Infinity in one file and infinity in another, between 2024-1-5 and 2024-01-05, and between 10:00:00 and 10:00:00.000. Now eq, ne, in, unique and foreign_key compare the text of such strings, except in the cases under "Still passes" below. CSV values are not changed by this.
eq,inandforeign_keyover two spellings fail, for example one UUID in two letter cases.- A
query_zero_rowsrule now has to pass twice: with the values read as 0.8.0 reads them, and with the values as text, where the text reading must find no violating row. This applies to every query rule in a run in which any file has such a column. As text, dates compare character by character: a rule listing rows withd > '2024-01-31'passes on 0.8.0 over2024-1-5and now fails, while over2024-01-05it still passes. Queries also read UUID keys as text, so two files no longer match on a UUID written in two letter cases. Predicate rules still match keys as 0.8.0 does. - A new
E_FORMAT_DETECTrefusal: a rule that needs the text reading is refused where the reader has to rename a key, for example keys that differ only in letter case (vandV). A file that changes between the two readings is refused withE_IO.
Different text is now different:
| Rule | 0.8.0 |
|---|---|
ne between two spellings of a date in two files |
FAIL |
ne against a date written differently in the rule |
E_SQL_ERROR |
ne against the same UUID in another letter case |
FAIL |
unique over 10:00:00 and 10:00:00.000 |
E_SQL_ERROR |
two rules, gte and ne, over two spellings in two files |
FAIL |
one rule with ne on a date string and a test on a number |
E_SQL_ERROR |
not in with another spelling |
E_SQL_ERROR |
unique over one UUID in two letter cases |
FAIL |
And identical text is now equal: Infinity eq its own text, in with a value's own spelling and foreign_key to the same string (each E_SQL_ERROR on 0.8.0), and, in a file with UUID ids, a UUID value eq its own text (FAIL on 0.8.0). If you meant such values as dates or UUIDs, these passes are not what you want: write each value one way.
Check this case in particular. Two files both say 01-02-2024, and the second also holds 02-13-2024. 0.8.0 reads one file day first and the other month first, so the two identical values are unequal and eq fails. It now passes, because the text is identical. If your two files really use different day and month orders, the same text means two different days, and this PASS is wrong. verify does not warn you. Write dates as YYYY-MM-DD.
0.8.0 passes these too. This lists the cases we found, not every variant.
- A predicate or aggregate rule that mixes the comparison with another kind of test can keep 0.8.0's reading: for example
eqtogether withv >= vacross two files, orv < otheroreq; in one file, a UUIDeqin another letter case together withnotis_null; andmaxequal to a UUID in another letter case. - A
foreign_keyinto a UUID key column written in another letter case: keys are still matched as 0.8.0 matches them. - A JSON date compared for equality with a CSV date column keeps 0.8.0's reading for the whole rule, whatever else it compares. With
d=2024-1-5in JSON,deqthe CSV date2024-01-05andInfinityeqinfinitypasses, and so doesdeqthe CSV date2024-01-06orInfinityeqinfinity. This keeps same-day comparisons between JSON and CSV working. Workbook and Parquet date columns follow the same rule; we ran the cases here with CSV. - A query that cannot run on the text has only 0.8.0's answer: for example
a.v <> b.v OR date_part('year', a.v) < 0overInfinityandinfinity.
CSV carries no types, so verify guesses each column's type from its contents, and some guesses lose what the file says. Where a run would pass and a rule depends on such a column, verify now refuses with E_UNRELIABLE_COLUMN. Some runs that 0.8.0 passed are now refused. The refusal names each column, says why and says what to change. Examples, each of which passes on 0.8.0:
- Dates that can be read as more than one day: a rule that no date is after 31 March 2024 passes over
10/01/2024and11/01/2024. - Dates read as no day and month order would read them:
15/01/24is read as 24 January 2015, andinfinitybeside13/01/2024as 1900-01-01. - Numbers with more digits than can be kept: two different 20-digit numbers compare equal.
NaNandInfinity: columns holding onlyInfinityandinfinitycompare equal, and a query finds no difference betweenNaNandnan.- Times finer than a microsecond: two times that differ only past the sixth decimal place compare equal.
The same applies to the number, date and time columns of a file with no header row, because they cannot be checked. A query rule depends on every loaded column, including ones it does not name. A FAIL is never changed.
The text of a column does not always show what its author meant. These four cases can still pass although a date was read wrongly. 0.8.0 passes them too.
- One stray value turns a day/month column into month/day. If a day/month/year column holds a value that only month/day/year can read, such as
03/15/2024, and every other value can be read either way, the whole column is read as month/day. - And the reverse. A value that only day/month/year can read, such as
15/03/2024, turns such a month/day/year column into day/month. - Two-digit years get a century by a fixed rule.
00to68become 2000 to 2068 and69to99become 1969 to 1999. A maturity written06/30/69and meaning 2069 is read as 1969. - The same text can mean two days in two files. Each file is read by its own values. When two files settle on different orders,
01/02/2024is 2 January in one and 1 February in the other. If one file got its order from a stray value, comparing the two can pass when the dates meant are different.
A column the reader cannot type stays text, and text is compared character by character: 01/15/2025 comes before 12/31/2024, so on 0.8.0 a rule that every date is on or before 12/31/2024 passes over 15 January 2025. The most ordinary cause is one empty cell, for example a loan with no maturity date: it keeps even a YYYY-MM-DD column as text. Other causes include slash timestamps with seconds (01/15/2025 10:00:00), timestamps without seconds, AM and PM times, a second date format in the same file, N/A, an impossible date and month names.
Where a run would pass, verify now refuses with E_UNRELIABLE_COLUMN in two cases. Some runs that 0.8.0 passed are now refused.
- A text column that looks like dates or times cannot be relied on by any rule that reads it, and, because a query can read any loaded column, by any query rule in the run (
text_date). "Looks like" means that some cell is written as a date in a layoutverifyknows: numbers in a date order, a month name with a day or a year, a quarter or fiscal period, a week, a range of two dates, or a time of day with AM or PM or an offset. A cell that is mostly other text, or a date inside a code such asLOAN-2025-01-15, does not count. A column of version numbers or model numbers is refused too if one cell is written like a date. - A predicate
lt,lte,gtorgte, or an aggregateminormax, over any other text column is refused as well (text_order), whether or not it looks like dates. That includes codes such asA010, and number columns that stay text because of an empty cell.eq,ne,inanduniqueover such a column are not affected, and neither are query rules.
The exception: a column whose non-empty cells all have the one same fixed-width year-first shape, such as YYYY-MM-DD, YYYY-MM-DD hh:mm:ss, YYYY/MM/DD, YYYYMMDD or YYYY-MM, is refused by neither, because values of that one shape sort as text in date order. The same rules apply to Excel worksheets, which are loaded the same way.
For ordering, the exception holds only against the column's own shape. In a predicate lt, lte, gt or gte, the other side must be a value written in that shape, or another such column of the same shape, in the same file or another. With min or max, every value in compare must be written in that shape, whatever its operator, eq and ne included. Otherwise a run that would pass is refused (text_order). Over an ISO column with an empty cell that holds 2025-01-15, "on or before 31/12/2024" and "on or before Dec 31 2024" pass on 0.8.0 and are now refused. Some correct comparisons are refused too, for example a YYYY-MM-DD column against 2030-01-01 00:00:00, against 2030/01/01 or against an empty string. This covers predicate and aggregate rules only, not query rules.
0.8.0 passes these too.
- A query rule that compares an excepted column with a date written another way. Query rules are not covered. Over that ISO column, a query listing dates after
'31/12/2024'finds none, so the rule passes. - The same day spelled another way: over that ISO column,
ne,notinor a query ford = '01/15/2025'finds no match for2025-01-15. - A date layout
verifydoes not recognise. It cannot know every one. Left out on purpose, because ordinary data looks the same: bare years, serial and epoch numbers, six-digit dates such as150125,2024-064(day of the year),2024.03, compact times, and 24-hour times. Over such a column, query rules,ne,in,unique,eq,foreign_keyandnot_nullare not refused: with an empty cell, a query listing six-digit dates after'311224'finds none over 15 January 2025. Only predicate ordering,minandmaxare refused whatever the layout. - A query rule over a text column that is not refused compares characters. How a query orders text is not examined.
Write every date as YYYY-MM-DD (timestamps as YYYY-MM-DD hh:mm:ss), with four digits for the year and two each for month and day, one shape through the column, and leave a missing date empty rather than writing N/A. Write times of day as 24-hour HH:MM:SS. What a rule can then do depends on whether the column has an empty cell:
- With no empty cell the column is read as dates, and query rules and comparisons between files compare dates. A predicate or aggregate rule cannot compare it with a fixed value, including through
minormax: in a run on one file, 0.8.0 and this version refuse that withE_SQL_ERROR. Use a query rule, for exampleSELECT id AS key__id FROM input WHERE d > DATE '2024-12-31'. A column read as a time of day is more limited still: query rules andnot_nullwork on it, while predicate,uniqueandmaxrules are refused withE_SQL_ERROR, in 0.8.0 and this version. - With an empty cell the column stays text, and a value compared with it must be written in the same shape. Query rules work that way, for example
SELECT id AS key__id FROM input WHERE d > '2024-12-31'; theDATE '...'form is refused withE_SQL_ERROR. So do upper bounds in predicates and throughmax. A lower bound fails on the empty cell, which is an empty string, not null, and sorts before every date;d IS NULLdoes not find it. Skip it in a query (d <> '' AND d < '2020-01-01') or in a predicate (is_blankorthe bound).minselects the empty cell and cannot skip it.
To order other text, such as zero-padded codes, use a query rule.
CSV carries no types, and some typed values lose what a cell says: dates that can be read as more than one day or in no one order, numbers with more digits than can be kept exactly, NaN and Infinity, and times finer than a microsecond. A column left as text loses the order of what it says: it is refused where it looks like dates, and wherever a predicate, min or max orders it, unless every cell has one fixed-width year-first shape. Where a run would PASS and a rule depends on such a column (a query rule depends on every loaded column), verify refuses instead. The message names each column, says why and says what to do, for example writing dates as YYYY-MM-DD. A FAIL is never changed. docs/plan.md has the exact rule, and CSV columns held as text lists false rules that still pass.
Default verify run output is redacted: the raw key values and cell values of failing rows are replaced by deterministic ordinal refs, so a failing rule cannot print bound data into a log or a model's context. Keys become redacted:ref:k1, redacted:ref:k2, ... and cell values redacted:ref:v1, redacted:ref:v2, ... in two separate namespaces (a key and a cell holding equal bytes do not share a ref). Numbers follow first appearance over the entries that are actually printed, so --sample-affected cannot leak anything about unprinted rows, and rerunning the same input with the same flags gives byte-identical output. No hash of any value appears anywhere. Rule ids, severities, counts, binding names, key column names, field names, and the JSON shape are unchanged. DuckDB error text on a SQL_ERROR refusal (which can quote the offending cell) is withheld too. Pass --explicit to get the raw values back, for example verify run c.verify.json --bind input=data.csv --json --explicit.
What a ref reveals: which printed entries share a value and how many distinct values there are, never the content. Refs are not comparable across runs on different inputs or with different sampling.
Hashes of content. A hash of a bound file, of the version a lock expects, or of a ground claims file lets anyone who holds the report try likely contents until one matches. Default output therefore omits each of them: bindings.<name>.content_hash, the constraint_hash of a ground report, and the hashes in an E_INPUT_DRIFT refusal. No ordinal ref stands in for them. With a key set, each is shown as the marker of its text, algorithm prefix included, so someone with the key and a file can check a report: HMAC-SHA256 over the JSON string "sha256:<hex>", cut to 32 hex digits. --explicit prints the plain hashes. The constraint_hash of a run or one-step report is the hash of the compiled constraints and is always plain. The local witness ledger records each input's path and byte count, not a hash of it.
Stable markers (opt-in). Set VERIFY_REDACTION_KEY to a secret of at least 16 bytes and every key and cell value becomes redacted:hmac-sha256:<32 hex>: HMAC-SHA256 (RustCrypto hmac 0.12 with sha2 0.10) over the canonical JSON of the value, truncated to 128 bits. Markers are stable across runs and inputs for whoever holds the key and cannot be guessed without it. A set-but-empty or shorter key refuses with E_REDACTION_KEY (exit 2) before any input is read; it never falls back to ordinal refs. The key is never printed, logged or written to the witness ledger. --explicit ignores the key but a bad key is still refused. There is deliberately no random per-run salt: it would make default output non-reproducible.
What is not redacted, with or without --explicit: column and binding names, rule ids, the rule's own SQL or predicate text, file paths, and counts. Equality between values is visible inside one output (and, in keyed mode, across outputs for the key holder). Treat redaction as "no raw values in the output", not as anonymization.
Changed in this release: outputs that used to show raw key and value fields now show refs unless --explicit is passed, and the short-lived redacted:sha256:<16 hex> token is gone (its only consumers were verify's own docs and tests). Exit codes and the report shape are unchanged; E_REDACTION_KEY is a new refusal.
One primitive with two execution contexts:
- reads bound inputs from disk (CSV, row-oriented JSON, JSONL, Parquet, and Excel worksheets; see below)
- evaluates portable and batch-only rules
- loads every named relation once into one in-memory
BatchContext - materializes only the columns portable rules read, so a column no rule references cannot fail the load
- evaluates binding-qualified predicates through deterministic keyed joins
- can verify bound inputs against lockfiles
- is the reference executor
- receives already-materialized named relations
- evaluates portable rules only
- refuses batch-only rules with explicit refusal semantics
- exists to support factory-time constraint enforcement
The report contract stays the same across both.
verify/
├── .github/workflows/
│ ├── ci.yml
│ └── release.yml
├── crates/
│ ├── verify-core/ # domain types: constraint, report, refusal, ordering
│ ├── verify-engine/ # portable rule evaluation + embedded executor
│ ├── verify-duckdb/ # batch bindings, keyed predicates, query rules, locks
│ └── verify-cli/ # CLI surface: run, compile, validate, witness, doctor, render
├── fixtures/
│ ├── authoring/ # YAML and SQL authoring fixtures
│ ├── constraints/ # compiled constraint artifacts
│ ├── inputs/ # CSV test datasets
│ ├── locks/ # lock file fixtures
│ └── reports/ # reference report fixtures
├── schemas/
│ ├── verify.constraint.v1.schema.json
│ └── verify.report.v1.schema.json
├── scripts/
│ └── ubs_gate.sh
├── tests/
│ ├── cli.rs # CLI exit/output integration tests
│ ├── binding_qualified_predicates.rs # cross-binding PASS/FAIL conformance
│ ├── binding_qualified_refusals.rs # keyed predicate refusal contract
│ ├── binding_qualified_determinism.rs # row-order and byte determinism
│ ├── determinism.rs # byte-identical report determinism proof
│ ├── embedding_equivalence.rs # batch/embedded parity
│ ├── lock_integration.rs # lock verification tests
│ ├── portable_rules.rs # full compile→bind→evaluate pipeline
│ ├── query_rules.rs # query_zero_rows localization tests
│ ├── refusals.rs # refusal path coverage
│ ├── schema_contract.rs # fixture/schema round-trip validation
│ ├── gen_fixtures.rs # deterministic fixture generators
│ └── perf_smoke.rs # performance guardrail tests
├── Cargo.toml
└── LICENSE
verify is not:
- a benchmark scorer
- a policy engine
- a canonicalization system
- an extraction pipeline
- a storage/orchestration layer
Fresh-eyes boundary:
verifyenforces constraintsbenchmarkscores correctness against ground truthassessdecides proceed / escalate / block
cargo fmt --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
ubs .AI coding agents should read AGENTS.md before making changes.
Claude Code users should also read CLAUDE.md for the
machine-local permission and MCP availability boundary; shared project policy
remains in AGENTS.md.
cd verify
br ready # find available work
bv -robot-alerts -alert-type stale_issue
bv -robot-alerts -alert-type blocking_cascade
br show <bead-id> # read the spec
br update <id> --status in_progress
# reserve only exact files, implement, and run the relevant gate
br close <id> --reason "Completed"
br sync --flush-only # non-invasive; stage .beads/ in normal git workflowFor the full toolchain guide, see the Agent Operator Guide. Run verify --describe for this tool's machine-readable contract.
verify is part of the open-source toolchain from the CMD+RVL lineage and AI enablement practice. MIT-licensed. Contributions welcome from any practice or stack.
