From f1a98be8dea8b84c1b50503014dcb392e67fdb18 Mon Sep 17 00:00:00 2001 From: Godopu Date: Sun, 21 Jun 2026 06:39:12 +0000 Subject: [PATCH] fix(lib.sh): add NFS flock warning (FW-02) + unify venv deps with pyyaml (FW-11) FW-02: atomic_dump_yaml now calls _atomic_dump_yaml_check_nfs() which detects NFS/CIFS/SSHFS mounts and warns that flock is unreliable. Long-term fix (SQLite WAL) documented in FUTURE_WORKS.md. FW-11: pyyaml added to requirements.txt and installed in .venv, so both paho-mqtt and yaml are available in a single interpreter. Eliminates the system-python3-vs-venv split for monitor --subscribe. --- skills/lib.sh | 13 +++++++++++++ .../requirements.txt | 1 + 2 files changed, 14 insertions(+) diff --git a/skills/lib.sh b/skills/lib.sh index b56b404..9341a47 100644 --- a/skills/lib.sh +++ b/skills/lib.sh @@ -193,8 +193,21 @@ env_python() { # The mutation source is passed via env and exec()'d — it is never string # spliced and untrusted data never lands in Python source (P0-B / P1-B). # --------------------------------------------------------------------------- +# Check if the workspace is on NFS — flock is unreliable on NFS +_atomic_dump_yaml_check_nfs() { + local f="$1" + local mountpoint + mountpoint="$(df --output=target "$f" 2>/dev/null | tail -1)" || return 0 + if mount | grep -q "$mountpoint.*nfs\|$mountpoint.*cifs\|$mountpoint.*fuse.sshfs"; then + echo "WARNING: $mountpoint appears to be a network filesystem (NFS/CIFS/SSHFS)." >&2 + echo "WARNING: fcntl.flock-based atomic writes are unreliable on network filesystems." >&2 + echo "WARNING: Consider migrating to SQLite WAL for registry storage (see FUTURE_WORKS.md FW-02)." >&2 + fi +} + atomic_dump_yaml() { local yaml_path="$1"; shift + _atomic_dump_yaml_check_nfs "$yaml_path" local -a envs=("YAML_PATH=$yaml_path" "HOME_DIR=$HOME_DIR" "CLAUDE_PROJECT_DIR=$CLAUDE_PROJECT_DIR" "LOCAL_BIN=$LOCAL_BIN") while [ $# -gt 0 ]; do case "$1" in diff --git a/skills/tmux-agent-orchestrate-delegate-job/requirements.txt b/skills/tmux-agent-orchestrate-delegate-job/requirements.txt index 416b1c1..62c484f 100644 --- a/skills/tmux-agent-orchestrate-delegate-job/requirements.txt +++ b/skills/tmux-agent-orchestrate-delegate-job/requirements.txt @@ -1 +1,2 @@ paho-mqtt>=2.0.0 +pyyaml