ProjectStateStore.write_project always fails: it calls DotProjectWriter.write(), which has never existed
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with write_project and write_maintainers in packages/darnit/src/darnit/stores/defaults/project.py (lines 61-71 and 86), and confirm the AttributeError by running mypy on that file. The methods also appear in the ProjectStateStore Protocol in darnit/stores/protocols.py and in the in-memory store. Check tests/darnit/stores/test_us1_equivalence.py and tests/darnit/context_integrity/test_single_writer.py. Done when the methods are gone from the Protocol and both implementations, and those tests pass, but the removal-versus-routing choice still needs a maintainer decision.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
FilesystemProjectStateStore.write_project (packages/darnit/src/darnit/stores/defaults/project.py:61-71) calls DotProjectWriter(...).write(config). DotProjectWriter has never had a write() method, only update(dict); no commit in dot_project.py's history adds one. So write_project, and write_maintainers, which calls it at line 86, always raise StoreOperationError (wrapping an AttributeError).
It has been broken since the store was added in feature 033 (f24a554, 2026-08-26). Nobody noticed because:
- No production code calls either method. The audit only reads from the project store (
tools/audit.py:892), and real.project/writes go throughdarnit.config.context_writes(feature 042, the single writer). - The only test that calls
write_project(tests/darnit/stores/test_us1_equivalence.py) usesInMemoryProjectStateStorefrom darnit-testchecks. The filesystem implementation has never run. - CI's type check runs mypy on two files with
|| true. Onproject.pyalone, mypy reports"DotProjectWriter" has no attribute "write" [attr-defined].
Users aren't affected today. But ProjectStateStore.write_project / write_maintainers are part of a plugin-facing Protocol (darnit/stores/protocols.py), so a third-party caller or backend author would build on a method that cannot work.
Proposal: remove write_project and write_maintainers from the ProjectStateStore Protocol and its implementations (filesystem and in-memory). Since feature 042, .project/project.yaml is never written with context values, and context_writes is the only writer (framework-design.md 7.4-7.11, tests/darnit/context_integrity/test_single_writer.py). A generic "write a whole ProjectConfig" method on the store conflicts with that rule.
The alternative is to route them through context_writes with the same restrictions. That keeps a write surface no caller needs.
Found while reviewing #504. A repo-wide audit for other declared-but-unwired interfaces like this one is under way.
Drafted with Claude Code; reviewed and posted by me.
- Ngôn ngữ chính
- Python
- Star
- 22
- Fork
- 27
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 darnitdevorg/darnit
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
darnitdevorg/darnit#587 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
darnitdevorg/darnit#585 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
darnitdevorg/darnit#523 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
darnitdevorg/darnit#516 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue module-core
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
darnitdevorg/darnit#506 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của darnitdevorg/darnit
Issue tương tự
-
comp/gateway comp/plugins duplicate P3 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NousResearch/hermes-agent#137019 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bot-triaged module: docs triaged
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
new-entry
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
BinWang28/audio-ai-hub#194 ·
-
confluence: a paged listing's links re-encode a parameter they carry, where real carries it as sentĐang mởfidelity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
Maintainer thường phản hồi trong vòng 1 ngày