Skip to content

fix: Save discovery state after each file to prevent repeat work on crash#409

Merged
rjroy merged 1 commit intomainfrom
feat/cards-processing-state-save
Jan 24, 2026
Merged

fix: Save discovery state after each file to prevent repeat work on crash#409
rjroy merged 1 commit intomainfrom
feat/cards-processing-state-save

Conversation

@rjroy
Copy link
Copy Markdown
Owner

@rjroy rjroy commented Jan 24, 2026

Summary

  • Save discovery state immediately after processing each file, not just at the end of a run
  • Prevents losing hours of work if the process crashes mid-discovery
  • Uses reference equality check to skip writes when state is unchanged (e.g., retriable errors)

Test plan

  • Existing tests pass (59 tests)
  • Added test for incremental state saving behavior
  • Lint and typecheck pass

🤖 Generated with Claude Code

…rash

Previously, state was only saved at the end of runDailyPass and
runWeeklyPass. If the process crashed mid-run, all progress was lost
and files would be reprocessed. Now state is saved after each file,
so at most one file's work is lost on crash.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rjroy rjroy merged commit 3d3645d into main Jan 24, 2026
2 checks passed
@rjroy rjroy deleted the feat/cards-processing-state-save branch January 24, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant