---
title: "sources.category@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/sources.category"
updated: null
---

# sources.category@1 · OpenVibe.Services

HTML: [sources.category@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/sources.category)

# SourceCategory `sources.category@1`

Generated at 2026-11-13 06:25:48 UTC from [`openvibe-contracts v0.419.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.419.0) and [`openvibe-sdk v0.161.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.161.0).

- Version: 1.0.0
- Owner: sources
- Visibility: first-party
- Status: active
- Compatibility: backward
- Decision: [ADR-017](/docs/adr/ADR-017)
- Schema: [`https://openvibe.network/contracts/sources/category.v1.json`](/docs/contracts/sources.category.json)

One category of the sources registry and how long OpenVibe.Sources keeps its items (roadmap §3 F). The window is what stops the registry's items growing linearly: every category says for itself how long its items live, so a consumer knows how long an item may be there and Sources prunes what the category no longer keeps. The age of an item is the last time it was current: its last fetch while it is live, its removal once it is removed. The categories are the ones sources.source@1 and sources.item@1 use.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `key` | enum | yes | The category's key: the same value sources.source@1's category and sources.item@1's category carry. | - `one of "news", "blog", "reviews", "deals", "coupons", "trade", "hosting", "crowdfunding", "games", "housing", "food", "jobs", "code"` |
| `retention` | one of | yes | How long Sources keeps an item of this category: a window in days, or "keep" for reference data that is never pruned by age. |  |

## Examples

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

 Valid: code

~~~~
{
  "key": "code",
  "retention": {
    "days": 30,
    "reason": "code repositories are current rankings; a month keeps the tracked set through a failed pull"
  }
}
~~~~

Valid: housing

~~~~
{
  "key": "housing",
  "retention": "keep"
}
~~~~

Valid: news

~~~~
{
  "key": "news",
  "retention": {
    "days": 30,
    "reason": "News shows the last 30 days and copies every item it follows"
  }
}
~~~~

Rejected: no-window

~~~~
{
  "key": "news"
}
~~~~

Rejected: unknown-category

~~~~
{
  "key": "weather",
  "retention": {
    "days": 7
  }
}
~~~~

Rejected: zero-days

~~~~
{
  "key": "news",
  "retention": {
    "days": 0
  }
}
~~~~

## Validate

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