mirror of
https://github.com/rohitg00/ai-engineering-from-scratch.git
synced 2026-10-02 01:54:39 +08:00
- Checkpoint.save is now atomic: write to <path>.tmp, flush+fsync, then os.replace. A crash mid-write no longer leaves the checkpoint file truncated, so the retry can still find the prior idempotency record. - run_transfer now short-circuits on EVERY terminal status, not just 'committed'. Retries after 'verified', 'rolled-back', or 'aborted-precondition' were previously able to re-execute, which broke the exactly-once-by-txid guarantee the lesson is teaching. - docs/en.md: replace the 'mark-as-done-first' mitigation wording with the safer pattern — persist an in-flight intent before the side effect and promote to 'committed' only after post-action verification succeeds. - skill-rollback-rehearsal.md: update the idempotency-audit item to require explicit execution states (pending -> executing -> committed/failed) and reserve-by-key ordering, so auditors do not sign off on the commit-before-execute pattern. - Update the inline code comment next to the intent-save so readers understand why we persist before the side effect but only verify afterward.