@@ -27,5 +27,53 @@ export interface CrawlArticleMessage {
2727 source_url : string ;
2828 crawl_id : string ;
2929 enqueued_at : string ;
30+ // Refresh window for this article, set by the producer: discovery uses
31+ // the article fetch TTL, the agent uses the live-article interval. The
32+ // worker gates re-fetch and writes its fetch claim against this value.
33+ // Optional so a rolling deploy does not reject messages enqueued before
34+ // the field existed; the worker falls back to the configured fetch TTL.
35+ refresh_interval_minutes ?: number ;
3036 corpus_item ?: CorpusItem ;
3137}
38+
39+ /**
40+ * Surface and topic a discovered page is crawled for. A page
41+ * can be crawled for several surfaces, so each discovery job
42+ * carries one context per (surface, topic) pair.
43+ */
44+ export interface DiscoveryContext {
45+ surface_id : string ;
46+ topic : string ;
47+ }
48+
49+ /**
50+ * Pub/Sub message consumed from the crawl-article-discovery
51+ * subscription. Tells the discovery worker which page to crawl,
52+ * how recently it may have been crawled, and the contexts to
53+ * attribute discovered articles to.
54+ */
55+ export interface CrawlArticleDiscoveryMessage {
56+ url : string ;
57+ interval_minutes : number ;
58+ contexts : DiscoveryContext [ ] ;
59+ }
60+
61+ /**
62+ * A live (curated) article in the agent's publisher list. The agent
63+ * enqueues a crawl-article job carrying this corpus_item so the
64+ * worker can re-extract and sync editorial metadata.
65+ */
66+ export interface LiveArticle {
67+ url : string ;
68+ corpus_item : CorpusItem ;
69+ }
70+
71+ /**
72+ * The agent's publisher list, loaded from JSON. pages drive
73+ * discovery crawls; live_articles are re-crawled directly to keep
74+ * curated metadata fresh. Phase 5 replaces this with the Corpus API.
75+ */
76+ export interface PublisherList {
77+ pages : CrawlArticleDiscoveryMessage [ ] ;
78+ live_articles : LiveArticle [ ] ;
79+ }
0 commit comments