Skip to content

fix(doctor.sh): gate self-test copies the whole model directory, not just .mpr + mprcontents (#127) - #142

Merged
MendixMau merged 2 commits into
masterfrom
fix/doctor-selftest-resources
Sep 29, 2026
Merged

MendixMau merged 2 commits into
masterfrom
fix/doctor-selftest-resources

Conversation

@MendixMau

@MendixMau MendixMau commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

What changed and why (one paragraph)

Addresses issue #127 and a second field report of the same shape (a macOS project with a custom theme on Mendix 11.12.4): bin/doctor.sh --gate-selftest copied only the .mpr and mprcontents/ into its scratch directory, so the --target=deploy build it runs there could not resolve widgets, theme and design properties that live in theme/, resources/, widgets/ and javasource/ beside the .mpr. The self-test then reported hundreds to over a thousand Could not find widget errors as a dirty baseline while the real gate, which builds in place, passed with 0 on the same model. The scratch copy is now the whole directory holding the .mpr (project root on a single-tree checkout, app/ on two-tree) minus .git/, deployment/, node_modules/ and .mpr-snapshots/, with the copied size printed. The earlier real-basename fix from #128 is kept (every sibling is copied as itself). mxbuild --target=check was ruled out (nothing in the toolkit has ever used it), a sibling .mpr in the project dir was ruled out (collides with the project's own mprcontents/), and symlinks were ruled out (Git Bash copies through them).

Field evidence

  • Two fixture projects (single-tree, and .mpr under app/) with all four excluded dirs nested at both levels plus mprcontents/, theme/, resources/, widgets/, javasource/, and a stub mxbuild that logs the scratch contents per invocation. bin/doctor.sh --quick --gate-selftest --no-docker with real java and MXBUILD_PATH= the stub: all five resource dirs copied, all four exclusions honoured in both layouts, size note printed, verdict pass (baseline=0 known-bad=1), no leftover scratch dir after either run.
  • Real field run, 2026-09-29 (Linux, real mxbuild 11.12.1, scratch copy of a greenfield PoC project; the real model untouched): self-test baseline on master 1337 errors (almost all Could not find widget), with this PR 20 errors, matching an in-place mxbuild of the same copy. The false errors are gone; the 20 are the model's real ones. Not exercised: the known-bad injection half, since the baseline is not clean.
  • check-portability, check-scripts, leak guard all pass. tests/wave2/test-doctor-gate-selftest.sh (10 cases) and the doctor case in tests/run-tests.sh read in full: none assert the old copy wording.

Checklist

  • No client data (leak guard clean; projects described, never named)
  • Size cap: 2 files, +56/−8
  • Test tier T2 (real mxbuild field run, cited above)
  • Instrument rules: rules 2, 3 and 4 done
  • Routing row: n/a
  • CHANGELOG line in the same commit
  • Bug entries: n/a

🤖 Generated with Claude Code

https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw

… model directory

The gate self-test's scratch copy previously carried only .mpr + mprcontents/. A
--target=deploy build (the same target the real gate runs, in place, against the
project as it sits on disk) also resolves widget/theme/design-property references
out of theme/, resources/, widgets/ and javasource/ sitting beside the .mpr — a
thin copy reported hundreds to 1000+ false errors as a "dirty baseline" while the
real gate passed with 0 errors on the identical model (two field reports: an Atlas
project on Mendix 11.14.0, and a project with a custom theme on Mendix 11.12.4).

Now copies the whole directory holding the .mpr (dirname "$MPR" — the model's own
root on a single-tree checkout, or app/ on a two-tree one) minus .git/,
deployment/, node_modules/ and .mpr-snapshots/, none of which mxbuild reads, and
prints the copied size (du -sh) so the cost is visible. The existing real-basename
fix (copying every sibling, including the .mpr, as itself) is unchanged.

mxbuild --target=check was ruled out: grepped for it across bin/, project-bin/,
skills/ and bug-logs/ and found no evidence it exists or is used anywhere in this
toolkit — --target=deploy is the only target ever invoked. A sibling .mpr dropped
into the project's own directory was also ruled out: MPR v2 stores an internal
record of the model's basename in mprcontents/, and a second .mpr there would
collide with the real model's own mprcontents/.

Verified against two constructed fixtures (single-tree and .mpr-under-app/) with a
stub mxbuild that logs the scratch directory's contents on every invocation: both
layouts copy in mprcontents/, theme/, resources/, widgets/, javasource/ and the
.mpr itself, exclude all four named directories (including when nested one level
under app/ on the two-tree layout), report the copied size, reach a "pass"
verdict, and leave no scratch directory behind afterward. Not run against a real
mxbuild in this environment.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
@MendixMau
MendixMau marked this pull request as ready for review September 29, 2026 08:56
@MendixMau
MendixMau merged commit 06d7245 into master Sep 29, 2026
1 check 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.

1 participant