Skip to content

The market data a report is built on can come from nichedb - #26

Merged
ralyodio merged 1 commit into
mainfrom
nichedb-mirror
Sep 11, 2026
Merged

The market data a report is built on can come from nichedb#26
ralyodio merged 1 commit into
mainfrom
nichedb-mirror

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

A report build asked Alpaca for four hundred days of bars and the SEC for a company's facts, and the symbol directory was Alpaca's asset list pulled whole. nichedb.dev keeps all three now (0.8.0: markets kinds symbol, history, fundamentals), so this adds the other path behind one switch and leaves the live one in place.

With NICHEDB_MARKETS=1 (NICHEDB_URL optional):

  • Bars for a report build: the symbol's history item (two requests a build with fundamentals), mapped to the same MarketBar[]; no item, empty window or last older than five days → the Alpaca→Yahoo path unchanged. Report records barsSource for provenance.
  • Fundamentals: the company's fundamentals item with the same derivations sec.ts makes (revenue precedence, YoY from two fiscal years, shares from the cover page, debt current + noncurrent, runway); missing → live SEC. The filings list stays live.
  • Symbols: transcripts symbols sync walks kind=symbol by keyset with a since= cursor (nichedb_cursor table, advanced only after a completed walk) instead of pulling /v2/assets; crypto pairs skipped as before; nichedb failure → Alpaca path.
  • News: a ticker's refresh reads nichedb's market news wire for the symbol (90-day window on published_at) as step 0 of the same provider chain, then the RSS wires run as before; URL dedupe already exists.

Snapshots stay live (nichedb keeps no quotes), and so does everything built on top: signals, corroboration, scoring, ASR, the LLM analysis, credits and digests.

bun test: 618 pass (28 new); tsc --noEmit clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_014X1XCwt5iD3nqZfbddZqEP

A report build asked Alpaca for four hundred days of bars and the SEC
for a company's facts, and the symbol directory was Alpaca's asset
list pulled whole. nichedb.dev keeps all three now, so with
NICHEDB_MARKETS=1 a build reads the symbol's history item and the
company's fundamentals item, two requests, and falls back to the
live path when either is missing or older than five days; the
symbol sync walks the directory by cursor instead of pulling the
list; and a ticker's news refresh reads nichedb's market news wire
for the symbol before the RSS feeds run. Snapshots stay live, since
nichedb keeps no quotes, and so does everything built on top: the
signals, the corroboration, the scoring and the analysis.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014X1XCwt5iD3nqZfbddZqEP
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

31 finding(s)

MEDIUM: 27 | LOW: 4

Severity Rule Location
MEDIUM js-unescaped-html-sink public/app.js:81
MEDIUM js-unescaped-html-sink public/app.js:137
MEDIUM js-unescaped-html-sink public/app.js:284
MEDIUM js-unescaped-html-sink public/app.js:627
MEDIUM js-unescaped-html-sink public/app.js:631
MEDIUM js-unescaped-html-sink public/app.js:685
MEDIUM js-unescaped-html-sink public/app.js:1100
MEDIUM js-unescaped-html-sink public/app.js:1101
MEDIUM js-unescaped-html-sink public/app.js:1148
MEDIUM js-unescaped-html-sink public/app.js:1666
MEDIUM js-unescaped-html-sink public/app.js:1851
MEDIUM js-unescaped-html-sink public/app.js:1863
MEDIUM js-unescaped-html-sink public/app.js:1905
MEDIUM js-unescaped-html-sink public/app.js:1965
MEDIUM js-unescaped-html-sink public/app.js:2124
MEDIUM js-unescaped-html-sink public/app.js:2140
MEDIUM js-unescaped-html-sink public/app.js:2291
MEDIUM js-unescaped-html-sink public/app.js:2308
MEDIUM js-unescaped-html-sink public/app.js:2513
MEDIUM js-unescaped-html-sink public/auth.js:41
MEDIUM js-unescaped-html-sink public/auth.js:59
MEDIUM js-unescaped-html-sink public/auth.js:106
MEDIUM js-unescaped-html-sink public/auth.js:258
MEDIUM sql-template-interpolation src/cli.ts:1053
MEDIUM sql-template-interpolation src/research/routes.ts:299
MEDIUM sql-template-interpolation src/server.ts:515
MEDIUM sql-template-interpolation src/symbols/routes.ts:75
LOW secret-generic-api-key test/auth.test.ts:190
LOW js-dynamic-code-execution test/dashboard-crypto.test.ts:216
LOW js-dynamic-code-execution test/dashboard-search.test.ts:182
LOW js-dynamic-code-execution test/dashboard-watchlist.test.ts:236

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 9a784e2 into main Sep 11, 2026
6 checks passed
@ralyodio
ralyodio deleted the nichedb-mirror branch September 11, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant