From ed4efbb829bbf206fb1ff0b8dde27f2fa7cd3868 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 13 Oct 2026 14:59:12 +0000 Subject: [PATCH 1/4] fix(exec): follow-ups from independent review of #304/#306/#290 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Stale-lock takeover serialised through an O_EXCL .exec.lock.takeover file; the lock is removed only if it still holds the stale line read (no mv -f restore). 12 contenders x 10 rounds: master 2/10 rounds with 2-3 holders, fixed 0/10. - --watch-compat: only ui-loop.md's watch-safe list says "watch can apply this"; other statements print "unknown — restart if behaviour looks stale". - Two-tree (.mpr under app/) cases for the lock and --commit-first. - Leading flags parsed in one loop (--commit-first --cr CR-NN works); a script name starting with -- is refused before any commit or snapshot. - ui-only test lane names the embedders of a changed snippet/layout. Refs #287 #289 #274 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw --- CHANGELOG.md | 1 + project-bin/exec.sh | 169 ++++++++++++++++++-------- tests/wave2/test-exec-change-class.sh | 8 ++ tests/wave2/test-exec-lock-watch.sh | 128 +++++++++++++++++++ 4 files changed, 254 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20342404..543b3aeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. ## Unreleased +- fix(exec): **follow-ups from an independent review of #304/#306/#290: the stale-lock takeover is mutually exclusive, only watch-safe statements say "watch can apply this", `--cr` works after `--commit-first`, and the ui-only test lane names snippet/layout embedders** ([#287](https://github.com/MendixMau/mxcli-project-toolkit/issues/287), [#289](https://github.com/MendixMau/mxcli-project-toolkit/issues/289), [#274](https://github.com/MendixMau/mxcli-project-toolkit/issues/274)). (1) The takeover moved a stale lock aside and put back a fresh one with `mv -f`, which is check-then-act: with 12 contenders against one dead-pid lock, up to 3 held the lock at once. It is now serialised through an O_EXCL `.exec.lock.takeover` file (bounded by pid and age), and the lock is removed only if it still holds the stale line that was read. `tests/wave2/test-exec-lock-watch.sh` runs 10 rounds of 12 contenders and asserts at most one holder. On master 2 of 10 rounds had 2 or 3 holders; with the fix, 0. (2) `--watch-compat` said "watch can apply this" for any statement it did not classify: associations, enumerations, `ALTER ENTITY … MODIFY`, Java actions, constants and navigation. These now print `unknown — restart if behaviour looks stale`, and only statements on ui-loop.md's watch-safe list say watch can apply them. (3) The fixture now also covers a two-tree checkout (`.mpr` under `app/`) for the lock and `--commit-first`. (4) Leading flags are parsed in one loop and can come in any order. The documented `--commit-first --cr CR-07