fix(aidd-context): preserve project-memory files on write failure
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js
- Lĩnh vực
- tooling
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 481
- Fork
- 45
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 91
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ai-driven-dev/framework
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
ai-driven-dev/framework#1311 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
ai-driven-dev/framework#1244 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ai-driven-dev/framework#1197 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refactor(aidd-context): apply the new skill template to learnCó thể đã có người làm @blafourcade đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ai-driven-dev/framework#1186 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
ai-driven-dev/framework#1163 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ai-driven-dev/framework
Issue tương tự
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysCó thể đã có người làm @pcbeingused333 đã nhận hôm nay. Đang mởBug db: d1-sqlite Payload OSS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
payloadcms/payload#19766 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
device-management-toolkit/sample-web-ui#3711 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
elastic/kibana#306401 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
agentes-chat/agentes-chat#927 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Closing a pinned tab jumps to the Tabs section instead of the next open pinned tabCó thể đã có người làm @seenimohamed đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ardia-browser/ardia#2769 ·
Maintainer thường phản hồi trong vòng 1 ngày