fix(aidd-context): preserve project-memory files on write failure
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript, node.js
- 領域
- tooling
研究方向
Start with the write path in plugins/aidd-context/hooks/update_memory.js around lines 272 and 283, where existing files are written in place, and reproduce the truncation with the injected partial-write-then-EIO fault described in the issue. Read scripts/__tests__/update-memory.test.js to see the symlink, hard-link and path-substitution safeguards from PR #992 that must stay intact. Done means a partial write followed by an error restores or reports the original content for the affected file, with a deterministic test that fails on the current code.
由索引模型根據 Issue 內容生成。
描述
Description
At upstream/next commit b688e402, project-memory sync writes directly to existing files. A deterministic fault-injection reproduction makes CLAUDE.md truncate when a partial write is followed by EIO. The script exits with an error, but the file is already damaged.
The reproduction uses a temporary project fixture and a Node preload that writes 28 bytes to CLAUDE.md, then throws an injected EIO. The resulting file is USER PREFIX\n<!-- aidd_projec.
Affected file(s)
plugins/aidd-context/hooks/update_memory.js#L272plugins/aidd-context/hooks/update_memory.js#L283scripts/__tests__/update-memory.test.js
Expected behaviour
A failed sync must not silently leave an existing project-memory file corrupted. If original content cannot be preserved or restored, the failure must explicitly identify the affected file and recovery outcome.
- An I/O failure before the first write leaves every destination unchanged.
- Partial-write and truncation failures are covered by deterministic tests and return a failure; they are never reported as a successful sync.
- Tests and safeguards against symlinks, hard links, and path substitutions remain in place.
- Failures between multiple destinations have documented and tested outcomes. No global atomicity across files is claimed.
Observed behaviour
With the injected EIO, the process exits with code 1, but CLAUDE.md is truncated to USER PREFIX\n<!-- aidd_projec. The original content is not restored.
AI tool
Other — direct invocation of the aidd-context project-memory sync script
aidd-cli version
Not applicable — the reproduction invokes the project-memory script directly; framework next is at b688e402.
OS
Linux
Additional context
PR #992 adds descriptor-based writes and safeguards against symlinks, hard links, and path substitution. Its injected write-failure test fails before the first byte; it does not cover a partial write followed by an error or a truncation failure. The PR also states that it does not guarantee recovery from every filesystem failure or atomicity across multiple files.
Code of Conduct
- I agree to follow this project's Code of Conduct.
- 主要語言
- TypeScript
- 星號
- 481
- 分支
- 45
- 平均合併
- 1 天 13 小時
- 30 天內合併 PR
- 91
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
ai-driven-dev/framework 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 86/100
ai-driven-dev/framework#1311 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 79/100
ai-driven-dev/framework#1244 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
ai-driven-dev/framework#1197 ·
維護者通常 1 天內回覆
-
refactor(aidd-context): apply the new skill template to learn可能已有人在做 @blafourcade 於 3 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
ai-driven-dev/framework#1186 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 83/100
ai-driven-dev/framework#1163 · 1 則留言 ·
維護者通常 1 天內回覆
查看 ai-driven-dev/framework 的全部 Issue
相似的 Issue
-
type: bug
難度 2/5 1-3 小時 新手友好度 78/100
nrwl/nx#37955 · 1 個 reaction ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 67/100
db-ux-design-system/core-web#8856 ·
維護者通常 1 天內回覆
-
'!' breaking change is lost when the commit also has an empty BREAKING CHANGE footer可能已有人在做 @wittdennis 今天認領。 未關閉priority: p3 type: bug
難度 2/5 1-3 小時 新手友好度 74/100
googleapis/release-please#2971 ·
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 87/100
維護者通常 1 天內回覆
-
🛠️ dette technique
難度 2/5 1-3 小時 新手友好度 61/100
betagouv/mon-entreprise#4752 · 1 則留言 ·
維護者通常 5 天內回覆