Skip to content

Trading push approval + IBroker refactor + UTA e2e#72

Merged
luokerenx4 merged 4 commits intomasterfrom
dev
Mar 18, 2026
Merged

Trading push approval + IBroker refactor + UTA e2e#72
luokerenx4 merged 4 commits intomasterfrom
dev

Conversation

@luokerenx4
Copy link
Contributor

Summary

  • Trading push requires manual approval: hollowed out tradingPush tool so AI can't execute trades directly. New PushApprovalPanel on the chat page right sidebar with approve/reject buttons, inline confirmation, buy/sell color coding, and commit history
  • Reject with history: TradingGit.reject(reason?) records a user-rejected commit so AI can see denied operations in tradingLog
  • Decimal rehydration fix: TradingGit.restore() now rebuilds Decimal instances lost during JSON round-trip, fixing qty.equals is not a function crash
  • IBroker refactor: removed provider field, added generic meta<TMeta>, moved aliceId from broker layer to UTA layer
  • UTA e2e tests: standalone Bybit UTA lifecycle + reject tests, Alpaca paper e2e

Test plan

  • pnpm build — type check passes
  • pnpm test — 856 unit tests pass
  • uta-lifecycle.e2e — 10 MockBroker tests pass
  • uta-ccxt-bybit.e2e — 3 tests pass (full lifecycle + reject with/without reason)
  • Manual: AI stages + commits → panel shows pending → approve → executes
  • Manual: reject → commit in history with user-rejected status → AI sees it via tradingLog

🤖 Generated with Claude Code

luokerenx4 and others added 4 commits March 18, 2026 15:16
…ne is the single source

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hollow out tradingPush tool so AI cannot execute trades directly — it
now returns pending status and tells the user to approve in the UI.

Add POST /accounts/:id/wallet/push REST endpoint for the frontend to
call directly, and a PushApprovalPanel component on the chat page that
polls for pending commits and provides an "Approve & Push" button.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add TradingGit.reject(reason?) that records a user-rejected commit so
the AI can see which operations were denied and why. New REST endpoint
POST /accounts/:id/wallet/reject.

Rewrite PushApprovalPanel: reject button, inline push confirmation,
buy/sell color coding, commit history below pending section with
status badges and relative timestamps. Panel stays visible when
trading accounts exist (no layout jump).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TradingGit.restore() now rebuilds Decimal instances (Order.totalQuantity,
Position.quantity, closePosition.quantity) lost during JSON round-trip,
fixing "qty.equals is not a function" crash on walletLog after restart.

Add standalone UTA-level e2e test for Bybit (uta-ccxt-bybit.e2e.spec.ts)
covering full lifecycle (stage→commit→push→sync→close) and reject flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@luokerenx4 luokerenx4 merged commit a9a0e34 into master Mar 18, 2026
2 checks 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.

1 participant