Skip to content

feat: official B3 listed-funds catalog - #54

Open
robertoecf wants to merge 3 commits into
mainfrom
cursor/b3-etf-catalog-763e
Open

robertoecf wants to merge 3 commits into
mainfrom
cursor/b3-etf-catalog-763e

Conversation

@robertoecf

Copy link
Copy Markdown
Owner

Summary

Official B3 listed-funds catalog via fundsListedProxy/Search/GetListFunds (same base64-JSON family as indexProxy). Not an HTML scrape.

Unknown *11 tickers were the FII suffix heuristic. REST, MCP and findata resolve now consult the catalog:

  • SPBZ11 / SPXR11 → ETF de renda variável (B3 type ETF)
  • LFTS11 → ETF de renda fixa (ETF-RF)
  • IFRA11FI-INFRA on B3 (seed still wins offline at 0.97)
  • catalog miss → Indefinido, not FII

Library resolve_asset() / classify() stay offline unless the caller passes providers=[b3_listed_provider].

Surfaces

  • GET /b3/listed-funds (type and/or ticker)
  • findata b3 listed --type ETF / findata b3 listed SPXR11
  • findata resolve SPBZ11 (--offline skips B3)
  • REST/MCP resolve_asset injects the provider

Validation

  • bash scripts/ship/preflight.sh via pre-push: ruff, mypy --strict, pytest 365 passed (16 integration deselected)
  • Live smoke 2026-09-16: SPBZ=ETF, SPXR=ETF, IFRA=FI-INFRA, LFTS=ETF-RF

Deslop

no removable slop found (FIM type hints share one mapping)

Adversarial review

  • Mode: CROSS_FAMILY — author Grok 4.6, reviewer Codex Astra (high then follow-up medium)
  • First pass: P1 — catalog miss kept the FII heuristic. Fixed in fab2e37.
  • Follow-up: SHIP, no open findings.
  • Network-error fallback still keeps the prior core result (provider_error); that is the existing engine isolation, not a catalog miss.

MCP Trust Review

  • Classificação: AGENT_DATA + MCP_TOOL
  • Base: origin/main f5a0c90
  • Head: 2e12f83
  • Tools tocadas: resolve_asset (behavior: official B3 catalog for *11). No new MCP tool. REST 97→98.
  • Conclusão: PASS

Achados

NO_FINDINGS

Over-engineering

No new MCP tool. Catalog lookup is one REST route + the existing AssetProvider seam. Code mode unchanged. No credentials.

Not merged

Stops before merge. No PyPI.

Unknown *11 tickers were guessed as FII. The official
fundsListedProxy JSON (not HTML) splits ETF / ETF-RF /
FII / FI-Infra so SPBZ11 and SPXR11 classify as equity ETFs.
A *11 ticker absent from the official listed-funds pages is
Indefinido, not the suffix heuristic. Offline classify() is unchanged.
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

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

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 86cf2d63-daa7-45a8-a8fd-6046618a0776


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

Comment @coderabbitai help to get the list of available commands.

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