TradeSourceStalePayload trade.source.stale@1

Generated at from openvibe-contracts v0.34.2 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
trade
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/trade.source.stale.v1.json

trade.source.stale v1 (OpenVibe.Trade server/domain/freshness.js evaluate). A source Trade shows data from went stale by Trade's own clock: its last successful fetch is older than its staleness window (Sources' stale_after_sec, else TRADE_DEFAULT_STALE_AFTER_SEC), or no success is known at all. Sent only on a transition (fresh to stale), or once when Trade first evaluates a source that is already stale; replays and further ticks send nothing. Evaluated when the Sources sync reports a source's health (sync.js reportHealth), when a recorded observation or filing proves a retrieval (noteRetrieval), and by the worker (evaluateAll). Sources' own health status is carried as upstream_status but is not the verdict. Envelope: subject { type: source, id: <source_key> }, visibility public, priority low, actor service:trade.

Fields

FieldTypeRequiredDescriptionConstraints
source_keystringyesOpenVibe.Sources source key.
  • pattern ^[a-z0-9][a-z0-9-]{1,63}$
staleconstyes
  • = true
stale_sincestringyesLast success + window, or when Trade first saw the source if it never succeeded.
  • format date-time
last_success_atstring | nullyesLast known successful fetch; null when none is known.
  • format date-time
stale_after_secintegeryesThe staleness window applied, in seconds.
upstream_statusstring | nullyesSources' own health status as last reported (healthy, stale, failing, never_fetched, disabled, manual); null if never reported.
evaluated_atstringyes
  • format date-time

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: never-succeeded
{
  "source_key": "sec-xbrl-filings",
  "stale": true,
  "stale_since": "2026-09-23T03:25:25.317Z",
  "last_success_at": null,
  "stale_after_sec": 2700,
  "upstream_status": "disabled",
  "evaluated_at": "2026-09-23T03:25:25.318Z"
}
Valid: window-passed
{
  "source_key": "test-feed",
  "stale": true,
  "stale_since": "2026-09-23T15:00:00.000Z",
  "last_success_at": "2026-09-23T12:00:00.000Z",
  "stale_after_sec": 10800,
  "upstream_status": "failing",
  "evaluated_at": "2026-09-23T15:01:00.000Z"
}
Rejected: no-stale-since
{
  "source_key": "sec-xbrl-filings",
  "stale": true,
  "stale_since": null,
  "last_success_at": null,
  "stale_after_sec": 2700,
  "upstream_status": "disabled",
  "evaluated_at": "2026-09-23T03:25:25.318Z"
}
Rejected: not-stale
{
  "source_key": "sec-xbrl-filings",
  "stale": false,
  "stale_since": "2026-09-23T03:25:25.317Z",
  "last_success_at": null,
  "stale_after_sec": 2700,
  "upstream_status": "disabled",
  "evaluated_at": "2026-09-23T03:25:25.318Z"
}
Rejected: rendered-text
{
  "source_key": "sec-xbrl-filings",
  "stale": true,
  "stale_since": "2026-09-23T03:25:25.317Z",
  "last_success_at": null,
  "stale_after_sec": 2700,
  "upstream_status": "disabled",
  "evaluated_at": "2026-09-23T03:25:25.318Z",
  "message": "SEC filings are stale"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('trade.source.stale@1', value);   // { valid, errors: [{ path, message }] }