Skip to content

feat(core): core-path features — search, metainfo, TA summary, TA ranking#46

Merged
bearmug merged 5 commits into
mainfrom
feat/core-path
Apr 10, 2026
Merged

feat(core): core-path features — search, metainfo, TA summary, TA ranking#46
bearmug merged 5 commits into
mainfrom
feat/core-path

Conversation

@bearmug

@bearmug bearmug commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Core Path Implementation

Implements the core-path spec defined in docs/SPEC-core-path.md — the browserless, HTTP-first expansion track.

Features Added (Core-1 through Core-5)

# Feature MCP Tool CLI Command Status
Core-1 Symbol discovery search_symbols tradingview-cli search
Core-2 Market metadata get_market_metainfo tradingview-cli metainfo
Core-3 Richer field/timeframe support (enhanced existing) (enhanced existing)
Core-4 TA summary get_ta_summary tradingview-cli ta
Core-5 TA ranking rank_by_ta tradingview-cli rank-ta

Architecture

src/
  api/search.ts       — HTTP client for symbol-search v3 endpoint
  api/metainfo.ts     — HTTP client for scanner metainfo endpoint
  api/ta.ts           — TA summary/ranking via scanner Recommend.* fields
  tools/search.ts     — MCP/CLI tool wrapper with cache + rate limiting
  tools/metainfo.ts   — MCP/CLI tool wrapper with cache + rate limiting
  tools/ta.ts         — Thin MCP wrapper around TAClient
  cli/help.ts         — Help text for search, metainfo, ta, rank-ta
  cli/parseArgs.ts    — Argument parsing for new CLI commands
  tests/search.test.ts    — 8 tests (validation, caching, URL building)
  tests/metainfo.test.ts  — 8 tests (normalization, caching, raw mode)
  tests/ta.test.ts        — 17 tests (score mapping, summary, ranking, null handling)

Spec Verification

  • ✅ All 5 core features implemented per spec
  • ✅ Input/output shapes match spec definitions
  • ✅ Score-to-label mapping: strong_sell/sell/neutral/buy/strong_buy
  • ✅ Timeframe-qualified fields (e.g. Recommend.All|60) supported
  • ✅ MCP tools and CLI commands aligned
  • ✅ Cache and rate limiter shared across new HTTP calls
  • ✅ Error handling for empty/invalid inputs
  • ✅ Graceful degradation for null/missing scores
  • ✅ 201 tests all passing

Cleanup

  • Removed experimental tool references (bars, stream-quotes, stream-bars) that belonged to the lab-path branch and were causing build failures
  • Added docs/SPEC-core-path.md as source of truth

Out of Scope (per spec)

WebSocket streaming, browser automation, order execution, Pine compilation, screenshots — these belong to the lab or future product lines.

bearmug added 2 commits April 10, 2026 23:11
Core-path features (Spec: docs/SPEC-core-path.md):

- Core-1: search_symbols — browserless symbol discovery via symbol-search v3
- Core-2: get_market_metainfo — market/screener metadata discovery
- Core-3: richer field/timeframe support (timeframe-qualified columns)
- Core-4: get_ta_summary — TradingView-style TA with buy/sell/neutral labels
- Core-5: rank_by_ta — weighted multi-timeframe TA ranking

API fixes found during integration testing:
- search: added Origin/Referer headers (TradingView blocks without them)
- search: strip <em> HTML tags from highlighted results
- search: populate currency_code from TradingView response
- search: asset_type param not supported by v3 endpoint (removed server-side)
- metainfo: handle compact {n, t, r} field format from real API
- metainfo: CLI --fields now supports comma-separated values

Removes experimental tool references (bars, stream) that belong to lab-path.
Updates README with new tools, CLI commands, and usage examples.

204 unit tests passing.
21 integration tests against live TradingView API:
- Core-1: search_symbols (6 tests)
- Core-2: get_market_metainfo (4 tests)
- Core-4: get_ta_summary (5 tests)
- Core-5: rank_by_ta (4 tests)
- Regression: existing screen/lookup tools (2 tests)

Bug fixes found during integration testing:
- search: added Origin/Referer headers (TradingView blocks without them)
- search: strip <em> HTML tags, populate currency_code
- search: asset_type param not supported by v3 endpoint
- metainfo: handle compact {n, t, r} field format from real API
- CLI: --fields now supports comma-separated values

Isolation:
- 'npm test' → 204 unit tests only (src/tests/*.test.ts flat glob)
- 'npm run test:integration' → 21 integration tests only (TV_INTEGRATION=1 gate)
- Zero cross-contamination between suites

CI: .github/workflows/integration.yml (weekly, manual, label-triggered)
bearmug added 2 commits April 10, 2026 23:34
The default GITHUB_TOKEN doesn't have issues:write or pull-requests:write,
which caused the 'Comment PR with results' step to 403.
@github-actions

Copy link
Copy Markdown
Contributor

Integration Test Results

✅ Passed — hit real TradingView API endpoints.

https://github.com/fiale-plus/tradingview-mcp-server/actions/runs/24265433652

…label

Reduces unnecessary TradingView API load by skipping drafts and
intermediate pushes. Integration tests only fire when:
- PR marked ready for review
- PR gets 'run-integration' label
- Weekly schedule (Saturday)
- Manual workflow_dispatch
@bearmug bearmug merged commit 97d42df into main Apr 10, 2026
4 checks passed
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