Skip to content

fix(check-design-reaches-app): resolve the model dir via find_model_dir; unreadable knob file is a FAULT, never clean - #177

Merged
MendixMau merged 2 commits into
masterfrom
fix/design-reaches-app-two-tree-v2
Sep 30, 2026
Merged

MendixMau merged 2 commits into
masterfrom
fix/design-reaches-app-two-tree-v2

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

What changed and why (one paragraph)

The knob pass read theme/web/custom-variables.scss relative to the working directory. When it found nothing it printed "knobs bound 0 of 0" under clean, exit 0. #162 added a one-level app/*.mpr probe to the same lines, which fixes the common two-tree case. This PR replaces that probe with find_model_dir from _common.sh ($PROJECT_ROOT, $MPR_FILE, the app/ probe), and adds an app/theme / app/deployment probe for a tree with no .mpr. It also covers what #162 did not: a missing knob file, or one that declares no knobs, is now FAULT … UNMEASURED and exit 2. The knob file can also be passed as a third argument. This replays branch fix/design-reaches-app-two-tree (b773795) on current master, keeping #162's pass 2b (tokens valued) intact. The old branch is left untouched.

Field evidence

Original run (from the source branch): a Stage 5 obligation pass on a two-tree Mendix 11.14 app. With no arguments, knobs went from 0 of 0 before to 26 of 30 after, and tokens were 157 of 157.

Re-run on current master, against a scratch Mendix 11.13 app with a real mxbuild-compiled theme.compiled.css (never a real project model):

Layout master cee5c9a this PR
single-tree knobs 0 of 46, css-vars true, exit 1 same, and prints the knob file used
two-tree, .mpr under app/ knobs 0 of 46, css-vars true, exit 1 same
two-tree, no .mpr exit 2 "no BUILT stylesheet found" finds app/deployment, knobs 0 of 46, exit 1
knob file missing, tokens all arrived "clean, 2 warning(s)", exit 0, knobs 0 of 0 FAULT UNMEASURED, exit 2

That last row is the defect: a pass that read nothing, reported as clean. When violations exist too, exit 1 wins over the fault, as before. Both results are non-green.

Checklist

  • No client data: the source-project name was removed from the CHANGELOG line and the commit message; diff grepped, leak guard passes
  • Size cap: 4 files, +167/−28
  • Test tier: T2. Field run above on both layouts; fixture cases 9–10 in tests/wave2/test-design-reaches-app.sh come from the source branch and run in CI
  • Instrument rules: both layouts probed (rule 2); golden capture in fixtures/design-reaches-app/CAPTURE.md (rule 1); field run cited (rule 4)
  • Routing row: n/a
  • CHANGELOG line: yes, under Unreleased
  • Bug entries: n/a

🤖 Generated with Claude Code

https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw


Generated by Claude Code

…ts; unreadable knob file is a FAULT, never clean

On a two-tree checkout (model under app/) the script read theme/web/custom-variables.scss,
theme/web/, themesource/ and deployment/ from the working directory, found nothing, and
printed "knobs bound 0 of 0" under a clean verdict (exit 0); the dead-SCSS-bridge pass was
silently skipped too ($use-css-variables read 'unknown').

- Model directory from find_model_dir (_common.sh: PROJECT_ROOT, MPR_FILE, app/ probe), with
  an app/ directory probe when no .mpr is found; design/ and mdlsource/ from the repo root.
- Missing knob file, or one declaring no knobs: FAULT, knobs UNMEASURED, exit 2.
- Knob file accepted as a third argument as well as CUSTOM_VARS.
- Fixture cases 9-10: both layouts (with and without an .mpr), two-tree dead bridge, missing
  and empty knob file, both overrides. CAPTURE.md records the real two-tree layout.

Field run (2026-09-28, Mendix 11.14.0, model under app/, run from
the repo root with no arguments): master 0 of 0 knobs, clean; this commit 26 of 30 knobs bound,
157 of 157 tokens, 239 of 269 classes, $use-css-variables: true. CUSTOM_VARS=<missing> -> exit 2.

Replayed on current master: #162 had added a one-level app/*.mpr probe
to the same lines; this supersedes it with find_model_dir. Re-run on a
scratch Mendix 11.13 app, both layouts: master prints a clean exit 0
with the knob file missing; this exits 2 with FAULT UNMEASURED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
@MendixMau
MendixMau marked this pull request as ready for review September 29, 2026 23:49
… all Unreleased lines)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
@MendixMau
MendixMau merged commit b5fc89b into master Sep 30, 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.

2 participants