Skip to main content

attune-verify

Generation fact-checker for the attune-* family. Verifies named entities in LLM-generated content actually exist — imports import, CLI flags are real, links resolve, counts match source — so hallucinations that pass unit tests are caught before they reach a reader.

Install

pip install attune-verify

With the optional LLM semantic layer (requires attune-rag):

pip install 'attune-verify[rag]'

Quick start

from attune_verify import verify, VerifyContext
from pathlib import Path

ctx = VerifyContext(
    project_root=Path("."),
    allowed_help_cmds=frozenset(["attune"]),
)
result = verify(generated_content, ctx)
if not result.ok:
    for f in result.findings:
        print(f"{f.kind}: {f.detail}")

Part of the attune family

  • attune-rag grounds generation in accurate retrieved sources (input-side)
  • attune-verify checks that named entities in the output actually exist (output-side)

Together they bracket generation: rag verifies "is this claim supported?"; verify checks "does this named thing exist?"

What each checker verifies

Checker Claim it settles Truth source you declare
imports every import in a Python code fence resolves, by full dotted path env_python
flags every --flag in an inline span or shell fence appears in that command's --help help_commands / allowed_help_cmds
links every local markdown link target exists under the project project_root
counts every numeric claim matches the number it names count_sources

Findings are error when a claim is refuted and warning when it cannot be checked — an unverifiable claim is never a silent pass. result.ok is False only on errors; raise_if_failed(result) turns it into a hard gate.

Status

Beta — the deterministic core (imports, flags, links, counts) is stable and guarded by a labeled precision/recall corpus (gated ≥ 0.95 each) and mutation testing (gated ≥ 0.75). The public API above (verify, VerifyContext, VerifyResult, Finding, FindingKind, raise_if_failed, and the Judge protocol) is what beta covers: it will not change shape without a deprecation in a minor release. The LLM semantic layer is optional via the [rag] extra and is the least settled part of the surface.

Known limitations

  • Reference-style links ([text][ref]) are not resolved — only inline [text](target) links are checked.
  • Short flags (-v) are not checked; only --long forms are.
  • A flag written as bare `--flag` in prose is attributed to the nearest preceding word, so it may degrade to a warning rather than resolve.
  • Counts are matched to a source by keyword overlap with the claim's surrounding text; a numeric claim whose context names no source is skipped rather than guessed at.

License

Apache 2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

attune_verify-0.3.0.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

attune_verify-0.3.0-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file attune_verify-0.3.0.tar.gz.

File metadata

  • Download URL: attune_verify-0.3.0.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for attune_verify-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4cfdac20c3c32c97a7f1782d013cec8449bf485dd9392c5319d37a489075087b
MD5 b49b98bd6c56b37e09e9c3e0c2999923
BLAKE2b-256 f34e1e39e45439ae3bf110493ea339e48644fd74c37caa7bc7fae41cc78c7284

See more details on using hashes here.

Provenance

The following attestation bundles were made for attune_verify-0.3.0.tar.gz:

Publisher: publish-pypi.yml on Smart-AI-Memory/attune-verify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file attune_verify-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: attune_verify-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for attune_verify-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6e16716406b5035505873cfbe585ed3c7ce2b014cf55acc4744d2b568f81c71
MD5 d4a5ccbd13e4cfe1f94a27ade18e6af0
BLAKE2b-256 ff386f968c3a1f13c3d906fedf3dfb6019f6cfa7057e24418d2f0e94e44e7606

See more details on using hashes here.

Provenance

The following attestation bundles were made for attune_verify-0.3.0-py3-none-any.whl:

Publisher: publish-pypi.yml on Smart-AI-Memory/attune-verify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page