Skip to content

Refactor web-react: SSE app state + sendCommand (#43)#137

Merged
enricopiovesan merged 1 commit into
mainfrom
cursor/issue-43-sse-app-state
Jul 11, 2026
Merged

Refactor web-react: SSE app state + sendCommand (#43)#137
enricopiovesan merged 1 commit into
mainfrom
cursor/issue-43-sse-app-state

Conversation

@enricopiovesan

Copy link
Copy Markdown
Contributor

Summary

  • Replace useExecution polling with useAppState SSE subscription to /apps/traverse-starter/events
  • Add sendCommand() for POST /apps/{app_id}/commands (059); remove pollExecution
  • Update App to submit via command dispatch and render runtime-owned states (idle / processing / results / error)

Governing Spec

Project Item

Definition of Done

  • useExecution.ts deleted
  • useAppState.ts connects via EventSource and maps event payloads only
  • sendCommand() on traverseClient.ts
  • App.tsx submits via sendCommand, renders from useAppState
  • Unit tests mock SSE events instead of HTTP polling
  • Coverage target updated to hooks/useAppState.ts
  • phase1_smoke.sh unchanged (Phase 1 execute/poll path still valid)

Validation

  • npm test / npm run typecheck / npm run lint in apps/traverse-starter/web-react
  • bash scripts/ci/coverage_gate.sh
  • bash scripts/ci/repository_checks.sh

Architecture boundary

  • UI maps runtime state/output only; no local transition or business-field logic
  • Public HTTP/SSE surface only (no private Traverse internals)

Checklist

  • Issue linked and Project 2 item updated
  • Updated AGENTS.md platform table if this changes platform status (N/A — web already shipped; pattern upgrade only)
  • No business logic added to UI layer
  • CI gates pass locally where applicable

Made with Cursor

Make traverse-starter the reference client for app state subscriptions
(033 SSE + 059 command dispatch) instead of a local poll state machine.

Co-authored-by: Cursor <cursoragent@cursor.com>
@enricopiovesan enricopiovesan enabled auto-merge (squash) July 11, 2026 15:10
@enricopiovesan enricopiovesan merged commit 2e33e8d into main Jul 11, 2026
6 checks passed
@enricopiovesan enricopiovesan deleted the cursor/issue-43-sse-app-state branch July 11, 2026 15:10
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.

Refactor web-react: replace useExecution polling with runtime SSE state subscription

1 participant