84 Commits
Author SHA1 Message Date
Investor Flow Build a79331fe9a Bound confluence replay so Unraid HTTP stays alive.
CI / Test (push) Canceled after 0s
CI / Build and push (push) Canceled after 0s
Replay of 80 as-of days per symbol was a sync CPU loop; boot and symbol-page reads ran it on the main thread, so login and every tRPC call hit the 8s timeout. Cap wall time, yield every as-of, and stop filling the learning ledger on boot.
2026-09-09 10:29:18 -04:00
Investor Flow Build 0b901fc190 Keep HTTP responsive during confluence replay.
CI / Test (push) Canceled after 0s
CI / Build and push (push) Canceled after 0s
Boot replay was a tight CPU loop that wedged the Unraid backend, so login hit the 8s client timeout. Yield every few as-of dates, shorten the boot ledger fill, and make /health a cheap liveness check.
2026-09-09 10:16:36 -04:00
Investor Flow Build 7426103d73 Isolate Yahoo drain from SEC backlog and protect the guest account.
CI / Test (push) Canceled after 0s
CI / Build and push (push) Canceled after 0s
Yahoo and SEC drain on separate workers so hung EDGAR jobs cannot freeze watchlist prices. Queue health splits yahooHealthy from institutional backfill, watchlist snapshots only enqueue missing quotes, and first subscribe seeds quote/candles/symbol. Hide the anonymous system user from Admin so it cannot be deleted.
2026-09-09 09:55:21 -04:00
Investor Flow Build 7649eaf399 feat: welcome desk auth and operator password reset
CI / Test (push) Canceled after 0s
CI / Build and push (push) Canceled after 0s
First visit lands on /welcome instead of burying signup in Settings.
Add a host CLI to reset passwords without a session, plus Settings
change-password. Refresh as-built design docs and the Unraid operator guide.
2026-08-19 21:19:57 -04:00
Investor Flow Build 90e1829d39 feat: Unraid deploy, dealer-flow heatmap, confluence zones, 13F capture
CI / Test (push) Canceled after 0s
CI / Build and push (push) Canceled after 0s
Ship Node production images, Unraid compose, and Gitea CI/CD (test then
push registry images; cron script if no runner). Rebuild dealer flow as a
heatmap-first map with integrity gates and chart helpers. Add confluence
zone rules, session clock, capture evidence, and tighter 13F/queue/options
paths, plus the matching UI and tests.
2026-08-18 14:10:02 -04:00
Investor Flow Build f7efea2178 feat: per-source pause/stop controls for queue admin
Add operator pause/resume/stop/start for individual adapter sources,
persisted in queue_state. Pause freezes draining and retains jobs; stop
clears pending/backoff jobs and blocks re-enqueue until start. Wires admin
tRPC endpoints plus a clean two-row Actions layout in the queue admin page.
2026-08-12 22:39:23 -04:00
Investor Flow Build 0bc7b636e5 fix: dedup fund_capture alerts for same-date sibling records and add clear-all
fund_capture alerts for a symbol with multiple capture records sharing one
as_of re-fired every batch cycle: the single comparison-state slot
ping-ponged between sibling evidence URLs, and the pre-check dedup key
never matched the stored buildDedupKey format. Track a seen-set of URLs in
comparison state and align dedup-key construction with buildDedupKey.
Also add alerts.clearAll (hard delete) with an immediate-refresh bell.
2026-08-12 22:39:19 -04:00
Investor Flow Build e5a7ff9f33 fix: race condition causing wrong symbol data in chart and evaluation
- Add cancelled flags to evaluation and scorecard effects so stale
  responses from a previous symbol cannot overwrite current data
- Clear evaluation and scorecard state immediately in pickSymbol so
  old data never flashes when switching symbols
- Add key={symbol} to ConfluenceChart to force clean remount on
  symbol change
2026-08-11 23:43:56 -04:00
Investor Flow Build be4c59d3f4 fix: revert label to 'Symbol', highlight ticker in sidebar nav
- Revert ConfluencePanel label back to just 'Symbol'
- In SidebarNav, render 'Symbol: IREN' with the ticker in accent/pink color
2026-08-11 23:33:03 -04:00
Investor Flow Build 43786161cf fix: remove redundant symbol badge, highlight symbol in label
- Remove symbol badge between input boxes (input now stays in sync)
- Change label to 'Symbol: IREN' with the symbol value in accent/pink color
2026-08-11 23:30:07 -04:00
Investor Flow Build 96ce1c9e96 fix: sync symbol input with focus ticker
- Add searchQuery state to ConfluencePanel that tracks input value
- Pass value={searchQuery} and onChange={setSearchQuery} to SymbolAutocomplete
- Sync searchQuery when activeSymbol changes externally (from another panel)
- Update SymbolAutocomplete onChange to call externalOnChange in controlled mode
- Input now shows current symbol after pick and stays in sync
2026-08-11 23:25:51 -04:00
Investor Flow Build 9a1d837150 fix: alignment, section order, and tooltip duplication
- Move symbol badge inline with input (flex items-end) so symbol and
  rack inputs align at the bottom
- Move Signal Timeline chart above Slot Evidence table
- Deduplicate signal fires by slotId per day in chart data processing
  and by slotName in tooltip rendering (prevents MACD Bullish etc
  from appearing twice)
2026-08-11 23:20:54 -04:00
Investor Flow Build 762d6612f5 feat: add Signal Timeline chart to Signal Confluence panel
- New ConfluenceChart component renders daily price as area chart
- Overlays colored dot markers at each signal fire date (green=bull,
  red=bear, amber=exit)
- Detects entry zones (2+ bull signals within 5 days) and exit zones
  (2+ bear/exit signals) and shades them on the chart
- Custom tooltip shows price + which signals fired on hover
- Fetches candles and signal history in parallel on mount
- Placed between Slot Evidence and Reliability Scorecard sections
2026-08-11 23:15:19 -04:00
Investor Flow Build 44f8342f6e feat: add confluence.signalHistory API route
Returns signal fire history for a symbol (last 6 months) with slot
names and body types. Used by the upcoming confluence chart to plot
signal markers on price data.
2026-08-11 23:13:15 -04:00
Investor Flow Build 1a063d199a rename: Slot Picture -> Signal Confluence + fix symbol disappearing
- Tab label, panel title, ariaLabel, and explanatory text all updated
- Add visible symbol badge below autocomplete input so user always sees
  what symbol they're viewing after picking from search results
2026-08-11 23:11:54 -04:00
Investor Flow Build 470a9a27e1 fix: confluence autocomplete editable + consistent styling
- Remove value prop from SymbolAutocomplete (was making input read-only)
- Use inputClassName with app design tokens (bg-surface-sunken, border-line,
  rounded-lg) to match SymbolHeader and other pages
- Make symbol input, watchlist input, and rack select all use same
  border/radius/padding/font-size tokens
- Both panels now consistent with each other and the rest of the app
2026-08-11 22:53:54 -04:00
Investor Flow Build 0afc5b6f6e feat: confluence autocomplete + explanatory text
- Replace plain text inputs with SymbolAutocomplete (existing component)
  in both CorridorPanel and ConfluencePanel
- Add explanatory text to both panels describing what the visualization
  shows and how to interpret results
- Fix symbol reset bug: panels now sync with global activeSymbol store
  so symbol persists across tab switches and page reloads
- Add 'Run evaluation now' button when no corridor snapshot exists,
  wired to existing runEvaluationNow mutation
2026-08-11 22:49:30 -04:00
Investor Flow Build 9b41890d33 fix: IREN/ASTS/IRE stuck-pending + corridor feature
Fix stuck adapter_queue jobs (ASTS/IRE/IREN stuck pending forever):

1. fetchSpec early-return paths (cooldown checks) now update job status
   to 'backoff' with last_attempt set and 30s backoff_until, instead of
   returning without any status change. Prevents jobs from being
   re-processed every drain cycle indefinitely.

2. Wrap adapter.fetchOne() in 30s Promise.race timeout. A hung HTTP
   request no longer blocks the entire per-source promise chain
   forever, preventing all subsequent jobs for that source.

Also includes corridor/confluence feature, tiered quote schedules,
cache improvements, and HoldingsBookView refinements.
2026-08-11 22:25:17 -04:00
Investor Flow Build 24349a8b6d docs: add ADR-0012 (confluence signal engine) + glossary terms (M22 slice 12)
CI / Test & Type-Check (push) Canceled after 0s
ADR-0012 documents the 34-slot confluence signal engine architecture: slot
catalog, redundancy-aware rack evaluation, CandleProvider seam, closed-loop
signal history, and picture-change alert producer. CONTEXT.md gains a new
'Confluence Signal Engine (M22)' glossary section.
2026-08-10 22:08:33 -04:00
Investor Flow Build 74ff851ed2 feat(ui): add /confluence page with picture-quality + slot evidence grid (M22 slice 11)
ConfluencePanel shows the current picture quality for a symbol+rack, a
color-coded evidence summary, a per-slot fired/not-fired evidence grid with
notes, and the reliability scorecard. Uses the existing LayoutShell and
CollapsibleSection patterns. ADR-0007: quality labels are evidence-based
descriptions, never buy/sell directives.
2026-08-10 22:06:00 -04:00
Investor Flow Build 44243618d5 feat(confluence): add15-symbol universe seed + 3 system rack presets (M22 slice 10)
Confluence startup seed: pins the15-symbol research universe + SPY benchmark
into the permanent demand set, and creates three system rack presets (Full
Confluence, Technical Momentum, Macro+Flows+Sentiment) if absent. Called once
from index.ts; idempotent on every restart.
2026-08-10 21:59:45 -04:00
Investor Flow Build b04193e615 feat(confluence): add seasonal + technical slot evaluators (M22 slice 9)
CI / Test & Type-Check (push) Canceled after 0s
Pure, tested evaluator modules for the seasonal family (5 slots) and the
candle-computable technical family (15 slots). Uses the CandleProvider seam
(slice 8) and the indicator functions from slice 1. ADR-0007 evidence-only
notes on every assessment.
2026-08-10 21:51:46 -04:00
Investor Flow Build 07d95ba601 feat(confluence): add candle resolution seam for confluence (M22 slice 8)
CANDLE_PROVIDER resolves a symbol's candles per-granularity (1d/1wk) from the
shared cache, with a reversible fold-in of the freshest live quote so a
mid-session evaluation sees the current price. Pure fold logic + todayIso are
unit-tested; CacheCandleProvider is a thin cache-backed shim. Evaluators use
this seam instead of cache.get inline, so a future realtime/replay source can
slot in without touching slot logic.
2026-08-10 17:08:33 -04:00
Investor Flow Build a9fc5d243e feat(cot): add CFTC Traders-in-Financial-Futures adapter (M22 slice 7)
CI / Test & Type-Check (push) Canceled after 0s
Parse the annual FinFutYY.txt zip (leveraged-funds long/short + OI) into a
CotSeries. Registers the 'cot' source_kind, 'cot_weekly' TTL (7d), the 'cftc'
vendor family (1 req/1.5s pacing), and the adapter in the queue registry.

Uses the file-header column names so parser is robust to layout changes.
2026-08-10 16:35:33 -04:00
Investor Flow Build 8031eae1b2 feat(api): add confluence tRPC router (slots, racks, evaluation, backtest, scorecard, saveRack) + client exposure (M22 slice 6) 2026-08-10 16:07:19 -04:00
Investor Flow Build 9110d5023e feat(alerts): add confluence_change picture-transition alert producer (M22 slice 5) 2026-08-10 16:02:20 -04:00
Investor Flow Build 358286ce18 feat(confluence): add slot backtest, follow-through resolver, and reliability scorecard (M22 slice 4) 2026-08-10 15:18:21 -04:00
Investor Flow Build 93593f3ecf feat(confluence): add racks, evaluations, and signal-history schema + repository (M22 slice 3) 2026-08-10 15:13:08 -04:00
Investor Flow Build 49bcfc3d3a feat(confluence): add confluence slot catalog, library, rack, and sentiment source (M22 slice 2) 2026-08-10 15:06:10 -04:00
Investor Flow Build ef2c39167c feat(analysis): add technical indicator coverage for confluence signal engine
CI / Test & Type-Check (push) Canceled after 0s
New functions in indicators.ts:
- sma: Simple Moving Average
- crossover: golden/death cross detector
- roc: Rate of Change (momentum)
- timeSeriesMomentum: 12-1 month momentum (Moskowitz et al.)
- relativeStrength: symbol vs benchmark momentum differential
- realizedVol: annualized realized volatility from log returns
- volatilityPercentile: percentile rank of current vol vs history
- fibLevels: Fibonacci retracement and extension levels
- fibCluster: proximity check for Fib confluence zones

New file volumeByPrice.ts:
- buildVolumeProfile: ported from frontend volumeProfile.ts
- Identical algorithm: bin clamping, uniform volume split, POC/VAH/VAL

All functions are pure (zero deps, no I/O). Tests added for all new
functions with edge cases, error handling, and numerical correctness.
2026-08-10 14:12:35 -04:00
Investor Flow Build ac94acf9e3 feat: dealer flow, mirror portfolio (M21), options convexity, FINRA short interest, alert producers, vendor gate
CI / Test & Type-Check (push) Canceled after 0s
Snapshot of in-progress module work across multiple slices:

- Dealer Flow: dealerExposureEngine, dealerMapService, dealerMapExplain,
  dealerMapIntegrity, dealerMapReplay, dealerStudyEngine, hanStyleLevels
- Mirror Portfolio (M21): fundRepository, captureIngest, mirrorAlertProducers,
  fund holdings strip, live book, position capture ingest
- Options: BSM, NormalizedOptionSurface types, OptionsChainRouter,
  ConvexityGate, option legs panel
- Alert producers: vixLevel, rotation, thesis, unlock, portfolioRisk,
  mirror (fund_capture, fund_13f, mirror_diff)
- FINRA short interest adapter + queue integration
- SEC company tickers adapter + ingest (symbol search index seed)
- Vendor gate (rate-limit-first data plane, ADR-0009)
- CUSIP registry, reverse 13F refresh, stock float service
- LRU cache, portfolio backtest engine
- Frontend: dealer-flow, funds, journal, lab, monitor, plan, portfolio,
  reports, screener, strategies, theses, guided-start, exits, more pages
- Volume profile, workspace profile, visibility-aware poll
- ADRs 0010 (mirror math not advice), 0011 (symbol search index)
- VENDOR_INTEGRATIONS.md, END_USER_TEST.md
- .gitignore: exclude DBs, .DS_Store, local config, agent scratch
2026-08-10 13:36:26 -04:00
Investor Flow Build 04fc11b2fd fix: populate short interest cache directly instead of relying on clogged drain queue
The stale-while-revalidate pattern queues background fetches via the AdapterQueue,
but with 227+ pending jobs, short interest keys take too long to process.
Users saw empty panels on every symbol because the fetch never completed before
the response returned.

Fix:
- shortInterest procedure: when Yahoo + NASDAQ caches are both empty, fetch
  directly via the adapters, store in cache, and return — all within the request.
  Subsequent requests hit the cache. Bypasses the clogged queue entirely.
- FinraBulkAdapter: guard against per-symbol keys (non-'latest' and non-date IDs)
  by returning a skipped result instead of trying to download a file named
  after the ticker.
- finraShortInterest handler: return isStale=false when no data is in the table,
  so per-symbol reads never trigger queue fetches (FINRA is schedule-only).
  Router stale computation now excludes FINRA from the combined stale flag.
2026-07-25 13:23:07 -04:00
Investor Flow Build 3d12f50418 fix: queue short interest fetches on subscribe alongside quote/candles
- Add yfinance:shortinterest: and nasdaq:nasdaqShortinterest:
  to subscribe() initial queue list so short interest data is fetched proactively
  when a symbol is first viewed, rather than only on stale read
- FINRA remains bulk-schedule only via queue_schedules
2026-07-25 13:17:16 -04:00
Investor Flow Build 48872b7805 fix: correct FINRA URL, filename format, parser column order, and default base URL
- Fix default base URL: https://cdn.finra.org/equity/regsho/daily (was www.finra.org/sites/default/files)
- Fix filename pattern: CNMSshvol{YYYYMMDD}.txt (was CAshvol with year/month subdir)
- Fix parser: actual file columns are Date|Symbol|ShortVolume|ShortExemptVolume|TotalVolume|Market
  (was incorrectly expecting Market|Symbol|... — first col is Date, last col is Market)
- Dedupe by symbol (volume is total across all listed exchanges, not per-exchange)
- Store combined market codes (e.g. 'B,Q,N') as exchange string
- Use BEGIN/COMMIT instead of db.transaction() (node:sqlite DatabaseSync doesn't have transaction())
- Update finra_config defaults in schema.sql + migration + admin fallback
2026-07-25 13:14:05 -04:00
Investor Flow Build 8a00363dd0 feat: admin-configurable FINRA download URL
- Add finra_config singleton table (base_url + updated_at)
- Add getFinraBaseUrl() and setFinraBaseUrl() to admin.ts
  Resolution order: DB config > env FINRA_BASE_URL > built-in default
- Add finraConfig query + finraConfigUpdate mutation to admin tRPC router
- Update FinraIngestService.downloadAndIngestFinra to accept optional baseUrl
  param; falls back to getFinraBaseUrl(db) when omitted
- FinraBulkAdapter resolves URL implicitly via the service (no adapter change)
- Add migration #10 for existing DBs
2026-07-25 13:11:50 -04:00
Investor Flow Build 0b9df1e9d3 refactor: drive FINRA bulk ingest through existing queue_schedule system instead of cron
- Add finra-bulk case to enqueueDueSchedules() — queues a single
  finra-bulk:finraShortinterest:latest key per cycle
- Register default twice-monthly schedule (14-day interval) in seedDefaultSchedules()
- Removes need for any external cron; the existing 30s scheduler loop handles it
2026-07-25 13:09:48 -04:00
Investor Flow Build 3fa6b32916 feat: Phase 3 FINRA bulk adapter + Phase 4 three-way merge with discrepancy flagging
Phase 3 — FINRA bulk short-interest ingest:
- Add finra_short_interest table to schema (per-symbol, per-settlement-date, per-exchange, with short/exempt/total volume, avg daily vol, days to cover)
- Create FinraIngestService: downloads FINRA consolidated pipe-delimited file from configurable base URL, parses Market|Symbol|ShortVolume|ShortExemptVolume|TotalVolume, stores in finra_short_interest table
- Create FinraBulkAdapter: SourceFetch that calls downloadAndIngestFinra, registers as finra-bulk source kind with finraShortinterest cache handler
- finraShortinterest handler reads latest settlement row per symbol from finra_short_interest table (no per-symbol kv_cache write; data is bulk-ingested)
- Register in index.ts adapter map + HANDLERS + del case

Phase 4 — three-way merge with discrepancy detection:
- shortInterest tRPC procedure now reads all 3 caches (yfinance, nasdaq, finra-bulk) in parallel
- Reconciliation hierarchy: FINRA (shares short) > NASDAQ > Yahoo
- daysToCover: NASDAQ (specific) > FINRA (computed) > Yahoo (short ratio fallback)
- settlementDate: FINRA > NASDAQ > Yahoo
- Discrepancy detection: compares sharesShort across available sources, flags >10% difference with discrepancyPct + discrepancyBetween
- Updated ShortInterestPanel: FINRA source badge, discrepancy warning banner, three-source disclaimer
- Updated trpc.ts client type for new shape
2026-07-25 13:03:49 -04:00
Investor Flow Build 76f60dc766 feat: Phase 2 NASDAQ adapter for days-to-cover + 24mo history
- Add nasdaq SourceKind + nasdaqShortinterest KindHandler (kv_cache with nasdaq: prefix)
- Create NasdaqAdapter: calls api.nasdaq.com/quote/SYM/short-interest, parses settlementDate/sharesShort/daysToCover/avgVolume, returns 24mo history; handles non-NASDAq gracefully
- Register NasdaqAdapter in server index.ts adapters map
- Update shortInterest procedure: reads both yfinance + nasdaq caches in parallel, reconciles (NASDAQ for daysToCover/sharesShort, Yahoo for %float/shortRatio and NYSE fallback)
- Update ShortInterestPanel: display daysToCover, settlement date, source badges, 6-month history table, updated disclaimer
- Update trpc.ts client type for merged response shape
2026-07-25 12:59:43 -04:00
Investor Flow Build d53c3a1cab fix: close institutionalRouter with ) not ;
Missing closing parenthesis on router() call at end of institutionalRouter caused SyntaxError on backend startup.
2026-07-25 12:10:46 -04:00
Investor Flow Build 605dc7f3d1 feat: short interest panel Phase 1 Yahoo Finance
- Add short_interest TtlClass (24h) to CacheRepository.ts with shortInterestHandler KindHandler (kv_cache JSON pattern), register in HANDLERS and del switch case
- Add case 'shortinterest' to YFinanceAdapter.fetchOne using quoteSummary(defaultKeyStatistics): parses sharesShort, shortPercentOfFloat, shortRatio, dateShortInterest, sharesShortPriorMonth, floatShares, sharesOutstanding
- Add institutional.shortInterest tRPC procedure (cache-read pattern, returns stale flag + provenance)
- Add api.institutional.shortInterest to frontend trpc client
- Create ShortInterestPanel.tsx: mirrors AnalystRatings pattern with loading/error/retry states, formatted shares/ratio/percentage display with source date
- Mount ShortInterestPanel on overview page after AnalystRatings
2026-07-25 12:09:21 -04:00
Investor Flow Build 351c104eba fix: analyst ratings timeout + add accession column to institution_filings
- Add 6s server-side timeout to Yahoo Finance quoteSummary (Promise.race) so the backend responds with stale data instead of hanging indefinitely. Stale cache is served on error (router.ts:1895-1898), matching ADR-0009.
- Hoist YahooFinance to a module-level singleton (getYf()) so the crumb/cookie is fetched once, not per call. Matches YFinanceAdapter pattern.
- Add suppressNotices for yahooSurvey to reduce log noise.
- Add accession column to institution_filings (schema.sql + migration in client.ts) and thread it through both secDataFetcher.ts INSERT paths (13D/G and 13F-HR). Fixes recurring `no such column: accession` error in new13daProducer alert tick.
- new13daProducer.ts needs no changes - its SELECT accession query now works.
2026-07-25 11:52:48 -04:00
Investor Flow Build 8b51d16d7b fix: Analyst ratings abort without reason on overview page
- trpcQuery/trpcMutate now throw 'Request timed out (8s)' instead of
  generic 'The operation was aborted.' so users know WHY the request failed
