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

オープン
#137 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
220
フォーク
54
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bmad-code-org/bmad-builder のほかの issue

bmad-code-org/bmad-builder の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。