phase-7_alpha: legacy code cleanup

This commit is contained in:
Kazuma
2026-06-05 22:27:53 -04:00
parent 73db0fe7a8
commit 617703e91d
13 changed files with 31 additions and 983 deletions
+6 -1
View File
@@ -3,9 +3,14 @@ import assert from 'node:assert/strict';
import { PortfolioAdvisor } from '../server/services/PortfolioAdvisor';
import { SIGNAL } from '../server/config/constants';
import type { PortfolioHolding } from '../server/types';
import type { YahooFinanceClient } from '../server/clients/YahooFinanceClient';
// _cryptoPrices is the only method that uses the client; all other private
// methods under test are pure calculations that never touch it.
const stubClient = {} as unknown as YahooFinanceClient;
// Cast to any to access private methods — tests exercise internal behaviour directly.
const advisor = new PortfolioAdvisor() as any;
const advisor = new PortfolioAdvisor(stubClient) as any;
// Minimal holding shape used by _position and _advice (only costBasis/shares matter).
const holding = (costBasis: number, shares: number): PortfolioHolding => ({