- AnalystRatings adds cancelled guard (race condition fix) so stale
  promise results from symbol changes are ignored (matches OverviewPanel
  pattern)
- Add Retry button on error state for timeout or other failures
- useEffect cleanup returns cancelled flag setter
2026-07-25 11:42:33 -04:00
Investor Flow Build 7492317ebb feat: per-user module access, classification watchlists, watchlist persistence & move
**Module access control (admin)**
- Added modules column to users table (JSON array of allowed module keys)
- auth.me returns modules; admin.setUserModules/disableUser/enableUser/deleteUser procedures
- UserActions dropdown with Reset Password, Manage Modules, Disable/Enable, Delete
- useFeatureAccess hook + FeatureGate component for page-level gating
- SidebarNav, CommandPalette, MobileTabNav filter by modules

**Classification watchlists (auto-generated sector/thematic/style/region)**
- watchlists schema: added kind, class_key, class_label columns
- materializeClassificationWatchlists(): lazy idempotent materialization of system lists from Yahoo sector data
- 11 GICS sector lists, Semiconductors, Biotech thematic lists, Small Cap style, Intl region
- Materialization triggered on listWatchlists + addSymbol/removeSymbol/add
- Sector thematic filter uses industry keywords (semiconductors, biotech) to avoid misclassification
- Symbol overrides fixed: IREN removed from SMH theme, bitcoin miners XLE->XLK, SLNH added as Technology

**Watchlist persistence & move**
- active-watchlist-store.ts: Zustand persist store mirroring active-symbol-store pattern
- moveSymbol procedure: removes from source, adds to target (idempotent, preserves empty lists)
- Action menu (⋯) per row: Move to + Remove, click-outside close
- Active watchlist survives navigation and page reloads

**List protections**
- default list: non-deletable, non-renamable, keeps empty row when pruned
- System lists (sector/thematic etc.): read-only, add form hidden, no remove/move/delete

**Per-user module restrictions**
- ProtectedProcedure blocks non-active users
- deleteUser refuses self-delete and last-admin-delete, cleans halt_state manually
- Module gating on execution/analytics pages, sidebar, command palette, mobile nav

Also fixed: schema.sql index moved to migration, materialize DB column fixes, test updates.
2026-07-25 11:38:23 -04:00
Investor Flow Build 63d9f80c09 Remove automaton task management framework
CI / Test & Type-Check (push) Canceled after 0s
- Delete .automaton/ directory and all tracked files
- Remove git hooks (pre-commit, pre-push)
- Delete ADR-0002 (automaton as issue tracker)
- Remove automaton references from AGENTS.md, HANDOFF.md, TASK_COMPLETION_SUMMARY.md, docs
- Update .gitignore to remove automaton entries
- Unregister from ~/.automaton/projects.json
2026-07-23 20:57:52 -04:00
Investor Flow Build 5b9f770aa4 Phase 5: alert subscriptions UI + multiple watchlists + queue fixes
CI / Test & Type-Check (push) Canceled after 0s
UI:
- /alerts page: event history with acknowledge, subscription create/manage with toggle
- /admin/smtp: SMTP config form (host, port, auth, test)
- Watchlist sidebar: dropdown selector for multiple watchlists, create/delete
- Sidebar: alerts count badge, SMTP link under admin
- Mobile tab nav: alerts tab added
- Client trpc.ts: all new API methods + types

