# \_mod\_CROSSWATCH

Provider ID: `CROSSWATCH`\
Version (module): `1.0.0`

{% tabs %}
{% tab title="End users" %}
CrossWatch can act as its own local tracker.

It stores watchlist, history, and ratings as JSON on disk.

Use it for:

* local backups before risky runs
* staging and testing
* seeding other providers from a clean dataset

Related docs:

* [Adapter: CrossWatch](/crosswatch/providers/synchronization/adapter-crosswatch.md)
* [Editor](/crosswatch/tools/editor.md)
  {% endtab %}

{% tab title="Power users" %}
**Entry point:** `sync/_mod_CROSSWATCH.py`

### Provider surface

* `health()`
* `build_index(feature)`
* `add(feature, items)`
* `remove(feature, items)`

### Features

* `watchlist` → `providers/crosswatch/_watchlist.py`
* `history` → `providers/crosswatch/_history.py`
* `ratings` → `providers/crosswatch/_ratings.py`

### Capabilities

* `bidirectional: true`
* `provides_ids: true`
* `index_semantics: "present"`
* `observed_deletes: true`

### Config

Config block name:

* `CrossWatch` or `crosswatch`

Common keys:

* `root_dir` (default `/config/.cw_provider`)
* `auto_snapshot` (default `true`)
* `retention_days` (default `30`)
* `max_snapshots` (default `64`)
* `restore_watchlist`, `restore_history`, `restore_ratings`

### Pair scoping (optional)

Enable:

* `CW_CROSSWATCH_PAIR_SCOPED=1`

Scope key reads from:

* `CW_PAIR_KEY`, `CW_PAIR_SCOPE`, `CW_SYNC_PAIR`, `CW_PAIR`

Effects:

* state files become `watchlist.<scope>.json`, etc.
* snapshots go under `snapshots/<scope>/`

### Gotchas

Timestamp comparisons can be string-based.

Use ISO8601 UTC `...Z` timestamps.

<details>

<summary>Capabilities (raw)</summary>

```json
{
  "bidirectional": true,
  "index_semantics": "present",
  "observed_deletes": true,
  "provides_ids": true,
  "ratings": {
    "from_date": false,
    "types": {
      "episodes": true,
      "movies": true,
      "seasons": true,
      "shows": true
    },
    "unrate": true,
    "upsert": true
  }
}
```

</details>

<details>

<summary>OPS contract</summary>

* `name()`
* `label()`
* `features()`
* `capabilities()`
* `is_configured(cfg)`
* `build_index(cfg, feature=...)`
* `add(cfg, items, feature=..., dry_run=False)`
* `remove(cfg, items, feature=..., dry_run=False)`
* `health(cfg)`

</details>

<details>

<summary>Common state files</summary>

* `watchlist.json`, `watchlist.restore_state.json`, `watchlist.unresolved.json`
* `history.json`, `history.restore_state.json`, `history.unresolved.json`
* `ratings.json`, `ratings.restore_state.json`, `ratings.unresolved.json`

</details>
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.crosswatch.app/blueprint-architecture/sync/_mod_crosswatch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
