feat(engine): expose canonical replay sessions through native workers

This commit is contained in:
Boki 2026-10-23 00:54:36 -04:00
parent 417a7bd21e
commit e3635f23cf
26 changed files with 2693 additions and 33 deletions

View file

@ -183,11 +183,15 @@ describe('orchestrator architecture boundaries', () => {
relative(root, file).startsWith('backtest/') &&
imports.get(file)?.includes('@stock-bot/engine')
);
expect(nativeEntrypoints.map(file => relative(root, file))).toEqual([
expect(nativeEntrypoints.map(file => relative(root, file)).sort()).toEqual([
'backtest/native-replay.ts',
'backtest/native-worker.ts',
]);
for (const file of files) {
const path = relative(root, file);
if (reachable(file).has(join(root, 'backtest/native-replay.ts'))) {
expect(['backtest/native-replay.ts', 'backtest/native-worker.ts']).toContain(path);
}
const source = ts.createSourceFile(
file,
readFileSync(file, 'utf8'),
@ -211,6 +215,12 @@ describe('orchestrator architecture boundaries', () => {
) {
expect(path).toBe('backtest/native-worker.ts');
}
if (
!binding.isTypeOnly &&
(binding.propertyName ?? binding.name).text === 'FinancialReplaySession'
) {
expect(path).toBe('backtest/native-replay.ts');
}
}
}
}