Skip to content

feat(push-channels): WebSocket/SSE as data sources (7.3, C8)#62

Merged
officialCodeWork merged 1 commit into
developmentfrom
build/phase-7/step-7.3-push-channels
Jul 17, 2026
Merged

feat(push-channels): WebSocket/SSE as data sources (7.3, C8)#62
officialCodeWork merged 1 commit into
developmentfrom
build/phase-7/step-7.3-push-channels

Conversation

@officialCodeWork

Copy link
Copy Markdown
Owner

Phase 7.3 — Push channels (failure mode C8)

Server-push data arrives over a long-lived connection, not a request/response fetch. This recognizes new WebSocket(url) and new EventSource(url) as data sources so a component fed by a live channel shows it in its lineage.

Changes

  • New sse DataSourceKind (schema regenerated, drift gate green) — honest for EventSource; websocket stays for WebSocket.
  • New pushchannels.ts: detectPushChannel matches a new WebSocket(...) / new EventSource(...) expression by constructor name (allowing a window./self. qualifier — a very low false-positive set) and resolves the URL through the existing resolveEndpoint (constant-folded, :param-normalized).
  • extractBodyFacts gains a NewExpression pass that emits the data-source node + fetches-from edge, mirroring the fetch path (skipped inside API wrappers). Transport is carried in method (WS/SSE).

Fixture & tests

  • c8-push-channels: a WebSocket (wss://chat.example.com/socket) and an SSE channel (/api/notifications/stream) → one websocket and one sse source, each with a fetches-from edge.
  • 4 unit tests (WS source · SSE source · edges · no stray sources).

Verification

  • pnpm eval332 pass · determinism 1.000 · all metrics 1.000
  • parser-react 164 tests; schema drift gate green; full suite, typecheck, lint clean.

socket.io deferred — io() needs import-aware detection to avoid false positives on the common io identifier. Tracker updated.

🤖 Generated with Claude Code

Server-push channels are long-lived data sources, not request/response fetches.

- New `sse` DataSourceKind (schema regenerated); new pushchannels.ts:
  detectPushChannel matches `new WebSocket(url)` / `new EventSource(url)` by
  constructor name (allowing a window./self. qualifier — low false-positive
  set) and resolves the URL through the existing resolveEndpoint.
- extractBodyFacts gains a NewExpression pass emitting the data-source node +
  fetches-from edge, mirroring the fetch path (skipped inside API wrappers).
  websocket for WebSocket, sse for EventSource; transport in method (WS/SSE).
- New fixture c8-push-channels (WebSocket wss:// + SSE /api/.../stream); 4 unit
  tests.

eval 332/0/0/0, determinism 1.000, all metrics 1.000; parser-react 164 tests,
schema drift gate green, typecheck + lint clean. socket.io deferred (needs
import-aware detection).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@officialCodeWork
officialCodeWork merged commit dbc270c into development Jul 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants