perf: extend author trust cache#94
Merged
Merged
Conversation
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_cb0ca65f-9071-4fbd-8af8-23d1497ef9ad) |
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
Test Plan
npm exec --workspace @agentvouch/web vitest run __tests__/api/author-route.test.tsnpm exec --workspace @agentvouch/web -- prettier --check lib/cachePolicy.ts lib/baseAuthorTrust.ts __tests__/api/author-route.test.tsgit diff --checkNotes
npm run typecheck --workspace @agentvouch/webstill fails inapp/layout.tsxon an existing missing module declaration for@vercel/speed-insights/next.Note
Low Risk
Caching-only changes with no auth or trust computation logic; slightly staler author trust at the edge and in-process until TTLs expire.
Overview
Public author trust responses are cached longer at the edge:
PUBLIC_ROUTE_CACHE_SECONDS.authorTrustmoves from 30s to 60s, so routes likeGET /api/author/[pubkey]emitCache-Controlwiths-maxage=60(covered by a new assertion inauthor-route.test.ts).Base author trust (
baseAuthorTrust.ts) no longer hardcodes a 30s in-memory TTL; it readsIN_MEMORY_CACHE_TTL_MS.authorTrustfromcachePolicy.ts, keeping server-side caching aligned with the shared policy as those values evolve.Reviewed by Cursor Bugbot for commit c158663. Bugbot is set up for automated code reviews on this repo. Configure here.