Skip to content

Show market data and performance cache health in admin diagnostics - #105

Closed
jaywedgeworth22 wants to merge 5 commits into
mainfrom
codex/admin-market-status-20260629
Closed

Show market data and performance cache health in admin diagnostics#105
jaywedgeworth22 wants to merge 5 commits into
mainfrom
codex/admin-market-status-20260629

Conversation

@jaywedgeworth22

Copy link
Copy Markdown
Owner

Summary

  • adds distinct admin diagnostics cards for Massive, Intrinio, Twelve Data, Finnhub, and SEC EDGAR enrichment paths
  • adds admin diagnostics cards for asset price cache, S&P benchmark cache, and trade performance anchors
  • keeps provider secret values out of diagnostics while showing configured/last-used/count/error status

Why S&P performance can be unavailable

Performance requires tickered, non-option trades with cached asset EOD prices, cached SPY/S&P benchmark closes, current price, and computed tx_performance anchors. This PR makes those cache states visible to admins.

Verification

Preview: https://congress-trade-preview.jaywedgeworth22.workers.dev
Preview version: 22af451e-1380-4d21-a192-8d74714fa3a2

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0591091d87

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/admin/routes.ts
Comment on lines +1116 to +1117
FROM securities_ref
WHERE source IS NOT NULL AND source != ''

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Count source-less provider failures in diagnostics

When a configured Massive/Intrinio/Twelve Data/Finnhub attempt fails before any provider returns a ref, upsertEmpty records enrichment_error and enriched_at but leaves source NULL. This new provider-health aggregate drops those rows with WHERE source IS NOT NULL, so the new provider cards can report 0 recent errors and no last use even while the diagnostics error list contains fresh enrichment failures. Please either tag the attempted provider when recording the failure or include source-less failures in the configured provider's health calculation.

Useful? React with 👍 / 👎.

Comment thread app/src/admin/routes.ts
connections.push({
id: 'provider:fmp',
label: 'FMP Market Data',
label: 'FMP Enrichment',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Filter FMP diagnostics to FMP-sourced rows

With the new provider-specific cards, this card is now presented as FMP-only, but the query feeding it still aggregates every row in securities_ref without a source predicate. In an environment where FMP is configured but recent enrichment came from Massive/EDGAR/etc., provider:fmp will inherit those providers' last-used times, counts, and errors, sending admins to the wrong provider. Filter this aggregate to sources containing fmp or fold FMP into the same per-provider aggregation as the new cards.

Useful? React with 👍 / 👎.

Comment thread app/src/admin/routes.ts
Comment on lines +1103 to +1108
`SELECT CASE
WHEN lower(source) LIKE '%massive%' THEN 'massive'
WHEN lower(source) LIKE '%intrinio%' THEN 'intrinio'
WHEN lower(source) LIKE '%twelvedata%' THEN 'twelvedata'
WHEN lower(source) LIKE '%finnhub%' THEN 'finnhub'
WHEN lower(source) LIKE '%edgar%' THEN 'edgar'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Split composite sources across provider cards

securities_ref.source is persisted as a +-joined list when multiple providers contribute to a ticker, but this CASE assigns each row to only one provider. For example, a row sourced from both Massive and EDGAR is counted only under Massive because that branch matches first, so the other provider cards can show zero usage even though they are part of the enrichment chain. Aggregate each provider with its own source LIKE predicate, or otherwise explode the source list before grouping.

Useful? React with 👍 / 👎.

Base automatically changed from codex/asset-type-canonicalization-20260628 to main June 29, 2026 05:47
@jaywedgeworth22

Copy link
Copy Markdown
Owner Author

Included in the production integration merge via #113 (main commit 3317b42) and deployed to congress.trade. Closing this PR as superseded.

@jaywedgeworth22
jaywedgeworth22 deleted the codex/admin-market-status-20260629 branch July 23, 2026 00:59
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