feat(refresh): record a lapsed source instead of failing every run on it
holodori.wiki still answers 200 and still parses, but its editors stopped
adding events after 19 Sep 2026, so every cycle parsed to zero, was rejected,
and after three cycles turned the refresh workflow red over something no code
here can fix. No fetchable replacement exists.
A registry entry can now carry `lapsed: { recorded, reason }`, written by a
person. Refresh reports such a source's empty 200s as a warning rather than
broken; any other status is still broken, and the first cycle that lists
events again warns that the record should come out. Readers see no change:
the held snapshot keeps ageing and the staleness footer still says so.
The 2026-10-14 page is kept as a fixture, pinning that the template still
matches and only the current table is empty.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3d32ab8d21
commit
ae701de74e
6 files changed
+1029
-2
No files matched your search
@@ -247,6 +247,14 @@ export async function runRefresh(
|
||||
summary.warnings.push(`${adapter.id}: ${outcome.note}`);
|
||||
}
|
||||
|
||||
// A record that outlives its reason would excuse the next real failure, so
|
||||
// the first cycle that lists events again asks for it to be taken out.
|
||||
if (adapter.lapsed && outcome.result === "fetched" && (outcome.eventCount ?? 0) > 0) {
|
||||
summary.warnings.push(
|
||||
`${adapter.id} is listing events again; remove \`lapsed\` from its registry entry`,
|
||||
);
|
||||
}
|
||||
|
||||
options.log(
|
||||
` ${adapter.id.padEnd(24)} ${outcome.result.padEnd(17)} ${outcome.note}`,
|
||||
);
|
||||
@@ -257,7 +265,19 @@ export async function runRefresh(
|
||||
// this reports a standing condition, not one bad afternoon.
|
||||
if (!options.dryRun) {
|
||||
const health = await options.store.readState(adapter.id);
|
||||
if (health.consecutiveFailures >= BROKEN_AFTER_FAILURES) {
|
||||
// A source recorded as lapsed is excused only while it keeps answering:
|
||||
// its 200s are a page with nothing current, which a person has already
|
||||
// looked at. Any other status is a new failure and is reported as one.
|
||||
if (
|
||||
health.consecutiveFailures >= BROKEN_AFTER_FAILURES &&
|
||||
adapter.lapsed &&
|
||||
health.lastStatus === 200
|
||||
) {
|
||||
summary.warnings.push(
|
||||
`${adapter.id}: lapsed (recorded ${adapter.lapsed.recorded}, ${adapter.lapsed.reason}); ` +
|
||||
`${health.consecutiveFailures} cycles with nothing current, not counted as broken`,
|
||||
);
|
||||
} else if (health.consecutiveFailures >= BROKEN_AFTER_FAILURES) {
|
||||
summary.broken.push({
|
||||
sourceId: adapter.id,
|
||||
consecutiveFailures: health.consecutiveFailures,
|
||||
|
||||
Reference in new issue
Block a user