VALIDATION · APRIL 2026

sourcebook check — Validation Results

30 real diffs from open-source repos. Rules-based Layer A and AI-powered Layer B evaluated separately. Methodology, results, and known limitations.

Overview

sourcebook check analyzes a git diff for completeness using structural signals: git co-change coupling, test file mappings, import graph siblings, and hub file blast radius.

This page documents the validation methodology and results for both layers.

Methodology

Layer A results (rules-based)

Metric Result
Completeness gate accuracy 100% (30/30)
False positive rate (clean diffs) 0%
Test file detection 73%
Sibling file detection 71%
Hard semantic detection 33%

Layer B results (AI-powered)

What it catches

Four signal types power the completeness analysis:

  1. Co-change coupling — Files that historically change together in git commits. “auth.ts changed → session.ts usually changes too.”
  2. Test file coverage — Source file modified, corresponding test file not. Detected via naming convention and co-change history.
  3. Import graph siblings — Files that import or are imported by the changed file. Structural dependencies.
  4. Hub file blast radius — Modified file has 50+ dependents. High-risk change.

Known limitations

Try it

$ npx sourcebook check # free, no API key needed
$ npx sourcebook check --ai # deeper semantic analysis, requires ANTHROPIC_API_KEY
$ npx sourcebook init # sets up Claude Code hooks for automatic checking
$ npx sourcebook init

MORE_FROM_SOURCEBOOK