🧭 The problem

Every time I tried to set up a new open-source project, something in the docs was wrong. The README said Python 3.8+, pyproject.toml said >=3.10, and the Dockerfile ran 3.9. The setup guide said make lint, but that target had been renamed a year earlier. The code read JWT_SECRET, which was nowhere in .env.example.

Each file looked fine by itself. Together they contradicted each other.

This happens all the time, and nobody checks for it:

  • Linters check one file at a time.
  • Type checkers check code.
  • Link checkers check URLs.
  • Nothing checks that a repository's files agree with each other.

That gap is where new contributors give up, deployments drift and "works on my machine" comes from.

πŸ’‘ The what-if

What if a repository could be cross-examined the way a careful new contributor reads it?

truthlint treats every file as a claim. The README claims a Python version. The Makefile claims which targets exist. .env.example claims which variables the app needs. truthlint collects all of those claims and checks them against each other and against the code. Whenever two of them disagree, it reports a contradiction, with evidence from both sides.

βš™οΈ What it does

 HIGH     TL101-406201  Python version contradiction  high confidence
   README.md says Python 3.8+ is enough, but the project requires >=3.10
   (minimum 3.10). Users following the docs on Python 3.8 will be refused by pip.
   ↳ README.md:8        claims Python 3.8+
   ↳ pyproject.toml:9   declares requires-python '>=3.10'
   Fix: State Python 3.10+ in README.md, or raise the constraint.  [auto-fix available]
  • πŸ”Ž 35 cross-file rules covering README and docs, pyproject.toml, requirements*.txt, package.json, lockfiles, Dockerfiles, compose files, GitHub Actions and GitLab CI, Makefiles, .env examples and source code.
  • 🧾 Evidence for every finding: the exact file and line on both sides of the contradiction, a confidence level, and how it was checked.
  • 🧭 Onboarding audit: it walks through your setup instructions step by step, keeping track of cd, cp and virtualenvs along the way, and checks each command statically. Does that npm script, make target, file, compose service or pip extra actually exist?
  • πŸ“Š Two explainable scores: a Repository Truth Score and an Onboarding Reliability Score, each out of 100, with every deduction listed.
  • 🩹 Fixes you review: a suggested fix for every finding, many with a ready-made patch, applied only after you confirm.
  • 🚦 CI gate: truthlint scan . --fail-on high stops a pull request that adds new contradictions.
  • πŸ›‘οΈ GitHub code scanning (new): truthlint report --format sarif writes SARIF 2.1.0. Upload it in CI and every contradiction appears as an alert on the exact line in a pull request, with the other side of the contradiction attached so the reviewer sees both files.
  • πŸ”’ Safe by design: fully offline, no API keys, no AI service, nothing leaves your machine. It never runs anything from the repository it scans, not even git, because a repository's .git/config can make git run commands.

What it catches

