ProjectStateStore.write_project always fails: it calls DotProjectWriter.write(), which has never existed
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 22
- Fork
- 27
- Merge medio
- 2g 1h
- PR unite (30g)
- 35
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di darnitdevorg/darnit
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
darnitdevorg/darnit#587 ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
darnitdevorg/darnit#585 ·
I maintainer di solito rispondono entro 1 giorno
-
quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
darnitdevorg/darnit#523 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
darnitdevorg/darnit#516 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue module-core
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
darnitdevorg/darnit#506 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di darnitdevorg/darnit
Issue simili
-
🐛 Bug: Calendar work items cannot be opened on mobileForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
Status: Triage Type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
Objects.List treats versions=false (and similar flags) as trueForse già presa @andaaron l’ha presa oggi. Apertapriority: p2 type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
googleapis/storage-testbench#829 ·
I maintainer di solito rispondono entro 2 giorni
-
[Bug]: memory provider treats 1:1 DMs as shared surfaces, so DM turns never receive reviewed recordsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
rlaope/oh-my-hermes#2088 ·
I maintainer di solito rispondono entro 1 giorno