Skip to content

refactor(sdk)!: remove WebSockets + consolidate tooling/coverage - #190

Merged
EricAndrechek merged 16 commits into
mainfrom
sdk-updates
Jun 2, 2026
Merged

refactor(sdk)!: remove WebSockets + consolidate tooling/coverage#190
EricAndrechek merged 16 commits into
mainfrom
sdk-updates

Conversation

@EricAndrechek

@EricAndrechek EricAndrechek commented May 27, 2026

Copy link
Copy Markdown
Member

Summary

Foundation pass for the SDK/API: removes dead transport code, consolidates build/test tooling, and turns on coverage enforcement — the groundwork the feature work builds on. This PR is intentionally scoped to cleanup/infra only. The features originally planned here have been split into focused, one-PR-each sub-issues tracked under the epic #194.

What's in this PR

  • Kill WebSocket support entirely — SSE becomes the single streaming transport. Removes ws.ts, ws-manager.ts, stream_ws.go; renames stream_sse.gostream.go. (One transport is simpler to focus on, and SSE tends to work more consistently through corporate networks where WS may be blocked.) ⚠️ Breaking for any consumer on the WS transport.
  • pnpm workspace consolidation — single root pnpm-workspace.yaml + lockfile (shadows stray ancestor workspace files); drops the per-project lockfiles under clients/ts, docs, tests/e2e/sdk.
  • Root Makefile consolidation — one top-level Makefile (no more per-subproject docs/Makefile) with a first-class SDK target.
  • biome for TS lint + format (biome.json) plus a repo-wide format pass.
  • Test coverage enforcement.testcoverage.yml, scripts/cov, vitest config, e2e fixtures moved to tests/e2e/fixtures. Closes chore(coverage): restore SDK statements coverage threshold to ≥50 #176.
  • Re-enable the SSE public-events streaming test. Closes test(sdk): re-enable or delete the disabled SSE-public-events streaming test #153.
  • Remove the clients/ts/playground/ scratch dir and stale PLAN.md; add editor configs (.vscode, .zed, .editorconfig).

~50% of the diff is generated lockfile churn; most of the rest is deletions and a mechanical biome reformat. The hand-written surface is small.

Feature work — moved out, tracked in #194

Split into individually-reviewable PRs so this doesn't become a mega-PR:

NDJSON upload (#195) · bounded parallel uploads (#196) · live DLQ streaming (#197) · better TS errors (#198) · builder/command restructure (#199) · cache HIT/MISS + debug internals (#200) · exported error types (#201) · auto dedupe ID (#202) · SSE auth → Fetch EventSource (#203) · live-vs-replay (#98) · multi-subscription SSE replay (#204)

Related Issues

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Consolidates SSE/WS into a single StreamHandler, removes the websocket handler and WS transport from the SDK, consolidates routing to GET /v1/stream, updates tests and E2E fixtures/orchestrator, and applies supporting tooling/config and docs changes.

Changes

Stream handler migration and routing

Layer / File(s) Summary
StreamHandler implementation and routing
internal/api/stream.go, internal/api/router.go
Introduce StreamHandler, move replay/policy helpers to it, add multiplexing TODO, and change /v1/stream route to use StreamHandler.Handle; update Dependencies and tracing skip comment.
Router tests dependency wiring
internal/api/router_test.go
Update router-focused tests to construct NewStreamHandler(...) instead of NewSSEHandler(...) across multiple testcases.
Remove WS handler and update unit tests
internal/api/stream_ws.go (removed), internal/api/stream_test.go
Remove websocket-specific code and its WS unit test; update stream unit tests to use StreamHandler and path /v1/stream.
Binary and integration wiring
cmd/wavehouse/main.go, tests/integration/setup_test.go
Create and wire StreamHandler in the main binary, assign shared PolicyStore, and update integration test server wiring to drop WS and use NewStreamHandler(...).

Client/SDK transport and tests

Layer / File(s) Summary
TS client runtime and SSE transport
clients/ts/src/client.ts, clients/ts/src/stream/sse.ts
Remove WebSocket manager/imports, add EventSource availability guard and updated error text, and change SSE EventSource URL to /v1/stream.
Public API types and exports
clients/ts/src/index.ts, clients/ts/src/types.ts
Remove SharedWSManager re-export and remove transport from ClientConfig/StreamOptions.
TS tests and coverage
clients/ts/src/stream/controller.test.ts, clients/ts/vitest.config.ts
Adjust stream controller tests to new error semantics and update Vitest coverage excludes to only test files.

E2E, orchestrator, playground, and fixtures

Layer / File(s) Summary
E2E streaming tests
tests/e2e/sdk/streaming.test.ts
Re-enable/refactor SSE E2E tests to call stream() without explicit transport and ensure try/finally teardown with optional unsub and stream.close().
Orchestrator and fixtures
scripts/orchestrator/main.go, tests/e2e/fixtures/config.yaml
Orchestrator runs WaveHouse from repo root using WH_CONFIG YAML; add e2e fixture config.yaml with CORS, MQ, dedupe, JWT, schema refresh, DLQ, policy file, and OTel settings.
Playground and compose removals
clients/ts/playground/*, tests/e2e/compose.yaml
Remove playground example scripts and compose artifacts used by SDK examples.

Tooling and module changes

Layer / File(s) Summary
Makefile and golangci-lint
Makefile
Add --allow-parallel-runners to golangci-lint run in lint and fix targets.
go.mod
go.mod
Remove github.com/coder/websocket requirement.
Test coverage thresholds
.testcoverage.yml
Raise per-suite minima for unit, integration, and e2e thresholds.

Docs and marketing

Layer / File(s) Summary
API and SDK docs
docs/src/content/docs/api.md, docs/src/content/docs/sdk.md
Document GET /v1/stream and ?token= behavior (header precedence, stripping), remove WebSocket upgrade caveat, and remove transport option from SDK docs.
Architecture and marketing pages
docs/src/content/docs/architecture.md, docs/src/content/docs/why-wavehouse.md, README.md, AGENTS.md
Remove WebSocket references from architecture/diagrams and marketing text; change diagrams and examples to the consolidated SSE /v1/stream route.

🎯 4 (Complex) | ⏱️ ~45 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request initiates a series of large-scale improvements to the SDK and API, focusing on developer experience, type safety, and error handling. The current changes focus on optimizing the development environment and restoring test coverage for core streaming features, setting the stage for broader architectural updates.

Highlights

  • CI/CD Optimization: Updated the Makefile to enable parallel runners for golangci-lint, improving the efficiency of linting tasks.
  • Test Coverage: Re-enabled skipped end-to-end tests for SSE and WebSocket streaming functionality in the SDK.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added area/sdk TypeScript SDK (clients/ts/) area/infra CI, build, deploy, Docker, release labels May 27, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request configures golangci-lint to allow parallel runners in the Makefile and re-enables previously skipped end-to-end tests for SSE and WebSocket streaming. The review feedback correctly identifies that these newly enabled tests do not clean up their streams and subscriptions if an assertion fails or a timeout occurs. It is recommended to wrap the test logic in try...finally blocks to guarantee proper resource cleanup and prevent connection leaks.

Comment thread tests/e2e/sdk/streaming.test.ts
Comment thread tests/e2e/sdk/streaming.test.ts Outdated
@EricAndrechek EricAndrechek moved this from Backlog to In progress in WaveHouse Task Board May 27, 2026
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file go Pull requests that update go code area/api HTTP handlers, routing, middleware labels May 27, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation area/ingest Ingest pipeline (Bento, batching, DLQ) area/docs Documentation, site/, README labels May 28, 2026
@coderabbitai coderabbitai Bot removed documentation Improvements or additions to documentation area/ingest Ingest pipeline (Bento, batching, DLQ) area/docs Documentation, site/, README labels May 28, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code area/ingest Ingest pipeline (Bento, batching, DLQ) area/docs Documentation, site/, README labels Jun 2, 2026
@EricAndrechek EricAndrechek changed the title feat(sdk): overdue sdk cleanup and updates refactor(sdk)!: remove WebSockets + consolidate tooling/coverage (foundation for #194) Jun 2, 2026
@EricAndrechek EricAndrechek changed the title refactor(sdk)!: remove WebSockets + consolidate tooling/coverage (foundation for #194) refactor(sdk)!: remove WebSockets + consolidate tooling/coverage (foundation for #194)fdsf Jun 2, 2026
@EricAndrechek EricAndrechek changed the title refactor(sdk)!: remove WebSockets + consolidate tooling/coverage (foundation for #194)fdsf refactor(sdk)!: remove WebSockets + consolidate tooling/coverage Jun 2, 2026
@EricAndrechek
EricAndrechek marked this pull request as ready for review June 2, 2026 16:17
@EricAndrechek
EricAndrechek requested a review from taitelee June 2, 2026 16:17
@EricAndrechek EricAndrechek moved this from In progress to Ready in WaveHouse Task Board Jun 2, 2026
EricAndrechek and others added 4 commits June 2, 2026 12:53
- README: streaming example route /v1/stream/sse -> /v1/stream
- sse.ts: fix stale "auth token for upgrade" comment (SSE has no upgrade)
- CHANGELOG: stop the forward-looking Unreleased entries from advertising
  the now-removed WS transport; add entries for biome, coverage
  enforcement, WS removal, pnpm + Makefile consolidation, node engines
- package.json x4: engines.node normalized to >=22; drop redundant
  packageManager from docs/package.json

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
main's #205 access-control guide documented the pre-removal /v1/stream/sse +
/v1/stream/ws routes and "WebSocket subscribers". This branch removes WS and
collapses the streaming route to /v1/stream, so reconcile the merged-in guide.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- ci(setup-env): read node-version-file: .nvmrc instead of a hardcoded "22"
  so the Node version has one source of truth (bump = edit .nvmrc only).
- build(pnpm): engineStrict: true in pnpm-workspace.yaml so `pnpm install`
  errors (not just warns) when the active Node doesn't satisfy engines.node
  (>=22 in every package.json). pnpm 11 honors engineStrict here, not in
  .npmrc (verified by forcing a mismatch).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@taitelee taitelee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed go file modifications and doc edits related to removing websocket support. Looks good. There does not seem to be dangling/outdated references to it.

@github-project-automation github-project-automation Bot moved this from Ready to In progress in WaveHouse Task Board Jun 2, 2026
@EricAndrechek
EricAndrechek enabled auto-merge (squash) June 2, 2026 17:57
@EricAndrechek
EricAndrechek merged commit a4d72c1 into main Jun 2, 2026
6 of 9 checks passed
@EricAndrechek
EricAndrechek deleted the sdk-updates branch June 2, 2026 18:11
@github-project-automation github-project-automation Bot moved this from In progress to Done in WaveHouse Task Board Jun 2, 2026
EricAndrechek added a commit that referenced this pull request Jun 9, 2026
## Why

Prep for flipping the repo public: the `wave-rf-runners` ARC pool must
never serve a public repo (GitHub's hard rule on self-hosted + public),
and GitHub-hosted standard runners are free for public repos — with
public `ubuntu-latest` being the 4-core/16 GB tier. Reverses the #77
calculus, exactly as planned in the public-launch gates.

## What

1. **`runs-on: [wave-rf-runners]` → `ubuntu-latest`** — all 11 jobs
across all 10 workflows.
2. **`docker/setup-buildx-action` in `publish-dev.yml` + `release.yml`**
(`d7f5e7f` = v4.1.0, SHA verified against upstream): `dockers_v2` builds
the `linux/amd64+arm64` manifest via buildx, and the hosted default
docker driver can't do multi-platform — the runner-pod `BUILDX_BUILDER`
(remote BuildKit VM) used to provide this. No QEMU needed:
`Dockerfile.goreleaser` stages are `$BUILDPLATFORM`-pinned / COPY-only
by design. `goreleaser-validate.yml` correctly stays buildx-free (`build
--single-target` never touches `dockers_v2`).
3. **Cache-key fix**: the pnpm/Playwright/Astro keys hashed
`clients/ts/`, `tests/e2e/sdk/`, `docs/` lockfiles — paths deleted in
the #190 root-workspace consolidation — so `hashFiles()` was empty and
the keys degenerated to constants that never invalidated. Now keyed on
the root `pnpm-lock.yaml`. Old degenerate entries stay reachable via
unchanged `restore-keys`, so the first run warm-starts and re-saves
under the correct key.

No falcondev cache-server or registry-proxy references existed in any
workflow (the redirects were runner-pod env) — `actions/cache` falls
back to GitHub's backend transparently. Footprint ~2–3 GB vs the 10
GB/repo cap.

## Verification

- `make ci` green locally (full pipeline incl. integration + e2e)
- pre-push reviewer: ship_it, zero findings; docs review skipped on the
record (workflows-only diff)
- actionlint: clean for this diff (5 pre-existing info-level shellcheck
nits on untouched lines)
- repo-wide grep: zero remaining `wave-rf-runners` / `self-hosted` /
`BUILDX_BUILDER` references

## Watch-items (post-merge)

- **First multi-arch publish on main**: the buildx push path gets its
first real exercise on the post-merge `publish-dev.yml` run — watch it.
(A pre-merge dispatch from this branch would clobber the rolling `:dev`
tag, so deliberately not done.)
- **Docker Hub pulls**: test suites pull
`clickhouse/clickhouse-server:latest` unauthenticated; hosted runners
share egress IPs, so rate-limit flakes become *possible*. If they
appear: GHCR mirror or registry login.
- **Until the flip**, this repo is private → runs use the 2-core tier
and bill against org included minutes; the `ci.yml` 4-core comment
describes the post-flip state. Well inside the 45-min cap either way.
- **Open PRs** still carry workflow files targeting the old pool — each
needs a merge-from-main after this lands (`@dependabot rebase` for the
bot ones), same dynamic as #77.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
EricAndrechek added a commit that referenced this pull request Jun 11, 2026
## Problem

Every Dependabot **npm** PR has been failing CI since the #190
root-lockfile consolidation — e.g. #211 (`@vitest/coverage-v8` in
`tests/e2e/sdk`) and #337 (the `docs` group). They fail fast on
Lint/Unit/E2E/Coverage and **a rebase never fixes them**.

Root cause is the Dependabot config, not the dependencies. The repo is a
pnpm workspace with a **single root `pnpm-lock.yaml`**, but
`.github/dependabot.yml` pointed its three npm entries at the *member*
directories (`directory: /docs`, `/clients/ts`, `/tests/e2e/sdk`).
Dependabot only updates a lockfile co-located with the manifest it
targets, so it edited the member `package.json` but **left the root
lockfile untouched**. CI then runs `pnpm install --frozen-lockfile`, the
lockfile's recorded specifier no longer matches `package.json`, and it
aborts with `ERR_PNPM_OUTDATED_LOCKFILE`. A rebase only replays the same
`package.json`-only change onto fresh `main` — it never regenerates the
lockfile, so the mismatch returns every run. (#337, created well after
#190, fails identically — confirming it's structural, not a stale
branch.)

## Fix

Replace the three per-member npm entries with **one entry at the
workspace root** (`directory: /`, group `npm-deps`, prefix `deps`). At
the root, Dependabot reads `pnpm-workspace.yaml`, walks every member,
and updates the single root lockfile inside the PR. As a bonus it now
also covers the root `package.json`'s own devDeps (biome, markdownlint,
nyc), which the per-member configs never did.

**Trade-off:** one combined weekly npm PR with a single `deps:` prefix,
instead of three per-area PRs (`docs:` / `deps(sdk):` / `deps(tests):`).
This matches the existing grouped `go-deps` / `actions-deps` configs and
the team's stated preference for fewer Monday PRs.

## Docs sync

- `docs/src/content/docs/development.md` — Dependabot section: five
configs → three, plus the root-lockfile rationale.
- `SECURITY.md` — supply-chain line: "three npm workspaces" → one root
npm config.
- `CHANGELOG.md` — `[Unreleased] → Changed` entry.

## Note (out of scope)

`pnpm-workspace.yaml` sets `minimumReleaseAge: 10080` (7-day cooldown),
which Dependabot doesn't honor. When the new config regenerates
lockfiles, a dep released <7 days ago can be held by the cooldown at
install time — so a freshly-cut bump may need a few days before it
merges cleanly. Pre-existing; the no-auto-merge + admin-review gate
covers it.

## Follow-up on the broken PRs

Once this merges, the old per-member configs no longer exist, so #211
and #337 should be **closed** (not rebased — rebasing keeps the old
member-directory branch and reproduces the failure). The new root config
regenerates correct combined PRs on the next Dependabot run.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api HTTP handlers, routing, middleware area/docs Documentation, site/, README area/infra CI, build, deploy, Docker, release area/ingest Ingest pipeline (Bento, batching, DLQ) area/sdk TypeScript SDK (clients/ts/) dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code go Pull requests that update go code

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

chore(coverage): restore SDK statements coverage threshold to ≥50 test(sdk): re-enable or delete the disabled SSE-public-events streaming test

2 participants