Summary
CollectionsView.vue re-runs the full pipeline — space fan-out (useRecentFiles), per-file excerpt fetch, and LLM clustering (useCollections) — from scratch on every mount (onMounted(loadAndCluster)). There is no caching of the resulting recentFiles/collections, so navigating away from the Collections view and back pays the full IO + LLM cost again.
This is in contrast to the session consent flag (useConsent.ts), which is cached at module scope for the lifetime of the SPA session.
Proposal
Cache the last successful recentFiles/collections result at module scope (or in a small composable), consulted on mount to skip the fan-out/LLM call when a cache is warm, with an explicit "Refresh" action in the UI to invalidate it and re-fetch.
Context
Raised in the automated review on #498 (verdict: "Commenting", non-blocking) as a real but non-correctness/non-security inefficiency. Deferred out of that PR as a follow-up; the other eight findings from that review (prompt injection, batch-failure data loss, masked outage, consent-gating test coverage, dependency drift, stray .gitignore entries, placeholder description, and the inefficient excerpt fetch) were addressed directly in #498.
Summary
CollectionsView.vuere-runs the full pipeline — space fan-out (useRecentFiles), per-file excerpt fetch, and LLM clustering (useCollections) — from scratch on every mount (onMounted(loadAndCluster)). There is no caching of the resultingrecentFiles/collections, so navigating away from the Collections view and back pays the full IO + LLM cost again.This is in contrast to the session consent flag (
useConsent.ts), which is cached at module scope for the lifetime of the SPA session.Proposal
Cache the last successful
recentFiles/collectionsresult at module scope (or in a small composable), consulted on mount to skip the fan-out/LLM call when a cache is warm, with an explicit "Refresh" action in the UI to invalidate it and re-fetch.Context
Raised in the automated review on #498 (verdict: "Commenting", non-blocking) as a real but non-correctness/non-security inefficiency. Deferred out of that PR as a follow-up; the other eight findings from that review (prompt injection, batch-failure data loss, masked outage, consent-gating test coverage, dependency drift, stray
.gitignoreentries, placeholderdescription, and the inefficient excerpt fetch) were addressed directly in #498.