Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m

## Unreleased

- fix(script-owners): **the restatement guard now parses under macOS's default bash 3.2, so `exec.sh` no longer skips it silently** (guard added in #498). `exec.sh` runs `bash script-owners.sh check … 2>/dev/null || true`; under /bin/bash 3.2.57 the file failed to parse (an apostrophe in a comment inside `$(...)`, then `case` patterns without a leading `(`), so the call (and the ledger `record` call) printed nothing and warned nothing. Fixture `test-restatement-guard.sh` under /bin/bash 3.2.57: 16 of 58 pass before, 58 of 58 after; `bin/check-scripts.sh` now also parses every script with /bin/bash when the bash on PATH is a different one. — saingge
- fix(progress-report, build-plan-status): **HARNESS rows are no longer counted as built rows, and a module's `verify-module.sh` row shows once, as that module's sign-off status on its phase card, instead of as a row.** A HARNESS step is a module's sign-off, not a build, so it is out of every "x of y built" count: the phase cards, the plan rollup and the Stage 5 card in `progress-report.html`, and the lede of `build-plan-status.sh --html` ("N build rows", plus a "Not counted: N HARNESS rows" note). The verify row's evidence is read exactly as #501 reads it (`harness_verify`'s rule, now `verify_evidence` + `module_status` in `progress-report.py`; nothing new measured, no extra script run, no mxcli or mxbuild call) and shown as one line per module: `Verified ✓ <date> (LOOK n/n)`, `Verify owed - LOOK + CONFIRM`, `Verify stale (N builds since)` (or `(a script was marked done- after it)`), `Verify not run`, `built? no verify summary`, `Verify not clean <date> (<why>)` for a summary with a FAULT, FINDING or SKIPPED row, or `Verify clean <date>, LOOK n/n - held: State says <State>` when State is blocked or pending a person (held is not signed off, as #501 never promoted it); a State cell that disagrees is flagged under it, the rollup says how many modules are verified, and the Stage 5 card, KPI and owed text add ", k of n modules signed off". The Phase state badge is read from the build rows only (a phase of HARNESS rows alone says "sign-off only" and its card "Sign-off phase: no build rows"). A module with no verify row shows no status. Other HARNESS rows (a coherence pass, a harness run) stay in the row list, marked "(not counted)". `build-plan.md`, `build-plan.json` and the text output are unchanged, so agents still see every HARNESS step. **Behaviour change to check in your project:** the progress report's built counts drop the HARNESS rows (a plan of 10 rows with 2 HARNESS reads "x of 8"), and the verify rows leave the row tables. Fixture: `test-progress-harness-verify.sh` (H1-H10, N1-N6, both layouts). — MendixMau (decision 2026-10-21)
- fix(exec): **a script restated from a stale DESCRIBE now WARNs instead of silently reverting an earlier exec** (#261). A script drafted from a DESCRIBE taken before an earlier script of the batch ran put four old messages back, with check, mxbuild and lint green. New `project-bin/describe-baseline.sh stamp` writes `-- baseline: <Doc> sha256=<hash>` (plus `-- baseline-mxcli: <version>`) from a DESCRIBE at draft time; `exec.sh` runs `verify` only for a script that carries the header, so other scripts cost one grep and no mxcli call. It reports DRIFT with the first lines of the diff, STALEHEADER, and RESTAMP after an mxcli upgrade (DESCRIBE text may change, so that is not called drift). A re-run by the script's own last recorded write (the #269 ledger) and a fresh model are not drift. Nothing is refused and the exit codes do not change. Preflight STOP 21 gains one clause (`-- supersedes:`, `stamp`, exec.sh only warns) and its trigger names `create or modify` (+24 words). Not-found DESCRIBE and `--version` output are captured from mxcli v0.26.0. Lands after the #269 PR; with it, supersedes draft #311. **Behaviour change to check in your project:** `exec.sh` output can carry `WARN: stale draft: …` lines, and the BUILD-LOG detail cell `WARN stale baseline: <docs>`; `MXTK_RESTATE_GUARD=off` skips the check. — AlvinnYeo (#261)
- fix(exec): **re-running an older `mdlsource/` script over a newer owner's live work now WARNs instead of passing silently** (#269). Three field apps had 99/579, 130/357 and 38/159 documents created by more than one script, and a replay of an older one reverted the newer with exit 0 and every gate green. New `project-bin/script-owners.sh` maps each microflow, nanoflow, page and snippet to the scripts that create or restate it, in run order (digit runs compared as numbers, so `2-core/` runs before `11-fixes/`; `done-` ignored), and reads `-- supersedes:` / `-- superseded-by:` headers. `exec.sh` records every kept write in a machine-local last-writer ledger (`.claude/loop/script-owners/`, self-gitignored, compacted per write); `restore-mpr.sh` marks it on a manual restore. A replay WARNs only when the newer owner's write is live: ledger first, else one DESCRIBE per document, at most 5 per exec (the rest print `CONFLICT (not checked)`). A new owner without a supersedes header gets one `NOTE:` line on its first run, kept out of BUILD-LOG. Nothing is refused and the exit codes do not change. With no co-owner, `exec.sh` runs one grep over `mdlsource/` and no mxcli call. `gate-check.sh` prints the co-owned count when it is above 0. Part of the rebuilt draft #311 (with the #261 PR). **Behaviour change to check in your project:** `exec.sh` output can carry `WARN: restatement: …` and `NOTE: new owner of …` lines; the BUILD-LOG detail cell can carry `WARN reverts: <docs>`. Set `MXTK_RESTATE_GUARD=off` to skip the check. — MendixMau (#269)
Expand Down
13 changes: 11 additions & 2 deletions bin/check-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ set -uo pipefail
TOOLKIT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PROJECT_DIR="${1:-}"

# macOS ships bash 3.2 as /bin/bash and its $(...) scanner rejects things bash 5 accepts. When
# the bash on PATH is a different one, parse with /bin/bash too — script-owners.sh shipped
# unparseable on a Mac this way. `bash -n` there catches an apostrophe in a comment inside
# $(...); it does not catch a case pattern without a leading "(" (that fails only when run).
SYS_BASH=""
if [ -x /bin/bash ] && [ "$(/bin/bash -c 'printf %s "$BASH_VERSION"' 2>/dev/null)" != "$BASH_VERSION" ]; then
SYS_BASH=/bin/bash
fi

FAIL=0
SH_OK=0; SH_N=0
JS_OK=0; JS_N=0
Expand All @@ -42,11 +51,11 @@ check_sh() { # check_sh LABEL GLOB...
for f in "$@"; do
[ -f "$f" ] || continue
n=$((n + 1)); SH_N=$((SH_N + 1))
if OUT="$(bash -n "$f" 2>&1)"; then
if OUT="$(bash -n "$f" 2>&1)" && { [ -z "$SYS_BASH" ] || OUT="$("$SYS_BASH" -n "$f" 2>&1)"; }; then
SH_OK=$((SH_OK + 1))
else
FAIL=$((FAIL + 1))
printf ' FAIL %s does not parse under this bash:\n' "$f"
printf ' FAIL %s does not parse under this bash (or /bin/bash):\n' "$f"
printf '%s\n' "$OUT" | head -3 | sed 's/^/ /'
if ! tr -d '\r' < "$f" | cmp -s - "$f"; then
printf ' (file carries CRLF line endings — see doctor.sh "Line endings" for the fix)\n'
Expand Down
10 changes: 5 additions & 5 deletions project-bin/script-owners.sh
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ case "$cmd" in
[ -n "$PAIRS" ] || exit 0
MY_SUP="$(so_header "$S" supersedes)"; MY_SUPBY="$(so_header "$S" superseded-by)"
OUT="$(NL_SEEN=""; NL_DESC=0
# rc 0: O's work on doc $1 is not in the model; 1: it is (or unknown); 2: DESCRIBE cap reached.
# rc 0: the work of O on doc $1 is not in the model; 1: it is (or unknown); 2: DESCRIBE cap reached.
not_live() { # $1 = "KIND Module.Name", $2 = O
local w live rc=1
if [ "$S_RAN" = 0 ] && ! so_has_run "$ROOT" "$2"; then return 0; fi # S is new
case "$NL_SEEN" in *"|$1="*) rc="${NL_SEEN#*"|$1="}"; return "${rc%%|*}" ;; esac
case "$NL_SEEN" in (*"|$1="*) rc="${NL_SEEN#*"|$1="}"; return "${rc%%|*}" ;; esac
w="$(so_last_writer "$ROOT" "$1")"
if [ -n "$w" ] && [ -n "$S_REL" ] && { [ "$w" = "$(so_sortkey "$S_REL")" ] || so_before "$w" "$S_REL"; }; then
rc=0
Expand All @@ -263,9 +263,9 @@ case "$cmd" in
revert() { # $1 doc $2 O $3 message
local r=0; not_live "$1" "$2" || r=$?
case "$r" in
0) ;;
2) printf 'UNCHECKED\t%s\t%s\tCONFLICT (not checked: 5 DESCRIBE calls per exec) — %s\n' "$1" "$2" "$3" ;;
*) printf 'REVERT\t%s\t%s\t%s\n' "$1" "$2" "$3" ;;
(0) ;;
(2) printf 'UNCHECKED\t%s\t%s\tCONFLICT (not checked: 5 DESCRIBE calls per exec) — %s\n' "$1" "$2" "$3" ;;
(*) printf 'REVERT\t%s\t%s\t%s\n' "$1" "$2" "$3" ;;
esac
}
while IFS=' ' read -r d o; do
Expand Down
Loading