Skip to content

refactor(mocks): name the fake SahajCloud for what it is - #467

Merged
Ardnived merged 5 commits into
mainfrom
claude/refactor-mocks-sahajcloud
Nov 25, 2026
Merged

Ardnived merged 5 commits into
mainfrom
claude/refactor-mocks-sahajcloud

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

src/mocks/wire.ts is a fake SahajCloud. "Wire" (as on the network) is not legible, so the module, its fixture export and every identifier that named the backend are renamed for what they are. No behaviour change.

Change outline

  • src/mocks/wire.ts -> src/mocks/sahajcloud.ts
  • src/mocks/wire.test.ts -> src/mocks/sahajcloud.test.ts
  • Export wire -> sahajCloud
  • WIRE_API_KEY -> SAHAJCLOUD_API_KEY, WIRE_EVENT -> SAHAJCLOUD_EVENT, wireEventFeature -> eventFeature, the spec's serveWire -> serveSahajCloud (answerSahajCloud and Json keep their names)
  • WireAnswer is gone: it was exported and read once, in the signature a line below it, so the type is inlined there
  • ⚠ Wire shape in the module header and docs/testing.md's "The fixtures are wire shape" are the other, right sense — the network shape a fetcher parses — and stay
  • Importers updated: playwright.config.ts, tests/browser/*, scripts/serve-embed-review.mjs (comment)
  • Docs updated: AGENTS.md, docs/testing.md (prettier also reflowed a few lines there)

Test results

  • .claude/skills/pr-prep/check.sh: lint, typecheck and the unit lane pass — 191 files, 2408 tests, including the Modal.focus-opener flake an earlier run hit.
  • pnpm test:browser: 10 passed, after the merge.
  • git grep -nE "WIRE_API_KEY|WIRE_EVENT|wireEventFeature|serveWire|WireAnswer|mocks/wire" shows no leftover.

Notes for reviewer

#466 adds src/mocks/wire-demo.ts on top of this module, and it will be renamed sahajcloud-demo.ts when #466 rebases onto this.

🤖 Generated with Claude Code

"wire" (as on the network) was not legible. src/mocks/wire.ts becomes
src/mocks/sahajcloud.ts, its fixture export wire becomes sahajCloud, and the
docs that named it follow. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher

sydevs-dispatcher Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 16:27Z resolve-conflicts · attempt 1 · session · done
  • 16:27Z resolve-conflicts · attempt 1 · session
  • 17:27Z address-review · attempt 1 · session · done
  • 17:27Z address-review · attempt 1 · session
  • 17:16Z review-pr · attempt 1 · session · done

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

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 24, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 24, 2026

@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 rename is right and the PR should exist: wire.ts named a shape, not a thing, while answerSahajCloud beside it already used the real word. Scope is clean: nine files, every one a caller, nothing added. But it stops half way: WIRE_API_KEY, WIRE_EVENT, wireEventFeature, serveWire and the exported WireAnswer all still carry the word. The ⚠ Wire shape header and docs/testing.md's heading are the other, legitimate sense, and were right to stay.

The outline's "prettier also reflowed a few lines" is 52 of 118 changed lines, 44 in docs/testing.md. Not this PR's fault — prettier/prettier is scoped to **/*.{js,jsx,ts,tsx} (eslint.config.js:56), so no gate has ever checked Markdown and main has drifted. Filed separately.

Findings

  • should-fix src/mocks/sahajcloud.ts:116 — four identifiers still carry wire as the module name. Replacements in the thread.
  • should-fix src/mocks/sahajcloud.ts:207 — WireAnswer is an exported alias with one reader a line below. Streamline: inline it.

What was checked

Read whole on the branch: sahajcloud.ts (230 lines), its spec, playwright.config.ts, tests/browser/fixtures.ts, both browser specs, eslint.config.js.

git grep mocks/wire is empty, so the no-leftover claim holds; git grep -i wire leaves only the shape sense and the five names above. Both titles in registration.spec.ts match main and read as a pair. Every path the body names exists on the branch. No ## Preview link, and .claude/workflow.json on main declares no previewUrl or fixture.

Contracts: contractSync's consumer paths and docs/embedding.md are untouched; the module is test-only.

Streamliner: 1 piece, 1 kept — sahajCloud earns it, since answerSahajCloud routes to it and three specs read it. No dependency added, no question threads.

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


Generated by Claude Code

Comment thread src/mocks/sahajcloud.ts Resolved
Comment thread src/mocks/sahajcloud.ts Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 24, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 24, 2026
The module and its fixture export were renamed, but four names still called the
fake backend "wire": WIRE_API_KEY, WIRE_EVENT, wireEventFeature and the spec's
serveWire. So playwright.config.ts imported WIRE_API_KEY from sahajcloud.

The header's "⚠ Wire shape" and docs/testing.md's "The fixtures are wire shape"
are the other, right sense — the network shape a fetcher parses — and stay.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYYwfAJAz63CzUU8A6
WireAnswer was exported and read once, in the signature a line below it.
Nothing outside the file imported it, and it carried the word the rename
retires.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYYwfAJAz63CzUU8A6
@sydevs-bot

Copy link
Copy Markdown
Contributor

Both critic threads adopted. Branch was already current with main, so no merge.

Body refreshed: the outline claimed WIRE_EVENT and WIRE_API_KEY kept their names.

Gates: lint, typecheck and the unit lane pass (189 files, 2372 tests — the Modal.focus-opener flake included). pnpm test:browser: 9 passed. Docs checked, nothing else stale. No security-review path in the diff.

🤖 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 24, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 24, 2026

@sydevs-dispatcher sydevs-dispatcher 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.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 24, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 24, 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 Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design e6d415b Nov 25 2026, 04:36 PM

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 25, 2026
#476 rewrote tests/browser/navigation.spec.ts: Cambridgeshire now holds one
class, so the drill-down is two steps and dismissal is the sheet's own Back
button inside the dialog. This branch only renamed the fixture module there.

Resolved to main's scenarios with the rename applied: main's three tests and
its `backTo` helper, reading `SAHAJCLOUD_EVENT` from `src/mocks/sahajcloud`.
`CITY` and the ancestor-strip assertions are gone because main removed the
levels they addressed, not because this branch dropped them.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWhWJBM1ssxxhXKQyW
#476 replaced the X with the sheet's own Back, dropped the Cambridge level
and added a third navigation scenario, leaving the table describing two
scenarios under names no spec carries and omitting the third.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWhWJBM1ssxxhXKQyW
@sydevs-bot

Copy link
Copy Markdown
Contributor

Merged main in. The one conflicted file was tests/browser/navigation.spec.ts, in three hunks, all the same collision: #476 rewrote the scenarios there while this branch only renamed the fixture module in them.

Every hunk took main's scenarios with the rename applied. CITY and the ancestor-strip assertions are gone because #476 removed the Cambridge level and the strips, not because this branch dropped them.

Joined one docs fix: docs/testing.md's browser-lane table named two navigation scenarios after the X #476 replaced with Back, and omitted the third it added.

Lean gate green — 191 files, 2408 tests. pnpm test:browser: 10 passed.

🤖 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 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 25, 2026
@Ardnived
Ardnived merged commit 86845b6 into main Nov 25, 2026
22 checks passed
@Ardnived
Ardnived deleted the claude/refactor-mocks-sahajcloud branch November 25, 2026 17:02
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 25, 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