Commit Graph

156 Commits

Author SHA1 Message Date
Devin
2fa41dd000 docs(backtest): engine readiness assessment
Investigates whether the backtest engine is ready to power a customer-
facing "test plan against history" feature on /plans (e.g. COVID, war
periods). Combines code review with 4 synthetic-data smoke tests run
against the running engine.

TL;DR:
  Engine itself is sound — deterministic, fast (~250-325 candles/sec),
  multi-timeframe data pipeline works, intra-candle policies wired
  correctly, runs the same strategy code as live trading.

Ship blockers for customer feature:
  - Zero engine unit tests (1,984 LOC backend, 0 *.test.* files)
  - No Alpaca data source — only Kraken auto-fetch + CSV/JSON upload
    means stock plans can't be tested without manual CSV
  - Log noise (~25k lines per 5k-candle backtest)
  - Production gate is intentional ("not yet production-ready" comment
    in flags.ts) — not an oversight

Recommended path: admin-only POC first (low risk, no flag changes),
plus the user's-own-trade-replay source as a v1 product alternative
that's truthier than synthetic historical scenarios.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 10:20:19 +00:00
Devin
391b3a9fd3 chore(web): audit-css.mjs — detect true (selector+context+body) duplicates
Extends the script with a strict-duplicate detector that distinguishes
real Pattern G dead code (same selector + same @media context + same
body, where everything but the LAST occurrence in cascade order has no
effect) from descendant-selector counts (which were mostly noise in the
previous report).

The new detector surfaced 29 dead rules in the prior commit (14398af);
it now reports 0 — the cleanup is complete and future regressions will
show up immediately.

Also wires the duplicate-rule data into the --json output for tooling.

Updates docs/ui/UI_AUDIT.md §5 #7 with the consolidation metrics.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 09:51:14 +00:00
Devin
eab2721e95 docs(ui): mark all UI audit §5 items as done with commit references
Updates docs/ui/UI_AUDIT.md §5 to reflect that all 10 recommendations
shipped (#1-#7 + #9-#10) or are partially complete with explicit rationale
for what was deferred (#8). Each item now references the commit hash that
addressed it so readers can trace the implementation.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 09:40:11 +00:00
Devin
063afdbff6 chore(web): hex-color audit + annotate intentional shadows (UI audit #10)
Extends scripts/audit-css.mjs to also report hardcoded hex colors
outside CSS custom-property defs (`--name: #xxx;`) and outside
`var(--token, #fallback)` token-default fallbacks (which are explicitly
allowed per repo design-system rules).

Initial run reports 4 violations — all intentional pre-cascade body
defaults in :root and html.dark that must be literal hex (no var()) so
the page renders correct colors before the cascade resolves the custom
props. Annotated each with an explanatory comment; values intentionally
mirror --foreground / --background. Future drift surfaces immediately.

UI audit doc §5 #10 updated to reflect the sweep is done and the 4 known
violations are documented.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 09:33:54 +00:00
Devin
63f17bf40e refactor(web): use @bytelyst/ui CardButton primitive (UI audit #9)
Now that @bytelyst/ui@0.1.6 ships <CardButton>, replace the local
`.card-button` className shim (added to layout-fixes.css §25 in the
prior commit) with the real primitive.

Conversions:
  - components/StrategyWizard.tsx — risk style (3 cards) + hours pickers
  - views/SimpleView.tsx — new-buy + manage-holding plan cards
  - tabs/MyStrategiesTab.tsx — diagnostic accordion toggle

Removes layout-fixes.css §25 (.card-button) — no longer needed.
Updates docs/ui/UI_AUDIT.md Pattern A to reflect that the design-system
fix has shipped.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 09:31:46 +00:00
Devin
9df8a255ce docs(ui): tighten UI audit — verified counts, real Button root cause, file:line refs
- Pattern A: corrected root cause (whitespace-nowrap + fixed h-{size}, not "block-children-as-flex-items"), verified against @bytelyst/ui Button source
- Pattern E: reframed as UX/discoverability (truncate doesn't hide from screen readers; full text is in DOM)
- Pattern H: narrowed to only the one real vw bug (index.css:1620); 1791/1798/1822/1832 are inside clamp() and fine
- Pattern F: confirmed 5 inline 1fr-1fr instances with file:line; confirmed 2 bare-1fr CSS instances
- Section 1: replaced fuzzy metric ("31 files use Button primitive") with verified counts and source of truth
- Section 5: every recommendation now has concrete file:line
- Section 6: NEW — how to verify a UI fix (5-viewport check, body scrollWidth probe, build/typecheck)
- Section 7: fixed broken pixel-width regex ([,$] -> [,;]?\s*$); added bare-1fr-in-css command
- Section 8: NEW — open questions / things to investigate (asChild slot inheritance, mobile, light theme)

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 08:32:25 +00:00
Devin
3949062435 Add UI audit report
Catalogs systemic UI issues by pattern (root causes), what was already
fixed in this session, and prioritized recommendations for further work.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 08:27:04 +00:00
root
34ed7813ee docs(docker): document base image approach as deferred due to workspace complexity
The base image strategy has been implemented but deferred due to fundamental
issues with pnpm workspace structure. All products currently use the proven
docker-prep.sh tarball approach. This commit documents the lessons learned
and future considerations.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 00:27:17 +00:00
root
5d9755fc0a docs: add Docker deployment guide and update smoke script
- Add comprehensive Docker deployment guide
- Update smoke-release.sh for compatibility

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-10 00:27:17 +00:00
83bc3af260 docs: add comprehensive documentation for coding agents
Created detailed documentation files to guide coding agents in implementing
the fixes and improvements identified in the functionality review:

1. API_DOCUMENTATION_GUIDE.md
   - Complete API endpoint catalog
   - Authentication documentation
   - REST API endpoints (health, user, trading, orders, market data, research, backtesting, feature flags, admin)
   - WebSocket namespaces (/trading, /admin, /)
   - Error responses and error codes
   - Rate limiting recommendations
   - Request ID propagation
   - Deprecation policy
   - OpenAPI/Swagger generation guide
   - Documentation maintenance process

2. ARCHITECTURE_DOCUMENTATION.md
   - System overview and high-level architecture
   - Monorepo structure and directory layout
   - Backend architecture (component structure, data flow, trading loop)
   - Web architecture (component structure, data flow, UI architecture)
   - Mobile architecture (component structure, data flow)
   - Shared code architecture (shared modules, platform integration)
   - Data architecture (Cosmos DB containers, data flow)
   - Service boundaries (backend, platform-service, web, mobile responsibilities)
   - Integration points (backend ↔ platform-service, web ↔ backend, mobile ↔ backend, etc.)
   - Security architecture (authentication, authorization, tenant isolation)
   - Monitoring & observability (telemetry, logging)
   - Deployment architecture (Docker, environment variables)
   - Scalability considerations (horizontal scaling, WebSocket scaling)

3. TROUBLESHOOTING_GUIDE.md
   - Backend issues (won't start, health check failing, trading loop not running, orders not executing, reconciliation failures)
   - Web issues (won't load, authentication failing, WebSocket connection failing, data not updating)
   - Mobile issues (won't launch, authentication failing, WebSocket connection failing, data not updating)
   - Database issues (Cosmos DB connection failing, slow performance, data inconsistency)
   - Authentication issues (platform-service unreachable, JWT token invalid)
   - WebSocket issues (connection drops, not receiving events)
   - Performance issues (backend slow response times, web slow load times)
   - Deployment issues (Docker build failing, container won't start)
   - Escalation procedures (when to escalate, escalation steps, on-call contact, incident response)
   - Common error messages (backend, web, mobile)
   - Monitoring and alerts (key metrics, alert thresholds, monitoring tools)

4. ONBOARDING_GUIDE.md
   - Project overview (what is the trading dashboard, tech stack, key concepts)
   - Prerequisites (required software, required accounts, optional tools)
   - Development setup (clone repo, install dependencies, configure environment, verify setup)
   - Project structure (monorepo layout, key files)
   - Development workflow (starting development, making changes, commit message format, pushing changes)
   - Testing (backend tests, web tests, mobile tests, verification script)
   - Code review process (PR process, PR checklist, code review guidelines)
   - Common tasks (adding backend endpoint, adding web component, adding mobile screen, adding feature flag)
   - Resources (documentation, external documentation, tools)
   - Getting help (internal resources, common issues, asking questions)
   - Best practices
   - Next steps (first week, first month, ongoing)

These documentation files provide detailed guidance for coding agents to implement
the fixes and improvements identified in FUNCTIONALITY_REVIEW.md without needing
to understand the entire codebase from scratch.
2026-05-09 17:02:05 -07:00
6b37cb059e docs: add comprehensive functionality review
Created comprehensive functionality review documenting:

Functional Gaps (12):
- Mobile push notifications (deferred)
- Cosmos audit-events container (not created)
- Mobile internal beta (not started)
- Web internal adoption (in progress)
- Backtest feature flag integration
- Marketplace tab (feature-flagged)
- Membership tab (feature-flagged)
- Mobile strategy management (not implemented)
- Mobile admin diagnostics (not implemented)
- Chat/copilot integration (partial)
- Reconciliation services (coverage gaps)
- Trading control persistence (edge cases)

Bugs (8):
- UX guide typo (giteaye -> gitea)
- E2E test count parsing (fixed in c9c6119)
- Mobile app src directory (intentional)
- Legacy Supabase scripts (maintenance burden)
- SupabaseService size (118KB)
- TradeExecutor size (128KB)
- apiServer size (183KB)
- ChatControl size (58KB)

Improvements (15):
- Backend service modularization
- Web component modularization
- Backend API contract documentation
- Web component Storybook coverage
- Mobile app testing
- Backend test coverage
- Error monitoring integration
- Performance monitoring
- Logging standardization
- Configuration validation
- Dependency updates
- Docker multi-stage builds
- CI/CD pipeline
- Accessibility improvements
- Responsive design testing

Documentation Gaps (6):
- Mobile cutover documentation
- API documentation
- Architecture documentation
- Deployment documentation
- Troubleshooting guide
- Onboarding documentation

Testing Gaps (5):
- Mobile E2E tests
- Backend integration tests
- Web component unit tests
- Backend repository tests
- Performance tests

Security Concerns (4):
- Tenant isolation edge cases
- API rate limiting
- Input validation
- Secret management

Performance Issues (3):
- Backend service size impact
- Web bundle size
- Mobile app size

Prioritized recommendations with immediate, short-term, medium-term, and long-term next steps.
2026-05-09 16:30:52 -07:00
e87d7a5839 docs: add local package resolution section to UX guide
Added critical section on using local common platform packages instead of Gitea registry:

- .pnpmfile.cjs configuration for local package resolution
- .npmrc configuration (remove repo-level GITEA_NPM_TOKEN)
- Environment variables (BYTELYST_PACKAGE_SOURCE)
- Verification commands to confirm local resolution
- Benefits of local package resolution (faster dev, offline, no registry dependency)
- Updated Phase 1 roadmap to include local package setup

This ensures other products follow the same approach of using local common-plat packages by default instead of pulling from Gitea registry.
2026-05-09 14:21:46 -07:00
691d8aa9da docs: expand UX guide to comprehensive implementation guide
Expanded from testing-focused guide to comprehensive UX implementation guide covering all UX work from last 2 days:

Part 1: Common Platform UI Integration
- Product Adapter Pattern with type-safe extensions
- Centralized import point for all UI components
- Product-specific variants without modifying common platform

Part 2: Design Token Usage
- CSS variable integration patterns
- Component token patterns
- Token migration checklist

Part 3: Component Normalization
- Badge normalization (commit: 94ce743)
- Alert banner unification (commit: d4846b7)
- Table controls standardization
- Control normalization pattern with 5-step process

Part 4: Accessibility Improvements
- Keyboard navigation patterns (commits: 3c52593, a65d726)
- ARIA labels for buttons, status indicators, forms
- Focus indicators and focus order

Part 5: Responsive Design
- Shell breakpoints (commit: c51544a)
- Viewport matrix testing
- Mobile-first patterns

Part 6: Testing Infrastructure
- Playwright setup (commit: 8db23bd)
- Test suite structure (commit: 79f0021)
- Test runner with server lifecycle (commits: df7c57e, a572293, 2bd38e1)
- AI-friendly report generation
- Storybook setup

Part 7: Cipher Design System Integration
- Design principles: hierarchy, spacing, typography, color, accessibility
- Component patterns: cards, buttons, alerts
- WCAG AA compliance

Part 8: Implementation Roadmap
- 10-week phased approach
- Clear verification commands at each phase
- Commit references for specific patterns

Part 9: Verification Commands
- UI audit, type checking, build verification
- Test execution commands
- Storybook commands

Part 10: Troubleshooting
- Common issues and solutions
- Playwright, design tokens, component imports

Part 11: Best Practices
- Component development, code organization
- Testing strategy, documentation

Part 12: References
- Common platform, Cipher design system, testing tools

This guide enables other products to replicate the exact same UX implementation approach with 40+ commits of UX work documented.
2026-05-09 14:20:59 -07:00
72624aa8fc docs: add comprehensive UX testing setup guide
Created detailed documentation for UX testing infrastructure that can be replicated across all ByteLyst products:

- Complete Playwright setup instructions
- Test suite structure and patterns
- Test runner script with server lifecycle management
- AI-friendly report generation
- Common platform UI integration
- Design token usage patterns
- Cipher design system integration
- Step-by-step implementation guide
- Troubleshooting and best practices
- CI integration examples

This guide enables other products to follow the exact same steps for UX testing
using common platform packages, design tokens, and Cipher design system principles.
2026-05-09 14:12:58 -07:00
79f00214a9 test(ui): add comprehensive Playwright E2E test suite
- Created e2e/alert-positioning.spec.ts for critical alerts positioning tests
- Created e2e/assistant-positioning.spec.ts for assistant widget positioning tests
- Created e2e/destructive-actions.spec.ts for destructive actions confirmation tests
- Created e2e/feedback.spec.ts for save/delete/update feedback tests
- Created e2e/page-states.spec.ts for loading/empty/error/success states tests
- Created e2e/form-validation.spec.ts for form validation tests
- Created e2e/keyboard-navigation.spec.ts for keyboard navigation tests
- Created scripts/tests/run-e2e.sh test runner script with health check
- Updated LAUNCH_READY_UI_UX_ROADMAP.md checklist - all items complete
- All testing infrastructure complete (CI integration replaced with local test runner)
2026-05-09 13:28:20 -07:00
8db23bde2d test(ui): add Playwright and Storybook testing infrastructure
- Installed Playwright and Storybook packages
- Created playwright.config.ts with viewport matrix and browser configurations
- Installed Playwright chromium browser
- Created e2e/viewport-matrix.spec.ts for viewport matrix testing
- Created e2e/horizontal-overflow.spec.ts for horizontal overflow testing
- Added test scripts to package.json (test:e2e, test:e2e:ui, test:e2e:viewport, test:e2e:overflow)
- Updated LAUNCH_READY_UI_UX_ROADMAP.md checklist with testing infrastructure status
2026-05-09 13:19:14 -07:00
6df08a0857 docs(ui): document launch readiness checklist verification status
- Updated checklist to distinguish code-inspection items from testing-required items
- Noted which items require Playwright, visual testing, or manual verification
- Added Launch Readiness Checklist Verification section documenting partial status
- Code inspection complete for static analysis items
- Remaining items require: Playwright screenshots, visual testing, keyboard navigation testing, form validation testing, CI setup, Storybook setup
2026-05-09 13:10:11 -07:00
2bb8f72249 docs(ui): update launch readiness checklist with PR 1-3 verification
- PR 1: Package Source and Install Stability - Verified
  - Local product install works without Gitea npm auth
  - Common-platform packages don't surprise local installs with private registry assumptions
- PR 2: Common Platform Foundation - Verified
  - Design tokens follow clear primitive, alias, semantic, typography, and effects structure
  - Shared primitives cover required components
  - Common platform UI can be reused by another product without trading-specific assumptions
- PR 3: Product Adapter And Shell - Verified
  - Desktop, tablet, and phone navigation follow the shell contract
  - Right panel behaves correctly across responsive breakpoints
  - AlertBanner components are inline within content
  - ChatControl assistant widget uses createPortal with fixed positioning
2026-05-09 13:07:45 -07:00
79db012e10 docs(ui): clarify remaining product-specific layout containers
- Add note about signal-status, rule-status, route-fallback-status, trading-sidebar-avatar-status
- These are intentional app-shell and component-level layouts, not dense operational table visual language
- Audit remains clean: 0 findings across all categories
2026-05-09 13:04:07 -07:00
6947532ae6 docs(ui): complete production-grade UX remediation roadmap
- Updated PRODUCTION_GRADE_UX_REMEDIATION_ROADMAP.md with final completion status
- Moved PRODUCTION_GRADE_UX_REMEDIATION_ROADMAP.md to docs/completed/
- Updated LAUNCH_READY_UI_UX_ROADMAP.md checklist with completed work
- All one-off visual language replaced with shared Badge components
- Audit baseline clean: 0 findings across all categories
2026-05-09 12:59:48 -07:00
94ce743bd0 refactor(ui): replace one-off visual language with shared Badge components
- Replace .stat-chip with Badge in PresetMarketplace, BacktestTab, MembershipTab
- Replace .saved-setup-id-chip with Badge in SimpleView
- Replace .screener-sector-chip with Badge in ScreenerView
- Replace .health-pill with Badge in TradeProfileManager
- Remove CSS definitions for one-off classes from index.css
- All components now use shared Badge from product adapter
- Verify: audit:ui (0 findings), audit:ui:strict (0 findings), typecheck, build
2026-05-09 12:56:52 -07:00
a17de130c7 docs(ui): record shared primitive integration checkpoint 2026-05-09 02:31:49 -07:00
0c8d3cf912 docs(ui): update launch readiness checkpoint 2026-05-09 02:18:50 -07:00
4566e9f675 docs(ui): record ux normalization checkpoint 2026-05-09 02:00:47 -07:00
4c658694f0 chore: enforce local ByteLyst package resolution 2026-05-08 21:09:14 -07:00
26ca71ac63 docs: expand launch-ready UX implementation roadmap 2026-05-08 21:07:37 -07:00
1994821acf Polish trading UI and add launch roadmap 2026-05-08 20:58:00 -07:00
root
041e5e6f63 Clarify closed roadmap baseline 2026-05-09 01:32:37 +00:00
root
43a0fa4a8f Close UI migration roadmap 2026-05-09 01:23:44 +00:00
root
3141260045 Update roadmap for strict audit enforcement 2026-05-09 01:14:11 +00:00
0b2783813b docs(ui): record right rail remediation 2026-05-07 13:37:45 -07:00
cedbdb9dd3 docs(ui): record manual entry remediation 2026-05-07 13:28:55 -07:00
2a23f88334 docs(deps): document local common platform default 2026-05-07 13:08:43 -07:00
34ecfddf38 docs(ui): record settings remediation 2026-05-07 13:06:51 -07:00
16a16ac85d docs(ui): record header shell remediation 2026-05-07 11:38:02 -07:00
eaa37682f3 docs(ui): record trade plans remediation 2026-05-07 10:17:47 -07:00
0743c16b71 docs(ui): record adapter sizing remediation 2026-05-07 10:05:10 -07:00
9cfaca740f docs(ui): expand production ux remediation gaps 2026-05-07 01:54:13 -07:00
b30f470873 docs(ui): add production ux remediation roadmap 2026-05-07 01:52:07 -07:00
root
4ab97acab7 docs(chat): record structured insight support 2026-05-07 08:03:23 +00:00
root
6797452e7b docs(chat): refresh capability audit 2026-05-07 07:42:08 +00:00
root
7b772494fc docs(chat): update capability audit status 2026-05-07 07:25:18 +00:00
root
d160beadfd docs(chat): update capability audit status 2026-05-07 07:00:03 +00:00
root
dfe876d49b docs(chat): add capability audit 2026-05-07 06:48:29 +00:00
root
69324be784 docs(ui): update migration roadmap status 2026-05-07 06:23:31 +00:00
root
57f7f35ad7 docs(ui): update migration roadmap status 2026-05-07 06:19:15 +00:00
root
309e9cc399 docs(ui): update migration roadmap status 2026-05-07 06:05:26 +00:00
root
8f05cc952f docs(ui): update migration roadmap status 2026-05-07 05:43:19 +00:00
root
d52beede0f docs(ui): update migration roadmap status 2026-05-07 05:41:33 +00:00
root
2455d40d04 docs(ui): update migration roadmap status 2026-05-07 05:37:04 +00:00