Area Examples
Runtime versions README, Dockerfile, CI matrix, .nvmrc and .python-version disagreeing with the declared requirement
Documented commands npm run X with no such script, make X with no such target, pip extras that don't exist, compose services that don't exist
Documentation broken relative links and heading anchors, outdated project-structure trees, references to deleted files
Environment variables read in code (Python, JS/TS, Go, Ruby, Rust, Java, PHP, C#, Elixir, shell) that are missing from .env.example
Dependencies imports never declared in any manifest, declared dependencies never imported
Containers COPY of missing or .dockerignored files, CMD pointing at modules that don't exist
CI workflow steps calling missing scripts, targets or files

πŸ‘₯ Who it's for

  • Open-source maintainers who want new contributors to get set up on the first try.
  • New contributors and students who lose hours to docs that no longer match the code.
  • Teams whose READMEs, Dockerfiles and CI files drift apart as the code changes.
  • Anyone running CI who wants "the docs are wrong" caught at review time instead of by a confused user.

πŸ› οΈ How I built it

truthlint is written in Python 3.11+, with Typer for the CLI, Rich for terminal output, Pydantic for the finding and report models, and PyYAML.

  1. Discovery: its own .gitignore engine, so it never shells out to git, plus protection against symlink escapes and limits on file size and binary files.
  2. Parsers: one per format (Markdown, shell, pyproject, package.json, Dockerfile, compose, GitHub Actions, GitLab CI, Makefile, .env, Python AST, JS/TS). Every parser tracks line numbers so findings can point at the exact line, and none of them execute code.
  3. Repository view: each file is parsed at most once, only when a rule needs it, and every rule reads from that same shared view.
  4. Rules: grouped by area (runtime, commands, docs, env, deps, containers, CI, build). One shared static command checker verifies commands in docs, CI, Makefiles and npm scripts.
  5. Scoring: each finding costs severity weight Γ— confidence points. Repeats of the same rule count for less, and each rule is capped, so one noisy area can't sink the whole score. Truth Score = 100 Γ— e^(βˆ’points / 90).
  6. Output: Rich terminal output, plus Markdown, JSON and SARIF 2.1.0 reports and patch files. The SARIF output maps each finding to an alert whose primary location is one side of the contradiction, with the other side attached as a related location. Severities map to SARIF's error, warning and note levels. Paths are relative to the repository, so your local folder path never appears in the report. A test validates the output against the official OASIS SARIF schema on every example repository.

It ships with a pytest suite (99 tests), CI on GitHub Actions, and trusted publishing to PyPI, so anyone can run pip install truthlint today. truthlint also checks its own repository and scores 100/100.

πŸ§— Challenges I ran into

The hard part was being accurate, not finding problems. A tool that cries wolf gets switched off in CI within a week. So truthlint is built to stay silent rather than guess:

  • Evidence or nothing: a finding can't be created without a file and line citation. The code enforces this, so it isn't just a convention.
  • Unverifiable is not broken: anything that depends on the network or on installed tools is reported as unverified, never as failing.
  • Ambiguity gets downgraded: if a script exists in another package of a monorepo, or a Makefile uses pattern rules, truthlint says unverified rather than missing.
  • Generated paths are respected: files under dist/ or build/, gitignored files, and outputs of earlier setup steps (cp, mkdir, python -m venv) aren't reported as missing.
  • Risky rules are opt-in: heuristic checks that are more likely to give false positives run only with --deep.

There's also a zero-false-positive guarantee in the test suite: the bundled examples/healthy-library repository must always score 100/100 with zero findings.

Security was its own challenge. Scanning a repository you don't trust shouldn't be dangerous, so truthlint never executes anything, never follows symlinks out of the repository, and never calls git.

Building SARIF output had its own subtleties. GitHub treats any alert with a "security-severity" score as a security vulnerability, but truthlint's findings are correctness problems, so I deliberately left that score out. SARIF code snippets must match the source text exactly, but truthlint trims its excerpts for display, so I emit precise line numbers instead of slightly inexact snippets.

πŸ“š What I learned

  • Precision matters more than recall for developer tools. Ten correct findings build more trust than a hundred noisy ones, and designing for trust changed almost every rule I wrote.
  • Docs are code. A README is a set of claims that can be checked, and once you parse it that way, most "docs drift" turns out to be detectable statically.
  • Safe-by-default needs real effort. Even running git on an untrusted repository can execute code, so I had to write my own .gitignore matcher instead.
  • Meet developers where they already look. A report nobody opens doesn't fix anything. Putting findings into GitHub's own pull-request review through a standard format like SARIF made truthlint far more useful than adding another report file.
  • Shipping is a skill of its own: publishing a real package to PyPI through trusted publishing, and writing tests that lock in the absence of false positives, not just their detection.

πŸš€ What's next

  • Release SARIF output on PyPI as v0.2.0
  • More ecosystems: Go modules, Cargo, Gemfile, Gradle/Maven
  • truthlint scan --diff origin/main, to report only the contradictions a pull request introduces
  • Checking the CLI subcommands documented in a README against their actual Typer, Click or argparse definitions
  • A GitHub Action so any repository can add truthlint in one line

▢️ Try it in 30 seconds

git clone https://github.com/harshith7002/truthlint.git && cd truthlint
pip install -e .                                 # latest, including SARIF (PyPI has v0.1.0)
truthlint scan examples/drifting-python-api      # a repository full of contradictions
truthlint scan examples/healthy-library          # 100/100, zero findings
truthlint report examples/drifting-python-api --format sarif -o truthlint.sarif

πŸ“ Disclosure: pre-existing vs. event work

Pre-existing: truthlint is my own project, started on November 12, 2026. The rule engine, parsers, onboarding audit, scoring, fixes, CLI, tests and the v0.1.0 PyPI release were built before this event.

During IdeaLab Hacks: I added SARIF 2.1.0 output (truthlint report --format sarif / scan --format sarif), so contradictions show up as GitHub code-scanning alerts on the exact line in pull requests. It came with a test suite that validates the output against the official OASIS SARIF schema, a ready-to-use GitHub workflow in the README, and this submission (commit 78b7e9f).

Third-party components: Typer, Rich, Pydantic and PyYAML (runtime), and pytest, ruff and jsonschema (development), all used under their open-source licenses. The bundled SARIF schema file comes from the OASIS SARIF specification.

Built With

  • github-actions
  • pydantic
  • pypi
  • pytest
  • python
  • pyyaml
  • rich
  • ruff
  • typer
Share this project:

Updates

Submission history