Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Validation Cache

Status: Current Last updated: 2026-05-01 17:07 EDT

The CHAT-core validation cache, used by chatter validate and the LSP server. Distinct from the result cache used by Batchalign for text and audio backend results: this cache stores parse + validate results keyed by file path + options.

crates/talkbank-transform/src/unified_cache/.

Architecture

flowchart TD
    req["Validation request\n(path + options)"]
    key["Cache key\n(path + check_alignment flag)"]
    db["SQLite WAL\n~/.cache/talkbank-chat/\ntalkbank-cache.db"]
    hit["Cache hit\n→ return stored result"]
    miss["Cache miss\n→ parse + validate + store"]

    req --> key --> db
    db -->|found + version match| hit
    db -->|not found or stale| miss
    miss --> db

Configuration

ConfigValueWhy
BackendSQLite via sqlxConcurrent reads (WAL), atomic writes, zero-config
Pool size16 connectionsMatches validation worker count
mmap256 MBFast random access for 95k+ entries
InvalidationVersion field + 30-day TTLSchema changes auto-invalidate; stale entries pruned
BridgeEmbedded single-threaded tokio runtimeSync workers call rt.block_on() for async SQLite

Schema

file_cache table:

ColumnRole
file_pathPrimary key — absolute resolved path
check_alignmentWhether alignment validation was requested
parser_kindParser backend (tree-sitter or re2c)
resultSerialized validation outcome
cached_atInsertion timestamp
versionSchema/code version — mismatch invalidates the entry

Database location

PlatformPath
macOS~/Library/Caches/talkbank-chat/talkbank-cache.db
Linux~/.cache/talkbank-chat/talkbank-cache.db
Windows%LocalAppData%\talkbank-chat\talkbank-cache.db

Invalidation

  • Schema changes — bump the version field; old entries become unreachable.
  • Time-based — entries older than 30 days are pruned.
  • Manual — pass --force to bypass cache lookups for a particular validation run.

Per project policy, do not delete the cache directory without explicit request — see the cache-policy section of talkbank-tools/CLAUDE.md.

See also

  • Audio-task cache — Batchalign’s per-utterance cache for FA / UTR ASR / media conversion.