Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- fix(doctor, README): **an empty folder on Windows/macOS with no Studio Pro now gets the truth instead of a dead download.** Doctor said "No Studio Pro needed for the gate: --install downloads the standalone toolchain" and "a brand-new project gets its .mpr from 'mxcli init'"; both are wrong off Linux. The Mendix CDN publishes Linux mxbuild only (mxcli `NativeMxBuildForSetup`, #916), so on macOS/Git Bash `--install` no longer plans the ~800 MB download or calls `mxcli setup mxbuild` (which refuses there): it says to install Studio Pro in the app's version or use the Dev Container. With no `.mpr` it says there is no app yet and how to make one (Studio Pro New app > Blank outside OneDrive, or `mxcli new` *before* `mxcli init`, since `new` refuses a non-empty folder and runs init itself); the project-section help text says the same. The Claude Code permissions section reports "skipped" instead of two WARNs when Claude Code is not on the machine (`MXTK_CLAUDE=1` forces it): another agent reads AGENTS.md, not `.claude/`. README's no-Studio-Pro note says Linux only and adds the empty-folder order. New `tests/wave2/test-doctor-no-app-no-sp.sh` (21/21; 10 of its checks fail on the previous doctor, the stub mxcli shows `setup mxbuild` was called on Windows and macOS; macOS and Windows with Studio Pro installed and Linux behave as before). Three upstream drafts in `pending-github-issues/`: `mxcli new` downloads the Linux mxbuild on Windows/macOS, `init`'s VS Code extension install breaks on spaced paths, no `--version` discovery. Field run: a customer's Windows 11 / Git Bash machine, no Studio Pro, no Docker, an empty OneDrive folder, a non-Claude agent: four FAILs from the missing .mpr, then `mxcli new` left a 373 MB partial Linux mxbuild and no app — Maurits Visser, from a customer setup report
- fix(gate-check, status): **a `## Current stage` readout older than the newest `docs/BUILD-LOG.md` row is now named stale, and exec scripts run since Stage 5 with no `cr:` tag and no build-plan row are listed under the `Change log:` line (#767)** — both warn-only and computed when read (one awk over the log per gate-check/status run, nothing per exec row; `exec.sh` untouched): gate-check (every run) and `status.sh` (WATCH) print `Current stage line is from <date>; N exec rows since — re-run bin/gate-check.sh`; gate-check's rewrite now stamps `· last exec <date>` inside the parenthesis (the `**Stage N` prefix that `status.sh`, `token-burn.sh` and `obligation-check.sh` parse is unchanged) and also rewrites when that date moved; the nudge reads Stage 5's start as the first exec row the plan names (verbatim or `060-…-x.mdl`) and never changes the Change log verdict or an exit code. New `bin/lib/build-log-read.sh`; fixtures `test-stage-header.sh` T13, `test-change-log.sh` T10 — field report, greenfield build in auto mode, 2026-11-13
- fix(platform-link): **going live, the toolkit project IS the Team Server copy (#765)**: an app built with the toolkit went live through a separate Team Server working copy with no `.mxtk`, so every later change skipped the exec gate, snapshots and BUILD-LOG, and nothing said so. `skills/platform-link.md` §3 now states the rule and adds a six-step recovery for a copy that already split off (fetch it in, take its model whole, `mxcli fix hashes` + gate, adopt with `-X ours` and push without force, sync the metadata notes, retire the extra copy; the `mprname` trap, ContentsHash after a checkout, and the model-aware merge path needing mxcli ≥ 0.30); one-line pointers from the runbook's Stage 6 and `deploy-to-sandbox.md`. `bin/status.sh` WATCHes, local git only and exit code unchanged, at Stage 6+ when no remote URL names Team Server, and when a fetched Team Server ref is in no local branch ("Team Server has commits made outside the toolkit"). New `tests/wave2/test-status-teamserver.sh` — greenfield field run, 2026-11-13
- fix(marketplace-check, portability): **`bin/exec.sh` on a domain-model script no longer stops at the marketplace check on macOS `/bin/bash` 3.2 (#763)**: `_mkt_locate` ran `case "$m" in *"refusing to guess"*) ...` inside `$( ... )`, and bash 3.2 read the pattern's `)` as the end of the substitution (the #552 class, `bash -n` blind to it). The pattern now uses the POSIX leading paren `(pat)`; a sweep of `bin/`, `bin/lib/`, `project-bin/` and `claude-hooks/` found no other. New `bin/check-portability.sh` rule 3 (`bin/lib/case-in-subst.awk`, multi-line) flags a case pattern without a leading `(` inside `$( )`, so a third one cannot land; fixture `tests/wave2/test-case-in-subst.sh` — thanarat
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,18 @@ they would have saved, restarted or reopened it. Everything either side of that
> export MXBUILD_PATH="/c/Program Files/Mendix/<version>/modeler/mxbuild.exe"
> ```
>
> `bin/doctor.sh --install <project>` closes the gap without Studio Pro: it fetches a
> version-matched mxbuild that `exec.sh` then finds on its own. With no terminal to answer the
> prompt (an agent, CI), add `--yes`: `bin/doctor.sh --install --yes <project>`.
> On **Linux** (Dev Container, cloud) `bin/doctor.sh --install <project>` closes the gap without
> Studio Pro: it fetches a version-matched mxbuild that `exec.sh` then finds on its own. On
> **Windows and macOS** it cannot: the Mendix CDN publishes Linux mxbuild only, so the gate there
> needs Studio Pro's own mxbuild (install Studio Pro in the app's version) or the Dev Container.
> With no terminal to answer the prompt (an agent, CI), add `--yes`:
> `bin/doctor.sh --install --yes <project>`.
>
> **Starting from an empty folder?** There is no app until something creates the `.mpr`:
> Studio Pro (New app → Blank, saved in that folder, outside OneDrive, short path), or
> `./mxcli new <Name> --version X.Y.Z --output-dir <empty folder>` — which also needs Studio Pro on
> Windows/macOS for the same reason. Run `mxcli new` *before* `mxcli init`, never after: `new`
> refuses a folder that is not empty, and runs `init` itself.

**Existing clone from before 2026-08-18?** You predate `.gitattributes`, so if git checked the
scripts out with CRLF they will not run. Fix once:
Expand Down
75 changes: 66 additions & 9 deletions bin/doctor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,40 @@ fi

# The setup step itself, shared by the had-mxcli and just-fetched-mxcli paths. Re-runs the
# toolchain discovery on success — the cache did not exist the first time around.
# Why the toolchain cannot be downloaded here, before the plan promises ~800 MB it cannot deliver.
# noapp — no .mpr: no app yet, so no version to fetch for.
# nolinux — macOS or Git Bash: the CDN publishes Linux mxbuild only; `mxcli setup mxbuild`
# refuses (mxcli NativeMxBuildForSetup, issue #916). Studio Pro's bundled mxbuild is the
# only native one. Field run 2026-11-16: an empty folder on Windows, no Studio Pro, no
# Docker — four FAILs from the missing .mpr, then a 373 MB Linux download that could
# never have run there.
toolchain_skip_reason() {
[ -n "$PROJECT_DIR" ] || return 0
if ! ls "$PROJECT_DIR"/*.mpr >/dev/null 2>&1 && ! ls "$PROJECT_DIR"/app/*.mpr >/dev/null 2>&1; then
echo noapp
else
case "$PLATFORM" in macos|gitbash) echo nolinux ;; esac
fi
}
toolchain_skip_say() {
case "$1" in
noapp)
bad "--install: no .mpr in $PROJECT_DIR — there is no Mendix app here yet, so there is no version to fetch mxbuild for."
note "Create the app first, then run doctor again:"
note " Windows/macOS: Studio Pro > New app > Blank, saved in this folder, then close Studio Pro."
note " Keep it out of OneDrive and on a short path without spaces (C:/Mendix/<app>, ~/Mendix/<app>)."
note " Linux, Dev Container or cloud: ./mxcli new <Name> --version X.Y.Z --output-dir <empty folder>"
note " — BEFORE 'mxcli init' (new refuses a folder that is not empty, and runs init itself)."
note " An existing app: point doctor at the folder that holds its .mpr." ;;
nolinux)
_skv="$(mxtk_model_version "$(ls "$PROJECT_DIR"/*.mpr "$PROJECT_DIR"/app/*.mpr 2>/dev/null | head -1)" 2>/dev/null || true)"
bad "--install: no mxbuild can be downloaded for $PLATFORM — the Mendix CDN publishes Linux mxbuild only, and it cannot run here."
note "Install Studio Pro ${_skv:-in the app version}: doctor finds its bundled mxbuild by itself, nothing to download."
note "Or work in the Dev Container (Docker Desktop) or a cloud container, where the Linux mxbuild runs."
note "Studio Pro installed where doctor did not look? MENDIX_APP=<install root> in toolkit.env (see above)." ;;
esac
}

install_toolchain() {
INSTALL_MPR="$(ls "$PROJECT_DIR"/*.mpr 2>/dev/null | head -1)"
if [ -z "$INSTALL_MPR" ]; then
Expand Down Expand Up @@ -1450,7 +1484,15 @@ if [ "$INSTALL" -eq 1 ]; then
note "--install: $WRONG_MXCLI is a $_wf-format program built for another OS; it will be kept as $(basename "$WRONG_MXCLI").$_wf and the right build fetched."
fi

if [ "$NEED_TOOLCHAIN" -eq 0 ] && [ "$NEED_MXCLI" -eq 0 ]; then
TOOLCHAIN_SKIP=""
if [ "$NEED_TOOLCHAIN" -eq 1 ]; then
TOOLCHAIN_SKIP="$(toolchain_skip_reason)"
if [ -n "$TOOLCHAIN_SKIP" ]; then toolchain_skip_say "$TOOLCHAIN_SKIP"; NEED_TOOLCHAIN=0; fi
fi

if [ "$NEED_TOOLCHAIN" -eq 0 ] && [ "$NEED_MXCLI" -eq 0 ] && [ -n "$TOOLCHAIN_SKIP" ]; then
note "--install: nothing else to download — the project mxcli is in place."
elif [ "$NEED_TOOLCHAIN" -eq 0 ] && [ "$NEED_MXCLI" -eq 0 ]; then
ok "--install: nothing to download — a runnable mxbuild and the project mxcli are in place"
elif [ -z "$PROJECT_DIR" ]; then
bad "--install needs a project directory: bin/doctor.sh --install <project-dir>"
Expand Down Expand Up @@ -1606,7 +1648,7 @@ GATE_OK=1
# Studio Pro install (the root mxbuild and the bundled JRE are discovered under).
if [ -n "$SP_APP" ]; then
ok "Studio Pro install: $SP_APP"
elif [ "$PLATFORM" = linux ]; then
elif [ "$PLATFORM" = linux ] || [ "$PLATFORM" = wsl ]; then
warn "no Studio Pro install (none exists for Linux)."
note "A standalone mxbuild works instead: bin/doctor.sh --install <project-dir> downloads"
note "one to ~/.mxcli (the container build's toolchain), or set MXBUILD_PATH=/path/to/mxbuild."
Expand All @@ -1617,13 +1659,14 @@ else
note "the mxbuild gate; you still need Studio Pro to open the model yourself)."
else
bad "no Studio Pro install found — mxbuild and its bundled Java live inside it."
note "Two ways out:"
note " 1. No Studio Pro needed for the gate: bin/doctor.sh --install <project-dir>"
note " downloads the standalone toolchain (same one the headless container build uses)."
note " 2. Install Mendix Studio Pro, or point past the discovery:"
note "On $PLATFORM the gate needs Studio Pro's own mxbuild: the Mendix CDN publishes Linux"
note "mxbuild only, so 'doctor.sh --install' cannot download one that runs here. Two ways out:"
note " 1. Install Mendix Studio Pro in the app's version, or point past the discovery:"
note " MENDIX_APP=<install root> (macOS: /Applications/Mendix Studio Pro X.Y.Z.app,"
note " Windows: C:/Program Files/Mendix/X.Y.Z)"
note " MXBUILD_PATH=<mxbuild binary> JAVA_HOME=<jdk/jre root>"
note " 2. Work in the Dev Container (Docker Desktop) or a cloud container, where the"
note " downloaded Linux mxbuild runs."
fi
fi

Expand Down Expand Up @@ -1651,8 +1694,13 @@ else
bad "mxbuild not found/executable: ${MXBUILD:-<none>}"
fi
note "Have Studio Pro? Point at it: MENDIX_APP=<its version folder> in toolkit.env (see above)."
note "No Studio Pro: bin/doctor.sh --install <project-dir> downloads a standalone mxbuild,"
note "like the container build. MXBUILD_PATH=<path to mxbuild> also works."
if [ "$PLATFORM" = linux ] || [ "$PLATFORM" = wsl ]; then
note "No Studio Pro: bin/doctor.sh --install <project-dir> downloads a standalone mxbuild,"
note "like the container build. MXBUILD_PATH=<path to mxbuild> also works."
else
note "No Studio Pro: on $PLATFORM there is no download that runs (the CDN mxbuild is Linux only) —"
note "install Studio Pro, or use the Dev Container. MXBUILD_PATH=<path to mxbuild> also works."
fi
fi

# Cached runtime complete? (#692) mxcli takes a runtime on its launcher jar alone; an incomplete one
Expand Down Expand Up @@ -2002,7 +2050,9 @@ if [ -n "$PROJECT_DIR" ]; then
[ -n "$MPR" ] && ok "model: ${MPR#$PROJECT_DIR/}" || {
warn "no .mpr found in the project root"
note "If the model lives elsewhere, point doctor at the folder that contains it;"
note "a brand-new project gets its .mpr from 'mxcli init' or a Studio Pro export."; }
note "a brand-new project gets its .mpr from Studio Pro (New app > Blank, saved in this folder)"
note "or from './mxcli new <Name> --version X.Y.Z --output-dir <empty folder>' — 'mxcli init'"
note "creates no app. Run 'new' BEFORE 'init': it refuses a folder that is not empty and runs init itself."; }
PMXCLI_PROBE="$(find_project_mxcli 2>/dev/null || true)"
_wf=""; [ -n "$PMXCLI_PROBE" ] && _wf="$(mxtk_mxcli_wrong_format "$PMXCLI_PROBE" 2>/dev/null)"
if [ -n "$_wf" ]; then
Expand Down Expand Up @@ -2038,6 +2088,12 @@ if [ -n "$PROJECT_DIR" ]; then
# Claude Code permissions (2026-10-06): which profile intake Q12 picked, whether the
# settings files carry it, and what a project file cannot do. Greps only — no Python here.
head_ "Claude Code permissions: $PROJECT_DIR"
# Only where Claude Code is. Another agent (Codex, Copilot, Cursor, OpenCode, ...) never reads
# .claude/, so a WARN here sent its user to install hooks that cannot fire (field run 2026-11-16).
if ! command -v claude >/dev/null 2>&1 && [ ! -d "$HOME/.claude" ] && [ -z "${MXTK_CLAUDE:-}" ]; then
note "skipped — Claude Code is not installed on this machine. These checks cover Claude Code only;"
note "other agents start from AGENTS.md, which mxcli init writes. (MXTK_CLAUDE=1 runs them anyway.)"
else
PERM_PROFILE="$("$TOOLKIT_ROOT/bin/permission-profile.sh" "$PROJECT_DIR" 2>/dev/null)"
PERM_FROM="$("$TOOLKIT_ROOT/bin/permission-profile.sh" "$PROJECT_DIR" --explain 2>/dev/null | sed -n 's/^from: //p')"
ok "profile: ${PERM_PROFILE:-?} (from: ${PERM_FROM:-?})"
Expand Down Expand Up @@ -2089,6 +2145,7 @@ if [ -n "$PROJECT_DIR" ]; then
note "your own default mode (~/.claude/settings.json): ${_um:-not set, so the Claude Code built-in default applies}"
note "No prompts at all is your call, not the project's: set it in ~/.claude/settings.json, or start"
note "'claude --dangerously-skip-permissions' only inside a container/VM. Deny/ask rules still apply."
fi

# Property sets (#295) — see the header above ps_check. A full run checks (read-only);
# --quick (what exec.sh runs when the mxcli version changes) only compares the receipt
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
**Repo:** `mendixlabs/mxcli`
**Source:** field run 2026-11-16 — Windows 11, mxcli **v0.32.0** `init`, VS Code in its default per-user location, project folder under OneDrive (path with spaces). Code read on `main` at 121c9b5.
**Status:** NOT YET FILED
**Severity:** Low — cosmetic; the extension can be installed by hand. Hits the default Windows install.

---

# `mxcli init`: VS Code extension install fails when `code.cmd` and the project path both contain spaces

## Observed (verbatim)

```
Warning: VS Code extension install failed: exit status 1
'C:\Users\<user>\AppData\Local\Programs\Microsoft' is not recognized as an internal or external command,
operable program or batch file.
```

## Cause (hypothesis, consistent with the message)

`findCodeCLI` returns `%LOCALAPPDATA%\Programs\Microsoft VS Code\bin\code.cmd`, and
`installVSCodeExtension` runs `exec.Command(codeCLI, "--install-extension", vsixPath, "--force")`.
A `.cmd` runs under `cmd.exe /c`. When the command line holds more than two quote characters —
here both the `code.cmd` path and `vsixPath` (`<project>\.claude\vscode-mdl.vsix`, under OneDrive)
need quotes — `cmd.exe` strips the first and last quote, and the program path breaks at the
first space: `...\Programs\Microsoft`.

## Suggested fix

Run through `cmd.exe /s /c ""<code.cmd>" --install-extension "<vsix>" --force"` with
`SysProcAttr.CmdLine` set explicitly, or call `Code.exe` with `resources\app\out\cli.js` directly
(what `code.cmd` does), avoiding the batch layer. Repro: a project path with a space, VS Code
installed per-user, `code` not on PATH.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
**Repo:** `mendixlabs/mxcli`
**Source:** field run 2026-11-16 — Windows 11, Git Bash, mxcli **v0.32.0**, no Studio Pro, no Docker, an empty project folder under OneDrive. Code read on `main` at 121c9b5 (2026-11-15).
**Status:** NOT YET FILED
**Severity:** Medium — no data loss; costs an ~800 MB download and a session, and ends without a reason.

---

# `mxcli new` on Windows/macOS without Studio Pro downloads the Linux mxbuild, which cannot run there

## Summary

`mxcli new <Name> --version X.Y.Z` resolves `mx` through `docker.ResolveMxForNewProject`, which
falls back to `DownloadMxBuild` when no local Studio Pro of that version exists. The Mendix CDN
publishes **Linux** mxbuild only, so on Windows and macOS that download can never yield a
runnable `mx`. `mxcli setup mxbuild` and `run --local` already know this
(`NativeMxBuildForSetup`, issue #916) and refuse up front with a clear hint; `new` does not.

## Observed

`mxcli new <Name> --version 11.11.0 --output-dir "$PWD"` started the MxBuild download, stopped
with no further step output and no error line, and left a partial cache
(`~/.mxcli/mxbuild/11.11.0`, 373 MB) and an empty folder. Whether the stop was the agent
harness ending the command or mxcli itself is **not proven**; either way the run could not have
succeeded, because what it was downloading is a Linux ELF.

## Expected

On a non-Linux host with no Studio Pro of the requested version, fail before downloading, with
the same guidance `setup mxbuild` gives: install Studio Pro X.Y.Z, or `--mxbuild-path`, or run
inside the Dev Container / a Linux host.

## Suggested fix

In `ResolveMxForNewProject`, call `NativeMxBuildForSetup(runtime.GOOS, version)` before
`DownloadMxBuild` and return its error + guidance on non-Linux hosts (the pattern
`resolveMxBuildForLocalOn` already uses).
25 changes: 25 additions & 0 deletions bug-logs/pending-github-issues/mxcli-new-version-discovery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**Repo:** `mendixlabs/mxcli`
**Source:** field run 2026-11-16 — Windows 11, mxcli **v0.32.0**, an agent setting up an empty folder. Code read on `main` at 121c9b5.
**Status:** NOT YET FILED
**Severity:** Low — feature request; a first-time user (or agent) has no way to find a valid `--version`.

---

# `mxcli new`: no way to discover a valid `--version`

## Observed (verbatim)

```
Error: --version is required (e.g., --version 11.8.0)
Error: no MxBuild archive published for Mendix 99.0.0 (tried https://cdn.mendix.com/runtime/mxbuild-99.0.0.tar.gz and a CDN listing of mxbuild-99.0.0.*)
```

The agent only got past this by trying a version it found in an unrelated example. `new` already
lists published releases when the *major.minor* exists (`CDNReleasesFor`), but prints nothing when
it does not, and there is no command that lists them up front.

## Requested

- `mxcli new --list-versions` (or `mxcli versions`): the releases the CDN publishes, newest first.
- `--version latest` / `--version lts`, resolved through the same listing.
- When the major.minor is unknown, print the newest published majors instead of nothing.
Loading
Loading