Skip to content

Add an investment research and portfolio intelligence workspace - #50

Merged
charles2ke merged 7 commits into
mainfrom
copilot/build-investment-research-platform
Sep 21, 2026
Merged

charles2ke merged 7 commits into
mainfrom
copilot/build-investment-research-platform

Conversation

Copilot AI commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • DCF computes both perpetuity-growth and exit-multiple terminal values, base/bull/bear scenarios and WACC sensitivity matrices; every assumption is an input.
  • Quant seasonality and event studies report observations and statistical significance alongside every mean, so noise isn't presented as an edge.
  • dividendSafety returns the contributing factors, not an opaque score; marketShareTrend returns 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.js builds 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:

const run = runResearch("TSLA");
run.interpretation.narrative.at(-2);
// "Not available from the connected data sources: peg. These values were not estimated."

UI

New research.html with thirteen tabs, rendered by src/research-ui.js; registered in vite.config.js, the service worker and the lint script, and linked from the navigation on every existing page.

Worth flagging for review

  • The data layer is a bundled dataset labelled simulated-market-data — there is no live vendor feed. provenance.js is the seam where a real provider would attach.
  • The AI layer is deterministic template-based interpretation, not an LLM call. It satisfies the "services calculate, the model interprets" architecture and the no-fabrication rule, but it is not generative.
  • PostgreSQL/Redis/FastAPI from the recommended stack were not adopted; this repository is a vanilla-JS + Vite + Node app and the engines are framework-free ESM shared by client and server.
  • Two incidental fixes fell out of testing: createAlert built its id from the un-normalised ticker, and flatten in reports.js carried a dead branch.

Copilot AI and others added 4 commits September 21, 2026 12:50
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>
Copilot AI changed the title [WIP] Build institutional investment research and portfolio intelligence platform Add an investment research and portfolio intelligence workspace Sep 21, 2026
Copilot AI requested a review from charles2ke September 21, 2026 13:05
@charles2ke
charles2ke marked this pull request as ready for review September 21, 2026 13:19
@charles2ke
charles2ke requested a lite review from Copilot September 21, 2026 13:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity

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.

Comment thread src/research-ui.js Resolved
Comment thread src/research-ui.js Resolved
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

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>
@charles2ke

Copy link
Copy Markdown
Owner

@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.

Copilot AI commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, appl...

Both findings in that review thread are already fixed: the DCF scenario dereference crash was fixed in 3e32022 and the technical analysis dereference crash was fixed in bc63f07, which is the current HEAD of this branch. No further changes needed.

@charles2ke
charles2ke merged commit d0fd65a into main Sep 21, 2026
9 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.

Investment Research & Portfolio Intelligence Platform

3 participants