fix(checkpoint): serialize input state saves - #285
Conversation
fangxiu-wf
left a comment
There was a problem hiding this comment.
Reviewed head 71480aaf against base 8f47a1b7.
The revision-based save loop correctly serializes shared StateStore writes, drains mutations created during an active write, and preserves failed revisions for retry. Atomic temp-file collisions are also addressed.
Validation: 44/44 targeted checkpoint/restart tests passed; an additional completion-handoff concurrency case passed; typecheck and build passed. No blocking findings.
🔍 Code Review Summary
Lifecycle Verdict
无 FAIL 项。变更不含 Merge Gate(合入门禁)APPROVE-READY ✅(阻断级别: 无 open 阻断项。 总体结论修订号 + 单飞 flush 循环修好了共享 Highlights(正向实践)
✅ Medium/High 及以上问题已全部解决,本轮评审通过(approved)。 评审报告详见: |
linrunqi08
left a comment
There was a problem hiding this comment.
✅ Medium/High 及以上问题已全部解决,本轮评审通过(approved)。 Generated by LoongSuite-Pilot Code Review Agent
Summary
StateStore.save()calls through one in-flight save loopWhy
Each input serializes its own collection cycle, but all inputs share one
StateStore. Multiple inputs can therefore saveinput-state.jsonconcurrently. The previousdirtyboolean could be cleared by an older save after a newer mutation, and temporary names based only on PID and millisecond could collide.Verification
npm test -- tests/unit/checkpoints/state-store.test.ts tests/unit/utils/fs-utils.test.ts tests/unit/inputs/base-input.test.ts tests/integration/restart-recovery.test.ts tests/integration/state-restore.test.ts(44/44)npm run typechecknpm run build