refactor(services): rename burden-forecast loader to reflect cache-only behavior (#8019) - #8034
Conversation
…ly behavior (JSONbored#8019) loadOrComputeBurdenForecastResponse only ever returns a stored snapshot or null — the inline compute fallback was removed in JSONbored#906 (moved to the background buildBurdenForecasts job) but the name, the unreachable 'computed' source type variant, and the docs were left behind. Rename to loadCachedBurdenForecastResponse across all call sites, drop the dead 'computed' variant from BurdenForecastResponse.source (the code only ever sets 'snapshot'), and document the real snapshot-or-null behavior.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-22 14:29:03 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
src/services/burden-forecast.ts'sloadOrComputeBurdenForecastResponseis named "load-or-compute" and its return type declaredsource: "snapshot" | "computed", but the body only ever returns a stored snapshot (source: "snapshot") ornull— there is no compute path. Commitf850d7a5b("#906") deleted the inlinebuildBurdenForecast(...)fallback and moved it to the backgroundbuildBurdenForecastsjob (src/queue/processors.ts), but left the name, the unreachable"computed"type variant, and the docs behind.src/mcp/server.ts's handler summary already says "no cached burden forecast" for the null case, confirming the cache-only reality.Changes
loadOrComputeBurdenForecastResponse→loadCachedBurdenForecastResponseat every call site (src/mcp/server.ts,src/api/routes.ts, the definition, and the unit test)."computed"variant fromBurdenForecastResponse.source— the loader only ever sets"snapshot"(line 28). No consumer branches on a burden-forecast.source(the tworesponse.source === "snapshot"checks inmcp/server.tsbelong to the issue-quality and repo-outcome-patterns handlers, not this one;routes.tsonly passes the value through), so narrowing creates no dead branch.buildBurdenForecastsfor how the cache is populated.Scope
wantedPaths(src/**,test/**); noblockedPathsValidation
npx vitest run test/unit/burden-forecast.test.ts— 14/14 pass (the suite already assertssource: "snapshot", which now also pins the narrowed type)burden-forecast.ts100% lines + 100% branches; both renamed call sites are covered in CI bytest/integration/api.test.ts(in-processtools/callforloopover_get_burden_forecast+ the/v1/repos/:owner/:repo/intelligenceroute)typecheckclean on changed files (only the 2 pre-existing localsemverTS7016s remain) — the type-narrow ripples to no other typegit diff --checkcleanSafety
source: "computed"literals (a PR-reviewability report, a repo-status object) are on different types and are untouchedCloses #8019