Let a parser report that a page states it lists no events
A count of zero has two causes and nothing downstream can tell them apart: a source whose selectors all broke, and a game that is simply between patches. Both parse to nothing, so `canParse` plus a row count cannot separate them — and the pipeline currently has to assume the worst, which is right for a redesign and wrong for a quiet week. `statesNoEvents` is the seam for the one thing that can settle it: the page's own words. Optional, because most pages say nothing either way, and absent means the strict gate stands. No parser implements it yet and nothing reads it — the contract widens here so the parser and the refresh gate can land as their own changes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
d5301c5ceb
commit
0809fa1122
@@ -227,6 +227,9 @@ function toAdapter(spec: SourceSpec): Adapter {
|
||||
parserId: spec.parserId,
|
||||
minIntervalMs: spec.minIntervalMs ?? SIX_HOURS_MS,
|
||||
priority: spec.priority ?? 0,
|
||||
statesNoEvents(html: string): boolean {
|
||||
return parser.statesNoEvents?.(html) ?? false;
|
||||
},
|
||||
parse(html: string, ctx: ParseContext): GachaEvent[] {
|
||||
// A site redesign should fail the run loudly rather than publish an empty
|
||||
// calendar, which would read as "no events" to a user.
|
||||
|
||||
Reference in New Issue
Block a user