Backend:
- watchlists.listByWatchlist procedure + listSymbolsByWatchlist repo fn
- yfinance min-interval 1500->2000ms to reduce Edge 429s
- Fixed e.date.slice error in yfinance-adjustments with typeof guard
- Removed defunct BITF from watchlist+queue
- Cleared 83 failed + 12 backoff queue jobs

Docs:
- FUNCTIONAL_DESIGN.md: alerts + multiple watchlists + SMTP documented
- TECH_DESIGN.md: new modules, tRPC procs, routes updated
2026-07-23 20:51:47 -04:00
Investor Flow Build f71987c119 touch queue-overhaul task
CI / Test & Type-Check (push) Canceled after 0s
2026-07-23 18:25:13 -04:00
Investor Flow Build e262187c3c fix: backfill symbol_demand for sidebar-added symbols + analyst ratings schema fix
- Add await ctx.cache.subscribe() to addSymbol mutation so symbols
  added via the sidebar get registered in symbol_demand and yfinance
  jobs are queued immediately
- Backfill PEP, WYNN, STZ, CELH into symbol_demand + adapter_queue
- Upgrade yahoo-finance2 3.15.3 -> 3.15.4 and pass validateResult:false
  to quoteSummary() to handle Yahoo schema drift
- Add error detail logging for analyst ratings schema failures
- Update .gitignore with common ignores
2026-07-23 18:02:24 -04:00
Investor Flow Build 5ef2b2f060 feat(sec-lint): lint+backfill system for SEC data gaps (B1-B4)
- SecLintAdapter implements SourceFetch, runs via shared queue/drain loop
- Two new SourceKinds: sec-lint-holders, sec-lint-insiders (weekly schedules)
- No-op cache handlers so drain->cache.set doesn't throw on lint keys
- tRPC admin.queueLint(symbol, kind) — run lint for one symbol, returns LintResult
- tRPC admin.queueLintAll(kind) — backfill ALL watched symbols at once
- tRPC admin.dataQualityList() — query data_quality rows (filterable by symbol/kind)
- InstitutionalDashboard: 'Lint holders' button + status badge in detail panel header
- Admin queue page: Data Quality section with per-row status badges, 'Lint all' buttons
- DEFAULT_RATE_MS includes 167ms (~6 req/s) for lint kinds matching EDGAR limiter
2026-07-12 20:19:12 -04:00
Investor Flow BuildandClaude ca385c1960 feat(queue): adapter queue overhaul — pause/resume, error capture, scheduling
- Pause/resume persisted in queue_state; drain loop checks isPaused() and skips
- Error capture: every failed/backoff attempt logged to queue_errors with the
  full stack trace; admin queue page expands a failed job to stream it
- Retry controls: retryJob(key), retrySource(kind), clearDone(olderThanMs)
- Per-source scheduling: queue_schedules table + 30s enqueueDueSchedules loop
  (seed defaults sec-fetch 24h, yfinance 5min); admin UI lists/adds/deletes
- Startup recovery: interrupted in_flight jobs reset to pending on boot
- fix(edgar): archive URLs use the filer CIK (accession-number prefix), not the
  company CIK — resolves Cloudflare 429 that left SEC backfills sparse/empty
- Migration: add queue_errors, queue_schedules, queue_state tables plus error/
  scheduled_for columns on adapter_queue (idempotent ALTER on startup)

