Repository navigation
Conversation
…te; refuse them at commit exec.sh runs model-scope.py restore after the write and before the mxbuild gate, so the gate checks the final model, and puts a scope: note in the BUILD-LOG row. Never blocks; MXTK_NO_SCOPE=1 skips it, and it is skipped when FORCE_EXEC let the write run over uncommitted model changes. The pre-commit hook (v2) runs model-scope.py check --staged and refuses staged noise; MODEL_SCOPE_OK=1 lets one commit through. A project without model-scope.py skips the check; a machine without Python gets a warning; either way the commit stands. --check reports a v1 hook as stale (mxcli#1596). model-scope.py's header and the CHANGELOG entry for MendixMau#559 said exec.sh and the hook do not call it yet; both now say they do. Fixture: tests/wave2/test-model-scope.sh sections E (hook) and F (exec.sh).
|
Triage (outside PR, code not run): DISCUSS track. Verdict: DISCUSS, plus a required rebase.
Generated by Claude Code |
|
Maintainer decision: option 2, with a narrower scope. What's new: mxcli v0.29.0 (released 2026-10-30) fixes the source of this noise upstream:
The fix is commit What that means for this PR:
Still needed: a Windows timing for the step on the new base (process starts after #590), and the independent merge review. Thanks for the careful field run. It made this an easy call. Generated by Claude Code |
…te (#606) Port of #593 (saingge), reduced scope: exec.sh restores model scope before the gate and notes it in BUILD-LOG. Review: MERGE — faithful reduced-scope port; the exec step is identical to #593's, sits before the gate and never blocks. Follow-up: in --patch mode the restore runs after #603's hash verify, so a failed rehash is not re-verified. Co-Authored-By: saingge Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018LeNWZV2sVH62vkgfYh5u5
|
Thank you @saingge — the core of this landed in #606 (merged as 2a51963), with you kept as commit author: We took a reduced scope to keep regression risk down: the hook-side refusal and fixture section E were left out. Closing this one in favour of #606; happy to discuss the remaining parts in a new issue if you still need them. Generated by Claude Code |
Branch
fix/exec-model-scope-wiring, one commit (f8147b3) on origin/master 95e1b30. Lane 3 (direct). It follows #559, which putmodel-scope.pyon master. It stands alone: nothing is stacked on it and it does not need the canvas PRs.What changed and why
model-scope.py(#559) finds units a write changed only in XPath whitespace, as mxcli v0.27.0'salter entity … rename attributedid to 135 units in 20 unrelated modules of a Mendix 10.24.18 app (mendixlabs/mxcli#1596). On master nothing calls it:project-bin/exec.shand the pre-commit hook do not mention it. This PR puts it where the noise is made and where it would be committed.exec.shrunsmodel-scope.py restoreright after the write (MDL and--patch) and before the mxbuild gate, so the gate checks the final model. It prints the counts and the real changes per module, and adds ascope: N unit file(s) changed, R real, K noise restorednote to the BUILD-LOG row. It never blocks: a non-zero exit prints a warning, the write is kept with any noise not yet restored, and model-scope.py's own message says what it left (a part-way restore keeps the index matching).MXTK_NO_SCOPE=1skips it, and it is skipped whenFORCE_EXEClet the write run over uncommitted model changes, where the diff againstHEADis not this write's alone.model-scope.py check --stagedbefore the stamp check and refuses staged noise, namingrestoreas the remedy (a commit is not the remedy).MODEL_SCOPE_OK=1lets one commit through. A project withoutmodel-scope.pyskips the check silently; a machine without Python gets a warning; either way the commit stands.--checkreports a v1 hook as stale, and a re-run rewrites it in place instead of chaining it as a foreign hook. Thecore.hooksPathadvice gains the matching line.model-scope.py("Run it by hand; nothing calls it yet.") now saysbin/exec.shruns it after each write to a committed model, and the CHANGELOG entry for new(model-scope): find and put back units a write changed only in XPath whitespace (replaces #535) #559 ("Not wired intoexec.shor the pre-commit hook yet.") now points at the entry above it. Both were true when merged and are not true with this change.Impact
python3 -I bin/model-scope.py restore; one-commit overrideMODEL_SCOPE_OK=1.exec.shgains a step that never blocks. Projects pick the hook up on the nextsync-project.sh(--checknow reports v1 as stale).project-bin/exec.sh(shared; the_detailline of the BUILD-LOG row also carries${ROWS_NOTE}on master now, and this adds${SCOPE_NOTE:+ · $SCOPE_NOTE}after theHV_NOTEpart) andproject-bin/install-project-hooks.sh, plus the model-scope docstring line and CHANGELOG line above. Draft #311, which edited the same_detailline, was closed unmerged (read 2026-10-28). Draft #384 (exec --on-copy, open, unchanged since 2026-10-19) writes the live model only after the gate, so this step would see nothing to restore under--on-copy. Whichever merges second should run the step after the promotion, or skip it under--on-copywith a note.render-routing.sh --check, base 95e1b30 and head: both "Baseline: 65444 words (budget 80000)", all ten output lines identical.model-scope.py restore, which reads only the unit files git reports as changed. Measuredreportat 0.19 s on the golden capture (3 changed units, 2026-10-21); not measured on a large model.Field evidence
Field run of this wiring, end to end (2026-10-21, on the earlier base; the commit's content is unchanged by the rebase except the
_detailline). Scratch copy of a Mendix 10.24.18 enterprise app (own git repository, HEAD = clean pre-write state; this branch's project-bin installed withsync-project.sh --only-bin, hooks withbin/install-project-hooks.sh)../bin/exec.shran one mxcli v0.27.0 attribute rename. The scope step reported 149 unit files changed, 3 real, 146 noise in 21 modules (a different rename from the one #1596 reports, 135 units in 20 modules), and restored the 146. exec.sh's own mxbuild gate then ran on the restored model (mxbuild 10.24.18 through a Docker shim set asMXBUILD_PATH): 0 errors, exit 0, 94 s for the whole exec. The BUILD-LOG cell readscope: 149 unit file(s) changed, 3 real, 146 noise restored. The hook accepted the commit of that result. The rename back, run through exec.sh withMXTK_NO_SCOPE=1, left 149 changed units (its gate also passed: the noise is harmless to mxbuild and costly to a reviewer);git committhen refused (exit 1, "146 staged unit file(s) changed only in XPath whitespace"), andMODEL_SCOPE_OK=1 git commitwent through with the WARNING.I did not repeat the field run on 95e1b30; the fixture below covers the rebased code.
Checklist
LEAKGUARD_ALLOW_NO_DENYLIST=1 LEAKGUARD_BASE=origin/master bin/check-no-client-data.sh: clean; fixture names are synthetic).test-model-scope.shsections E and F. macOS only; Git Bash/Windows not run (Python found throughresolve_py, paths throughnative_path).CHANGELOG.mdline, credited, and the new(model-scope): find and put back units a write changed only in XPath whitespace (replaces #535) #559 line corrected.Verification
Run on this branch (f8147b3, rebased on 95e1b30), macOS arm64, 2026-10-29.
model-scope.py; staged noise refused and no commit made;MODEL_SCOPE_OK=1commits; a real change commits; a v1 hook is reported "older version" by--checkand upgraded in place with no.pre-mxtkchain; nomodel-scope.pyand the hook does not block. F: exec.sh with a stub mxcli that rewrites 3 units' XPath whitespace and makes 1 real change prints "4 unit file(s) changed, 1 real, 3 noise", "restored 3 noise unit(s) from HEAD", "real changes by module"; 1 unit left changed; ContentsHash index clean; the mxbuild gate stub saw 1 changed unit, so it checked the restored model; the BUILD-LOG row carries the scope note.MXTK_NO_SCOPE=1leaves 4 changed.--patchrestores 2 noise units and the gate saw 1. Nomodel-scope.py: exec.sh runs as before.exec.shandinstall-project-hooks.shswapped in ->PASS: 47 FAIL: 13, every E/F guard failing, so the checks catch a missing wiring.test-model-stamp.sh35/0,test-mx-metadata-note.sh40/0,test-exec-gate-log.sh24/0,test-exec-hash-verify.sh43/0,test-exec-step-times.sh7/0.bin/check-scripts.sh125/125 shell and 25/25 Node parse;bin/check-pr-discipline.sh origin/masterclean;bin/render-routing.sh --checkin sync, baseline 65444;bin/mdl-rules.sh --checkin sync;bin/check-portability.shclean;bin/check-no-private-citations.shclean;bin/check-no-client-data.shclean;bash tests/run-tests.shpassed=33 failed=0.bash tests/wave2/run-all.sh: not run to the end (about 180 fixtures; the machine was too loaded). Instead the 56 fixtures that name the files this change touches (exec.sh, the hook installer andmodel-scope) were run the way run-all.sh runs them, on a copy of this branch (before a last amend that changed comments, one docstring, the CHANGELOG line and the commit message, and no code line) and on a copy of origin/master, with identical exit codes. The other fixtures were not run.