Skip to content

Release v1.2.0#99

Merged
atomantic merged 55 commits intoreleasefrom
main
Mar 21, 2026
Merged

Release v1.2.0#99
atomantic merged 55 commits intoreleasefrom
main

Conversation

@atomantic
Copy link
Owner

Summary

Release v1.2.0 — Dependency updates, bug fixes, and backtest improvements.

Added

  • Re-invest toggle to backtest — recycle sell proceeds into cash pool
  • Privacy policy and terms of use for App Store submission

Changed

  • Upgraded vite 7.3.1 → 8.0.1, @vitejs/plugin-react 5.1.4 → 6.0.1
  • Upgraded jsdom 28 → 29, vitest group → 4.1.0, typescript-eslint → 8.57.0
  • Upgraded lint-staged, @types/node, flatted, recharts, postcss
  • Updated manualChunks to function syntax for vite 8/Rolldown compatibility

Fixed

  • Fund size calculation for manage_cash=false accumulate funds
  • Derivatives engine values for closed fund Net Gain/Loss
  • Zero out fund size/value for closed derivatives funds
  • Tracked fund_size for harvest mode funds on platform dashboard
  • Only count margin_borrowed from cash funds to prevent double-counting
  • Exclude test/demo funds from export
  • Updated undici to resolve WebSocket overflow and HTTP smuggling vulnerabilities

Full Changelog

Full Diff: v1.1.0...v1.2.0

atomantic and others added 30 commits March 8, 2026 00:59
Bumps [postcss](https://github.com/postcss/postcss) from 8.5.6 to 8.5.8.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](postcss/postcss@8.5.6...8.5.8)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [postcss](https://github.com/postcss/postcss) from 8.5.6 to 8.5.8.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](postcss/postcss@8.5.6...8.5.8)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.3.3 to 25.3.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.3.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 16.3.1 to 16.3.2.
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md)
- [Commits](lint-staged/lint-staged@v16.3.1...v16.3.2)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-version: 16.3.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.3.3 to 25.3.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.3.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [recharts](https://github.com/recharts/recharts) from 3.7.0 to 3.8.0.
- [Release notes](https://github.com/recharts/recharts/releases)
- [Changelog](https://github.com/recharts/recharts/blob/main/CHANGELOG.md)
- [Commits](recharts/recharts@v3.7.0...v3.8.0)

---
updated-dependencies:
- dependency-name: recharts
  dependency-version: 3.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…nting

margin_borrowed was being summed from all fund entries, but it is tracked
on both trading fund entries (per-trade amount) and cash fund entries
(cumulative total). This caused the dashboard to show ~2x the actual
margin used. Now only the cash fund (authoritative source) is counted.
…ostcss-8.5.8

chore(deps-dev): bump postcss from 8.5.6 to 8.5.8 in /pages
…-8.5.8

chore(deps-dev): bump postcss from 8.5.6 to 8.5.8
…ypes/node-25.3.5

chore(deps-dev): bump @types/node from 25.3.3 to 25.3.5 in /pages
…aged-16.3.2

chore(deps-dev): bump lint-staged from 16.3.1 to 16.3.2
…ode-25.3.5

chore(deps-dev): bump @types/node from 25.3.3 to 25.3.5
…s-3.8.0

chore(deps): bump recharts from 3.7.0 to 3.8.0
…atform

- Filter out test/demo platform funds in GET /export and GET /export/download
- Add 'demo' prefix check to isTestPlatform() for iOS app compatibility
…ash pool

When enabled (default), sell proceeds, cash interest, and dividends are
available for new DCA buys. When disabled, only the initial cash pool
funds purchases.
Bumps [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) from 5.1.4 to 6.0.1.
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/plugin-react@6.0.1/packages/plugin-react)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-react"
  dependency-version: 6.0.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the vitest group with 2 updates: [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) and [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest).


Updates `@vitest/coverage-v8` from 4.0.18 to 4.1.0
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v4.1.0/packages/coverage-v8)

Updates `vitest` from 4.0.18 to 4.1.0
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v4.1.0/packages/vitest)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-v8"
  dependency-version: 4.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: vitest
- dependency-name: vitest
  dependency-version: 4.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: vitest
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.3.5 to 25.5.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.1 to 8.0.0.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/create-vite@8.0.0/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 8.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.56.1 to 8.57.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.57.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-version: 8.57.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) from 5.1.4 to 6.0.1.
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/plugin-react@6.0.1/packages/plugin-react)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-react"
  dependency-version: 6.0.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [jsdom](https://github.com/jsdom/jsdom) from 28.1.0 to 29.0.0.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/v29.0.0/Changelog.md)
- [Commits](jsdom/jsdom@v28.1.0...v29.0.0)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-version: 29.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 16.3.2 to 16.4.0.
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md)
- [Commits](lint-staged/lint-staged@v16.3.2...v16.4.0)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-version: 16.4.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.1 to 8.0.0.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/create-vite@8.0.0/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 8.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.3.5 to 25.5.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Release v1.2.0 focusing on dependency upgrades (Vite 8/Rolldown ecosystem), correctness fixes in fund metrics/history calculations (accumulate/closed derivatives/margin borrowed), and App Store readiness docs (Terms/Privacy), plus a new “re-invest proceeds” toggle in the backtest UI/engine integration.

Changes:

  • Upgraded build/test tooling dependencies (Vite 8, plugin-react 6, jsdom 29, vitest coverage, etc.) and updated Vite manualChunks to function form for Rolldown compatibility.
  • Fixed/adjusted fund sizing & metrics logic across web + server (accumulate semantics, closed derivatives zeroing, margin borrowed double-count prevention, export filtering).
  • Added public + docs Terms/Privacy pages and backup normalization for Swift-export compatibility; added backtest reinvest toggle plumbing.

