feat: add lockfile guard to /design and /plan#567
Open
frosty-geek wants to merge 1 commit into
Open
Conversation
/design and /plan commit directly to the base branch via `git add -A`, with no worktree isolation. If two sessions run these skills simultaneously, they race on the working tree. Both skills now acquire .beastmode/.worktree-lock (using shell noclobber for atomicity) before starting work, and release it after the checkpoint commit. If the lock exists, the session prints diagnostic info (PID, skill, timestamp) and stops. The lock file is transient and should be gitignored — see BugRoger#559 for the skeleton .gitignore that will cover this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/designand/plannow acquire an atomic lockfile (.beastmode/.worktree-lock) before starting work, preventing parallel sessions from racing ongit add -ACloses #565
Changes
plugin/skills/design/SKILL.mdplugin/skills/plan/SKILL.mdWhy not worktrees?
Design and plan artifacts must land on the base branch so that
/implementcan branch from them. A worktree would add a merge step for zero benefit. The lockfile is a lightweight safety net for the accidental parallel case.Mechanism
set -C(noclobber) makes lock acquisition atomic at the shell level*.lockpattern in Gitignore State Protection #559 covers itTest plan
/design— verify lock is created at.beastmode/.worktree-lock/designin a second session — verify it blocks with diagnostic message/design— verify lock is released after checkpoint/plan— same acquire/release cycle