Skip to content

Keep checkout paths and operational settings out of the model-call cache fingerprint - #90

Merged
pkieltyka merged 2 commits into
masterfrom
peter/44-cache-fingerprint
Nov 19, 2026
Merged

pkieltyka merged 2 commits into
masterfrom
peter/44-cache-fingerprint

Conversation

@pkieltyka

Copy link
Copy Markdown
Collaborator

Fixes #83, found in the #44 deep review. Refs #30, which stays open.

The model-call cache's run fingerprint hashed the absolute repository path and all of config.review and config.llm, including concurrency and timeouts. The same request from another checkout or worktree, or after a concurrency-only change, could therefore never replay. Plan 35 step 5 intended that reuse.

Change

  • Stays in the fingerprint: everything that can change output:
    • review mode, the resolved revisions and merge base, and PR identity
    • the raw diff hash and classification rules
    • the enabled lenses and the resolved skill-registry hash
    • provider, model, reasoning and forced-submit policy
    • review policy: depth, verification, confidence and severity, finding caps, supplemental modes, and token and call budgets
  • Removed: the checkout root, raw skill file locations, the raw git.baseBranch (already covered by the resolved target), worker and provider concurrency, and wall-clock timeouts.
  • Version field: the fingerprint gains one, so old entries miss and age out under the existing eviction.

The per-call key still hashes the actual routing, reasoning, prompts and history, tools, schemas and tool budgets.

Remaining #30 work

Materialized eval fixture commits can get different timestamps and SHAs even when their files match, so some eval re-runs will still miss.

Verification

  • Tests cover three cases: equivalent worktrees share a cache, concurrency and timeout changes replay all calls, and a changed call budget misses.
  • The pre-fix worktree-replay and path-input tests fail without the fix.
  • pnpm check, pnpm test (1629 tests) and git diff --check pass.
  • Peer review approved the patch before the rebase onto master. git range-diff confirms the patch is unchanged after it.

🤖 Generated with Claude Code

Hash the resolved target, skill registry, and semantic config. Version the run fingerprint so older cache keys miss and age out while the stored response format remains compatible.

Remaining #30 work: materialized eval fixture commits can have different Git timestamps, producing different commit SHAs that also appear in the planner prompt. This change makes equal resolved targets replay across fixture directories but does not stabilize those commit inputs or resolve same-path misses.
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🧞 Codegenie Review

Warning

Review completed with unresolved questions. 1 question(s) remain unresolved; absence of a confirmed finding does not establish safety.

0 confirmed findings retained from completed work. Unresolved questions require attention.

Coverage

Reviewed 5/5 hunks.
Coverage levels: deep 5, normal 0, light 0, skip 0.

🙋 Needs Human Attention

  • Does the model-call per-request key (prompt/tool payloads) ever embed the absolute checkout path, so the new cross-worktree replay assertion depends on prompt relativization that could regress silently in another worktree layout?
    • Files: src/llm/model-call-cache.ts, src/pipeline/review-runner.ts, tests/pipeline-phase6.test.ts
    • Symbols: buildModelCallCacheKey, createModelCallCache, reviewCacheFingerprint
    • Reason: Packet reviewer could not resolve this question from the reviewed context.

Stats

  • 🤖 Model: anthropic claude-opus-5 high
  • 🧞 Codegenie: v0.8.0 (4f21784dd6)
  • Elapsed time: 2m 15s
  • Stage timings: resolving input 794ms · parsing diff 31ms · classifying files 6ms · indexing symbols 180ms · planning review 1m 0s · building review packets 307ms · reviewing hunks 1m 5s · verifying findings 1ms · composing review 8s
  • Git: 0xPolygon/codegenie from master to peter/44-cache-fingerprint (83c2ab4a17)
  • Review completeness: complete.
  • Usage: model calls 14, tokens 395390, cost $1.1586.
  • Effective caps: tokens 8000000.
  • Local context pressure: 2 degraded tool results, 2 degraded hunks.

No confirmed findings

No confirmed findings were retained. The limitations above prevent a clean conclusion.

— View Workflow Job

@pkieltyka
pkieltyka merged commit 8426734 into master Nov 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cache fingerprints prevent replay across equivalent worktrees

1 participant