TaskFused 0.2 Lets Finished Work Expire and Adds Prometheus Metrics
TaskFused 0.1 kept every operation forever. That’s what makes joining work: a request that arrives a week later with the same key still finds the finished operation and gets its result. But a service that runs for a year piles up a year of operations, the file only grows, and a namespace with a cap on kept operations eventually hits it and refuses new work.
0.2 lets each namespace say how long finished work keeps its name. Set -identity-retention 720h and an operation that succeeded, failed or was canceled more than 30 days ago is deleted with its attempts and its history. Its slot is free, and the same key starts new work. Queued and running operations are never touched. taskfused serve does the expiry every minute; an embedding calls ExpireDue when it likes.
The retention is a promise about joining, so it has to be long enough. Within it, equal requests join the finished operation as before; after it, they run the work again. Pick a window longer than any client could plausibly retry.
Things the Review Caught
The independent review before the release found a case nobody had thought about. Cancel an operation while a worker is running it, and the worker only finds out at its next heartbeat. With a very short retention, the operation could be deleted before then, and the worker would hear “lease lost” instead of “canceled”. Now a canceled operation stays until the worker’s lease runs out.
It also caught that leaving the new flag out of set-limits would quietly switch expiry off, since that command replaces the whole policy. The flag is now required, like the other two. If you script set-limits, add -identity-retention 0 to keep the old behaviour.
Metrics and a Pure-Go Build
serve now answers GET /metrics for Prometheus: operations and attempts per namespace and state (expired attempts are lease expiries), how long the oldest queued operation has waited, and each namespace’s limits and retention.
The SQLite driver is now pure Go. Building TaskFused no longer needs a C compiler, and the full test suite now runs on Windows in CI, not just the smoke check. Files from 0.1 upgrade on open; stop the old processes first.
The download page has the binaries, and the reference has the new commands. The code is on GitHub.