Draft
Conversation
Co-authored-by: cft0808 <41196455+cft0808@users.noreply.github.com>
Co-authored-by: cft0808 <41196455+cft0808@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix code bugs and optimize performance
修复 kanban 原子更新后的二次写回风险并减少冗余 I/O
Mar 3, 2026
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.
变更描述
针对“全面检查 bug 与性能优化”,本次聚焦
scripts/kanban_update.py的高影响点:修复原子更新后再次读写同一文件带来的并发覆盖风险,并消除每次状态变更的冗余磁盘 I/O。改动保持行为兼容,仅调整刷新触发路径并补充回归测试。问题点(并发安全 + 性能)
atomic_json_update(...)后执行save(load()),引入一次额外读写。代码调整(最小改动)
save(tasks)替换为trigger_refresh():仅异步触发REFRESH_SCRIPT,不再重写tasks_source.json。save(load())统一替换为trigger_refresh()。atomic_json_write未使用导入,补充trigger_refresh()文档字符串。回归保障
test_state_update_does_not_reload_file_again:cmd_state不会触发二次atomic_json_read。变更类型
检查清单
python3 -m py_compile检查run_loop.sh关联 Issue
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.