Repository navigation
Adopt durable Framework jobs for receipt scans and email reports - #100
Merged
Merged
Conversation
andrewzolotukhin
temporarily deployed
to
pr-100
October 1, 2026 20:32 — with
GitHub Actions
Inactive
andrewzolotukhin
temporarily deployed
to
pr-100
October 1, 2026 20:46 — with
GitHub Actions
Inactive
andrewzolotukhin
marked this pull request as ready for review
October 1, 2026 20:53
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original request
Adopt Framework beta
0.0.0-beta-20261001170911in Xpenser using the PR workflow. Migrate both receipt scans and recurring email reports to durable scheduling, with up to three scan attempts and duplicate-safe result persistence. Keep the consumer-experience working document local-only.What changed
Reasoning
The existing PostgreSQL database supplies durability without another queue service. Framework owns claims, leases, retries, events, and recurrence; Xpenser retains budget authorization, artifact storage, domain progress, and idempotent business writes. Compact job contracts avoid JSON/date and payload-size problems.
Execution is at-least-once: an AI request may repeat and incur another charge if its result was not committed. Separate submissions remain separate jobs. This does not add page-refresh recovery, bot-session persistence, historical email backfill, or exactly-once provider delivery. No production deployment or Framework changes are included.
Blog post
/blog/durable-receipt-scanningScreenshots / preview evidence
pr100-api-1; the API returned healthy and the same completed scan/draft was readable afterward. No transaction was confirmed. This demonstrates persisted results; PostgreSQL tests cover interrupted-attempt recovery and stale workers./blog, the individual article, and the actual hero image render correctly. Source metadata points to this PR and resolves correctly; the existing blog template does not display source-PR metadata as a visible link.Validation
d3200c9; all 34 deployed browser tests passed, including repeated poll failures and terminal scan errors. Focused blog tests also passed locally after adding final metadata.agent-browser.job.transaction-scanspan (~5.24 s); trace-linked status requests; no job, migration, or SQL failures. Final-deployment logs contained only deliberate negative-test warnings (400/401/404, including Auth.js). Error traces additionally include existing optional Brandfetch 400/timeouts, unrelated to job adoption.EMAIL_REPORTS_SCHEDULER_ENABLED=0. Schedule/delivery behavior is covered by real PostgreSQL tests. No Telegram container is deployed in this preview; bot reconnect behavior is covered by unit tests and its build.docs/framework-consumer-experience.mdwas updated to remove the adopted proposal, preserved in the main checkout, and is intentionally not included in this PR.Rollout notes
Migration 020 is additive. Let old in-memory scans finish before switching deployments; they cannot be recovered retroactively. New jobs use versioned definitions, and the durable worker must remain available for outstanding jobs. Detailed retention, retry, shutdown, and rollback guidance is in
docs/background-jobs.md.