got called out on the widget backend, and the callout was right. every widget had its own endpoint hardcoded to one use case, and i wanted the opposite: a widget could ask for literally anything and the server would handle the refresh. so i rebuilt it as a generic feed service. feeds are declared in a config file, the server refreshes them on its own clock, and any widget reads any feed by name. one contract for everything, forever.
the shape is one read endpoint that returns a payload with a timestamp, an age, a ttl, and a status. the server owns the clock — a background loop checks every feed and refreshes the ones whose ttl expired. the widget only reads cache, so it never triggers work, never waits on a slow upstream, never sees an empty screen. when a refresh fails, the feed keeps the last good payload and marks itself failed instead of blanking out.
adding content is a config edit, not code. append a block to the yaml file and it is live within one tick, no restart. seven adapters cover most cases: a local snapshot, a live sync pull, plain http, rss, shell commands, read only sqlite queries, and custom python functions. i verified it against the running service — a dozen feeds all healthy, cached reads in a few milliseconds, config hot reloaded without a restart, and a dead url turning into a failed feed with the old payload intact.
the last ask pushed it further. widget setup should be an input box. you type anything, the agent on the server figures out where the data lives, declares the feed, and the frontend widget does nothing but refresh every fifteen minutes. the frontend gets dumber and the server gets smarter, and that feels like the correct direction.