Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/metareflection/claimcheck/llms.txt

Use this file to discover all available pages before exploring further.

Claimcheck is available as a Node.js library with two named exports. This page documents both exports: claimcheck for pure JSON-in/JSON-out audits where you supply pre-extracted Dafny lemmas, and audit for file-based workflows that handle lemma extraction, optional Dafny verification, and claim checking in a single call.

Installation

npm install claimcheck

Exports

The package exposes two entry points:
Import pathExportPurpose
"claimcheck"claimcheckPure JSON-in/JSON-out audit
"claimcheck/audit"auditFile-based lemma extraction and verification

claimcheck()

Import from the root entry point:
import { claimcheck } from 'claimcheck';
Runs a round-trip audit on pre-extracted claims. No file I/O, no side effects. Accepts an array of {requirement, lemmaName, dafnyCode} objects and returns structured results for each one.

Parameters

claims
object[]
required
Array of claim objects to audit. Each object must have the following shape:
domain
string
required
Human-readable domain name passed to the LLM as context (e.g. "counter", "kanban").
options
object
Optional configuration for the audit run.

Return value

Returns a Promise that resolves to an object with the following fields:
results
object[]
required
One result object per input claim, sorted in the original claim order.
tokenUsage
object
required
Aggregate token consumption for the audit run.

Example

import { claimcheck } from 'claimcheck';

const { results, tokenUsage } = await claimcheck({
  claims: [
    {
      requirement: 'The counter value is always non-negative',
      lemmaName: 'CounterNonNegative',
      dafnyCode: 'lemma CounterNonNegative(m: int)\n  requires Inv(m)\n  ensures m >= 0\n{}',
    },
  ],
  domain: 'counter',
});

audit()

Import from the audit entry point:
import { audit } from 'claimcheck/audit';
A higher-level wrapper over claimcheck() that handles lemma extraction from a .dfy source file, optional Dafny verification, and threading expected fields from the mapping back into results. Use this when you have a mapping file and a .dfy source on disk.

Parameters

mapping
object[]
required
Array of requirement-to-lemma mapping entries.
dfySource
string
required
Full Dafny source text. audit() uses this to extract each lemma named in mapping.
domainDfyPath
string
required
Absolute path to the .dfy file on disk. Required by dafny verify when opts.verify is true.
domainModule
string
Dafny module name. Only needed when opts.verify is true and the .dfy file uses module-scoped declarations.
domain
string
required
Human-readable domain name passed to the LLM as context.
opts
object
Optional configuration. Accepts all options from claimcheck() plus:

Return value

Returns a Promise that resolves to an object[]. Each entry corresponds to one mapping entry, sorted in the original mapping order.
(array)
object[]
required
Per-mapping results.
audit() requires dafny to be on your PATH only when opts.verify is true. For LLM-only audits, no Dafny installation is needed.

Build docs developers (and LLMs) love