34 Commits

Author SHA1 Message Date
Mauricio Barragan b7e5396690 Merge pull request #29 from mauricioabh/fix/vps-deploy-ssh
fix(deploy): use ssh-agent for VPS Deploy SSH key
2026-07-19 12:59:08 -06:00
Mauricio Barragan 5f8da3487f fix(deploy): use ssh-agent for VPS Deploy SSH key
printf of VPS_SSH_KEY produced a corrupted private key on the runner
(libcrypto error). Switch to webfactory/ssh-agent which handles multiline
OpenSSH keys reliably.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-19 12:52:35 -06:00
Mauricio Barragan 71c45dca9a chore(deploy): force Actions push event to register VPS Deploy
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-19 12:49:56 -06:00
Mauricio Barragan 2ca2e25b23 Merge pull request #28 from mauricioabh/chore/trigger-vps-deploy
chore(deploy): trigger VPS Deploy workflow registration
2026-07-19 12:45:50 -06:00
Mauricio Barragan bbe4188119 chore(deploy): trigger VPS Deploy workflow registration after PR #27
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-19 12:43:59 -06:00
Mauricio Barragan 407005b507 Merge pull request #27 from mauricioabh/dev
feat(deploy): automatic VPS deploy via GHCR on push to main
2026-07-19 12:28:50 -06:00
Mauricio Barragan f6108d8f8f feat(deploy): automatic VPS deploy via GHCR on push to main
Build the Docker image in GitHub Actions, publish to
ghcr.io/mauricioabh/arbpulse (latest + sha tags), then SSH into the
Hetzner VPS to docker compose pull + up -d with a health-check gate.
The VPS no longer builds images, keeping CPU/RAM free for the running
apps and making rollbacks a matter of pulling a previous sha tag.

- .github/workflows/vps-deploy.yml: build-push (GHCR) + deploy (SSH) jobs
- deploy/docker-compose.yml: app image now ghcr.io/mauricioabh/arbpulse
- deploy/deploy.sh: pulls from GHCR by default (BUILD=1 for local build),
  default APP_DIR aligned to /root/projects/arbpulse
- docs: deploy/README.md CI/CD section + paths, README deploy section

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-19 12:23:49 -06:00
Mauricio Barragan bf27435e30 Merge pull request #26 from mauricioabh/dev
fix(exchanges): Kraken phantom book levels + crossed-book guard (WAY-77)
2026-07-19 11:49:02 -06:00
Mauricio Barragan 4ffce9a59e fix(exchanges): truncate Kraken book to subscribed depth + crossed-book guard (WAY-77)
Kraken WS v2 book channel does not send deletes for levels evicted from
its top-N window; without client-side truncation those levels lingered
forever as phantom quotes, eventually crossing the local book (bid >= ask)
and feeding the engine a fake permanent arbitrage (~$62.9M bogus P&L).

- BookSide.truncate() removes levels beyond the best depth prices from
  the internal map (not just the emitted array)
- KrakenConnector uses depth 10 consistently (subscription + LocalBook)
  and truncates both sides after every update
- ExchangeConnector.emit() drops internally crossed books, logs and
  forces a resync (book reset + reconnect for a fresh snapshot)
- Unit tests for truncation and the crossed-book guard
- OpenSpec: order-book-integrity spec; change archived (2026-07-19)

Refs: Linear WAY-77
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-19 11:43:12 -06:00
Mauricio Barragan 14ea7e3fbd Merge pull request #25 from mauricioabh/dev
feat(pwa): installable PWA + responsive mobile dashboard
2026-07-16 15:28:08 -06:00
Mauricio Barragan 5d84df3e25 feat(pwa): installable PWA + responsive mobile dashboard
- Add Web App Manifest + ArbPulse icons (192/512/maskable/apple-touch) under
  web/public/; no service worker (real-time honesty: never serve stale data).
- Add mobile/install metadata to index.html (theme-color, viewport-fit=cover,
  apple-mobile-web-app-*, manifest + apple-touch-icon links).
- Responsive layout: PriceMatrix stacked per-venue cards below sm, StatsBar
  reflow, ~44px touch targets in Controls/ConfigPanel, safe-area top inset.
