- Remove ~44k LOC of dead code, legacy v1 TS simulator/strategy stack, event-bus, analytics FastAPI prototype, legacy calculation archives, and unused deps (data-ingestion provider API handlers untouched) - Extract @stock-bot/di/http-security and isolate @stock-bot/browser to data-ingestion via ServiceContainerBuilder.withRegistrations() - Harden @stock-bot/mongodb read-only proxies, flatten @stock-bot/postgres with unified master+research migrations, and fix @stock-bot/config EnvLoader, ServiceApplication worker lifecycle, NamespacedCache.clear(), and BatchProcessor error propagation - Flatten workspace root (remove apps/stock/package.json) and collapse orchestrator re-export shims - Pin all Docker image versions, add shm_size/nofile/RAM caps and docker-compose.quant.yml, fix 05-add-visible-column.sql view recreation, and decouple dev/QA Compose project names for side-by-side execution - Update PLATFORM-PLAN, DATA-CONTRACTS (bars_1m PARTITION BY MONTH, Rust bulk ETL, DuckDB limits), MILESTONES, and servers docs
29 lines
1.4 KiB
TypeScript
29 lines
1.4 KiB
TypeScript
import { buildCanonicalBacktestReport } from '@stock-bot/research/results';
|
|
import type { CanonicalRunResult } from '@stock-bot/stock-config/canonical-research';
|
|
import { prepareReplayLoad } from '../../apps/stock/orchestrator/src/backtest/native-replay';
|
|
import { runStrategyReplay } from '../../apps/stock/orchestrator/src/backtest/strategy-runtime';
|
|
import { smaStrategySelectionSchema } from '@stock-bot/stock-config/strategy';
|
|
import { createSmaStrategy } from '../../apps/stock/orchestrator/src/strategies/canonical-sma';
|
|
import { canonicalRunnerFixture } from './canonical-runner';
|
|
|
|
/** Actual Rust finances and existing SMA logic; fixture-only metadata is not an admission proof. */
|
|
export function canonicalResultFixture(): CanonicalRunResult {
|
|
const { request, dataset } = canonicalRunnerFixture();
|
|
const { result: financial } = runStrategyReplay(
|
|
prepareReplayLoad(dataset, request.policy),
|
|
[createSmaStrategy(smaStrategySelectionSchema.parse(request.strategy.selection))],
|
|
{ resultFormat: 'report' }
|
|
);
|
|
return {
|
|
kind: 'canonical-result/v1',
|
|
runId: request.runId,
|
|
backtestId: request.backtestId,
|
|
status: 'completed',
|
|
completedAt: '2026-10-27T12:00:00.000Z',
|
|
executionTime: 1,
|
|
financialEngine: 'rust',
|
|
strategyExecution: 'typescript-retained-builtin/v1',
|
|
request,
|
|
...buildCanonicalBacktestReport(financial, request.analyticsPolicy),
|
|
};
|
|
}
|