Reviewed changes

Copilot reviewed 25 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pages/vite.config.ts Updates manualChunks to function syntax for Vite 8/Rolldown compatibility.
pages/package.json Bumps dev tooling deps (Vite/plugin-react/PostCSS/@types/node).
pages/package-lock.json Lockfile updates reflecting Vite 8 + Rolldown dependency tree changes.
packages/web/vite.config.ts Updates manualChunks to function syntax; separates d3/vendor chunks.
packages/web/src/pages/FundDetail.tsx Fixes accumulate/liquidation tracking (sumShares reset) and fund size derivation for non-cash-managed funds.
packages/web/src/pages/Backtest.tsx Adds reinvest to default scenario configs.
packages/web/src/backtest/backtest.ts Adds ScenarioConfig.reinvest and overrides engine cash availability when enabled.
packages/web/src/backtest/BacktestView.tsx Adds UI checkbox for “Re-invest proceeds”.
packages/web/public/terms.html Adds public Terms of Use HTML page.
packages/web/public/privacy.html Adds public Privacy Policy HTML page.
packages/web/package.json Updates web deps (recharts/jsdom/vite/plugin-react/coverage-v8/postcss).
packages/storage/src/backup.ts Adds Swift→web backup normalization and applies it during validation.
packages/storage/package.json Updates dev deps (@types/node, vitest coverage).
packages/server/src/utils/platforms.ts Treats demo* as test/demo platforms in isTestPlatform.
packages/server/src/utils/fund-metrics.ts Adjusts final metrics (closed derivatives zeroing, accumulate/share tracking reset, fund_size preference).
packages/server/src/utils/calculations.ts Fixes liquidation detection logic to avoid false positives when value is missing/0.
packages/server/src/services/dashboard-cache.ts Avoids double-counting margin borrowed by only attributing it to cash funds.
packages/server/src/routes/funds.ts Multiple metrics/history fixes (margin borrowed attribution, accumulate invested calc, liquidation detection, closed derivatives net gain override).
packages/server/src/routes/export.ts Excludes test/demo funds from export output.
packages/server/src/routes/backup.ts Normalizes Swift backup payloads on upload before validation.
packages/server/package.json Updates vitest coverage dev dep.
packages/engine/package.json Updates vitest coverage dev dep.
package.json Bumps repo version to 1.2.0 and updates lint-staged/typescript-eslint.
docs/TERMS.md Adds Terms of Use markdown for repo documentation.
docs/PRIVACY.md Adds Privacy Policy markdown for repo documentation.
.changelogs/v1.2.0.md Adds v1.2.0 release changelog entry.
Files not reviewed (1)
  • pages/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

… policy network claims, align legal doc dates

- Backtest reinvest toggle: when disabled, sell proceeds/interest/dividends
  are no longer added to the cash pool, properly treating them as extracted.
  Also always override engine cash_available_usd with tracked cash for
  consistent behavior in both modes.
- Privacy policy: changed "No network requests" to "No external network
  requests" to accurately reflect local API communication.
- Terms/Privacy dates: aligned to March 19, 2026 to match terms.html.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 25 out of 28 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pages/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

… numbers

- derivLiquidPnl: realizedPnl already includes funding/interest/rebates/fees,
  so remove redundant sumFunding+sumInterest+sumRebates to fix double-counting
- Changelog: correct lint-staged from version (16.3.1, not 16.3.2) and
  @types/node from version (25.3.3, not 25.3.5) per actual PR diff
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 25 out of 28 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pages/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ility

Tests cover exported->backup_date conversion, numeric version normalization,
default scrape_archives, and combined Swift format handling.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 29 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pages/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…k grouping

- Derivatives closed metrics: derive total_invested/total_returned from
  DEPOSIT/WITHDRAW entries so all fields are internally consistent with
  net_gain/return_pct/apy computed from engine state.
- Vite manualChunks: include react-router alongside react-router-dom in
  the vendor chunk to prevent the transitive dependency from splitting.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 29 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pages/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)

packages/web/src/backtest/backtest.ts:296

  • totalExtracted is incremented on every SELL even when scenario.reinvest is enabled. This makes the "Total Extracted" metric (and downstream calculations like dollarsLiquidated) incorrect when proceeds stay in the fund, and can cause false full-liquidation detection/reset after profitable partial sells. Consider tracking separate totalSold vs totalExtracted (only when reinvest is false), and avoid using an extracted-dollar heuristic for liquidation when reinvesting (prefer share/value based checks).
        if (scenario.reinvest) {
          cash += sellAmount
        }
        totalExtracted += sellAmount

        spxlEquivShares *= (1 - sellProportion)
        vtiEquivShares *= (1 - sellProportion)
        brgnxEquivShares *= (1 - sellProportion)
        tqqqEquivShares *= (1 - sellProportion)
        gldEquivShares *= (1 - sellProportion)
        slvEquivShares *= (1 - sellProportion)

        const sharesLiquidated = shares < 0.0001
        const valueLiquidated = equity <= sellAmount + 0.01
        const dollarsLiquidated = totalExtracted >= totalInvested
        const isFullLiquidation = sharesLiquidated || valueLiquidated || dollarsLiquidated

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…cash flows

Label now says "Reinvest sell proceeds, interest, and dividends" to
accurately describe what the toggle controls in the simulation.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 29 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pages/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…s disabled

When reinvest is enabled, sell proceeds stay in the cash pool for future
buys, so they should not increment totalExtracted. This makes the
Total Extracted metric accurately reflect funds actually removed from
the simulation.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 29 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pages/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@atomantic atomantic merged commit 79f82c6 into release Mar 21, 2026
6 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.

2 participants