comicbox.events ¶
Shared event types for read / write / online workflows.
One on_event callback shape across the three public bulk entry points (iter_process_files, bulk_write, OnlineSession.tag_many) so a caller — typically Codex — can wire a single handler.
Handlers run on the orchestrator thread that drains worker results. They must be thread-safe and should return quickly; expensive work belongs in a queue the handler dispatches to.
AutoWritten dataclass ¶
Bases: Event
Matcher accepted a candidate without prompting.
Source code in comicbox/events.py
143 144 145 146 147 148 149 | |
BatchFinished dataclass ¶
Bases: Event
Fired once after every file has been delivered.
parsed / short_circuited / errored carry per-outcome counts so callers can render an end-of-batch summary without re-walking the result stream.
Source code in comicbox/events.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
BatchStarted dataclass ¶
Bases: Event
Fired once before the first file is submitted.
Source code in comicbox/events.py
43 44 45 46 47 | |
Event dataclass ¶
Base for all workflow events.
Subclasses are concrete frozen dataclasses keyed by the kind literal on the subclass — callers can match on type or on kind.
Source code in comicbox/events.py
23 24 25 26 27 28 29 30 31 32 33 34 35 | |
FileError dataclass ¶
Bases: Event
Worker raised an exception. error is the str(exception).
Source code in comicbox/events.py
71 72 73 74 75 76 | |
FileFinished dataclass ¶
Bases: Event
Per-file online tagging completed (success, skip, no-match, or error).
Source code in comicbox/events.py
272 273 274 275 276 277 | |
FileParsed dataclass ¶
Bases: Event
Worker fully parsed embedded metadata.
Source code in comicbox/events.py
64 65 66 67 68 | |
FileShortCircuited dataclass ¶
Bases: Event
Worker decided the embedded metadata had not changed and skipped parse.
reason="mtime_unchanged" — embedded mtime <= caller’s old_mtime. reason="filtered" — caller passed full_metadata=False so the worker only collected envelope fields.
Source code in comicbox/events.py
50 51 52 53 54 55 56 57 58 59 60 61 | |
NoMatch dataclass ¶
Bases: Event
No candidate cleared min_confidence.
Source code in comicbox/events.py
250 251 252 253 254 255 | |
PromptDeferred dataclass ¶
Bases: Event
OnlineSession is in defer_prompts mode and queued this prompt for later.
The batch continues; the deferred prompt is accessible via OnlineSession.deferred_prompts(). Codex’s intended flow: surface these in a “Review tagging” UI after the batch completes, collect the user’s decisions, seed them back into the session’s dedup cache via preload_resolution(), then re-run the affected files.
Source code in comicbox/events.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
PromptQueued dataclass ¶
Bases: Event
Matcher needs human input; prompt dispatched to PromptHandler.
Source code in comicbox/events.py
168 169 170 171 172 173 174 175 | |
PromptResolved dataclass ¶
Bases: Event
PromptHandler returned a decision.
Source code in comicbox/events.py
178 179 180 181 182 183 184 185 | |
PromptResolvedFromCache dataclass ¶
Bases: Event
OnlineSession auto-applied a cached choice instead of re-prompting.
Fingerprint matched a previously-resolved prompt in the per-session dedup cache; the user’s handler was not invoked.
Source code in comicbox/events.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
RateLimited dataclass ¶
Bases: Event
Source signaled a rate-limit hit.
retry_after_seconds is the server hint when available; otherwise the per-source retry-schedule’s next sleep.
Source code in comicbox/events.py
258 259 260 261 262 263 264 265 266 267 268 269 | |
ReadingListFetchFinished dataclass ¶
Bases: Event
A reading-list fetch ended, whether it fetched anything or not.
Source code in comicbox/events.py
308 309 310 311 312 313 314 | |
ReadingListFetchProgress dataclass ¶
Bases: Event
Part of a reading list arrived.
index counts the entries fetched so far and total is how many the source said there are, when it said.
Source code in comicbox/events.py
294 295 296 297 298 299 300 301 302 303 304 305 | |
ReadingListFetchStarted dataclass ¶
Bases: Event
A reading-list fetch began. source is where from, key what.
Source code in comicbox/events.py
285 286 287 288 289 290 291 | |
SearchCompleted dataclass ¶
Bases: Event
Online source returned candidate list.
Source code in comicbox/events.py
133 134 135 136 137 138 139 140 | |
SearchStarted dataclass ¶
Bases: Event
Worker is about to query an online source for this file.
Source code in comicbox/events.py
125 126 127 128 129 130 | |
SeriesIdentified dataclass ¶
Bases: Event
A series was resolved and cached for series-first batching.
Fired when a cold-path search resolves a series and the session’s series_cache is populated for the first time. Subsequent issues of the same series skip the search via :meth:OnlineSource.lookup_issue.
Source code in comicbox/events.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
Skipped dataclass ¶
Bases: Event
A source wrote no metadata for this file, and says why.
reason is one of the SKIP_* constants above.
Source code in comicbox/events.py
237 238 239 240 241 242 243 244 245 246 247 | |
SourceStarted dataclass ¶
Bases: Event
Worker is about to consult one online source for this file.
Fired once per source that actually runs, immediately before the source is consulted and after the first-wins skip — a source sat out because an earlier one already won never emits this. Unlike :class:SearchStarted, which only covers the cold-search path, this fires for every route a source can take: explicit-id fetch, stored-id refresh, series-cache issue lookup, and search. Callers rendering “which source is being consulted right now” want this one; SearchStarted stays the narrower “a full search is about to be issued” signal.
Source code in comicbox/events.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |