Overview
Whether treats data provenance as a first-class concern. Every numeric output includes explicit metadata about its source, timestamp, and freshness. This ensures operators can trust the regime assessment and audit decisions retroactively.Required Metadata
All data structures in Whether include these fields:The origin of the data (e.g.,
"https://fred.stlouisfed.org", "BLS public API")The official date of the data point (e.g.,
"2024-03-15"). This is the date the data represents, not when it was fetched.ISO 8601 timestamp when Whether retrieved the data (e.g.,
"2024-03-16T14:23:11.000Z")true: Data was fetched from a live APIfalse: Data is from a snapshot file (offline mode)
Optional Fallback Metadata
When Whether falls back to snapshot data, additional fields explain why:ISO timestamp when the fallback was triggered
Human-readable explanation (e.g.,
"Treasury API error: 503", "Time Machine cache miss for historical selection.")Source Health Monitoring
Live Fetch Flow
Whether attempts to fetch live data on every request, subject to Next.js caching:Fallback Snapshot Construction
When live fetch fails, Whether wraps the snapshot with explicit metadata:Offline Mode and Snapshot Fallback
When Whether Uses Snapshots
- Live API failure: Network error, 5xx response, or malformed data
- Time Machine mode: Historical regime views use pre-cached snapshots
- Missing data: If required fields are absent from the live response
Snapshot Storage
Snapshots are committed to the repository:- Treasury data:
data/treasury_snapshot.json - Macro indicators:
data/macro_snapshot.json
Snapshot Schema Validation
Before using snapshot data, Whether validates it against the expected schema:OFFLINE/SIMULATED Badges
Whether displays clear visual indicators when data is not live:OFFLINE Badge
Shown whenisLive: false due to API failure:
- Color: Gray or muted yellow
- Placement: Adjacent to regime label or sensor cards
- Tooltip: Includes
fallback_reasonandfallback_attimestamp
SIMULATED Badge
Shown in Time Machine mode when viewing historical regimes:- Color: Blue or purple
- Placement: Global banner across the top of the UI
- Message: “Historical View: YYYY-MM” with a link to return to live mode
Implementation
Badges are rendered based on theisLive and fallback_at metadata:
Stale Data Handling
Staleness Threshold
Whether considers data stale if:- Treasury yields:
record_dateis more than 3 business days old - Macro indicators:
record_dateis more than 1 month old
Staleness Warnings
If live data is successfully fetched but therecord_date is stale, Whether displays a warning:
- Icon: ⚠️ next to the timestamp
- Tooltip: “This data is older than expected. Source may not be updating regularly.”
No Arbitrary Defaults
Whether never silently defaults to zero or placeholder values. If data is missing:- Attempt to fetch from live source
- Fall back to snapshot with explicit
fallback_reason - If both fail, display an error message and refuse to classify regime
Audit Trails
Regime Assessment Metadata
EveryRegimeAssessment object includes a full audit trail:
- Which Treasury yields were used
- Which fallback logic was applied (e.g., 3M instead of 1M)
- The exact timestamps and sources for each input
Decision Memory (Post-MVP)
In the next-level release, Whether will persist decision metadata to an append-only log:Source URLs and Attribution
Every data point in Whether includes clickable source URLs:- Treasury yields: Link to
fred.stlouisfed.org/series/{SERIES_ID} - BLS series: Link to
api.bls.govwith series ID in tooltip - FRED macro indicators: Link to
fred.stlouisfed.org/series/{SERIES_ID}
Time Machine Cache
When viewing historical regimes, Whether uses a pre-built cache:Cache Structure
The Time Machine cache is a JSON file mapping dates to snapshots:Related
- Treasury Yields - Core yield curve data sourcing
- Macro Indicators - Additional economic signals
- Regime Scoring - How data feeds into classification