@@ -75,6 +75,34 @@ redact:
7575 fields:
7676 - base.tenant_id
7777
78+ # STATE OVERVIEW
79+ #
80+ # These variables are set to direct the work of later evaluations:
81+ #
82+ # state.stopping_point: The time just before the start of the current sequence of evaluations.
83+ # state.todo_types: The current list of content types to process.
84+ # state.subscribed: A map tracking which content types have been subscribed to since restart.
85+ # state.cursor.todo_content: A list of content items to fetch.
86+ # state.cursor.todo_links: A list of listing links, either generated or received.
87+ # state.cursor.last_for: A map tracking latest time considered in listings for each content type.
88+ #
89+ # LOGIC OVERVIEW
90+ #
91+ # Initializations that rewrite state and continue the evaluation:
92+ # - Rewrite legacy cursor data if present.
93+ # - Set a stopping point if absent.
94+ # - Generate the list of content types to process if empty.
95+ #
96+ # A check done on every evaluation:
97+ # - Ensure there is an active content type.
98+ #
99+ # Processing steps, only one of which will be performed per evaluation:
100+ # - If not subscribed to the current type, subscribe and rotate to the next type.
101+ # - If there is a content item ready to fetch, fetch it.
102+ # - If there is a prepared listing link, use it to list content items.
103+ # - If the current type is not up-to-date, generate a listing link for it, or
104+ # if the current type is up-to-date, move to the next type, or
105+ # if there are no more content types to process, stop.
78106program: |-
79107 (
80108 // This exists purely to rewrite the cursor from the original list format
0 commit comments