Atomic, lock-safe writes for config.yaml, config.user.yaml, module-help.csv and .memlog.md

Aperta
#137 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start by reading merge-config.py, merge-help-csv.py, and memlog.py to compare their current write paths, then trace how each script reads and rewrites shared files. The issue calls for a shared atomic-write helper and platform-specific advisory locking around read-modify-write operations. Done means the named files use this approach and interrupted or concurrent writes do not truncate or lose updates; the issue does not name tests to run.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe your idea

Use one write_atomic(path, text) (unique temp in the same dir + fsync + os.replace) and an advisory lock for every shared file the scripts rewrite.

Why is this needed?

merge-config.py and merge-help-csv.py open their targets with "w", so an interrupted install truncates the shared _bmad/config.yaml or module-help.csv. memlog.py has an atomic write, but with a shared temp name and no lock it loses entries under concurrency (separate bug report).

How should it work?

Shared helper vendored like the others: mkstemp(dir=target.parent), write, flush, fsync, os.replace, plus fcntl.flock / msvcrt.locking around read-modify-write. Install-time config is read by every skill, so a truncated file breaks the whole BMad setup until the installer is re-run.

PR

Happy to help implement this if the direction is agreed.

Lingua principale
Python
Stelle
220
Fork
54
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bmad-code-org/bmad-builder

Tutte le issue di bmad-code-org/bmad-builder

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.