Add fingerprint caching to restore and share commands#71
Conversation
Both commands were uploading the repo on every call with no cache. - restore: cache the SupermodelIR response by git fingerprint; subsequent calls without code changes skip the upload - share: same caching; the domain analysis and impact results now share cache keys with `supermodel audit`, so running audit then share (or vice versa) requires only one upload per API type; also deduplicated context creation across both API calls Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review WalkthroughThese changes introduce repository fingerprint-based caching to the restore and share commands. When analysis results are requested, the system first checks a cache keyed by repository fingerprint, operation name, and build version. On cache hit, cached results are reused; on miss, API calls proceed and results are stored for future use. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes The changes follow a consistent, repetitive caching pattern (check cache → execute API → store result) applied across multiple functions. While there are signature modifications and cache key construction to verify, the logic is straightforward and the pattern is homogeneous, reducing cognitive load during review. Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
Both
restoreandsharewere uploading the repo on every invocation with no cache check.SupermodelIRresponse by git fingerprint under arestoreanalysis key; subsequent calls on an unchanged repo skip the uploadaudit-domainskey and impact underimpactkey — the same keys used bysupermodel audit, soauditandshareshare results when run on the same codebase state; also deduplicatedcontext.WithTimeout(was created once per API call, now once perrunShare)Test plan
go build ./...passesgo test ./...passessupermodel restoretwice — second call skips uploadsupermodel auditthensupermodel share— share skips both uploads (uses audit cache)🤖 Generated with Claude Code
Summary by CodeRabbit