{"slug": "cfg-guard-a-lock-and-a-witness-for-config-files-too-many-hands", "title": "cfg-guard: A lock and a witness for config files too many hands…", "summary": "A developer released cfg-guard, an MIT-licensed Python tool that protects shared config files using flock plus a content-hash compare-and-swap to reject writes whose base bytes changed, and uses inotify with /proc to identify processes that write around the lock. The tool relies only on the standard library and sends no data anywhere, and its author cautions that its checks can produce false positives and should be used to flag candidates for rewriting rather than to grade writers.", "body_md": "Most cfg-guard write-ups stop at the README: here is what the tool does, here is how you run it. This one covers what it refuses to do, and where it breaks.\n\nA lock and a witness for config files too many hands edit: flock plus a content-hash compare-and-swap refuse a write whose base bytes moved, and inotify with /proc names whoever writes around the lock. Stdlib only.\n\nIn Russian: Замок и свидетель для конфигов, которые правят много рук: flock плюс compare-and-swap по хэшу содержимого не дают затереть чужую правку, а inotify и /proc называют того, кто пишет мимо замка. Только stdlib.\n\n```\npip install cfg-guard\n```\n\nPython. MIT licensed. Standard library first: the tool reads the data you point it at and sends nothing anywhere.\n\nEvery rule in a checker like this can produce a false positive. Use it to find candidates for a rewrite, not to grade a writer, and not where the voice is the point.\n\nSource, issue tracker and documentation: [https://gitlab.com/ameobius-ai/cfg-guard](https://gitlab.com/ameobius-ai/cfg-guard)\n\nOther tools from the same author: [https://ameobius-ai.gitlab.io](https://ameobius-ai.gitlab.io)", "url": "https://wpnews.pro/news/cfg-guard-a-lock-and-a-witness-for-config-files-too-many-hands", "canonical_source": "https://dev.to/ameobius/cfg-guard-a-lock-and-a-witness-for-config-files-too-many-hands-48ma", "published_at": "2026-10-23 22:00:18+00:00", "updated_at": "2026-10-23 22:09:53.471286+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["cfg-guard", "ameobius-ai"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/cfg-guard-a-lock-and-a-witness-for-config-files-too-many-hands", "markdown": "https://wpnews.pro/news/cfg-guard-a-lock-and-a-witness-for-config-files-too-many-hands.md", "text": "https://wpnews.pro/news/cfg-guard-a-lock-and-a-witness-for-config-files-too-many-hands.txt", "jsonld": "https://wpnews.pro/news/cfg-guard-a-lock-and-a-witness-for-config-files-too-many-hands.jsonld"}}