diff --git a/SESSION.md b/SESSION.md index b5ee850..df6f96f 100644 --- a/SESSION.md +++ b/SESSION.md @@ -10,7 +10,7 @@ Automation execution-layer PXX remains closed and its known scope stays frozen. ## Last Updated -2026-05-18 UTC +2026-05-20 UTC ## Automation Status @@ -118,6 +118,7 @@ Automation execution-layer PXX remains closed and its known scope stays frozen. - latest_decision_assistant_workspace_refinement_slice: continuous_workspace_summary_navigation - latest_decision_assistant_digest_browser_slice: digest_history_browser_review_sequence - latest_decision_assistant_digest_preference_slice: digest_preference_profile_local_mode +- latest_trader_mode_shell_slice: unified_workbench_left_tree_route - latest_decision_assistant_workflow_queue_slice: assistant_loop_queue - latest_decision_assistant_workspace_loop_slice: workflow_section_navigation_loop_queue - latest_decision_assistant_learning_focus_slice: learning_focus_queue @@ -800,6 +801,7 @@ Automation execution-layer PXX remains closed and its known scope stays frozen. - Workbench UX + read-only live usefulness recovery passed on 2026-05-20 after real intraday testing showed the root workbench was too long, hard to use, and runtime-dependent panels could appear ineffective. `/` now uses a left-menu/right-workspace layout with hash/localStorage section switching, default `Decision Assistant`, grouped `Readiness` and `Alerts` pages, and `/trader-mode` remains the fast-read entry. Frontend `fetchJson` now has request timeout fallback so slow review/readiness endpoints no longer keep the entire workbench stuck on Loading. Remote blockers were also recovered: PostgreSQL `pg_hba` accepted the Docker network, compose now maps `host.docker.internal`, non-root deploy env backup stays inside the remote app path, DB object ownership was reassigned to the migration/app user, the local proxy was relaunched, remote runtime env was restored with `TRADING_RUNTIME_ENABLED=1` / market and broker proxy URLs / `LIVE_TRADING_ENABLED=0`, and read-only launch readiness now treats fresh REST market data plus gap-clear state as usable while surfacing stream/news/account issues as warnings. Validation passed focused workbench/readiness/maintenance/deploy tests, secret/static script checks, Playwright screenshots at 1366x768 and 390x844 plus an Alerts hash view, full unit discovery, deploy smoke over 11 endpoints, standard remote ops smoke including `unattended_harness`, and remote `run_readonly_live_analysis_smoke.py` with `ready_for_readonly_live_analysis=true`, `must_not_trade=true`, `trade_permission_required=false`, and `submit_cancel_or_live_execution_called=false`. Current warning state: market stream may still be connecting while REST candles are fresh, news provider may be stale, and OKX account context may be unavailable; these warnings do not change `execution_allowed`, `decision_support_ready`, `real_live_ready`, risk governor, trust bucket, or operator confirmation protocol. - Trader Mode usefulness compression passed on 2026-05-20: `/trader-mode` and the embedded Decision Assistant watchlist now prioritize trader-language first-screen answers: `Why No Trade`, `Watch Next`, `Focus Reason`, `Data State`, and `No Candidate`. Watchlist queue cards now say why not to trade, what to watch next, and why the unique focus deserves attention instead of exposing internal reason buckets first. The stale/freshness gate no longer freezes the page just because an old candidate timestamp exists when fresh market/review timestamps are available, and read-only runtime fallback now treats market stream / broker sync degradation as warnings for analysis-only mode while strict execution/readiness gates stay unchanged. Profile filtering now preserves the server-generated readout when the current focus already matches the trader profile, avoiding fallback text that degraded `FVG retrace` into generic `confirmation`. State-change alerts now show readable trader messages instead of raw internal signatures. Validation passed 23 focused operator/static tests, `node --check`, Python compile checks, full unit discovery (`787` tests), secret static checks, script static checks, `git diff --check` with only LF/CRLF warnings, deploy smoke over 11 endpoints, standard remote ops smoke including `unattended_harness`, remote `run_readonly_live_analysis_smoke.py` with `ready_for_readonly_live_analysis=true` and `must_not_trade=true`, and gstack browser screenshots at `output/playwright/trader-mode-usefulness-readout-remote-final3-390x844.png` plus `output/playwright/trader-mode-usefulness-readout-remote-final3-1366x768.png`. - First real Trader Mode R2 use loop executed on 2026-05-20: used remote `/trader-mode` as the primary screen, observed `Observe Only: Watch Candidate #4610: FVG retrace`, and recorded a real `No Trade` action from the UI because Candidate `4610` remained `blocked` / `executable=false`. This correctly updated `shadow_paper_observations` instead of creating a fake paper ticket: `operator_feedback_count` increased from `1` to `2`, `shadow_observation_count` increased from `14` to `15`, while `paper_ticket_count=0` and `paper_execution_count=0` stayed unchanged. Saved after-close draft note `operator_notes.id=3` with scope `weekly_review_draft`; `/trading/journal/generate` returned `created=0`, so `weekly_review_entry_count` remains `0` until a real execution-derived journal entry exists. Evidence screenshot saved at `output/playwright/trader-mode-r2-real-use-loop-390x844.png`. Current R2 gate remains `paper_ticket_sample_gate`; do not mark R2 completed. +- Trader Mode unified shell closure passed on 2026-05-20: `/trader-mode` now resolves to the same left-menu/right-workspace `index.html` shell instead of the standalone page, with the Trader Mode section active from the route and the sidebar `Trader Mode` tree item selected. The embedded Trader Mode surface keeps the fast-read status, live readout, fast queue, freshness, focus, action buttons, after-close draft, R2 evidence, and read-only boundary controls, while the generic workbench filter bar is hidden only for this section. `trader_mode.js` is scoped so it can run inside the workbench without leaking globals into `app.js`; keyboard shortcuts and auto-refresh are active only while the Trader Mode section is visible. Remote validation passed deploy smoke over 11 endpoints, gstack browser checks on `http://192.168.3.90:8000/trader-mode` (`bodySection=trader-mode`, active nav=`Trader Mode`, sidebar present, generic controls hidden, loaded status=`Observe Only`), `run_readonly_live_analysis_smoke.py`, and `run_remote_ops_smoke.py`. Evidence screenshot saved at `output/playwright/trader-mode-unified-shell-1366x768-loaded.png`. No change was made to `execution_allowed`, `decision_support_ready`, `real_live_ready`, risk governor, trust bucket, or operator confirmation protocol. - Current assisted-analysis next gate: keep R1/R2 focused on `decision_support_ready` trust/sample/quality evidence and shadow/paper/operator feedback collection. OKX trade-permission sandbox smoke is deferred until the project explicitly re-enters execution adapter or real-trading preparation. ## Exact Next Step diff --git a/TASKS.md b/TASKS.md index afb7083..437f01c 100644 --- a/TASKS.md +++ b/TASKS.md @@ -150,7 +150,7 @@ - [x] R2 shadow / paper continuous validation ledger starter slice implemented and deployed - [x] R2 sample collection closure slice implemented and deployed: persistent daily observation ledger, runtime/API/cockpit observation actions, validation count fields, and remote sample writeback - [x] R2 evidence backfill audit and guarded shadow-observation backfill complete: remote dry-run found 10 eligible historical blocked-candidate days, remote apply created observations `1449` through `1458`, and the live gate moved from `shadow_candidate_day_coverage` to `paper_ticket_sample_gate` -- [ ] R2 evidence window still collecting: live state has `observed_shadow_day_count=12`, `shadow_observation_count=13`, `shadow_observation_day_count=11`, `paper_ticket_count=0`, `paper_execution_count=0`, `operator_feedback_count=1`, `weekly_review_entry_count=0`, and Trader Mode now surfaces these missing evidence types without marking `decision_support_ready=true` +- [ ] R2 evidence window still collecting: live state has `observed_shadow_day_count=12`, `shadow_observation_count=15`, `shadow_observation_day_count=11`, `paper_ticket_count=0`, `paper_execution_count=0`, `operator_feedback_count=2`, `weekly_review_entry_count=0`, and Trader Mode now surfaces these missing evidence types without marking `decision_support_ready=true` - [x] Recover remote API responsiveness blocker: no-proxy `/health` returned 200, SSH command execution recovered, and standard remote ops smoke passed all 9 checks including `unattended_harness` - [x] Restore OKX read-only market/broker proxy before continuing R2 sampling: remote no-proxy readiness now has `market_truth_ready`, `broker_state_ready`, and `runtime_ready`; standard remote ops smoke passed - [x] Read-only live analysis launch closure complete: `live_analysis_assistant_ready=true`, cockpit boundary/health summary visible, `decision_support_ready=false`, `execution_assist_ready=false`, `real_live_ready=false`, deploy smoke passed, `run_readonly_live_analysis_smoke.py` passed @@ -162,6 +162,7 @@ - [x] Low-risk sensitive credential cleanup complete: removed tracked expect scripts with embedded password sends, switched rollback docs/checker to `deploy_with_password.py` + runtime env, added redacted `run_secret_static_checks.py`, wired it into script static checks and Trading Delivery Checklist, and kept all real remote/runtime credentials unchanged - [x] Workbench frontend split-navigation closure: converted the long root workbench into a left-menu/right-workspace layout, added hash/localStorage section switching, added frontend request timeout fallback so slow review/readiness APIs no longer freeze the page, and validated desktop/narrow rendering - [x] Live usefulness blocker recovery: root workbench split-navigation is usable, slow frontend requests time out instead of freezing the page, remote DB/compose/deploy/migration/proxy/runtime blockers were recovered, standard remote ops smoke including `unattended_harness` passed, and readonly live analysis smoke passed without enabling order submission +- [x] Trader Mode unified workbench shell closure: `/trader-mode` now opens inside the same left-tree/right-workspace framework with the Trader Mode tree item active, hides the generic workbench filters only for this section, scopes Trader Mode JS to avoid app globals/hidden-section shortcuts, deploy smoke passed, remote gstack browser verification passed, readonly live analysis smoke passed, and remote ops smoke passed - [ ] Next trader-usefulness refinement: compress Trader Mode / watchlist language around why no trade, what to watch next, unique focus quality, stale data, and no-candidate states so the first screen answers live operator questions faster - [ ] R2 next collection action after readonly launch: wait for or surface a real executable candidate, then build shadow paper ticket / confirm paper execution / record operator feedback / add weekly review evidence without changing execution/live gates - [x] R3 OKX sandbox preflight starter implemented and deployed: signed dry-run request previews, idempotency key preview, error normalization catalog, `/trading/okx-sandbox-preflight`, live-readiness summary, cockpit surface, deploy smoke, remote ops smoke, and remote field/UI smoke diff --git a/output/playwright/trader-mode-unified-shell-1366x768-loaded.png b/output/playwright/trader-mode-unified-shell-1366x768-loaded.png new file mode 100644 index 0000000..5e273c9 Binary files /dev/null and b/output/playwright/trader-mode-unified-shell-1366x768-loaded.png differ diff --git a/src/api/server.py b/src/api/server.py index d0a38f0..ab4cd83 100644 --- a/src/api/server.py +++ b/src/api/server.py @@ -1299,7 +1299,7 @@ def _resolve_static_file(path: str) -> Optional[Path]: if path in {"/training", "/training.html"}: return STATIC_DIR / "training.html" if path in {"/trader-mode", "/trader-mode.html"}: - return STATIC_DIR / "trader_mode.html" + return STATIC_DIR / "index.html" relative = path.removeprefix("/static/") resolved = (STATIC_DIR / relative).resolve() try: diff --git a/src/web/app.js b/src/web/app.js index dfd16fc..bcca027 100644 --- a/src/web/app.js +++ b/src/web/app.js @@ -170,6 +170,14 @@ function getWorkbenchSection(sectionId) { return workbenchSections.find((section) => section.dataset.workbenchSection === sectionId) || null; } +function getPathWorkbenchSection() { + const normalizedPath = window.location.pathname.replace(/\/+$/, '') || '/'; + if (normalizedPath === '/trader-mode' || normalizedPath === '/trader-mode.html') { + return 'trader-mode'; + } + return ''; +} + function activateWorkbenchSection(sectionId, options = {}) { if (!workbenchSections.length) return; const fallback = getWorkbenchSection('decision-assistant') || workbenchSections[0]; @@ -180,6 +188,7 @@ function activateWorkbenchSection(sectionId, options = {}) { section.classList.toggle('is-active', isActive); section.toggleAttribute('hidden', !isActive); }); + document.body.dataset.workbenchSection = activeId; workbenchNavButtons.forEach((button) => { const isActive = button.dataset.workbenchTarget === activeId; button.classList.toggle('is-active', isActive); @@ -195,6 +204,7 @@ function activateWorkbenchSection(sectionId, options = {}) { if (options.scrollToTop && workbenchContent) { workbenchContent.scrollTo({ top: 0, behavior: options.smooth ? 'smooth' : 'auto' }); } + window.dispatchEvent(new CustomEvent('workbench-section-change', { detail: { sectionId: activeId } })); } function initializeWorkbenchNavigation() { @@ -209,7 +219,7 @@ function initializeWorkbenchNavigation() { }); }); const hashSection = window.location.hash ? window.location.hash.replace(/^#\/?/, '') : ''; - activateWorkbenchSection(hashSection || getStoredWorkbenchSection() || 'decision-assistant', { + activateWorkbenchSection(hashSection || getPathWorkbenchSection() || getStoredWorkbenchSection() || 'decision-assistant', { persist: false, scrollToTop: false, }); diff --git a/src/web/index.html b/src/web/index.html index 98c8e1d..03756fc 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -13,7 +13,7 @@

Live plan, candidate, ticket, position, and review flow.

- Trader Mode + Open Trader Mode
Loading workspace...
@@ -25,7 +25,7 @@
Decision Assistant