changedetection.io, urlwatch и direct adapters.
Детальный разбор двух основных watcher-кандидатов и трёх специализированных путей: GitHub events, RSS/Atom/RSSHub и Docling-based document diff. Здесь важно не выбрать один универсальный инструмент, а собрать правильные адаптеры под разные источники.
1. Разделение ролей
GENERIC HTML / JSON → changedetection.io OR urlwatch GITHUB → webhook/API directly RSS / ATOM → native feed consumer → RSSHub only when feed must be synthesized PDF / MANUAL / DOCUMENT → fetch → Docling → structured diff ALL PATHS → our SourceSnapshot → our ChangeEvent → our significance/freshness policy → Dossier / Researcher / Curator
2. changedetection.io — deep dive
Strong fit
- централизованный self-hosted watcher;
- history/diff-oriented workflow;
- REST automation path;
- selectors/filters для noise reduction;
- browser-rendered pages через browser automation path;
- notifications/webhooks можно использовать как event bridge;
- ручной UI полезен для диагностики сложных watchers.
Mapping to our domain
changedetection watch UUID = external_watch_id our watch_id = canonical history item → candidate SourceSnapshot detected difference → raw diff only our ChangeClassifier → semantic type + severity
What NOT to delegate
freshness policy version scope change severity Researcher routing Curator stale-check Dossier event semantics canonical SourceRef identity
Integration risks
- browser mode может быть ощутимо тяжелее простого HTTP fetch;
- часть страниц будет требовать login/cookies;
- selector configuration может стать maintenance burden;
- history/export behavior нужно practically проверить;
- нельзя принимать watcher-generated summary за evidence.
3. urlwatch — deep dive
Architecture advantage
urlwatch ближе к библиотеке/CLI-подобному engine: fetch → filter → compare → report. Для нашей системы это может быть преимуществом, потому что scheduler, domain state и routing у нас всё равно свои.
Ideal flow
our WatchTarget → urlwatch job config → fetch → filters → normalized content → diff → our snapshot storage → our classifier
Where it wins
- минимальная концептуальная прослойка;
- легче pin/containerize;
- deterministic diff path;
- меньше риска vendor UI becoming source of truth;
- ожидаемо ниже footprint.
Where it loses
- central multi-agent API придётся строить самим;
- central state/history/UI не так богаты;
- complex JS/browser use cases потребуют дополнительного fetch adapter;
- large watch fleet operational tooling придётся дописывать.
4. GitHub event adapter
Why direct
GitHub already emits structured events. Official webhooks include globally unique delivery IDs, event headers and SHA-256 HMAC signatures when a secret is configured. Release events require at least read access to repository Contents for a GitHub App; repository security advisory events require the relevant advisory permission.
Canonical event mapping
X-GitHub-Delivery → external_event_id / dedup key release.published → VERSION_RELEASE repository_advisory.published → SECURITY_CHANGE push → inspect changed paths → docs/changelog change candidate repository.archived → SOURCE_STATE_CHANGE
Security contract
verify X-Hub-Signature-256 verify expected event type verify repository identity deduplicate delivery GUID store raw payload hash never execute payload text
Fallback for repos we do not control
public REST polling release feeds where available page watcher RSS adapter
5. RSS / Atom / RSSHub adapter
Native feeds first
if site has RSS/Atom: use it directly if no feed: RSSHub may synthesize one do not use RSSHub when native structured API exists
Snapshot model for feeds
FeedSnapshot: feed URL ETag Last-Modified item GUIDs published/updated content hash
Change mapping
new GUID → NEW_ITEM same GUID + content changed → ITEM_UPDATED item disappears → usually NOT deletion event unless source semantics guarantee it
RSSHub risk
Маршруты, основанные на scraping, могут ломаться при изменениях сайта. Поэтому RSSHub adapter должен иметь health/failure state и не скрывать источник происхождения feed.
6. Docling document diff
Why raw hash is insufficient
old.pdf hash != new.pdf hash can mean: metadata changed compression changed producer changed layout changed but text can be identical.
Canonical document pipeline
fetch file → binary hash → Docling parse → canonical blocks → block IDs / page anchors → normalized structured representation → section/table diff → semantic classifier
Diff classes
LAYOUT_ONLY TEXT_MINOR TEXT_MAJOR TABLE_VALUE_CHANGED WARNING_ADDED WARNING_REMOVED SECTION_ADDED SECTION_REMOVED VERSION_METADATA_CHANGED
Reuse benefit
Docling уже является сильным reuse-кандидатом в общей экосистеме ИИшки, поэтому Source Watch не должен строить второй PDF parser.
7. Adapter contracts
WatchAdapter
create_watch() update_watch() delete_watch() fetch_now() get_health() export_state()
FetchResult
{
"watch_id": "...",
"retrieved_at": "...",
"status": "OK|NOT_MODIFIED|FAILED",
"http": {...},
"raw_hash": "...",
"normalized_hash": "...",
"content_ref": "...",
"structured_state": {...}
}
DiffResult
{
"old_snapshot_id": "...",
"new_snapshot_id": "...",
"changed": true,
"raw_diff": "...",
"structured_diff": {...},
"engine": "changedetection|urlwatch|docling|github|rss"
}
Boundary
Adapter сообщает «что изменилось технически». Source Watch Policy решает «насколько это важно».
8. Security & fetch policy
allowlisted protocols: https optionally http for explicit targets deny by default: file:// localhost 169.254.169.254 private network ranges unless explicitly approved internal source protect against: SSRF redirect to private IP credential leakage unbounded downloads zip bombs huge HTML infinite browser waits
Secrets
cookies basic auth API tokens GitHub secrets stored in secret store referenced by secret_id never stored in snapshot/diff text
GitHub
Webhook secret must be validated using the SHA-256 signature header before processing the payload.
9. server2 architecture/resource implications
| Path | Expected cost | Recommendation |
|---|---|---|
| plain HTTP/urlwatch | LOW | default |
| changedetection plain fetch | LOW/MEDIUM | good general service |
| browser rendering | HIGHER | only where needed |
| GitHub webhook | VERY LOW | preferred event path |
| RSS | LOW | preferred for feeds |
| Docling PDF parse | BURSTY | queue + concurrency limits |
| Qwen semantic classification | EXPENSIVE | only after deterministic diff |
Qwen use
hash same → STOP normalized content same → STOP small deterministic known change → classify without Qwen ambiguous meaningful diff → Qwen semantic classifier
10. Exact practical spike
changedetection.io vs urlwatch
100 WatchTarget: 40 static HTML 20 dynamic HTML 10 JSON 10 release/changelog pages 20 synthetic controlled pages Run: 24h accelerated schedule Inject: cosmetic metadata minor content major warning version removal 404 timeout redirect rate limit
Measure
HIGH change recall false meaningful alerts fetch reliability diff quality selector effort browser success state export restart recovery idle RAM peak RAM CPU disk growth API integration effort
GitHub adapter
verify: signature duplicate X-GitHub-Delivery release published release edited repository advisory push docs path malformed payload replayed delivery
RSS adapter
ETag/304 new item changed item duplicate GUID broken feed RSSHub route failure
Docling adapter
binary-only PDF change paragraph changed table value changed warning removed page order changed large manual
11. Preliminary decision before benchmark
LIKELY REUSE: GitHub webhooks/API native RSS/Atom Docling structured parse PRIMARY COMPETITION: changedetection.io vs urlwatch OUR BUILD: WatchTarget model SourceSnapshot canonical store ChangeEvent taxonomy freshness significance routing security policy idempotency audit Qwen semantic classifier
Decision logic
IF changedetection.io gives materially better dynamic-page reliability and manageable footprint/API: → ADAPT it as general watcher ELSE IF urlwatch covers target set with much lower complexity: → REUSE urlwatch engine HYBRID is valid: urlwatch default changedetection/browser only for difficult pages