feat(review): add hit/miss telemetry to the repo-culture-profile cache (#4509) - #4601
Merged
Merged
Conversation
#4509) readCachedCultureProfile's cache works correctly -- TTL plus a merged-PR-count drift check -- but emitted no incr()/audit-event pair distinguishing a hit from a fresh derive, unlike every sibling cache (ai_review, ai_slop, linked_issue_satisfaction, miner_detection). Mirrors the ai_review cache's instrumentation exactly; the single hit/miss branch point in extractRepoCultureProfile correctly counts the drift-invalidation path as a miss too, since readCachedCultureProfile's null return already unifies every invalidation reason.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4601 +/- ##
=======================================
Coverage 94.09% 94.09%
=======================================
Files 430 430
Lines 38215 38222 +7
Branches 13931 13931
=======================================
+ Hits 35958 35965 +7
Misses 1600 1600
Partials 657 657
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
readCachedCultureProfile's cache (asignal_snapshots-backed TTL, plus a merged-PR-count drift invalidation) works correctly — but its hit/miss branch was completely unlabeled, unlike every sibling cache in this codebase (ai_review,ai_slop,linked_issue_satisfaction,miner_detection), one of the six capability gaps issue feat(stats): AI-feature cache/reuse-efficiency rate, tracked over time, public #4448 identified.incr()/recordAuditEventpair on both the hit path (insideextractRepoCultureProfile, right where a non-null cached result is returned) and the miss/re-derive path, mirroring theai_reviewcache's instrumentation exactly (event names follow the samegithub_app.X_cache_hit/X_cache_missconvention, metric names followgittensory_X_cache_hit_total/_miss_total).readCachedCultureProfile'snullreturn already unifies every invalidation reason (no snapshot, TTL expiry, drift, malformed row) — there's no separate code path to accidentally leave uninstrumented.Closes #4509.
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #4509).Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally —src/review/repo-culture-profile.tsis 100% statements/branches/functions/lines in isolation (confirmed via a scoped coverage run), and the precise diff-line cross-reference against the full-suitelcov.infoshows zero uncovered lines/branches.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateSafety
UI Evidencesection below. (N/A — backend-only observability change, no visible UI.)