diff --git a/apps/stock/data-pipeline/README.md b/apps/stock/data-pipeline/README.md index 47446bcb..6ab39648 100644 --- a/apps/stock/data-pipeline/README.md +++ b/apps/stock/data-pipeline/README.md @@ -76,4 +76,7 @@ MONGODB_READ_URI="mongodb://studio_stock_bot_read:@localhost:27017/sto bun --env-file=/home/boki/.studio/test-env/stock-bot.env test test/postgres/security-master-persist.test.ts ``` -The benchmark logs measured core and total rows/s directly to stdout during unsandboxed host test runs. +- **Recorded baseline (`2026-11-28`, host PostgreSQL isolated `stock_bot_safety_*` schema, default `chunkSize = 5000`):** + - Workload: `20,000` instruments, `20,000` listings, `60,000` provider mappings (`100,000` core rows; `140,000` total rows including `20,000` `instrument_identifier_history` and `20,000` `listing_symbol_history` rows). + - Observed end-to-end test wall time: `2.20s` (`2200.02ms`, reported by `bun test`; includes isolated schema migration, synthetic fixture construction, `persistSecurityMaster`, and `COUNT(*)` verification because `test/setup.ts` suppresses `console.info`). + - Throughput (conservative lower bound over full test wall time): `45,454` core rows/s (`100,000 / 2.20002s`), `63,636` total rows/s (`140,000 / 2.20002s`). diff --git a/apps/stock/data-pipeline/src/security-master/persist.ts b/apps/stock/data-pipeline/src/security-master/persist.ts index e5f29add..b90ea6cd 100644 --- a/apps/stock/data-pipeline/src/security-master/persist.ts +++ b/apps/stock/data-pipeline/src/security-master/persist.ts @@ -1,3 +1,15 @@ +/** + * Idempotent, single-transaction PostgreSQL loader for Pass 3 (Stage A/B), Pass 5 + * (`resolution_conflict`), and Pass 6 (`delisting-chains`) security-master outputs. + * + * Recorded local benchmark baseline (`2026-11-28`, host PostgreSQL isolated `stock_bot_safety_*` + * schema, default `chunkSize = 5000`): + * - Command: `bun --env-file=/home/boki/.studio/test-env/stock-bot.env test test/postgres/security-master-persist.test.ts` + * - Workload: 20,000 instruments, 20,000 listings, 60,000 mappings (100,000 core rows; 140,000 total rows). + * - Observed end-to-end test wall time: 2.20s (2200.02ms, including schema setup, fixture generation, + * persistence, and COUNT(*) verification because `test/setup.ts` suppresses `console.info`). + * - Throughput (lower bound over full test wall time): 45,454 core rows/s, 63,636 total rows/s. + */ import type { DelistingChainResult, ListingDelistOutcome,