Skip to content

fix(exec): restore whitespace-only units after a write, before the gate (port of #593, reduced scope) - #606

Merged
MendixMau merged 2 commits into
masterfrom
port/593-saingge
Nov 1, 2026
Merged

MendixMau merged 2 commits into
masterfrom
port/593-saingge

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

Supersedes #593 by @saingge, with the maintainer's decision on that PR (option 2, narrower). saingge is the commit author.

Direct lane

What changed and why: after the write (MDL and --patch) and before the mxbuild gate, exec.sh runs model-scope.py restore (already on master). Units that changed only in XPath whitespace go back to HEAD with their ContentsHash rows updated, so the gate checks the final model. A scope: note goes in the BUILD-LOG row. The step never blocks: a failure is a warning, MXTK_NO_SCOPE=1 skips it, and it is skipped when FORCE_EXEC let the write run over uncommitted model changes.

Dropped from #593, by decision: the pre-commit hook refusal (marker v2), --check reporting v1 hooks as stale, and the hook tests (fixture section E). model-scope.py check --staged stays available to run by hand. So no synced project gets a new commit-time refusal.

Research: is it still needed on mxcli v0.29? I re-ran the #1596 rename on the real public binaries, on the fixture model with the golden capture's steps, and classified the result with master's model-scope.py:

mxcli units changed real noise
v0.28.0 3 1 2
v0.29.0 1 1 0 (fixed upstream, ako/mxcli#1506)

So the step is insurance for projects on mxcli ≤ v0.28 and a no-op on v0.29.

Row Answer
Process none new; nothing blocks
Dependencies project-bin/exec.sh: one step after the write and before the gate, plus ${SCOPE_NOTE} in the BUILD-LOG cell. The conflict was resolved onto master's current BUILD-LOG line (timestamp fast path kept), and #603's hash verify is untouched
Context cost none
Behaviour n/a: script only
Runtime one model-scope.py restore per exec on a committed model (one Python start plus a git diff). Not measured on Windows: a reviewer item

Re-verified on master 0db1c0e: test-model-scope.sh passes 50/1 here and 43/8 against master's exec.sh (section F: 7 new failures). The single failure on both is section C's partial-restore case: chmod 0555 cannot stop root, and this container runs as root. It fails identically on master's own fixture here, so it is an environment artifact, not this change. CI runs it as non-root.

  • No client data
  • Size: 4 files, +127/−3
  • CHANGELOG line rewritten for the reduced scope (credited to saingge)

Review: pending independent review


Generated by Claude Code

saingge and others added 2 commits November 1, 2026 07:26
exec.sh runs model-scope.py restore after the write (MDL and --patch)
and before the mxbuild gate, so the gate checks the final model. A
scope: note goes in the BUILD-LOG row. The step never blocks:
MXTK_NO_SCOPE=1 skips it, and it is skipped when FORCE_EXEC let the
write run over uncommitted model changes.

Ported from #593 onto current master with the maintainer's reduced
scope:
- The pre-commit hook refusal (marker v2) and its --check staleness
  report are dropped. Hook section E of test-model-scope.sh goes with
  them. model-scope.py check --staged stays available by hand.
- The exec.sh conflict was resolved onto master's BUILD-LOG line,
  which now also carries ${SCOPE_NOTE}.

The noise source is fixed upstream in mxcli v0.29.0 (ako/mxcli#1506).
Re-running the #1596 rename on the real binaries, classified by
master's model-scope.py: v0.28.0 gives 1 real and 2 noise units,
v0.29.0 gives 1 real and 0 noise. So this step is insurance for
projects on mxcli <= v0.28.

test-model-scope.sh: 50 pass / 1 fail on the port; master's exec.sh
gives 43 / 8. The one failure on both is the section C partial-restore
case, which can't fail under root (chmod 0555 does not stop root). It
already fails on master here, so it is an environment artifact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018LeNWZV2sVH62vkgfYh5u5
@MendixMau
MendixMau merged commit 2a51963 into master Nov 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants