Repository navigation
Add an investment research and portfolio intelligence workspace - #50
Conversation
Co-authored-by: charles2ke <6725706+charles2ke@users.noreply.github.com>
Co-authored-by: charles2ke <6725706+charles2ke@users.noreply.github.com>
Co-authored-by: charles2ke <6725706+charles2ke@users.noreply.github.com>
Co-authored-by: charles2ke <6725706+charles2ke@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical UI crashes and several moderate data-validation and snapshot issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Adds a deterministic investment research workspace with shared datasets, provenance, analytics engines, portfolio tools, reporting, UI, and tests.
Changes:
- Adds research, valuation, risk, portfolio, macro, and analytics engines.
- Adds workspace UI, navigation, caching, documentation, and screenshots.
- Adds extensive unit and end-to-end test coverage.
| File | Description |
|---|---|
vite.config.js |
Registers research entry point |
test/research-workspace.test.js |
Tests workspace functionality |
test/research-watchlists.test.js |
Tests watchlists |
test/research-technicals.test.js |
Tests technical analytics |
test/research-stats.test.js |
Tests shared statistics |
test/research-screener.test.js |
Tests screening |
test/research-risk.test.js |
Tests risk analytics |
test/research-reports.test.js |
Tests reports |
test/research-quant.test.js |
Tests quantitative analytics |
test/research-provenance.test.js |
Tests provenance |
test/research-portfolios.test.js |
Tests portfolios |
test/research-portfolio-builder.test.js |
Tests portfolio construction |
test/research-orchestrator.test.js |
Tests orchestration |
test/research-macro.test.js |
Tests macro analytics |
test/research-earnings.test.js |
Tests earnings analytics |
test/research-dividends.test.js |
Tests dividends |
test/research-dcf.test.js |
Tests DCF valuation |
test/research-dataset.test.js |
Tests datasets |
test/research-competition.test.js |
Tests competition analytics |
src/styles.css |
Research workspace styling |
src/research.js |
Research page bootstrap |
src/core/research/workspace.js |
Workspace operations |
src/core/research/watchlists.js |
Watchlists and alerts |
src/core/research/technicals.js |
Technical analytics |
src/core/research/stats.js |
Shared statistics |
src/core/research/screener.js |
Security screening |
src/core/research/risk.js |
Risk analytics |
src/core/research/reports.js |
Report snapshots |
src/core/research/quant.js |
Quantitative analytics |
src/core/research/provenance.js |
Data provenance |
src/core/research/portfolios.js |
Portfolio management |
src/core/research/portfolio-builder.js |
Portfolio construction |
src/core/research/orchestrator.js |
Research orchestration |
src/core/research/macro.js |
Macro analytics |
src/core/research/earnings.js |
Earnings analytics |
src/core/research/dividends.js |
Dividend analytics |
src/core/research/dcf.js |
DCF valuation |
src/core/research/dataset.js |
Shared financial dataset |
src/core/research/competition.js |
Competition analytics |
setup.html |
Adds research navigation |
research.html |
Research workspace UI |
README.md |
Documents research workspace |
public/service-worker.js |
Caches research assets |
package.json |
Adds research lint targets |
learn.html |
Adds research navigation |
index.html |
Adds research navigation |
e2e/screenshots.spec.js |
Research screenshots |
e2e/research.spec.js |
Research workflow tests |
docs/architecture.md |
Documents research architecture |
banking.html |
Adds research navigation |
audit.html |
Adds research navigation |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Playwright screenshots for desktop, Android, and iOS are available in artifact #10642440600. |
Co-authored-by: charles2ke <6725706+charles2ke@users.noreply.github.com>
Co-authored-by: charles2ke <6725706+charles2ke@users.noreply.github.com>
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
Both findings in that review thread are already fixed: the DCF scenario dereference crash was fixed in |

The epic asks for ten research workflows — discover → research → value → analyse → allocate → measure risk → monitor — with a hard constraint that they share one financial data and analytics foundation rather than becoming ten independent AI prompts, and that calculated data, sourced data and AI interpretation stay clearly separated.
Foundation (
src/core/research/)dataset.js— reference securities, fundamentals, earnings, dividends, deterministic price history and macro series; one source of truth for every engine.provenance.js— wraps each externally sourced value with provider, source, as-of timestamp and currency, or records it as explicitly missing. Missing is a first-class value, not a fallback estimate.stats.js— shared statistics (returns, volatility, correlation, beta, drawdown, autocorrelation, t-statistics).Analytics engines
Pure deterministic functions over the foundation, one per workflow:
screener.js,dcf.js,risk.js,technicals.js,earnings.js,portfolio-builder.js,dividends.js,competition.js,quant.js,macro.js.Notable behaviours driven by the issue's guardrails:
dividendSafetyreturns the contributing factors, not an opaque score;marketShareTrendreturns a missing record when no reliable series exists.Workspace layer
workspace.js(global search, canonical security records, company header, dashboard),watchlists.js(watchlists + seven alert types),portfolios.js(positions, transactions, cost basis),reports.js(deep-frozen snapshots carrying the data source, assumptions and calculation version so saved reports don't drift with live data).AI layer
orchestrator.jsbuilds a grounding packet (security metadata, market data, financials, calculated metrics, macro, user assumptions) and interprets it. Interpretation narrates only what it was handed and names what was unavailable:UI
New
research.htmlwith thirteen tabs, rendered bysrc/research-ui.js; registered invite.config.js, the service worker and the lint script, and linked from the navigation on every existing page.Worth flagging for review
simulated-market-data— there is no live vendor feed.provenance.jsis the seam where a real provider would attach.createAlertbuilt its id from the un-normalised ticker, andflatteninreports.jscarried a dead branch.