Verified: full sec-fetch backfill now succeeds for all watched symbols
(NVDA 14,675 institution filings, CIFR 274 insider txns, TSLA 6,011, etc.).
503 backend tests pass.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-12 12:55:59 -04:00
Investor Flow Build 55f07e6b42 fix: wire data adapters, fix OptionsAdapter v3, build Research pages
- Fix OptionsAdapter for yahoo-finance2 v3 API ({ date: expiry } instead of positional arg)
- Fix institutional.flow and insiderStream endpoints to query correct DB tables
- Fix anonymous user INSERT (pw_hash column, not password_hash)
- Create secDataFetcher module for 13F/Form 4 data population
- Add institutional and marketOutlook endpoints to frontend trpc client
- Build out Chart Lab, Institutional, Market Outlook pages with real components
- Add focus-visible rings, aria-labels, hex tokens, shape icons across all panels
- Integrate EmotionLogger, MobileTabNav, useKeyboardShortcuts
- Add localStorage persistence for emotion logs
- Normalize spacing, type scale, hover effects across all components
2026-07-05 08:50:12 -04:00
Investor Flow Build 1e818c0881 fix: restore Escape key support in LayoutShell (was overwritten by other task) 2026-07-03 22:57:49 -04:00
Investor Flow Build 3b04edefba style: standardize border-radius to rounded-xl and padding across all panels 2026-07-03 22:56:28 -04:00
Investor Flow Build 8c8a37f1cb feat: add Escape key to close collapsible sections and arrow key navigation in tables 2026-07-03 22:52:21 -04:00
Investor Flow Build 681a1810fe feat: add hover shadows, smooth transitions for collapsible sections, and active border accent 2026-07-03 22:50:10 -04:00
Investor Flow Build aa79812158 feat: add MobileTabNav component for mobile navigation 2026-07-03 22:30:31 -04:00
Investor Flow Build c6027b8a80 feat: add EmotionLogger component with quick-add buttons and stats 2026-07-03 22:16:01 -04:00
Investor Flow Build 1007ab4ed5 fix (ornith-35): watchlistRepository double-encoding bug — single JSON.stringify, 13/13 tests pass 2026-06-30 17:54:01 -04:00
Investor Flow Build 97607e0bd4 slice 6 fix (ornith-35): form4_tx double-.xml URL + correct Form 4 XML elements (rptOwnerCik/rptOwnerName/rptOwnerRelationship). qwopus re-review pending 2026-06-30 13:56:29 -04:00
Investor Flow Build 4ddf95e711 portfolioRepository (ornith-35): addHolding/updateHolding/removeHolding/listHoldings, parameterized, idempotent, ADR-0007 2026-06-30 13:52:51 -04:00
Investor Flow Build eb557f2093 slice 7a InstitutionFlowEngine (ornith-35): aggregate_13f_flow + insider_flow + classify helpers, ADR-0007 neutral language, uses EdgarAdapter 13f/form4
Cross-review by qwopus35b pending.
2026-06-30 13:46:38 -04:00
Investor Flow Build c2476ab137 slice 6 EdgarAdapter: fix full_text_search ETag caching (was not writing etags back); test asserts revalidation on 2nd call. 16/16 green (ornith-35) 2026-06-30 13:40:19 -04:00
Investor Flow Build cf1d7c7302 slice 6 EdgarAdapter 13f_holdings + form4_tx (ornith-35): edgarXmlFetch + regex parsers, ETag/rate-limit/cache, ADR-0007 2026-06-30 13:33:51 -04:00
Investor Flow Build 343d418405 slice 10a WatchlistRepository (ornith-35): addSymbol/removeSymbol/listSymbols, parameterized, idempotent, ADR-0007
Cross-review by qwopus35b pending.
2026-06-30 13:22:02 -04:00
Investor Flow Build cfc762e952 slice 15a OptionsAdapter (ornith-35): expiry_dates + options_chain (calls/puts/IV/greeks), yf2 lazy singleton, options_snapshot/intraday TTL, ADR-0007
Cross-review by qwopus35b pending.
2026-06-30 13:03:30 -04:00
Investor Flow Build e1e028b418 slice 16 X-cookie + Reddit adapters (qwopus35b): cashtag_search/trusted_timeline (1 req/3s, cookie-expiry->FAILED+degraded), Reddit public-JSON, 7d cache, FakeLLM, crowd-sentiment-not-edge caveat
Cross-review by ornith-35 pending. 17 new tests (40 adapter total).
2026-06-30 10:08:25 -04:00
Investor Flow Build 9f58d36566 slice 6a EdgarAdapter (ornith-35): filings_index/company_facts/filer_cik_meta/full_text_search + edgarFetch (UA, 8 req/s, ETag/If-Modified-Since, 304 no-op)
Cross-review by qwopus35b pending (after tests 6b).
2026-06-30 10:02:50 -04:00
Investor Flow Build a09eba4d42 fix-chartlab-findings (ornith-35): real OHLC candlesticks (CandleShape), remove dead CandleBar, rsiCaption figcaption, relvol domain
Re-review by qwopus35b pending. SPA lint 2/2 green.
2026-06-30 09:28:11 -04:00
Investor Flow Build cc1213fb64 fix-spa-review-findings (ornith-35): fetch timeout+res.ok, AuthSection loop fix, me() timeout, enable2fa finally, TOTP mask toggle, snapshot backoff, dup key removed
Cross-review by qwopus35b pending. SPA lint 2/2 green.
2026-06-30 08:54:33 -04:00
Investor Flow Build ce26a0ca15 slice 5c ChartLab panel (ornith-35): candlestick/volume/EMA/RSI/relvol + P7 tooltips, trpc.market.candles+indicators wiring
Cross-review by qwopus35b pending. SPA lint 2/2 green.
2026-06-30 08:46:47 -04:00
Investor Flow Build 2c7e7a0786 fix-backend-review-findings (ornith-35): oauth empty-token guard, session-secret startup assertion, OAuth email-link test
Fixes from ornith's backend code review, implemented by ornith-35 (cross-review by
qwopus35b pending). 129/129 tests green.
2026-06-29 23:33:02 -04:00
Investor Flow Build a303720c35 slice 5b (omlx/ornith-35): market.candles + market.indicators endpoints
Chart Lab data path: market.candles (cached OHLCV by timeframe) + market.indicators
(EMA/RSI/relativeVolume via analysis/indicators.ts). By ornith-35 (local, ~75s);
reviewed by orchestrator (128/128 tests, no regression). Conflict-free: impl=ornith-35,
reviewer=orchestrator.
2026-06-29 22:57:34 -04:00
Investor Flow Build e6b7219dd2 slice 4d (omlx/ornith-35): backfill integration test (first-track 4 keys -> drain -> candles+adjustments; rerun no-op)
Slice 4 (yfinance-backfill-permanent-ohlcv) COMPLETE: parseAdjustments + adjustments
kind + candles 10y backfill + adjustments fetchOne + subscribe queues backfill. 102/102
tests green. Implemented by local ornith-35, reviewed by orchestrator.
2026-06-29 22:09:12 -04:00
Investor Flow Build 2a99e008e3 slice 4c (omlx/ornith-35): YFinanceAdapter candles 10y backfill + adjustments fetchOne 2026-06-29 21:58:39 -04:00
Investor Flow Build 796d7b58b3 slice 4b (omlx/ornith-35): CacheRepository adjustments kind + subscribe queues backfill keys
Local ornith-35 dispatch (~2min). +PriceAdjustment, +adjustmentsHandler
(price_adjustments table, permanent), subscribe now queues candles+adjustments on
first demand. Surgical, 99/99 tests, no regression.
2026-06-29 21:55:27 -04:00
Investor Flow Build 190e9500a9 slice 4a (omlx/ornith-35): parseAdjustments (chart events -> price_adjustments) + 12 tests
First dispatch to the LOCAL ornith-35 (omlx) — ~3min vs ~8min for remote. Pure fn
parses yf2 chart events (splits/dividends, array or map) into PriceAdjustment[]; 12
tests incl. NVDA 5y fixture (2 splits + 26 dividends). Reviewed + approved.
2026-06-29 21:50:27 -04:00
Investor Flow Build 965f8d3b1c slice 3 COMPLETE: onboarding wizard (complexity/risk/drawdown + starter watchlist + demand subscribe)
starter.ts by ornith (9 symbols w/ ticker-kind + ADR-0007 reasons, defaults, 12 tests).
onboarding.complete + onboarding.starter + me().onboarded by orchestrator; schema
+drawdown_tolerance. Wizard UI (complexity picker, starter list, disclaimer, finish).
onboarding subscribes starter symbols to the demand set (adapter fetches them). 87/87
backend + 2/2 lint green. Slice 3 done; slices 1-3 complete.
2026-06-29 21:31:59 -04:00
Investor Flow Build 4816b19976 slice 2 UI: 2FA enrollment (enable -> secret/QR/backup codes -> confirm)
Orchestrator (me) SPA work: auth client +2FA/OAuth methods, 2FA strings, AuthSection
enrollment flow. Primary-Rule lint stays green. Slice 2 (auth-2fa-and-social-oauth)
COMPLETE: 2FA + OAuth backend (ornith modules + me integration) + 2FA enrollment UI.
2026-06-29 21:21:09 -04:00
Investor Flow Build 3b5aa90a89 slice 2b COMPLETE: social OAuth (GitHub/Google) — oauthStart/oauthCallback
oauth.ts by ornith (zero-dep, injectable-fetch, 15 tests; fixed its self-import bug
so OAuthProvider is exported). Router/context integration by orchestrator: CSRF state
cookie (HMAC), code exchange, find/link/create user (sentinel pw_hash for OAuth-only),
session. 74/74 backend tests green. CSRF rejection + reuse-no-duplicate covered.
2026-06-29 21:17:57 -04:00
Investor Flow Build 89bdf0edc4 slice 2a COMPLETE: TOTP 2FA (enable2fa/confirm2fa/login-2fa + protectedProcedure)
totp.ts + backup-codes.ts produced by ornith (remote model, reviewed+approved);
router/context/schema integration by orchestrator (delicate edit-existing — ornith
timed out on a dispatch of that size in-session). 58/58 backend tests green.
2FA flow: enable2fa -> confirm2fa -> login now requires a valid TOTP.
2026-06-29 19:32:09 -04:00
Investor Flow Build 9df05ade71 slice 2a (ornith): backup codes (scrypt, constant-time verify) + 13 tests 2026-06-29 19:19:59 -04:00
Investor Flow Build 3b6d306e4c slice 2a (ornith): TOTP core (RFC 6238, zero-dep) + 8 tests
First ornith remote-model dispatch. Right-sized single-file prompt -> ornith produced
correct totp.ts (base32/HMAC-SHA1/dynamic-truncation/+-1 window), reviewed + approved.
44/44 backend tests green. Ornith ~8min/dispatch; small focused prompts succeed.
2026-06-29 19:14:21 -04:00
Investor Flow Build a8b95e36e3 slice 1g: Next.js M1 overview panel + Primary-Rule lint (ADR-0007)
Symbol command bar (Zustand active-symbol) -> OverviewPanel (price + day-change
shape/color/label per P7 G3 + Recharts sparkline + sector) + signup/login + ADR-0007
footer. next.config rewrites proxy /api -> backend:3001 (same-origin cookies). Vanilla
fetch tRPC client (decoupled from server Node types). Primary-Rule lint 2/2 green.
Slice 1 tracer bullet COMPLETE: 38 tests green, live-verified end-to-end.
2026-06-29 17:51:54 -04:00
Investor Flow Build 82079b3e66 slice 1e-1f: tRPC router (auth + market.snapshot) + node:http server
auth.signup/login/logout/me with signed HMAC session cookies + scrypt hashing;
market.snapshot mega-endpoint (quote+candles+sector). node:http server mounts
tRPC at /api/trpc + /health + background drain loop. Live-verified: real NVDA
194.97/65 candles/Technology served after stale-while-revalidate drain. 36 tests green.
2026-06-29 17:40:42 -04:00
Investor Flow Build 1962ecc740 slice 1a-1d: DB + CacheRepository + YFinance adapter + AdapterQueue
Node 26 + node:sqlite backend (zero native deps; runtime glue adapted from
Bun-spec design, deep-module architecture unchanged). 29 tests green across
schema/CacheRepository/YFinance-parse/AdapterQueue-dedupe.
2026-06-29 17:28:57 -04:00