Add research market universe and runtime coverage - #14
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
futures_multitf._eligible_symbols can raise a TypeError for naive observed_at timestamps because it subtracts before verifying timezone-awareness.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR expands AI4Binance’s research-only market “universe” selection and uses it to drive broader runtime/collection coverage, including retention pruning of out-of-scope symbol data, richer dashboard readiness reporting, and additional deterministic tests across the new universe/runtime paths.
Changes:
- Add a research-only universe provider that unions wallet holdings (bounded, stale-safe) with public market-cap leaders and integrates it into market-history sync/monitoring.
- Add retention/pruning for symbol-scoped market datasets plus expanded continuous market-history staging/enrichment behavior and dashboard readiness projections.
- Extend runtime/accounting robustness (portfolio cost-basis reconciliation; websocket failure containment) and add/adjust deterministic tests covering these new paths.
| File | Description |
|---|---|
| tests/test_service_manifest.py | Updates service expectations and validates new report/lock/pid health fields. |
| tests/test_runtime_cycle.py | Adds multi-asset cost-basis reconciliation coverage in runtime cycle tests. |
| tests/test_research_market_universe.py | New deterministic tests for wallet+market-cap universe selection and retention pruning. |
| tests/test_opportunity_monitor.py | Adjusts monkeypatch signature compatibility for universe reader. |
| tests/test_market_history_continuous.py | Adds tests for staged screening stream interleaving and history horizon behavior. |
| tests/test_market_depth.py | Adds tests for depth journal retention-by-universe and identity validation. |
| tests/test_local_dashboard_source.py | Adds tests for readiness projections and futures research classification logic. |
| tests/test_futures_multitf.py | Expands universe validation/retention behavior expectations in futures multitf tests. |
| tests/test_data_acquisition.py | Adds coverage for canonical resident runtime symbol selection. |
| tests/test_continuous_skill_discovery.py | Ensures deterministic filter rejection doesn’t degrade overall blockers. |
| tests/test_config_reporting.py | Updates defaults expectations for bounded research history horizons/settings. |
| tests/test_accounting_collectors.py | Adds deterministic test for websocket open failure containment and blocker formatting. |
| src/ai4binance/skills/discovery_pipeline.py | Prevents FILTER-stage rejections from degrading global blockers. |
| src/ai4binance/local_dashboard/server.py.in | Adds readiness projection helper and refines “COLLECTING vs DEGRADED” classifications. |
| src/ai4binance/integrations/research_market_universe.py | Introduces wallet + CoinGecko market-cap universe provider and bounded transport. |
| src/ai4binance/integrations/binance/market_universe_provider.py | Extends snapshot schema with selected/wallet/market-cap asset sets + validation helpers. |
| src/ai4binance/integrations/__init__.py | Re-exports new research market-universe integration types. |
| src/ai4binance/domain/universe.py | Expands stablecoin-like identifiers to filter universe assets. |
| src/ai4binance/data/market_universe_retention.py | Adds bounded retention pruning for generated symbol-scoped data across roots. |
| src/ai4binance/data/market_history_sync.py | Adds expected-source validation + supports provider-specific cache naming and priority snapshots. |
| src/ai4binance/data/market_history_continuous.py | Adds enrichment horizon, staged screening ordering, and optional universe retention pruning. |
| src/ai4binance/data/market_depth.py | Adds depth journal retention cleanup and records retention results in health output. |
| src/ai4binance/config.py | Narrows default history horizons; disables coin-m by default; adds new universe-related settings/validators. |
| src/ai4binance/compatibility/opportunity_monitor.py | Requires research-universe source when reading cached universe for UI monitoring. |
| src/ai4binance/cli/runtime.py | Selects a deterministic resident runtime symbol based on ranked universe priorities. |
| src/ai4binance/cli/market_data.py | Switches market-history synchronizer to research universe provider + wires retention and coin-m flag. |
| src/ai4binance/cli/futures_multitf.py | Adds strict cached-universe freshness/source validation and retains only state relevant to current universe. |
| src/ai4binance/application/runtime.py | Reconciles cost basis for multiple wallet assets and feeds portfolio analytics with per-asset average costs. |
| src/ai4binance/accounting/user_stream.py | Treats websocket exceptions as contained collection failures with explicit blockers. |
| scripts/ykb_daily_report.ps1 | Adds report status/blockers fields and improves operational vs report mismatch detection. |
| scripts/primary_local_reasoning_agent.ps1 | Adds PID reporting and a lock file for resident primary reasoning agent process. |
| config/operations/services.json | Enables futures-multitf service in the operations manifest. |
| .gitignore | Ensures src/ai4binance/data/ is not ignored by the top-level data/ rule. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
hscicek
approved these changes
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Safety
RESEARCH_ONLYbehaviorLIVE_ORDER_BLOCKEDand does not authorize live executionValidation