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

Abierto
#137 2 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
220
Forks
54
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bmad-code-org/bmad-builder

Todos los issues de bmad-code-org/bmad-builder

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.