TradeSourceRecoveredPayload trade.source.recovered@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.recovered.v1.json
trade.source.recovered v1 (OpenVibe.Trade server/domain/freshness.js evaluate). A stale source is fresh again by Trade's own clock: a successful fetch younger than its staleness window is now known, reported through Sources' health during the sync (sync.js reportHealth) or proved by the retrieved_at of a newly recorded observation or filing (noteRetrieval). Sent only on a stale-to-fresh transition; a source that is already fresh the first time Trade evaluates it is not a recovery and sends nothing. Envelope: subject { type: source, id: <source_key> }, visibility public, priority low, actor service:trade.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
source_key | string | yes | OpenVibe.Sources source key. |
|
stale | const | yes |
| |
stale_since | null | yes | Always null: the source is fresh. | |
last_success_at | string | yes | The successful fetch that made it fresh (or a later one). |
|
stale_after_sec | integer | yes | The staleness window applied, in seconds. | |
upstream_status | string | null | yes | Sources' own health status as last reported (healthy, stale, failing, never_fetched, disabled, manual); null if never reported. | |
evaluated_at | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: proved-by-retrieval
{
"source_key": "test-feed",
"stale": false,
"stale_since": null,
"last_success_at": "2026-09-23T15:30:00.000Z",
"stale_after_sec": 10800,
"upstream_status": null,
"evaluated_at": "2026-09-23T15:30:04.000Z"
}Valid: recovered
{
"source_key": "test-feed",
"stale": false,
"stale_since": null,
"last_success_at": "2026-09-23T15:30:00.000Z",
"stale_after_sec": 10800,
"upstream_status": "healthy",
"evaluated_at": "2026-09-23T15:30:04.000Z"
}Rejected: no-last-success
{
"source_key": "test-feed",
"stale": false,
"stale_since": null,
"last_success_at": null,
"stale_after_sec": 10800,
"upstream_status": "healthy",
"evaluated_at": "2026-09-23T15:30:04.000Z"
}Rejected: with-stale-since
{
"source_key": "test-feed",
"stale": false,
"stale_since": "2026-09-23T15:00:00.000Z",
"last_success_at": "2026-09-23T15:30:00.000Z",
"stale_after_sec": 10800,
"upstream_status": "healthy",
"evaluated_at": "2026-09-23T15:30:04.000Z"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('trade.source.recovered@1', value); // { valid, errors: [{ path, message }] }