xrtm-data 0.3.0__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xrtm_data-0.3.2/PKG-INFO +73 -0
- xrtm_data-0.3.2/README.md +54 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/pyproject.toml +1 -1
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/core/schemas/forecast.py +4 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/version.py +1 -1
- xrtm_data-0.3.2/src/xrtm_data.egg-info/PKG-INFO +73 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/tests/test_schemas.py +31 -1
- xrtm_data-0.3.0/PKG-INFO +0 -102
- xrtm_data-0.3.0/README.md +0 -83
- xrtm_data-0.3.0/src/xrtm_data.egg-info/PKG-INFO +0 -102
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/LICENSE +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/setup.cfg +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/__init__.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/core/__init__.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/core/interfaces.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/core/schemas/__init__.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/core/schemas/prior.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/core/schemas/trade.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/corpora/__init__.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/corpora/_builtin_corpora.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/corpora/real_binary.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/corpora/registry.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/providers/__init__.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/providers/online/__init__.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/providers/online/metaculus.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm/data/providers/online/polymarket.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm_data.egg-info/SOURCES.txt +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm_data.egg-info/dependency_links.txt +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm_data.egg-info/requires.txt +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/src/xrtm_data.egg-info/top_level.txt +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/tests/test_corpus_registry.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/tests/test_prior_schemas.py +0 -0
- {xrtm_data-0.3.0 → xrtm_data-0.3.2}/tests/test_real_binary_corpus.py +0 -0
xrtm_data-0.3.2/PKG-INFO
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xrtm-data
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: The Snapshot Vault for XRTM.
|
|
5
|
+
Author-email: XRTM Team <moy@xrtm.org>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Requires-Python: <3.13,>=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: pydantic>=2.0.0
|
|
11
|
+
Requires-Dist: scipy>=1.11.0
|
|
12
|
+
Provides-Extra: dev
|
|
13
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
14
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
15
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
16
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
17
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# xrtm-data v0.3.0
|
|
21
|
+
|
|
22
|
+
[](https://pypi.org/project/xrtm-data/)
|
|
23
|
+
|
|
24
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
25
|
+
[](https://www.python.org/downloads/)
|
|
26
|
+
|
|
27
|
+
**The Snapshot Vault for XRTM.**
|
|
28
|
+
|
|
29
|
+
`xrtm-data` provides the schemas, question sources, and temporal sandboxing for the XRTM forecasting ecosystem.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install xrtm-data
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Schemas
|
|
38
|
+
|
|
39
|
+
- **`ForecastQuestion`** — Standardized forecast question input
|
|
40
|
+
- **`ForecastOutput`** (alias `ForecastResult`) — Forecast result with probability, reasoning trace, causal graph
|
|
41
|
+
- **`CausalNode` / `CausalEdge` / `CausalGraph`** — Reasoning chain DAG
|
|
42
|
+
- **`BetaPrior` / `PriorState`** — Beta distribution for belief states
|
|
43
|
+
- **`TradeEvent` / `TradeWindow`** — Market trade data with temporal integrity
|
|
44
|
+
|
|
45
|
+
## Question Sources
|
|
46
|
+
|
|
47
|
+
| Source | API Key | Description |
|
|
48
|
+
|--------|---------|-------------|
|
|
49
|
+
| **real-binary** | None | 21 embedded historical binary questions (CI fixture) |
|
|
50
|
+
| **Polymarket** | None (public) | Live prediction market data via Gamma API |
|
|
51
|
+
| **Metaculus** | Free account | Forecasting questions from Metaculus |
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from xrtm.data.corpora import load_real_binary_questions
|
|
55
|
+
from xrtm.data.providers.online import PolymarketSource, MetaculusSource
|
|
56
|
+
|
|
57
|
+
# Built-in corpus
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
questions = load_real_binary_questions(limit=5)
|
|
61
|
+
|
|
62
|
+
# Live prediction markets (no API key)
|
|
63
|
+
poly = PolymarketSource()
|
|
64
|
+
markets = await poly.fetch_questions(limit=10)
|
|
65
|
+
|
|
66
|
+
# Metaculus (needs METACULUS_API_KEY)
|
|
67
|
+
meta = MetaculusSource()
|
|
68
|
+
meta_qs = await meta.fetch_questions(limit=10)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
Apache 2.0
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# xrtm-data v0.3.0
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/xrtm-data/)
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
|
+
[](https://www.python.org/downloads/)
|
|
7
|
+
|
|
8
|
+
**The Snapshot Vault for XRTM.**
|
|
9
|
+
|
|
10
|
+
`xrtm-data` provides the schemas, question sources, and temporal sandboxing for the XRTM forecasting ecosystem.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install xrtm-data
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Schemas
|
|
19
|
+
|
|
20
|
+
- **`ForecastQuestion`** — Standardized forecast question input
|
|
21
|
+
- **`ForecastOutput`** (alias `ForecastResult`) — Forecast result with probability, reasoning trace, causal graph
|
|
22
|
+
- **`CausalNode` / `CausalEdge` / `CausalGraph`** — Reasoning chain DAG
|
|
23
|
+
- **`BetaPrior` / `PriorState`** — Beta distribution for belief states
|
|
24
|
+
- **`TradeEvent` / `TradeWindow`** — Market trade data with temporal integrity
|
|
25
|
+
|
|
26
|
+
## Question Sources
|
|
27
|
+
|
|
28
|
+
| Source | API Key | Description |
|
|
29
|
+
|--------|---------|-------------|
|
|
30
|
+
| **real-binary** | None | 21 embedded historical binary questions (CI fixture) |
|
|
31
|
+
| **Polymarket** | None (public) | Live prediction market data via Gamma API |
|
|
32
|
+
| **Metaculus** | Free account | Forecasting questions from Metaculus |
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from xrtm.data.corpora import load_real_binary_questions
|
|
36
|
+
from xrtm.data.providers.online import PolymarketSource, MetaculusSource
|
|
37
|
+
|
|
38
|
+
# Built-in corpus
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
questions = load_real_binary_questions(limit=5)
|
|
42
|
+
|
|
43
|
+
# Live prediction markets (no API key)
|
|
44
|
+
poly = PolymarketSource()
|
|
45
|
+
markets = await poly.fetch_questions(limit=10)
|
|
46
|
+
|
|
47
|
+
# Metaculus (needs METACULUS_API_KEY)
|
|
48
|
+
meta = MetaculusSource()
|
|
49
|
+
meta_qs = await meta.fetch_questions(limit=10)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
Apache 2.0
|
|
@@ -111,6 +111,10 @@ class ForecastQuestion(BaseModel):
|
|
|
111
111
|
description="Detailed context and background",
|
|
112
112
|
)
|
|
113
113
|
resolution_criteria: Optional[str] = Field(None, description="Explicit rules for ground truth determination")
|
|
114
|
+
context: Optional[Dict[str, Any]] = Field(
|
|
115
|
+
None,
|
|
116
|
+
description="Optional market context or metadata injected by downstream consumers (e.g., price, volume, spread)",
|
|
117
|
+
)
|
|
114
118
|
metadata: MetadataBase = Field(default_factory=MetadataBase) # type: ignore[arg-type]
|
|
115
119
|
|
|
116
120
|
@property
|
|
@@ -21,7 +21,7 @@ This module provides the single source of truth for the package version.
|
|
|
21
21
|
|
|
22
22
|
__all__ = ["__version__", "__author__", "__contact__", "__license__", "__copyright__"]
|
|
23
23
|
|
|
24
|
-
__version__ = "0.3.
|
|
24
|
+
__version__ = "0.3.2"
|
|
25
25
|
__author__ = "XRTM Team"
|
|
26
26
|
__contact__ = "moy@xrtm.org"
|
|
27
27
|
__license__ = "Apache-2.0"
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xrtm-data
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: The Snapshot Vault for XRTM.
|
|
5
|
+
Author-email: XRTM Team <moy@xrtm.org>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Requires-Python: <3.13,>=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: pydantic>=2.0.0
|
|
11
|
+
Requires-Dist: scipy>=1.11.0
|
|
12
|
+
Provides-Extra: dev
|
|
13
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
14
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
15
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
16
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
17
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# xrtm-data v0.3.0
|
|
21
|
+
|
|
22
|
+
[](https://pypi.org/project/xrtm-data/)
|
|
23
|
+
|
|
24
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
25
|
+
[](https://www.python.org/downloads/)
|
|
26
|
+
|
|
27
|
+
**The Snapshot Vault for XRTM.**
|
|
28
|
+
|
|
29
|
+
`xrtm-data` provides the schemas, question sources, and temporal sandboxing for the XRTM forecasting ecosystem.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install xrtm-data
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Schemas
|
|
38
|
+
|
|
39
|
+
- **`ForecastQuestion`** — Standardized forecast question input
|
|
40
|
+
- **`ForecastOutput`** (alias `ForecastResult`) — Forecast result with probability, reasoning trace, causal graph
|
|
41
|
+
- **`CausalNode` / `CausalEdge` / `CausalGraph`** — Reasoning chain DAG
|
|
42
|
+
- **`BetaPrior` / `PriorState`** — Beta distribution for belief states
|
|
43
|
+
- **`TradeEvent` / `TradeWindow`** — Market trade data with temporal integrity
|
|
44
|
+
|
|
45
|
+
## Question Sources
|
|
46
|
+
|
|
47
|
+
| Source | API Key | Description |
|
|
48
|
+
|--------|---------|-------------|
|
|
49
|
+
| **real-binary** | None | 21 embedded historical binary questions (CI fixture) |
|
|
50
|
+
| **Polymarket** | None (public) | Live prediction market data via Gamma API |
|
|
51
|
+
| **Metaculus** | Free account | Forecasting questions from Metaculus |
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from xrtm.data.corpora import load_real_binary_questions
|
|
55
|
+
from xrtm.data.providers.online import PolymarketSource, MetaculusSource
|
|
56
|
+
|
|
57
|
+
# Built-in corpus
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
questions = load_real_binary_questions(limit=5)
|
|
61
|
+
|
|
62
|
+
# Live prediction markets (no API key)
|
|
63
|
+
poly = PolymarketSource()
|
|
64
|
+
markets = await poly.fetch_questions(limit=10)
|
|
65
|
+
|
|
66
|
+
# Metaculus (needs METACULUS_API_KEY)
|
|
67
|
+
meta = MetaculusSource()
|
|
68
|
+
meta_qs = await meta.fetch_questions(limit=10)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
Apache 2.0
|
|
@@ -16,7 +16,7 @@ from datetime import datetime, timedelta, timezone
|
|
|
16
16
|
|
|
17
17
|
import pytest
|
|
18
18
|
|
|
19
|
-
from xrtm.data import CausalEdge, CausalNode, ForecastOutput, ForecastResult, MetadataBase
|
|
19
|
+
from xrtm.data import CausalEdge, CausalNode, ForecastOutput, ForecastQuestion, ForecastResult, MetadataBase
|
|
20
20
|
from xrtm.data.core.schemas import TradeEvent, TradeWindow
|
|
21
21
|
|
|
22
22
|
|
|
@@ -172,3 +172,33 @@ def test_trade_window_normalizes_naive_boundaries_and_timestamps():
|
|
|
172
172
|
|
|
173
173
|
assert window.start_time.tzinfo == timezone.utc
|
|
174
174
|
assert window.trades[0].timestamp.tzinfo == timezone.utc
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def test_forecast_question_context_field():
|
|
178
|
+
"""ForecastQuestion accepts an optional context dict for market metadata."""
|
|
179
|
+
q = ForecastQuestion(
|
|
180
|
+
id="q1",
|
|
181
|
+
title="Will market X exceed $100?",
|
|
182
|
+
context={"market_price": 0.55, "volume_24h": 150000, "spread": 0.02},
|
|
183
|
+
)
|
|
184
|
+
assert q.context == {"market_price": 0.55, "volume_24h": 150000, "spread": 0.02}
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def test_forecast_question_context_defaults_to_none():
|
|
188
|
+
"""ForecastQuestion context is None by default for backward compatibility."""
|
|
189
|
+
q = ForecastQuestion(id="q2", title="Simple question")
|
|
190
|
+
assert q.context is None
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def test_forecast_question_context_serializes():
|
|
194
|
+
"""Context field serializes to JSON and round-trips correctly."""
|
|
195
|
+
q = ForecastQuestion(
|
|
196
|
+
id="q3",
|
|
197
|
+
title="Serialization test",
|
|
198
|
+
context={"key": "value", "nested": {"a": 1}},
|
|
199
|
+
)
|
|
200
|
+
payload = q.model_dump(mode="json")
|
|
201
|
+
assert payload["context"] == {"key": "value", "nested": {"a": 1}}
|
|
202
|
+
|
|
203
|
+
reloaded = ForecastQuestion.model_validate(payload)
|
|
204
|
+
assert reloaded.context == {"key": "value", "nested": {"a": 1}}
|
xrtm_data-0.3.0/PKG-INFO
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: xrtm-data
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: The Snapshot Vault for XRTM.
|
|
5
|
-
Author-email: XRTM Team <moy@xrtm.org>
|
|
6
|
-
License-Expression: Apache-2.0
|
|
7
|
-
Requires-Python: <3.13,>=3.11
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Requires-Dist: pydantic>=2.0.0
|
|
11
|
-
Requires-Dist: scipy>=1.11.0
|
|
12
|
-
Provides-Extra: dev
|
|
13
|
-
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
14
|
-
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
15
|
-
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
16
|
-
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
17
|
-
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
18
|
-
Dynamic: license-file
|
|
19
|
-
|
|
20
|
-
# xrtm-data
|
|
21
|
-
|
|
22
|
-
[](https://opensource.org/licenses/Apache-2.0)
|
|
23
|
-
[](https://www.python.org/downloads/)
|
|
24
|
-
[](https://pypi.org/project/xrtm-data/)
|
|
25
|
-
|
|
26
|
-
**The Snapshot Vault for XRTM.**
|
|
27
|
-
|
|
28
|
-
`xrtm-data` provides the rigid schemas and temporal sandboxing infrastructure required for zero-leakage forecasting. It defines the "Ground Truth" data structures that the rest of the ecosystem (Forecast, Eval, Train) relies on.
|
|
29
|
-
|
|
30
|
-
## Part of the XRTM Ecosystem
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
Layer 4: xrtm-train → (imports all)
|
|
34
|
-
Layer 3: xrtm-forecast → (imports eval, data)
|
|
35
|
-
Layer 2: xrtm-eval → (imports data)
|
|
36
|
-
Layer 1: xrtm-data → (zero dependencies) ← YOU ARE HERE
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
`xrtm-data` is the foundation layer with **zero dependencies** on other xrtm packages.
|
|
40
|
-
|
|
41
|
-
## Installation
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
pip install xrtm-data
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Core Primitives
|
|
48
|
-
|
|
49
|
-
### 1. The Forecast Object Standard
|
|
50
|
-
Adhering to strict Governance, the canonical runtime schema is
|
|
51
|
-
`ForecastResult` (legacy alias: `ForecastOutput`). Every forecast result carries
|
|
52
|
-
`forecast_request_id`, `probability`, a `reasoning_trace`, and an optional
|
|
53
|
-
`execution_trace`. Legacy `question_id`, `reasoning`, `logical_trace`,
|
|
54
|
-
`logical_edges`, and `structural_trace` inputs remain accepted for compatibility.
|
|
55
|
-
|
|
56
|
-
```python
|
|
57
|
-
from xrtm.data import ForecastResult, CausalNode
|
|
58
|
-
|
|
59
|
-
forecast_result = ForecastResult(
|
|
60
|
-
forecast_request_id="q_123",
|
|
61
|
-
probability=0.75,
|
|
62
|
-
reasoning_trace={
|
|
63
|
-
"narrative": "Base rate analysis suggests...",
|
|
64
|
-
"causal_graph": {
|
|
65
|
-
"nodes": [
|
|
66
|
-
CausalNode(event="Inflation rises", probability=0.8),
|
|
67
|
-
CausalNode(event="Fed cuts rates", probability=0.4),
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
execution_trace=["ingestion", "forecast"],
|
|
72
|
-
)
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### 2. Zero Leakage
|
|
76
|
-
The `MetadataBase` enforces a strict `snapshot_time`. This timestamp represents the "End of History" for the model. Any data point generated after this time is considered "Future Leakage" and is programmatically inaccessible during backtesting.
|
|
77
|
-
|
|
78
|
-
## Project Structure
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
src/xrtm/data/
|
|
82
|
-
├── core/ # Interfaces & Schemas (domain-agnostic)
|
|
83
|
-
│ ├── interfaces.py # DataSource protocol
|
|
84
|
-
│ └── schemas/ # ForecastRequest, ForecastResult, etc.
|
|
85
|
-
├── kit/ # Composable utilities (processors)
|
|
86
|
-
└── providers/ # External data source implementations
|
|
87
|
-
├── local/ # LocalDataSource (JSON files)
|
|
88
|
-
└── online/ # PolymarketSource (Gamma API)
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Development
|
|
92
|
-
|
|
93
|
-
Prerequisites:
|
|
94
|
-
- [uv](https://github.com/astral-sh/uv)
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# Install dependencies
|
|
98
|
-
uv sync
|
|
99
|
-
|
|
100
|
-
# Run tests
|
|
101
|
-
uv run pytest
|
|
102
|
-
```
|
xrtm_data-0.3.0/README.md
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# xrtm-data
|
|
2
|
-
|
|
3
|
-
[](https://opensource.org/licenses/Apache-2.0)
|
|
4
|
-
[](https://www.python.org/downloads/)
|
|
5
|
-
[](https://pypi.org/project/xrtm-data/)
|
|
6
|
-
|
|
7
|
-
**The Snapshot Vault for XRTM.**
|
|
8
|
-
|
|
9
|
-
`xrtm-data` provides the rigid schemas and temporal sandboxing infrastructure required for zero-leakage forecasting. It defines the "Ground Truth" data structures that the rest of the ecosystem (Forecast, Eval, Train) relies on.
|
|
10
|
-
|
|
11
|
-
## Part of the XRTM Ecosystem
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
Layer 4: xrtm-train → (imports all)
|
|
15
|
-
Layer 3: xrtm-forecast → (imports eval, data)
|
|
16
|
-
Layer 2: xrtm-eval → (imports data)
|
|
17
|
-
Layer 1: xrtm-data → (zero dependencies) ← YOU ARE HERE
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
`xrtm-data` is the foundation layer with **zero dependencies** on other xrtm packages.
|
|
21
|
-
|
|
22
|
-
## Installation
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pip install xrtm-data
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Core Primitives
|
|
29
|
-
|
|
30
|
-
### 1. The Forecast Object Standard
|
|
31
|
-
Adhering to strict Governance, the canonical runtime schema is
|
|
32
|
-
`ForecastResult` (legacy alias: `ForecastOutput`). Every forecast result carries
|
|
33
|
-
`forecast_request_id`, `probability`, a `reasoning_trace`, and an optional
|
|
34
|
-
`execution_trace`. Legacy `question_id`, `reasoning`, `logical_trace`,
|
|
35
|
-
`logical_edges`, and `structural_trace` inputs remain accepted for compatibility.
|
|
36
|
-
|
|
37
|
-
```python
|
|
38
|
-
from xrtm.data import ForecastResult, CausalNode
|
|
39
|
-
|
|
40
|
-
forecast_result = ForecastResult(
|
|
41
|
-
forecast_request_id="q_123",
|
|
42
|
-
probability=0.75,
|
|
43
|
-
reasoning_trace={
|
|
44
|
-
"narrative": "Base rate analysis suggests...",
|
|
45
|
-
"causal_graph": {
|
|
46
|
-
"nodes": [
|
|
47
|
-
CausalNode(event="Inflation rises", probability=0.8),
|
|
48
|
-
CausalNode(event="Fed cuts rates", probability=0.4),
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
execution_trace=["ingestion", "forecast"],
|
|
53
|
-
)
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### 2. Zero Leakage
|
|
57
|
-
The `MetadataBase` enforces a strict `snapshot_time`. This timestamp represents the "End of History" for the model. Any data point generated after this time is considered "Future Leakage" and is programmatically inaccessible during backtesting.
|
|
58
|
-
|
|
59
|
-
## Project Structure
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
src/xrtm/data/
|
|
63
|
-
├── core/ # Interfaces & Schemas (domain-agnostic)
|
|
64
|
-
│ ├── interfaces.py # DataSource protocol
|
|
65
|
-
│ └── schemas/ # ForecastRequest, ForecastResult, etc.
|
|
66
|
-
├── kit/ # Composable utilities (processors)
|
|
67
|
-
└── providers/ # External data source implementations
|
|
68
|
-
├── local/ # LocalDataSource (JSON files)
|
|
69
|
-
└── online/ # PolymarketSource (Gamma API)
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Development
|
|
73
|
-
|
|
74
|
-
Prerequisites:
|
|
75
|
-
- [uv](https://github.com/astral-sh/uv)
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
# Install dependencies
|
|
79
|
-
uv sync
|
|
80
|
-
|
|
81
|
-
# Run tests
|
|
82
|
-
uv run pytest
|
|
83
|
-
```
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: xrtm-data
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: The Snapshot Vault for XRTM.
|
|
5
|
-
Author-email: XRTM Team <moy@xrtm.org>
|
|
6
|
-
License-Expression: Apache-2.0
|
|
7
|
-
Requires-Python: <3.13,>=3.11
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Requires-Dist: pydantic>=2.0.0
|
|
11
|
-
Requires-Dist: scipy>=1.11.0
|
|
12
|
-
Provides-Extra: dev
|
|
13
|
-
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
14
|
-
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
15
|
-
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
16
|
-
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
17
|
-
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
18
|
-
Dynamic: license-file
|
|
19
|
-
|
|
20
|
-
# xrtm-data
|
|
21
|
-
|
|
22
|
-
[](https://opensource.org/licenses/Apache-2.0)
|
|
23
|
-
[](https://www.python.org/downloads/)
|
|
24
|
-
[](https://pypi.org/project/xrtm-data/)
|
|
25
|
-
|
|
26
|
-
**The Snapshot Vault for XRTM.**
|
|
27
|
-
|
|
28
|
-
`xrtm-data` provides the rigid schemas and temporal sandboxing infrastructure required for zero-leakage forecasting. It defines the "Ground Truth" data structures that the rest of the ecosystem (Forecast, Eval, Train) relies on.
|
|
29
|
-
|
|
30
|
-
## Part of the XRTM Ecosystem
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
Layer 4: xrtm-train → (imports all)
|
|
34
|
-
Layer 3: xrtm-forecast → (imports eval, data)
|
|
35
|
-
Layer 2: xrtm-eval → (imports data)
|
|
36
|
-
Layer 1: xrtm-data → (zero dependencies) ← YOU ARE HERE
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
`xrtm-data` is the foundation layer with **zero dependencies** on other xrtm packages.
|
|
40
|
-
|
|
41
|
-
## Installation
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
pip install xrtm-data
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Core Primitives
|
|
48
|
-
|
|
49
|
-
### 1. The Forecast Object Standard
|
|
50
|
-
Adhering to strict Governance, the canonical runtime schema is
|
|
51
|
-
`ForecastResult` (legacy alias: `ForecastOutput`). Every forecast result carries
|
|
52
|
-
`forecast_request_id`, `probability`, a `reasoning_trace`, and an optional
|
|
53
|
-
`execution_trace`. Legacy `question_id`, `reasoning`, `logical_trace`,
|
|
54
|
-
`logical_edges`, and `structural_trace` inputs remain accepted for compatibility.
|
|
55
|
-
|
|
56
|
-
```python
|
|
57
|
-
from xrtm.data import ForecastResult, CausalNode
|
|
58
|
-
|
|
59
|
-
forecast_result = ForecastResult(
|
|
60
|
-
forecast_request_id="q_123",
|
|
61
|
-
probability=0.75,
|
|
62
|
-
reasoning_trace={
|
|
63
|
-
"narrative": "Base rate analysis suggests...",
|
|
64
|
-
"causal_graph": {
|
|
65
|
-
"nodes": [
|
|
66
|
-
CausalNode(event="Inflation rises", probability=0.8),
|
|
67
|
-
CausalNode(event="Fed cuts rates", probability=0.4),
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
execution_trace=["ingestion", "forecast"],
|
|
72
|
-
)
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### 2. Zero Leakage
|
|
76
|
-
The `MetadataBase` enforces a strict `snapshot_time`. This timestamp represents the "End of History" for the model. Any data point generated after this time is considered "Future Leakage" and is programmatically inaccessible during backtesting.
|
|
77
|
-
|
|
78
|
-
## Project Structure
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
src/xrtm/data/
|
|
82
|
-
├── core/ # Interfaces & Schemas (domain-agnostic)
|
|
83
|
-
│ ├── interfaces.py # DataSource protocol
|
|
84
|
-
│ └── schemas/ # ForecastRequest, ForecastResult, etc.
|
|
85
|
-
├── kit/ # Composable utilities (processors)
|
|
86
|
-
└── providers/ # External data source implementations
|
|
87
|
-
├── local/ # LocalDataSource (JSON files)
|
|
88
|
-
└── online/ # PolymarketSource (Gamma API)
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Development
|
|
92
|
-
|
|
93
|
-
Prerequisites:
|
|
94
|
-
- [uv](https://github.com/astral-sh/uv)
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# Install dependencies
|
|
98
|
-
uv sync
|
|
99
|
-
|
|
100
|
-
# Run tests
|
|
101
|
-
uv run pytest
|
|
102
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|