Skip to content

Add Infinifi escrow context to LLM reports - #340

Merged
spalen0 merged 3 commits into
mainfrom
feat/infinifi-farm-context
Aug 17, 2026
Merged

Add Infinifi escrow context to LLM reports#340
spalen0 merged 3 commits into
mainfrom
feat/infinifi-farm-context

Conversation

@spalen0

@spalen0 spalen0 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an Infinifi-specific LLM context adapter for mainnet RWA escrow calls
  • verify the farm-to-escrow relationship on-chain and resolve configured ERC-20 targets from whitelist events
  • render the farm, accounting asset, total assets, and configured token names in the full gist report
  • cover prompt, report, relationship validation, whitelist reconstruction, and formatting behavior

Testing

  • uv run pytest -q tests/test_infinifi_context.py tests/test_ai_explainer.py tests/test_llm_report.py tests/test_timelock_alerts.py (132 passed, 2 subtests passed)
  • uv run ruff check on changed Python files
  • uv run ruff format --check on changed Python files
  • uv run mypy --follow-imports=skip utils/llm/infinifi_context.py
  • uvx prek run
  • live mainnet replay for the supplied New Silver rate update

- add a User-Agent header to the Infinifi farm API request, consistent with
  the existing protocol monitor's request convention
- log previously-silent context-resolution skips (non-ERC20 accounting asset,
  empty farm records, unknown farm, farm/escrow mismatch, non-ERC20 whitelist
  target) so transient enrichment failures are visible instead of vanishing
- extend unit coverage for _candidate_addresses, _looks_like_escrow,
  _farm_by_address, _fetch_farm_records parsing, _token_label, the
  empty-configured-tokens report, and the non-ERC20 accounting asset path

Verification: pytest tests/ (803 passed, 4 skipped), ruff check, ruff
format --check, mypy on utils/llm/infinifi_context.py all clean.
@spalen0
spalen0 marked this pull request as ready for review August 17, 2026 21:10
@spalen0
spalen0 merged commit 581fb7f into main Aug 17, 2026
3 checks passed
@spalen0
spalen0 deleted the feat/infinifi-farm-context branch August 17, 2026 21:10
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