Repository navigation
chore: drop the KV cache leftovers from tests and docblocks - #219
Conversation
…lper - `kv: undefined` in two sahajcloud-context mocks: the context lost its kv field in #107, so the mocks described a shape that no longer exists. - Three retry tests titled "…since the KV layer used to supply that": the KV layer is gone, so the titles now state only the behaviour. - `headTags()` in the smoke preview helper: exported in #28 and never called. The audit found no migration-era test files left; #87, #99 and #107 already removed them with their code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | fb7f91b | Commit Preview URL Branch Preview URL |
Nov 02 2026, 12:39 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | fb7f91b | Commit Preview URL Branch Preview URL |
Nov 02 2026, 12:40 AM |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is smaller than its problem and adds no file, function, type or dependency, so there is no new layer to justify. Scope matches the body: four mock and title edits, one dead export. The one real gap is reach: the sweep stopped at server/**.test.ts and left the same dead KV vocabulary in production source, where a reader meets it first.
Findings
should-fix—server/api-routes.ts:19tells the readergetSahajCloudContext()resolves "the API key and KV binding normally". It resolves{ apiKey, baseURL }, andSahajCloudEnv.Bindingscarries no KV. This PR deletes that same field from the file's own test mock, so the false claim is this PR's leftover. See the inline thread.should-fix—components/organisms/RelatedContent/RelatedContent.tsx:23andRelatedContentLoader.tsx:51call the related-content fetch "KV-cached". It is edge-cached: SahajCloud setss-maxageandCache-TagviapublicReadCacheHeaders(src/plugins/cache/cacheHeaders.ts,relatedMeditations.ts:237), andserver/CACHING.mdsays this Worker holds no persistent state.
What was checked
headTagshas no caller on the branch. Every otherpreview.tsexport is live:getBaseUrlat its line 43,PageResultandSahajCloudSamplesin exported signatures. That sweep is complete.- No code reads
.kvoff the context, so droppingkv: undefinedmakes both mocks match the interface rather than changing behaviour. - The retitled tests keep their
#98comments, consistent with the untouched sibling atserver/sahajcloud-client.test.ts:325: the name says what, the comment says why. Not a finding. - Producer side read in the
SahajCloudcheckout for the cache claim. CI green: Lint/Typecheck/Unit, Smoke (web), Smoke (ladle). Reviewer profile applied.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`getSahajCloudContext()` returns `{ apiKey, baseURL }`, and
`SahajCloudEnv.Bindings` carries no KV namespace — the binding went with
`server/kv-cache.ts` in #98. The docblock still promised a reader that the
helper resolves one, which is the same leftover this PR deletes from the
file's own test mock. Wording now matches `sitemap-routes.ts`.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXde9tn99Z82seiuKd
Nothing in this Worker holds persistent state (server/CACHING.md). The related endpoints are cached by the Cloudflare zone in front of SahajCloud, which sets `s-maxage` and `Cache-Tag` through `publicReadCacheHeaders`. The KV namespace these docblocks named went away in #98, so "KV-cached" pointed a reader at a cache they could neither inspect nor purge. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXde9tn99Z82seiuKd
Deploying wemeditate-design with
|
| Latest commit: |
fb7f91b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://42b4f9a9.wm-design.pages.dev |
| Branch Preview URL: | https://claude-chore-test-cleanup.wm-design.pages.dev |
|
Both review findings adopted. Pushed
Nothing rebutted. Title and body refreshed: the PR now edits production docblocks, so it is 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
Change outline
No shape changed. Every edit is a test file or a comment — no function, type, contract, component
or file responsibility moved, and
comment-fingerprint.mjsreports the two production filescomment-only (
3 codeHash identical). The diff is its own map.Preview
Nothing renders differently: the production edits are docblock text. The branch aliases are here
so the reviewer can confirm that, not to show a change.
RelatedContentstories still renderTest results
tsc --noEmit,vitest run— 91 files, 921 tests passedManual verification
None. No visitor-facing behaviour changes.
Notes for reviewer
chore:rather thantest:— the PR now editstwo production files, in their docblocks only.
server/sahajcloud-client.ts:682,server/sahajcloud-client.test.ts:325andserver/CACHING.mdall describe the removed layer ashistory, which is still true and worth keeping.
Detail
Audit finding: no test file here is dead. The migration-era tests already went with their
code: KV cache (#107), the payload#14495 shim (#87), preview-route merging (#99). Every test
import resolves, nothing is skipped, and every module under test is used in production.
File by file:
server/api-routes.test.ts,server/payload-client.test.ts: dropkv: undefinedfrom thesahajcloud-contextmock.SahajCloudContexthas had nokvsince refactor(server): delete the KV read-through cache and its binding #107.server/atlas-client.test.ts,server/sitemap-routes.test.ts: retitle three retry tests thatsaid "…since the KV layer used to supply that". The behaviour they test is live. Only the
history in the title was stale.
tests/smoke/_helpers/preview.ts: deleteheadTags(), exported in ci: GitHub Actions CI with smoke tests against the Cloudflare preview #28 and never called.server/api-routes.ts: the docblock promisedgetSahajCloudContext()resolves a KV binding. Itreturns
{ apiKey, baseURL }, andSahajCloudEnv.Bindingsis{ SAHAJCLOUD_API_KEY?, SENTRY_DSN? }.components/organisms/RelatedContent/RelatedContent.tsx,components/organisms/RelatedContent/RelatedContentLoader.tsx: the related fetch is edge-cached,not KV-cached. SahajCloud sets
s-maxageandCache-TagthroughpublicReadCacheHeaders(
src/collections/Lectures/endpoints/relatedMeditations.ts:237), and this Worker holds nopersistent state at all (
server/CACHING.md).🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjXde9tn99Z82seiuKd