comicbox.config.online.settings ¶
Typed settings for the online-tagging block.
Split out of comicbox.config.settings because the online block is roughly half the config layer on its own.
Invariant: this module must not import comicbox.formats at runtime (TYPE_CHECKING-only is fine). comicbox.formats.* imports these settings, so a runtime import back would close a cycle; test_config_online_leaf pins it.
CacheMode ¶
Bases: StrEnum
Cache tri-state: on / off / refresh.
Source code in comicbox/config/online/settings.py
72 73 74 75 76 77 | |
Effort ¶
Bases: StrEnum
API-call effort per comic, for fan-out sources.
Orthogonal to MatchMode (which controls how the matcher’s verdict is applied). Effort controls how aggressively pre-call algorithms trade accuracy for API throughput — it only bites on sources that fan out per candidate (ComicVine). Single-call sources (Metron since PR #143) have no fan-out to throttle and ignore it.
MINIMAL: aggressive pre-filtering; trade accuracy for throughput.BALANCED: today’s behavior; the default.THOROUGH: spend API budget freely; max accuracy.
Source code in comicbox/config/online/settings.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
MatchMode ¶
Bases: StrEnum
Match-resolution aggressiveness.
Strictly increasing aggressiveness: each level auto-writes a superset of what the previous one does (ask ⊂ careful ⊂ auto ⊂ eager). See match-resolution-user-doc.md for the full decision algorithm.
A StrEnum so dataclass equality, dict keys, JSON serialization, and str() all “just work”.
Source code in comicbox/config/online/settings.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
OnlineAuthSettings dataclass ¶
Per-source credentials, indexed by source name.
Source code in comicbox/config/online/settings.py
146 147 148 149 150 | |
OnlineCacheSettings dataclass ¶
Where the online response cache lives and how long entries survive.
Source code in comicbox/config/online/settings.py
153 154 155 156 157 158 159 | |
OnlineLookupSettings dataclass ¶
What to look up and how aggressively to act on results.
Source code in comicbox/config/online/settings.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
OnlineSettings dataclass ¶
Online metadata-tagging settings, split into four concern groups.
Source code in comicbox/config/online/settings.py
227 228 229 230 231 232 233 234 | |
OnlineSourceCredentials dataclass ¶
Resolved credentials for one online source.
Both sources take an API key and an optional url. The source’s is_configured() decides which fields are required.
Source code in comicbox/config/online/settings.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
__repr__() ¶
Redact the key so this object is log-safe.
Source code in comicbox/config/online/settings.py
136 137 138 139 140 141 142 143 | |
OnlineSourceLimits dataclass ¶
Per-source rate-limit overrides.
All fields default to None, in which case comicbox lets the upstream library (mokkari / simyan) apply its own rate limits.
Documented defaults live in comicbox.formats.base.online.rate_limits for citation / audit.
Source code in comicbox/config/online/settings.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
OnlineSourceTuning dataclass ¶
Per-source overrides for tuning knobs.
Any field left at None falls back to the global default in OnlineTuningSettings. Advanced fields (min_confidence, disambiguation_margin, solo_threshold) are undocumented in user-facing reference but live here so power users can adjust them per source via YAML.
Source code in comicbox/config/online/settings.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
OnlineTuningSettings dataclass ¶
Global tuning defaults plus per-source overrides.
Source code in comicbox/config/online/settings.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
Prompts ¶
Bases: StrEnum
Whether comicbox is allowed to prompt the user mid-run.
Source code in comicbox/config/online/settings.py
45 46 47 48 49 | |
resolve_auto_threshold(settings, source_name) ¶
Per-source auto_threshold override > global default.
Source code in comicbox/config/online/settings.py
249 250 251 252 | |
resolve_disambiguation_margin(settings, source_name) ¶
Per-source override > built-in default. Not user-exposed today.
Source code in comicbox/config/online/settings.py
269 270 271 272 | |
resolve_effort(settings, source_name) ¶
Per-source effort override > global setting > BALANCED.
Source code in comicbox/config/online/settings.py
255 256 257 258 259 260 | |
resolve_match(settings, source_name) ¶
Per-source match mode falls back to the global default.
Source code in comicbox/config/online/settings.py
241 242 243 244 245 246 | |
resolve_min_confidence(settings, source_name) ¶
Per-source override > built-in default. Not user-exposed today.
Source code in comicbox/config/online/settings.py
263 264 265 266 | |
resolve_rate_limit(settings, source_name) ¶
Per-source historical rate-limit override values.
No override path exists for any source anymore — the values only feed the sources’ warn-and-ignore checks (mokkari>=4 tracks Metron’s limits from response headers; simyan manages ComicVine’s internally).
Source code in comicbox/config/online/settings.py
297 298 299 300 301 302 303 304 305 306 307 | |
resolve_solo_threshold(settings, source_name) ¶
Per-source override > this source’s resolved auto_threshold.
Phase E’s floor is defined as “the same bar as a multi-candidate unambiguous win”, so it tracks whatever auto-write bar this source actually runs at — global, per-source, CLI or env. A constant here would silently decouple the two: raising auto_threshold to 0.98 left a lone 0.96-scoring candidate auto-writing through a 0.95 back door that no configuration could close, and lowering it left the floor stricter than the bar it mirrors.
Lowering solo_threshold per source is the only way to make AUTO/EAGER’s solo carve-out reach below the auto-write bar (see _policy_auto_writes).
Source code in comicbox/config/online/settings.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | |