[BTAPI-81] Add a feature flag to gate the wealthsimple-api migration cutover #91

Merged
chris merged 10 commits from feature/BTAPI-81 into main 2026-09-13 16:50:04 -06:00
Owner

Ticket

BTAPI-81 — Add a feature flag to gate the wealthsimple-api migration cutover

Summary

  • Adds Config.wealthsimpleApiEnabled (env WS_API_ENABLED, default false), the flag that gates the whole wealthsimple-api migration cutover — the client swap (BTAPI-75), doorbell delegation (BTAPI-76), and status sourcing (BTAPI-77).
  • No behavior of its own: nothing reads the flag yet, so false keeps today's direct-Wealthsimple / local-session path untouched. BTAPI-75/76/77 each add the branch point that consumes it.
  • Documents the flag's lifecycle in server/lib/wealthsimple/CLAUDE.md, including two things a later implementer would otherwise hit blind: the three consumers do not share a network (sync is not on api-shared, so BTAPI-75 carries an infra prerequisite this ticket deliberately does not resolve), and BTAPI-78 retires the flag with the local credentials deleted last so the rollback path survives.
  • Documents WS_API_ENABLED=false in .env.example, with the caveat that flipping it needs the container recreated, not merely restarted — compose resolves env_file at creation.
  • Tests: the code default and the shipped .env.example value are both asserted.

Verification

bun --cwd=./server run verify — type-check, lint, format, format:check all pass; tests 773 passed / 1 skipped / 1 failed. The single failure is lib/wealthsimple/trigger-listener/.test.ts:97 binding port 9998 → EADDRINUSE, which is environmental and pre-existing (reproduced on main with this branch absent; the port is held by the host's stash container at 0.0.0.0:9998->9999/tcp, and the file is 9/9 green with WS_SYNC_TRIGGER_PORT=19998). It does not reproduce in CI.

🤖 Generated with Claude Code

## Ticket BTAPI-81 — Add a feature flag to gate the wealthsimple-api migration cutover ## Summary - Adds `Config.wealthsimpleApiEnabled` (env `WS_API_ENABLED`, default `false`), the flag that gates the whole wealthsimple-api migration cutover — the client swap (BTAPI-75), doorbell delegation (BTAPI-76), and status sourcing (BTAPI-77). - No behavior of its own: nothing reads the flag yet, so `false` keeps today's direct-Wealthsimple / local-session path untouched. BTAPI-75/76/77 each add the branch point that consumes it. - Documents the flag's lifecycle in `server/lib/wealthsimple/CLAUDE.md`, including two things a later implementer would otherwise hit blind: the three consumers do not share a network (`sync` is not on `api-shared`, so BTAPI-75 carries an infra prerequisite this ticket deliberately does not resolve), and BTAPI-78 retires the flag with the local credentials deleted last so the rollback path survives. - Documents `WS_API_ENABLED=false` in `.env.example`, with the caveat that flipping it needs the container **recreated**, not merely restarted — compose resolves `env_file` at creation. - Tests: the code default and the shipped `.env.example` value are both asserted. ## Verification `bun --cwd=./server run verify` — type-check, lint, format, format:check all pass; tests 773 passed / 1 skipped / 1 failed. The single failure is `lib/wealthsimple/trigger-listener/.test.ts:97` binding port 9998 → `EADDRINUSE`, which is environmental and pre-existing (reproduced on `main` with this branch absent; the port is held by the host's `stash` container at `0.0.0.0:9998->9999/tcp`, and the file is 9/9 green with `WS_SYNC_TRIGGER_PORT=19998`). It does not reproduce in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chris merged commit d2222bce8a into main 2026-09-13 16:50:04 -06:00
chris deleted branch feature/BTAPI-81 2026-09-13 16:50:04 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
chris/budget-tracker!91
No description provided.