Skip to content

Bounded background workflow — local implementation result

Task 76c4ab9c-a0fd-43ff-8ff0-1a80abda010b, 2026-09-23. Server base d4ff4d5e8f48e678d0020da1c4b59092d3fc622c; Bridge base 0419d3cfc3cd4686274658bba4be382e357a4de4. Both changes are on codex/background-workflow.

The normal Bridge daemon now owns a separate background worker thread/runtime with explicit local opt-in, one pinned policy and a durable finite attempt budget. Installation grants nothing. Empty offers consume no budget; attempts reserve before claim. File locks prevent concurrent workers, and workspace locks preserve existing execution exclusion. Restart after an ambiguous attempt pauses instead of replaying; disabled or replaced authorization cancels work. The worker reads current Keychain credentials and leaves heartbeat renewal and UI responsive. The menu exposes state, enable and disable; CLI offers the same. Polling/backoff is bounded and reads only small local state files between polls.

The server periodically reconciles expired workflow execution leases in bounded batches under task/execution locks. It interrupts the execution and blocks its workflow, never inventing completion, acceptance or a retry. Late events remain rejected. An index supports active lease lookup.

Actual local validation: complete isolated PostgreSQL/MCP suite 293 passed in 22.97 seconds, zero skips; Bridge 100 passed in 1.29 seconds; rustfmt, clippy with warnings denied, and Swift warnings-as-errors typecheck passed. Tests include durable budget/restart, duplicate workers, private records, disable cancellation, idle offers, reservation before claim and concurrent server expiry recovery without receipts or requeue.

This is implementation evidence, not installed production acceptance. The final FLOW-08 release must validate catalog-backed real providers, automatic pickup by the ordinary enrolled installed node, and foreground responsiveness. Hardware wake is deferred. A force-killed in-flight provider cannot be assumed finished; the budget ledger and server expiry deliberately require explicit recovery.