Skip to content

chore: drop the KV cache leftovers from tests and docblocks - #219

Merged
Ardnived merged 3 commits into
mainfrom
claude/chore-test-cleanup
Nov 2, 2026
Merged

Ardnived merged 3 commits into
mainfrom
claude/chore-test-cleanup

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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.mjs reports the two production files
comment-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.

  • Site — a meditation page still loads its related carousel
  • Ladle playground — the RelatedContent stories still render

Test results

  • Lean gate: ✓ lint (0 errors), tsc --noEmit, vitest run — 91 files, 921 tests passed
  • Targeted specs: the 5 touched test files are in that run
  • Build: N/A — no build, server entry or Wrangler change

Manual verification

None. No visitor-facing behaviour changes.

Notes for reviewer

  • Scope shifted after the review, so the title is chore: rather than test: — the PR now edits
    two production files, in their docblocks only.
  • Three "KV" mentions stay on purpose: server/sahajcloud-client.ts:682,
    server/sahajcloud-client.test.ts:325 and server/CACHING.md all describe the removed layer as
    history, 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: drop kv: undefined from the
    sahajcloud-context mock. SahajCloudContext has had no kv since 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 that
    said "…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: delete headTags(), exported in ci: GitHub Actions CI with smoke tests against the Cloudflare preview #28 and never called.
  • server/api-routes.ts: the docblock promised getSahajCloudContext() resolves a KV binding. It
    returns { apiKey, baseURL }, and SahajCloudEnv.Bindings is
    { 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-maxage and Cache-Tag through publicReadCacheHeaders
    (src/collections/Lectures/endpoints/relatedMeditations.ts:237), and this Worker holds no
    persistent state at all (server/CACHING.md).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mg9rjXde9tn99Z82seiuKd

…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]>
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 2, 2026
@sydevs-bot

sydevs-bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 00:34Z address-review · attempt 1 · session · done
  • 00:34Z address-review · attempt 1 · session
  • 00:27Z review-pr · attempt 1 · session · done
  • 00:27Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 2, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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 sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 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:19 tells the reader getSahajCloudContext() resolves "the API key and KV binding normally". It resolves { apiKey, baseURL }, and SahajCloudEnv.Bindings carries 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:23 and RelatedContentLoader.tsx:51 call the related-content fetch "KV-cached". It is edge-cached: SahajCloud sets s-maxage and Cache-Tag via publicReadCacheHeaders (src/plugins/cache/cacheHeaders.ts, relatedMeditations.ts:237), and server/CACHING.md says this Worker holds no persistent state.

What was checked

  • headTags has no caller on the branch. Every other preview.ts export is live: getBaseUrl at its line 43, PageResult and SahajCloudSamples in exported signatures. That sweep is complete.
  • No code reads .kv off the context, so dropping kv: undefined makes both mocks match the interface rather than changing behaviour.
  • The retitled tests keep their #98 comments, consistent with the untouched sibling at server/sahajcloud-client.test.ts:325: the name says what, the comment says why. Not a finding.
  • Producer side read in the SahajCloud checkout 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

Comment thread server/api-routes.test.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 2, 2026
`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
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Deploying wemeditate-design with  Cloudflare Pages  Cloudflare Pages

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

View logs

@sydevs-bot sydevs-bot changed the title test: drop leftovers from the KV cache removal and an unused smoke helper chore: drop the KV cache leftovers from tests and docblocks Nov 2, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor

Both review findings adopted. Pushed bac831a..fb7f91b.

  • server/api-routes.ts:19 docblock (thread) — bac831a. Now reads "resolves the API key normally", matching server/sitemap-routes.ts:9.
  • "KV-cached" in RelatedContent.tsx:23 and RelatedContentLoader.tsx:51 — fb7f91b. Both now say edge-cached. Confirmed upstream: relatedMeditations.ts:237 returns publicReadCacheHeaders(req, ['meditations', 'lectures']), which sets s-maxage and Cache-Tag.

Nothing rebutted. comment-fingerprint.mjs reports both commits comment-only — no code hash changed. Three remaining "KV" mentions stay: server/sahajcloud-client.ts:682, server/sahajcloud-client.test.ts:325 and server/CACHING.md all describe the removed layer as history.

Title and body refreshed: the PR now edits production docblocks, so it is chore:, not test:. Lean gate green — lint, tsc --noEmit, 921 tests.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 2, 2026
@sydevs-bot
sydevs-bot enabled auto-merge November 2, 2026 00:42
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 2, 2026
@Ardnived
Ardnived merged commit 38212a4 into main Nov 2, 2026
31 checks passed
@Ardnived
Ardnived deleted the claude/chore-test-cleanup branch November 2, 2026 01:05
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants