Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

ProjectStateStore.write_project always fails: it calls DotProjectWriter.write(), which has never existed

Đang mở
#574 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@i-am-paradox đang làm issue này rồi.

Từ ngày 11/10/2026.

  • #588 của @i-am-paradox — đang mở

Đá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
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

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ả

module-core needs triage

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 through darnit.config.context_writes (feature 042, the single writer).
  • The only test that calls write_project (tests/darnit/stores/test_us1_equivalence.py) uses InMemoryProjectStateStore from darnit-testchecks. The filesystem implementation has never run.
  • CI's type check runs mypy on two files with || true. On project.py alone, 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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của darnitdevorg/darnit

Tất cả issue của darnitdevorg/darnit

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.