|
| 1 | +# Paper-Sim UI Polish 001 |
| 2 | + |
| 3 | +SOURCE STATUS: Public-safe, frontend display-only polish. No secrets, no |
| 4 | +credentials, no account IDs. This task only clarifies read-only / simulated / |
| 5 | +demo labelling. It adds no controls and changes no backend behavior. |
| 6 | + |
| 7 | +## 1. Purpose |
| 8 | + |
| 9 | +Make it immediately obvious to a demo viewer that the broker / paper surfaces are |
| 10 | +**read-only, simulated/demo, and not live trading**. Closes the one labelling gap |
| 11 | +found on the rendered broker surface. |
| 12 | + |
| 13 | +## 2. Scope |
| 14 | + |
| 15 | +Frontend display/copy polish only. No backend/API, no endpoints, no scripts, no |
| 16 | +workflows, no package changes. No new controls or mutating calls. |
| 17 | + |
| 18 | +## 3. Components reviewed |
| 19 | + |
| 20 | +Rendered broker / paper surfaces (via `App.tsx` routes → `TerminalShell`): |
| 21 | + |
| 22 | +- **`IBKRBrokerCard`** — rendered on the terminal dashboard view and the |
| 23 | + dedicated `/brokers` route. **Gap found:** showed status flags + permissions |
| 24 | + but no plain-language "simulated / not live" caption. **Polished.** |
| 25 | +- **`AlpacaPaperReadOnlyCard`** — already clearly labelled ("PAPER ONLY", |
| 26 | + "Advisory / demo status only — not live trading", fallback note). No change. |
| 27 | +- **`PaperRunPreviewPanel`** (`/terminal/paper-run-preview`) — already strongly |
| 28 | + labelled (READ ONLY / DRY RUN / LIVE ORDERS BLOCKED / HUMAN REVIEW REQUIRED / |
| 29 | + EXECUTION OFF chips; "GET-only · display-only"; "No broker execution, no order |
| 30 | + placement, no persistence"; `Load Preview` button is GET-only). No change. |
| 31 | +- **`SafetyBadges`** — global safety posture chips. No change. |
| 32 | +- **`BrokerCard`** (`components/BrokerCard.tsx`) — the canonical read-only broker |
| 33 | + card, but its only host (`DashboardPage`) is **not routed** (`/dashboard` |
| 34 | + redirects to `/terminal`), so it is not rendered in the live app. Intentionally |
| 35 | + **left unchanged** to keep this polish scoped to verifiable, rendered surfaces. |
| 36 | + |
| 37 | +## 4. UI changes |
| 38 | + |
| 39 | +- `IBKRBrokerCard`: added a single display-only caption below the diagnostics |
| 40 | + list: |
| 41 | + |
| 42 | + > Paper / simulated — read-only preview. No live execution, no credentials, |
| 43 | + > not live trading. |
| 44 | +
|
| 45 | + Reuses the existing `panel-note` class already used by the adjacent |
| 46 | + `AlpacaPaperReadOnlyCard`, so styling is consistent. |
| 47 | + |
| 48 | +No other UI changes. |
| 49 | + |
| 50 | +## 5. Safety labels added or confirmed |
| 51 | + |
| 52 | +- **Added** (IBKRBrokerCard): "Paper / simulated — read-only preview. No live |
| 53 | + execution, no credentials, not live trading." |
| 54 | +- **Confirmed present** elsewhere: PAPER ONLY; READ ONLY / DRY RUN / LIVE ORDERS |
| 55 | + BLOCKED / EXECUTION OFF / HUMAN REVIEW REQUIRED chips; "Advisory / demo status |
| 56 | + only"; "No broker execution, no order placement, no persistence". |
| 57 | + |
| 58 | +## 6. Forbidden controls check |
| 59 | + |
| 60 | +Confirmed the change adds none of, and the reviewed surface contains none of: |
| 61 | + |
| 62 | +- Buy / Sell / Order / Execute buttons — none added. |
| 63 | +- connect-live CTA — none. |
| 64 | +- broker-credential input UI — none. |
| 65 | +- order-placement / trade-submission logic — none. |
| 66 | +- new mutating frontend calls (POST/PUT/PATCH/DELETE) — none. |
| 67 | + |
| 68 | +The change is a static `<p>` caption only — no buttons, forms, inputs, or |
| 69 | +handlers. |
| 70 | + |
| 71 | +## 7. Validation |
| 72 | + |
| 73 | +- `npm run build` (`tsc -b && vite build`) → **success** (typecheck clean; caption |
| 74 | + ships in the built bundle). |
| 75 | +- `python scripts/validate_safety_config.py` → **OVERALL: PASS**. |
| 76 | +- `git diff --check` → clean. |
| 77 | +- No unit-test runner is configured (only Playwright e2e; no `test` script), so a |
| 78 | + unit test was not added (would require a new test runner / package changes, |
| 79 | + which are out of scope). Build + validator + static scan were run instead. |
| 80 | + |
| 81 | +## 8. Static scan |
| 82 | + |
| 83 | +Changed file (`IBKRBrokerCard.tsx`): |
| 84 | + |
| 85 | +- No secrets / tokens / DB URLs / API keys / credentials / account IDs / emails / |
| 86 | + phones / Neon identifiers. |
| 87 | +- No `placeOrder` / `submitOrder` / `executeTrade` / `cancelOrder` / |
| 88 | + `enableAutotrade` / "connect live"; no `<button>` / `<form>` / `<input>` / |
| 89 | + `onClick`. |
| 90 | +- No profit / ROI / win-rate / live-trading assertions. |
| 91 | +- buy/sell/order/execution terms appear only in read-only permission/flag |
| 92 | + displays (pre-existing) and the new prohibition-context caption. |
| 93 | + |
| 94 | +## 9. Safety confirmation |
| 95 | + |
| 96 | +- no backend/API changes ✅ |
| 97 | +- no workflows ✅ |
| 98 | +- no package changes ✅ (deps reused via a temporary, gitignored junction for the |
| 99 | + build only) |
| 100 | +- no broker credentials ✅ |
| 101 | +- no env vars touched ✅ |
| 102 | +- no broker API calls ✅ |
| 103 | +- no order/execution routes added ✅ |
| 104 | +- no Buy/Sell/Order/Execute UI added ✅ |
| 105 | +- no secrets ✅ |
| 106 | +- no live-trading claims ✅ |
| 107 | +- no profit/ROI/win-rate claims ✅ |
| 108 | +- safety posture unchanged (autotrade=false, dry_run=true, read_only=true, |
| 109 | + live_orders_blocked=true, max risk ≤ 1%) ✅ |
| 110 | + |
| 111 | +## 10. Recommended next step |
| 112 | + |
| 113 | +**PAPER-SIM-UI-POLISH-001-PUBLISH** (push + Draft PR), or |
| 114 | +**BROKER-SIM-SCREENSHOT-EVIDENCE-001** to capture the labelled surfaces as demo |
| 115 | +evidence. |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +*MellyTrade is a read-only, dry-run, paper-only portfolio project. It is not a |
| 120 | +commercial platform, not a live trading system, and not financial advice.* |
0 commit comments