feat(review): add cache hit/miss telemetry to grounding and review-memory (#4448) - #4658
Conversation
|
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 #4658 +/- ##
=======================================
Coverage 94.12% 94.12%
=======================================
Files 434 434
Lines 38496 38510 +14
Branches 14038 14038
=======================================
+ Hits 36233 36247 +14
Misses 1604 1604
Partials 659 659
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-10 10:11:30 UTC
🛑 Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Why this is blocked
CI checks failing
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
…mory (#4448) Two of the six AI-touching capabilities #4448 identified as having zero reuse-rate signal: grounding's per-file GitHub Contents cache (getCachedGroundingFileContent) and review-memory's in-isolate suppression-list TTL cache (getCachedReviewSuppressions, #4508). Both already correctly avoid redundant work -- they just had no telemetry proving it, mirroring the exact gap #4509 closed for repo-culture-profile. Instruments both with the SAME incr()+recordAuditEvent hit/miss pair convention already established for repo_culture_profile / ai_review / ai_slop / linked_issue_satisfaction / miner_detection, so a future aggregate reuse-rate computation (#4448's remaining deliverable) can read a consistent event shape across every instrumented capability. Part of epic #4445's #4448. The remaining three uninstrumented capabilities (enrichment, impact-map, reputation -- none of which have an existing cache mechanism to instrument, unlike these two), the aggregate reuse-rate computation, the daily rollup, the public API extension, and the homepage trend chart are deferred to follow-up PRs.
…/review-memory (#4448) codecov/patch flagged 93.75% on the prior commit -- both new hit/miss telemetry sites wrap recordAuditEvent in .catch(() => undefined), but only the cache-HIT side's failure path had a test; the cache-MISS side's catch callback was never actually invoked by any test, so it never executed. Adds the missing miss-side "swallows a failing audit-event write" test to both files, mirroring the existing hit-side test exactly.
9eb4b85 to
01184aa
Compare
Summary
getCachedGroundingFileContent) and review-memory's in-isolate suppression-list TTL cache (getCachedReviewSuppressions, from fix(review): review-memory suppression list re-read from D1 on every comment render, no cache #4508). Both already correctly avoid redundant work — they just had no telemetry proving it, mirroring the exact gap fix(review): repo-culture-profile cache works correctly but has zero hit/miss telemetry #4509 closed forrepo_culture_profile.incr()+recordAuditEventhit/miss pair convention already established forrepo_culture_profile/ai_review/ai_slop/linked_issue_satisfaction/miner_detection, so a future aggregate reuse-rate computation (feat(stats): AI-feature cache/reuse-efficiency rate, tracked over time, public #4448's remaining deliverable) can read a consistent event shape across every instrumented capability.gittensory_grounding_cache_hit_total/_miss_total,gittensory_review_memory_cache_hit_total/_miss_total. New audit events:github_app.grounding_cache_hit/_miss,github_app.review_memory_cache_hit/_miss.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally — 100% branch coverage on the new telemetry code in both files (confirmed via a scoped coverage run; the only reported gaps in these two files are pre-existing functions outside this diff, exercised by other test files not included in that scoped run)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=moderate— 0 vulnerabilitiesSafety
UI Evidencesection. — N/A, backend-only change, no visible UI.Notes