---
title: "trade.source.recovered@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/trade.source.recovered"
updated: null
---

# trade.source.recovered@1 · OpenVibe.Services

HTML: [trade.source.recovered@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/trade.source.recovered)

# TradeSourceRecoveredPayload `trade.source.recovered@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.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`](/docs/contracts/trade.source.recovered.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. | - `pattern ^[a-z0-9][a-z0-9-]{1,63}$` |
| `stale` | const | yes |  | - `= false` |
| `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). | - `format date-time` |
| `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 |  | - `format date-time` |

## 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 }] }
~~~~
