Skip to content

feat(tools): computed price analytics — statistics, trend, correlation, spread (#195) - #199

Closed
karlwaldman wants to merge 2 commits into
mainfrom
feat/mcp-analytics-tools-1110
Closed

karlwaldman wants to merge 2 commits into
mainfrom
feat/mcp-analytics-tools-1110

Conversation

@karlwaldman

Copy link
Copy Markdown
Member

Summary

Analytics: the four /v1/analytics operations ledger v8 deferred, verified live on 2026-11-10 with the Scale smoke key. The analytics family is now exposed.

Tool Operation Types
opa_get_price_statistics GET /v1/analytics/statistics z-score, percentile, annualized volatility
opa_get_price_trend GET /v1/analytics/trend analysis, sma, ema, rsi, levels
opa_get_price_correlation GET /v1/analytics/correlation analysis, rolling, matrix (2-10 codes)
opa_get_spread_statistics GET /v1/analytics/spread list (no spread), current, historical
  • Gate: every description says the API serves analytics to Professional and Scale (and active trials) and answers 403 otherwise. Source: TIER_FEATURES on oilpriceapi-api main.
  • The 403 body's sample_data is never rendered as data (mocked test).
  • The response tier field is not rendered: it reads "free" for the Scale account. Filed oilpriceapi-api#10761 (confirmed-live).
  • Commodity names resolve locally, so an unknown name fails before a request. Series are capped at the latest 400 rows with a partial-answer notice.
  • Ledger v9: four rows flipped to exposed. A new analytics live-smoke shape was added. Tool counts 40 -> 44 (read 36 -> 40).

Verification (local, 2026-11-10, rebased on main 124c1de)

  • npm test: all suites pass (see per-PR counts in the commit).
  • npm run build, npm run check:readme-tools, npm run smoke:live-contract-matrix, npm run smoke:package: pass.
  • npm run check:capability-ledger: OK v9 against the live OpenAPI contract (136 operations), rerun after rebasing onto 124c1de (fix(ci): unblock main - npm audit fix (qs), ledger v8 for 18 new API operations, relative test date #193).
  • npm run test:live with the production smoke key (Scale) and SMOKE_WRITE_CONTRACTS=1: every contract PASSED, including the new tools; 0 failed, 0 cannot-check.
  • Plan-gated 403 paths were not observable live: both available test keys are on the same Scale account. They are covered by mocked tests against the documented 403 bodies.

Merge notes

Refs #195.

🤖 Generated with Claude Code

https://claude.ai/code/session_01B3sTPV81755NVtvVwb9Cd8

Exposes the four /v1/analytics operations ledger v8 deferred, verified
live on 2026-11-10 with the Scale smoke key:

- opa_get_price_statistics: GET /v1/analytics/statistics (z-score,
  percentile, annualized volatility).
- opa_get_price_trend: GET /v1/analytics/trend (analysis, sma, ema, rsi,
  levels).
- opa_get_price_correlation: GET /v1/analytics/correlation (analysis,
  rolling, matrix of 2-10 codes).
- opa_get_spread_statistics: GET /v1/analytics/spread (list, current,
  historical).

Every description states the Professional/Scale gate. The 403
sample_data is never rendered, and the body's `tier` field is not
rendered because it reads "free" for Gen-2 paid plans. Series capped at
400 rows. Ledger v9 (analytics family exposed), live-contract catalog
entries, README rows, tool counts 44/40.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B3sTPV81755NVtvVwb9Cd8
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2a58b8eb-6364-4b6c-a1aa-0051a5988209
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The public-claims smoke bans hard-coded plan names in source and packed
surfaces, so plan gates are stated as entitlement gates (HTTP 403).
smoke:docker asserts the container's default read inventory, which still
read 36.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B3sTPV81755NVtvVwb9Cd8
@karlwaldman

Copy link
Copy Markdown
Member Author

Superseded by #200.

@karlwaldman
karlwaldman deleted the feat/mcp-analytics-tools-1110 branch November 10, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:elevated Elevated: auto-merges after an adversarial review APPROVE

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant