No description
Find a file
2026-10-20 14:35:45 -04:00
.githooks running prettier for cleanup 2025-06-13 13:38:02 -04:00
.vscode format 2025-06-22 17:55:51 -04:00
apps commit 2 refactor 2026-10-20 14:35:45 -04:00
database socket reruns 2025-07-04 17:04:47 -04:00
docs test 2026-03-21 13:06:46 -04:00
libs commit 2 refactor 2026-10-20 14:35:45 -04:00
monitoring linxus fs fixes 2025-06-09 22:55:51 -04:00
scripts commit 2 refactor 2026-10-20 14:35:45 -04:00
test commit 2 refactor 2026-10-20 14:35:45 -04:00
tools/coverage-cli commit 2 refactor 2026-10-20 14:35:45 -04:00
.coveragerc.json fixed format issues 2025-06-26 16:12:27 -04:00
.dockerignore linxus fs fixes 2025-06-09 22:55:51 -04:00
.env test 2025-07-07 15:48:03 -04:00
.gitignore first refactor 2026-10-20 12:39:38 -04:00
.gitlab-ci.yml first refactor 2026-10-20 12:39:38 -04:00
.prettierignore prettier configs 2025-06-13 13:38:02 -04:00
.prettierrc commit 2 refactor 2026-10-20 14:35:45 -04:00
bun.lock commit 2 refactor 2026-10-20 14:35:45 -04:00
bunfig.toml added cli-covarage tool and fixed more tests 2025-06-26 14:23:01 -04:00
Cargo.lock work on new engine 2025-07-04 11:24:27 -04:00
Cargo.toml work on new engine 2025-07-04 11:24:27 -04:00
CLAUDE.md huge refactor to remove depenencie hell and add typesafe container 2025-06-24 09:37:51 -04:00
docker-compose.dev.yml removed cache mode so noeviction gets set 2025-06-09 22:56:23 -04:00
docker-compose.yml test 2026-03-21 13:06:46 -04:00
eslint.config.js commit 2 refactor 2026-10-20 14:35:45 -04:00
knip.json huge refactor to remove depenencie hell and add typesafe container 2025-06-24 09:37:51 -04:00
package.json commit 2 refactor 2026-10-20 14:35:45 -04:00
proxy-playwrite.ts fixed browser, made payload optional 2025-06-20 22:16:13 -04:00
README.md commit 2 refactor 2026-10-20 14:35:45 -04:00
test-e2e-backtest.sh fixed backtest i think 2025-07-03 20:41:42 -04:00
test-queue.ts huge refactor done 2025-06-24 11:59:35 -04:00
test-rust-strategies.js added trade-tracking and example rust strats 2025-07-03 22:55:23 -04:00
test-typescript-strategy.js added rust engine and adapter pattern 2025-07-03 22:28:31 -04:00
tetest.ts work on spider for te 2025-07-06 15:26:47 -04:00
tsconfig.app.json first refactor 2026-10-20 12:39:38 -04:00
tsconfig.check.json first refactor 2026-10-20 12:39:38 -04:00
tsconfig.contracts.json first refactor 2026-10-20 12:39:38 -04:00
tsconfig.json huge refactor to remove depenencie hell and add typesafe container 2025-06-24 09:37:51 -04:00
tsconfig.lib.json format 2025-06-22 17:55:51 -04:00
tsconfig.unused.json huge refactor to remove depenencie hell and add typesafe container 2025-06-24 09:37:51 -04:00
turbo.json first refactor 2026-10-20 12:39:38 -04:00

Stock Bot

Bun/TypeScript workspaces for market-data collection, processing, APIs, and a React dashboard, with a Rust native trading engine. apps/wcag-ada is an independent project and is not part of the root workspace checks.

Build and verify

Use Bun 1.2.17, Node.js 18 or newer, and a Rust toolchain with a native linker. CI uses Rust 1.88. Building and the tooling/contract/integration checks do not require running databases or provider credentials.

bun install --frozen-lockfile
bun run build
bun run check

The root build selects every buildable leaf workspace, including all stock services and the native engine. bun run build --dry=json shows the actual Turbo task plan.

Command Scope
bun run build:libs Build shared libraries in dependency order
bun run build --clean Force every workspace build without cached results
bun run typecheck Check library, stock application, and tool source directly
bun run test:contracts Compile positive and negative service-contract assertions
bun run test:tooling Run workspace and service-consumer regression tests without infrastructure
bun run test:integration Replay fixed prices through ingestion, storage, and the real native backtest engine
bun run lint:check Lint stock applications, libraries, and tools with zero warnings allowed
bun run check Run build, type checking, contract tests, tooling/integration tests, and lint; report every failed gate

check exits nonzero if any gate fails. Type/lint errors are not suppressed or baselined. The larger existing bun run test suite is separate: some tests need databases, Redis, browsers, or native-engine fixes.

Native builds generate apps/stock/engine/dist/engine.node and dist/index.d.ts. The public ESM/CommonJS loaders and declaration facade use those generated artifacts. Rebuild after changing Rust APIs. TensorFlow is loaded only when starting the optional ML strategy. Its TypeScript dependency is present for checking; using ML also requires installing its platform-specific native binding. Dependency install scripts were not enabled for verification.

Service contracts

@stock-bot/types contains independent domain, job, and handler types. @stock-bot/services composes service capabilities from the public APIs exported by the owning adapters. It uses type-only imports and does not initialize connections.

import type { IServiceContainer, ServiceTypes } from '@stock-bot/services';
import type { ExecutionContext } from '@stock-bot/types';

The DI and handler packages re-export IServiceContainer for existing consumers. Queue managers and individual queues are separate capabilities: obtain queues through container.queueManager, submit with queue.add, and await results with queue.waitForJob. Use getFullQueueName(service, handler) when addressing another service's queue.

Use requireServices(container, 'mongodb', 'queueManager') at consumer boundaries when those capabilities are required. Missing/disabled adapters fail explicitly before work begins. @stock-bot/invariants provides small, dependency-free checks for required values and indexed array reads; browser code can use it without importing server utilities.

Handler initializers receive their scanner/registry explicitly through the DI application initialization context. WebSocket connections and completion timers belong to the socket handler and are released on close/shutdown.

Backtest data integrity

Historical storage no longer invents prices when a database is unavailable. Configure a historical store, or explicitly set services.orchestrator.backtesting.allowSyntheticData for offline demos, with syntheticSeed for repeatability. Synthetic data is disabled by default and must not be used to assess trading performance. MongoDB's normalized EOD store currently supports daily bars only; intraday requests require QuestDB.

The integration test uses an in-memory persistence transport and the real storage/native engine path. It checks idempotent ingestion, invalid-price rejection, repeatable trades, and explicit failures for missing data or unsupported strategies. No live provider or broker is contacted. Native SMA and MACD regressions are covered by the repository checks.

Coverage reports contain measured LCOV data only. Missing coverage or an empty package selection fails the coverage command instead of producing an estimated score.