feat(tradingview): add tradingview#1432
Conversation
Greptile SummaryThis PR adds a new
Confidence Score: 5/5Safe to merge; the previous round's blocking concerns are all resolved and the only remaining finding is a latent ordering inconsistency in the watchlist snapshot queries. All four issues from the prior review (non-atomic sync writes, unbounded snapshot table, offline remove mismatch, stale price cache for quotes) are correctly addressed. The two remaining comments describe a non-deterministic snapshot-pair selection that only triggers when two syncs run within the same RFC3339 second — an edge case with negligible real-world exposure and no data loss risk. library/payments/tradingview/internal/cli/watchlist.go — the Important Files Changed
|
|
|
||
| // verifyShortCircuitEnvelope returns the synthetic JSON body that | ||
| // stands in for a real mutating response when do() short-circuits in | ||
| // verify mode. The __pp_verify_synthetic__ sentinel is namespace- | ||
| // reserved (no real API uses __pp_*) so downstream consumers | ||
| // (validate-narrative, agent inspections) can key on one obvious field | ||
| // instead of trying to disambiguate common literals like status:"noop". | ||
| // method and path are echoed back as diagnostic prose for human/agent |
There was a problem hiding this comment.
5-minute response cache silently serves stale prices
readCache uses a hardcoded 5-minute TTL for every GET, including live price requests from fetchRawQuote. quote NASDAQ:AAPL invoked twice within five minutes returns the cached response without any indication that the data is stale. The command's help text promises "last price," so a user that re-runs it during a fast-moving session would silently receive a price that could be several minutes old. Consider expiring price-endpoint responses more aggressively (e.g., 30–60 seconds), surfacing a cache-age note in human output, or defaulting --no-cache for the quote and convert commands.
…ransactional+bounded watchlist sync
|
Thanks for the review. Addressed all four findings in the follow-up commits:
Verified live: transactional double-sync, bare-ticker offline remove, and fresh back-to-back quotes all behave as expected; |
tradingview
Resolve any ticker and see its price in USD and EUR in one command — stocks, crypto, and forex, no API key.
API: tradingview | Category: payments | Press version: 4.27.1
Spec: internal (live-probed public endpoints:
scanner.tradingview.com,symbol-search.tradingview.com)Publication Path
New print
CLI Shape
Novel Commands
quoteconvertwatchlistwatchlist changesWhat This CLI Does
TradingView CLI turns a symbol into an answer:
searchresolves a query to a fully-qualifiedEXCHANGE:TICKER,quotereturns the last price in its native currency plus USD and EUR, andconvertdoes fiat conversion using TradingView's own forex rates. Terminal-first, agent-native--json, no data-API subscription required for the public endpoints. A localwatchlisttracks symbols and snapshots their USD/EUR prices to SQLite for offline querying and drift.TradingView has no official public data API; this CLI is built from live-probed public endpoints (symbol search + the universal scanner
/symbolprice endpoint + FX_IDC forex rates). No authentication is required at runtime. Crypto quote currencies (USDT/USDC) are treated as USD-pegged and surfaced explicitly.Manuscripts
Validation Results
Publish Live Gate
Full live dogfood reran at publish time against the real TradingView endpoints and passed (matrix 55/55, level full, auth: none). Proof: Phase 5 Acceptance Marker
Notes
Three hand-customizations over generated output are recorded under
.printing-press-patches/:tradingview-search-command— replaced the generator's broken framework FTSsearch(it targeted the root scanner host instead of the symbol-search host and 404'd) with the working symbol resolver, aliasedlookup.tradingview-watchlist— added the local SQLite watchlist (add/list/sync/quotes/changes).tradingview-mcp-trim— hid redundant/no-op commands from the MCP surface.🤖 Generated with Claude Code (Printing Press)