- scripts/gen-icons.ps1 derives icon sizes from the master (no new deps).
- openspec: add-pwa-mobile change (proposal/design/specs/tasks).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 15:21:13 -06:00
Mauricio Barragan 4cdfac5ff5 Merge pull request #24 from mauricioabh/dev
fix(build): make husky prepare tolerant so Docker build doesn't fail
2026-07-16 14:05:26 -06:00
Mauricio Barragan 4e8b113b4e fix(build): make husky prepare tolerant so Docker build doesn't fail
npm ci --prefix web installs the web package's file:.. dependency on root, which runs the root prepare script (husky). In the Docker build stages husky isn't installed, so 'husky' exits 127 and the build fails. 'husky || true' no-ops when the binary is absent (Docker/CI) while still running normally in local dev where husky is present.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 14:01:54 -06:00
Mauricio Barragan 27d259a881 Merge pull request #23 from mauricioabh/dev
feat(deploy): run behind existing host nginx (Caddy opt-in)
2026-07-16 13:53:03 -06:00
Mauricio Barragan d7e04a99dd feat(deploy): support running behind existing host reverse proxy (nginx)
The VPS already runs nginx+certbot on 80/443 for other apps, so bundled Caddy would collide. Make Caddy opt-in via a compose profile (WITH_CADDY=1); default deploy now runs only the app on 127.0.0.1:8080. Add an SSE-friendly nginx vhost (deploy/nginx/arbpulse.wayool.com.conf) and document the nginx+certbot integration path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 13:49:11 -06:00
Mauricio Barragan 94072b668c Merge pull request #22 from mauricioabh/dev
docs(deploy): target arbpulse.wayool.com via Cloudflare DNS-only
2026-07-16 13:28:51 -06:00
Mauricio Barragan 80413a3af4 docs(deploy): target arbpulse.wayool.com via Cloudflare DNS-only
Set DOMAIN default to arbpulse.wayool.com and document the Cloudflare DNS setup (grey-cloud / DNS-only) so Caddy HTTP-01 and SSE work without proxy buffering.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 13:25:21 -06:00
Mauricio Barragan 948e87beee Merge pull request #21 from mauricioabh/dev
chore(deploy): VPS deploy artifacts + archive gate-sentry-spans
2026-07-16 13:17:42 -06:00
Mauricio Barragan 3c7c3593ba chore(deploy): add VPS deploy artifacts (Docker Compose + Caddy + runbook)
Self-contained VPS deployment for 24/7 operation: app container behind Caddy with automatic HTTPS, idempotent deploy.sh, .env template, and runbook. SENTRY_TRACING defaults off to stay within the Sentry free-tier span quota.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 13:14:15 -06:00
Mauricio Barragan 70b4aa4e92 chore(openspec): archive gate-sentry-spans and sync observability spec
Moves the completed change to openspec/changes/archive/ and creates the canonical openspec/specs/observability/spec.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 13:07:13 -06:00
Mauricio Barragan 02a5cbe430 Merge pull request #3 from mauricioabh/dev
Production Skills M0–M5: OpenAPI, Sentry, OTel, Upstash
2026-07-16 12:59:03 -06:00
Mauricio Barragan a5c83ee026 feat(observability): gate Sentry tracing spans behind SENTRY_TRACING
Spans are now created and exported to Sentry only when SENTRY_TRACING is enabled (default off), keeping 24/7 operation within the free-tier span quota. Error monitoring stays always-on. Includes OpenSpec change gate-sentry-spans (proposal, design, specs, tasks).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 12:54:15 -06:00
Mauricio Barragan c1557908fa chore(m4): enable Dependabot on default branch
Add .github/dependabot.yml for npm and GitHub Actions weekly updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 13:04:18 -06:00
Mauricio Barragan f6e8381c20 test(m3): add Upstash read-tier rate limit HTTP test
Node test asserts 429 with Retry-After after 60 GET requests per IP.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 21:35:11 -06:00
Mauricio Barragan 8c7127cfde Add Sentry dev probe and observability smoke test.
GET /api/debug/sentry, load .env.local for DSN, Playwright observability spec.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 10:38:08 -06:00
Mauricio Barragan e04f3977c6 Fix Upstash import path blocking server start (M5 QA).
rate-limit.ts imported from a non-existent interfaces/cache path; use infrastructure/cache so Playwright smoke can start the server.
2026-06-11 03:06:42 -06:00
Mauricio Barragan fd4170963e Add Sentry, Pino logs, and OTel spans on WS pipeline (M2).
Capture REST/WS/SSE errors in Sentry, emit structured pino logs with correlation IDs, and trace the book-tick pipeline to Sentry via OpenTelemetry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 01:01:20 -06:00
Mauricio Barragan f4def0c214 Refactor API contracts to Zod, zod-to-openapi, and Scalar.
Replace hand-written OpenAPI and Swagger UI with schema-driven docs at /api-docs and Zod validation on request bodies.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 00:04:12 -06:00
Mauricio Barragan b5ff33d716 Add Husky pre-commit with eslint and Sentry env convention (M0).
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 23:51:52 -06:00
Mauricio Barragan 23c09bca43 Merge pull request #2 from mauricioabh/dev
Add Render deploy config (render.yaml)
2026-06-10 13:43:27 -06:00
Mauricio Barragan fbfa6e3ba6 Add render.yaml for Render Docker deploy with env vars and health check.
Documents production web service config (free tier, Singapore, main branch auto-deploy).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 13:43:01 -06:00
Mauricio Barragan 3683084fc0 Merge pull request #1 from mauricioabh/dev
Initial release: Arb Pulse monolith
2026-06-08 21:10:23 -06:00
Mauricio Barragan 2e8744ccf0 Initial commit: Arb Pulse monolith with CI and optional Fly deploy.
Real-time BTC cross-exchange arbitrage detection (Kraken, Bybit, OKX, Binance)
with React dashboard, GitHub Actions CI, and documented Fly.io deploy workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 21:04:53 -06:00
Mauricio Barragan 908aefb2d8 chore: initialize main branch
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 21:04:53 -06:00