Skip to main content

Pre-ingestion verification for epistemic quality in RAG systems

Project description

clarity-gate

Pre-ingestion verification for epistemic quality in RAG systems.

Core Question: "If another LLM reads this document, will it mistake assumptions for facts?"

Status

⚠️ v0.1.0 is a placeholder release to reserve the package name. Full validation is coming soon.

For working validators now, use the existing packages:

  • pip install cgd-validator
  • pip install sot-validator

Or use the Claude skill directly.


What It Does

Clarity Gate validates documents before they enter knowledge bases, ensuring:

  • Claims are properly marked as hypotheses vs. established facts
  • Projections have uncertainty markers
  • Assumptions are explicit, not buried
  • Data is internally consistent

Installation

pip install clarity-gate

CLI Usage

# Validate a Clarity-Gated Document
clarity-gate validate-cgd document.cgd

# Validate a Source of Truth file
clarity-gate validate-sot reference.sot

# Auto-detect format
clarity-gate check document.md

# Options
clarity-gate validate-cgd document.cgd --json      # JSON output
clarity-gate validate-cgd document.cgd --strict    # Treat warnings as errors

Programmatic Usage

from clarity_gate import validate_cgd, validate_sot, validate

result = validate_cgd("path/to/document.cgd")

if result.valid:
    print("Document passes all checks")
    print(f"RAG-ingestable: {result.metadata.rag_ingestable}")
else:
    for error in result.errors:
        print(f"[{error.rule}] {error.message}")

Document Formats

CGD (Clarity-Gated Document)

Documents that have been verified for epistemic quality:

  • YAML frontmatter with verification status
  • Epistemic markers inline (e.g., *(not specified)*)
  • HITL verification records
  • End marker: Clarity Gate: CLEAR | REVIEWED

SOT (Source of Truth)

Authoritative reference documents:

  • Strict structure requirements
  • Staleness tracking with markers: [STABLE], [CHECK], [VOLATILE]
  • Verified claims with citations

Specification

This validator implements:

Related Packages

Package Purpose
clarity-gate Unified validator (this package)
claritygate Alias → redirects here
cgd-validator Legacy CGD validator
sot-validator Legacy SOT validator

Links

License

CC-BY-4.0

Project details


Download files

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

Source Distribution

clarity_gate-1.0.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

clarity_gate-1.0.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file clarity_gate-1.0.0.tar.gz.

File metadata

  • Download URL: clarity_gate-1.0.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for clarity_gate-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ae0a30181cd47b4b9af5c5ece771c61dac8689e28c0fc6934440387eeaceed70
MD5 78009b031387d5eb948a9b0c22c42ba0
BLAKE2b-256 155986d07deb3bed8a65d32da730e6649926ece63ab89e1e8f868d7632101554

See more details on using hashes here.

File details

Details for the file clarity_gate-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: clarity_gate-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for clarity_gate-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90bc2826a7dbe0a4889a3476befd6ca19d1836072a4d251528c0202db7261691
MD5 31673c349b615c7666dc73dca98aa5fe
BLAKE2b-256 5c91694536dcd61ee24eb0b1a28e766eaa50bbc2a4fdd4a45fab08e10323cdfb

See more details on using hashes here.

Supported by

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