T-148: edits made in the worktree

This commit is contained in:
Studio 2026-12-01 23:24:23 -05:00
parent 8f9e9ac196
commit 4f0d16de5a
3 changed files with 7 additions and 6 deletions

View file

@ -131,7 +131,7 @@ Exported from `@stock-bot/research` and `@stock-bot/research/market-data-store-r
- **`createRoutedMarketDataStore({ daily, intraday })`** — Composes a full daily `MarketDataStore` (e.g. `createDuckDbMarketDataStore`) with an intraday `bars` reader (`Pick<MarketDataStore, 'bars'>`, e.g. `createQuestDbIntradayBarsReader`).
- `bars(q)` with `timeframe: '1m'` delegates directly to `intraday.bars(q)` (preserving lazy iteration, receiver, query identity, and error propagation). Note that `createQuestDbIntradayBarsReader` supports split-unadjusted raw (`adjustment: 'raw'`) `1m` bars.
- `bars(q)` with any other timeframe (`'1d'`, `'5m'`, `'1h'`, or malformed inputs) and all other `MarketDataStore` methods (`crossSection`, `fundamentalsAsOf`, `events`, `shortsAsOf`, `macroAsOf`, `fx`, `universe`) delegate directly to `daily`.
- **Shared Vault fence requirement:** The router adds no Vault logic of its own; each delegate enforces its own fence. Always construct `daily`, `intraday`, and any MCP tool (`createQueryDataTool` / `createResearchCopilotMcpServer`) with the exact same `vaultCutoffTs` and `vaultOperatorAuthorized`:
- **Shared Vault fence requirement:** The router adds no Vault logic of its own; each delegate enforces its own fence. Always construct `daily` and `intraday` with the exact same `vaultCutoffTs` and `vaultOperatorAuthorized`, and pass that same `vaultCutoffTs` to `createQueryDataTool` (which is always Vault-fenced and accepts only `{ vaultCutoffTs }`):
```ts
const vaultCutoffTs = Date.UTC(2025, 6, 1, 0, 0, 0, 0);
@ -151,7 +151,7 @@ const intraday = createQuestDbIntradayBarsReader({
const store = createRoutedMarketDataStore({ daily, intraday });
const queryDataTool = createQueryDataTool({
store,
vaultContext: { vaultCutoffTs, vaultOperatorAuthorized },
vaultContext: { vaultCutoffTs },
});
```