Skip to content

Caching ​

Every verdict is cached. Unchanged targets are never re-reviewed — only files whose review input has changed since the last run cost an API call.

How the cache works ​

When praxis eval run reviews a target, each configured reviewer:

  1. Computes a content hash over the full review input — the target, the spec's body, and the spec's resolved context: files
  2. Looks up .praxis/cache/validation/{target-relative-path}.json
  3. If the file holds an entry for this (spec, reviewer) pair and the hash matches — returns the cached verdict without any API call
  4. If there is no entry, or the hash doesn't match — calls the provider and writes the verdict

The hash covers everything the reviewer saw, and nothing else. Editing the target, the spec's prose, or a context file invalidates exactly the verdicts those inputs produced. Activating an axiom has no cache effect, because axioms never enter the review. Cohort units hash the assembled member set, so editing any member invalidates the cohort's verdict.

A spec's frontmatter is not part of the hash — and a reviewer is never shown it. paths:, excludes:, cohort: and type: declare where a spec applies, not how a target is judged, so retargeting a spec reaches new files while every verdict it already holds stands. The same goes for a context: glob rewritten over the same files: the resolved contents join the hash, the pattern that found them does not.

Cache file structure ​

Each target has exactly one cache file — its complete review state, across all specs and all reviewers, in one committed artifact. Entries are keyed <specHash>:<reviewerHash>:

json
{
  "version": "5.0",
  "verdicts": {
    "0311531a:e028f7f6": {
      "reviewer": {
        "name": "mercury",
        "model": "inception/mercury-2.5",
        "hash": "e028f7f6"
      },
      "spec_path": "src/services/README.md",
      "cached_at": "2026-09-14T21:41:44.993Z",
      "content_hash": "ecc6b3c2",
      "context_files": [{ "path": "src/domain/types.ts", "hash": "f1d20738" }],
      "result": {
        "compliant": false,
        "severity": "error",
        "issues": [
          {
            "text": "Error message 'bad input' names nothing.",
            "axiomId": null,
            "axiomVersion": null
          }
        ],
        "reason": "The service violates the error-message standard."
      }
    }
  }
}

Cached critiques are born raw — axiomId and axiomVersion are always null in the cache. Labels are triage assignment records in the ledger, joined at read time by the reports; they are never written back into the cache.

The reviewer's hash is its behavioral identity: the whole config entry minus name and apiKeyEnvVar, plus the complete reviewer-facing prompt surface this praxis version ships. When the spec declares context:, the entry records the resolved files with per-file hashes — the exact inputs behind the verdict.

Cache invalidation ​

The cache invalidates automatically when:

  • The target content changes (any member, for cohort units)

  • The spec's body changes — its prose, not its frontmatter

  • A context file the spec declares changes, or a context: glob starts resolving to a different set of files

  • The reviewer's behavioral settings change (model, temperature, baseUrl, provider, options) — this rolls the reviewer's epoch and invalidates all of its entries at once

Renaming a reviewer does not invalidate anything: the name is excluded from the hash, so identity follows behavior, not the label. Rolling a config change back re-hits the old entries at zero cost. There is no manual cache management in normal use — praxis eval prune exists only to drop entries no configured reviewer can ever hit again.

Disabling the cache ​

Pass --no-cache to skip cache reads and writes:

bash
praxis eval run --no-cache
praxis eval run src/services/redeem-coupon.ts --no-cache

Useful for checking reviewer non-determinism on a borderline result.

Cache hit reporting ​

Every cached run ends with the tally, and the run record in the ledger carries the same numbers:

[CACHE] Hits: 17, Misses: 1

[SPEND] Time: 24s, Cost: $0.0011

Reading a stale entry ​

praxis eval verdict <path> reads the cache without requiring a hash match, so you can inspect a target's last known verdict even after editing it. A changed target reports STALE rather than NOT VALIDATED.

Commit the cache ​

.praxis/ is committed — the ledger requires it, and the cache pays for itself the moment a second machine is involved: a verdict paid for on your laptop is a cache hit in CI and on every teammate's clone. Cache files are deterministic per content, so merges are rare and trivial.

See also ​

Built for teams that want both humans and AI agents to operate from the same knowledge.