diff --git a/CHANGELOG.md b/CHANGELOG.md index e9e148df..383d78af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m `docs/RELEASE-PROCESS.md` §8. ## Unreleased +- process(tests): **fixtures run alone no longer write `.leakguard-deny` into the toolkit clone**: `test-mode-contract.sh`, `test-ci-gates.sh`, `test-gitignore-crlf.sh` and `test-must-haves-advisory.sh` scaffolded through `init-project.sh` without `MXTK_LEAKGUARD_DENYFILE`, so a scoped run (outside `run-all.sh`, which sets it) registered `\bhand\b`, `\bc6\b`, `\bold\b`, `\bmid\b`, `\bfresh\b` and three `init-*` names in the clone's real denylist, and the pre-commit leak guard then flagged nearly every file for the next committer. Each now points it at its own scratch dir, and `tests/wave2/run-all.sh` treats its exported scratch denylist as a sentinel: emptied before each fixture, a fixture that leaves it non-empty FAILs by name, so the next fixture that forgets is caught at ~0 s cost (master's `test-mode-contract.sh` trips it with `\bhand\b`; the fixed one does not). — several toolkit maintenance sessions in one shared clone, 2026-11-19 - new(doctor, bug ledger): **a guard for mxcli's silent MxBuild fallback**: when the project's Mendix version is not in `~/.mxcli/mxbuild/` (and no Studio Pro of that version exists), `mxcli docker build` / `docker check` fall back to the newest cached MxBuild and print its path but no version warning (`run --local` is exact-or-refuse); `bin/doctor.sh` now warns, naming the model version, the cached ones and `./mxcli setup mxbuild -p .mpr` (`mxtk_mxbuild_cache_gap`, warning only, never changes a gate). Ledger entry `BUG-DRAFT-mxbuild-silent-version-fallback`; upstream issue not filed. — a four-app Mendix build (field run), independent review - fix(gate-check): **a fresh clone no longer FAILs Stage 3 as "stale render"**: `blueprint.html` / `process-map.html` freshness used `[ render -ot source ]`, a nanosecond mtime compare, and a checkout stamps files in directory order (`process-map.html` lands before `process-model.json`), so an unedited project read stale on every clone (reproduced: 200-wireframe checkout, 10 of 10 clones). New `bin/lib/render-fresh.sh` keeps `-ot` as the first test (a pass never flips, no git call) and, only where `-ot` would FAIL, asks git once per render (one `log`, one `status`) whether the source was committed after the render's commit; measured 0.19 s for 200 sources all `-ot`-stale on a 300-commit history (a per-source git version cost 12.9 s). Limit: a depth-1 clone cannot see a genuinely stale render. Field run: a four-app Mendix build checked out on a second machine. — a four-app Mendix build (field run), independent review - fix(test-stack-up, e2e-harness-base): **the app port follows the app's configured port, and a multi-app start is no longer pinned to 8080**: with no `APP_PORTS`, `test-stack-up.sh` puts `RUN_LOCAL_APP_PORT`, then `APP_PORT` from the `.docker/.env` beside the `.mpr` (`apps//.docker/.env`; the project-root one as fallback) first, ahead of the old fixed `8080 8081 8084` tail. A fresh `run --local` start for a model under `apps/` with no handshake and no configured port used to fall back to 8080 for every app (`--app-port 8080`); it now exits 4 naming `RUN_LOCAL_APP_PORT`. `e2e-harness-base.md` states that a PAD/Docker runtime listens on 8080 *inside* the container only. Fixtures T28–T32 added. Field run: a four-app Mendix build on 8081–8084 whose fresh start failed with every app pinned to 8080. — a four-app Mendix build (field run), independent review diff --git a/tests/wave2/run-all.sh b/tests/wave2/run-all.sh index 9f44a596..23ec1279 100755 --- a/tests/wave2/run-all.sh +++ b/tests/wave2/run-all.sh @@ -22,7 +22,12 @@ FAILED=0; RAN=0; SKIPPED=0 # Belt for the denylist pollution (2026-09-08): fixtures scaffold through init-project.sh, which # registers the project name in the toolkit's gitignored denylist unless told otherwise. Send it # to scratch here for every fixture, and refuse at the end if the real one appeared anyway. +# The scratch path doubles as a SENTINEL: it is emptied before each fixture, and a fixture that +# leaves it non-empty scaffolded without exporting its own MXTK_LEAKGUARD_DENYFILE, so run ALONE +# (the scoped way) it writes its project names into the clone's real .leakguard-deny and the +# pre-commit leak guard flags every file for the next committer (2026-11-19: `\bhand\b`, `\bc6\b`). export MXTK_LEAKGUARD_DENYFILE="${TMPDIR:-/tmp}/mxtk-runall-denylist.$$" +SENTINEL="$MXTK_LEAKGUARD_DENYFILE" # Same idea for the browser: every fixture that scaffolds a fresh project through init-project.sh # would open toolkit-guide.html in the developer's real browser, one tab per fixture, all run long. # test-guide-reopen.sh unsets this and uses a fake `open` to test the opening itself. @@ -72,8 +77,14 @@ for t in "$DIR"/test-*.sh; do fi fi + rm -f "$SENTINEL" out=$(bash "$t" $subject 2>&1); rc=$? RAN=$((RAN+1)) + if [ -s "$SENTINEL" ]; then + printf " FAIL %-34s scaffolds via init-project.sh without exporting its own MXTK_LEAKGUARD_DENYFILE (run alone it writes %s: %s)\n" \ + "$name" "$ROOT_DENY" "$(grep -v '^#' "$SENTINEL" | tr '\n' ' ')" + FAILED=$((FAILED+1)) + fi tail_line=$(printf '%s' "$out" | grep -E 'PASS=|SCORE:|ok,|FAIL' | tail -1) if [ "$rc" -eq 0 ]; then printf " ok %-34s %s\n" "$name" "$tail_line" @@ -87,7 +98,7 @@ done echo "" echo "ran $RAN fixture(s), skipped $SKIPPED, failing $FAILED" -rm -f "$MXTK_LEAKGUARD_DENYFILE" +rm -f "$SENTINEL" if [ "$ROOT_DENY_BEFORE" -eq 0 ] && [ -f "$ROOT_DENY" ]; then echo "FAIL a fixture wrote $ROOT_DENY — the real toolkit denylist (the pollution MXTK_LEAKGUARD_DENYFILE exists to stop)" FAILED=$((FAILED+1)) diff --git a/tests/wave2/test-ci-gates.sh b/tests/wave2/test-ci-gates.sh index aaa3366f..a4fc4096 100755 --- a/tests/wave2/test-ci-gates.sh +++ b/tests/wave2/test-ci-gates.sh @@ -20,6 +20,10 @@ ok() { PASS=$((PASS+1)); echo " ok — $1"; } bad() { FAIL=$((FAIL+1)); echo " FAIL — $1"; } WORK="$(mktemp -d "${TMPDIR:-/tmp}/citest.XXXXXX")" || exit 2 trap 'rm -rf "$WORK"' EXIT +# init-project.sh registers each scaffolded project's name in the toolkit clone's .leakguard-deny +# unless told otherwise; run alone (outside run-all.sh) this fixture would leave its project names +# there and the pre-commit leak guard would flag every file for the next committer. +export MXTK_LEAKGUARD_DENYFILE="$WORK/leakguard-deny" echo "== subject: $SUBJECT" [ -f "$SUBJECT" ] && [ -d "$FXS" ] || { echo "FAIL — subject or fixture missing"; echo "PASS=0 FAIL=1"; exit 1; } export GIT_AUTHOR_NAME=t GIT_AUTHOR_EMAIL=t@t GIT_COMMITTER_NAME=t GIT_COMMITTER_EMAIL=t@t diff --git a/tests/wave2/test-gitignore-crlf.sh b/tests/wave2/test-gitignore-crlf.sh index a76015e0..e8237596 100644 --- a/tests/wave2/test-gitignore-crlf.sh +++ b/tests/wave2/test-gitignore-crlf.sh @@ -18,6 +18,10 @@ bad() { FAIL=$((FAIL+1)); echo " FAIL — $1"; } WORK="$(mktemp -d "${TMPDIR:-/tmp}/gicrlf.XXXXXX")" || exit 2 WORK="$(cd "$WORK" && pwd -P)" trap 'rm -rf "$WORK"' EXIT +# init-project.sh registers each scaffolded project's name in the toolkit clone's .leakguard-deny +# unless told otherwise; run alone (outside run-all.sh) this fixture would leave its project names +# there and the pre-commit leak guard would flag every file for the next committer. +export MXTK_LEAKGUARD_DENYFILE="$WORK/leakguard-deny" CR="$(printf '\r')" nlines() { tr -d '\r' < "$1" | wc -l | tr -d ' '; } ncrlf() { grep -c "${CR}\$" "$1"; } diff --git a/tests/wave2/test-mode-contract.sh b/tests/wave2/test-mode-contract.sh index 1e7bdb9d..02066cd7 100755 --- a/tests/wave2/test-mode-contract.sh +++ b/tests/wave2/test-mode-contract.sh @@ -32,6 +32,10 @@ case "$SUBJECT" in /*) ;; *) SUBJECT="$PWD/$SUBJECT" ;; esac GOLD="$TOOLKIT/tests/wave2/fixtures/entry-mode-plan-rule" WORK="$(cd "$(mktemp -d "${TMPDIR:-/tmp}/mode-contract.XXXXXX")" && pwd -P)" || exit 2 trap 'rm -rf "$WORK"' EXIT +# init-project.sh registers each scaffolded project's name in the toolkit clone's .leakguard-deny +# unless told otherwise; run alone (outside run-all.sh) this fixture would leave its project names +# there and the pre-commit leak guard would flag every file for the next committer. +export MXTK_LEAKGUARD_DENYFILE="$WORK/leakguard-deny" PASS=0; FAIL=0 ok() { PASS=$((PASS+1)); echo " ok - $1"; } bad() { FAIL=$((FAIL+1)); echo " FAIL - $1${2:+: $2}"; } diff --git a/tests/wave2/test-must-haves-advisory.sh b/tests/wave2/test-must-haves-advisory.sh index 5449d9e2..4639f96b 100755 --- a/tests/wave2/test-must-haves-advisory.sh +++ b/tests/wave2/test-must-haves-advisory.sh @@ -17,6 +17,10 @@ OBCHECK="$(dirname "$SYNC")/lib/obligation-check.sh" for f in "$INIT" "$OBCHECK"; do [ -r "$f" ] || { echo "missing $f"; exit 2; }; done WORK="$(mktemp -d "${TMPDIR:-/tmp}/mh-adv.XXXXXX")" trap '[ -n "${KEEP:-}" ] || rm -rf "$WORK"' EXIT +# init-project.sh registers each scaffolded project's name in the toolkit clone's .leakguard-deny +# unless told otherwise; run alone (outside run-all.sh) this fixture would leave its project names +# there and the pre-commit leak guard would flag every file for the next committer. +export MXTK_LEAKGUARD_DENYFILE="$WORK/leakguard-deny" export MXTK_NO_GUIDE=1 PASS=0; FAIL=0 ok() { PASS=$((PASS+1)); printf ' ok %s\n' "$1"; }