Skip to content

doctor + sync: say when the speed fixes never reached a project - #597

Merged
MendixMau merged 2 commits into
masterfrom
fix/doctor-stale-speed-scripts
Oct 30, 2026
Merged

MendixMau merged 2 commits into
masterfrom
fix/doctor-stale-speed-scripts

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

A colleague analysed his ExpenseTracker build after the toolkit update. It still showed a full mxbuild on every change: 45.5 min in total, 57% of all exec time. His project's bin/ had 15 scripts that differ from the toolkit, among them exec.sh and lint-gate.sh. sync-project.sh never overwrites a hand-edited copy, so the speed work (#587, #590) never reached his project, and nothing said so.

What changes

  1. doctor, Machine health. The check looks at bin/exec.sh, bin/_common.sh and bin/lint-gate.sh. If one lacks its speed-fix marker, doctor warns "speed fixes not active in this project: older local copy of bin/…". The markers are gate_kind_decide, mxtk_mx_check_to_mxbuild and lint-receipt-ok. The warning uses advise, so the exit code doesn't change.
  2. doctor, Recommended fix. The fix now leads with sync-project.sh <project> --upgrade-bin …. When exec.sh is stale, the command always upgrades its _common.sh with it, and each copy is backed up. This comes before the Gate-mode, sync-folder and machine-speed advice, because until the scripts are current every bench number measures the old path.
  3. sync-project.sh known_fix_note. It now names the speed fixes on a hand-edited exec.sh that has the exit-code fix (fail_rc) but no gate_kind_decide. It does the same for a _common.sh that has _mxtk_has_model but no mxtk_mx_check_to_mxbuild. Older copies keep their existing, older note.
  4. skills/speed-setup.md. Taking the current scripts is now the first fix. Claude shows each local edit in one line and asks before replacing anything.

Evidence

  • Field run. I used the real pre-Exec speed: mx check gate by default, doctor performance check, Windows overhead fixes (#584, #585) #587 exec.sh, _common.sh and lint-gate.sh, taken from a4d701af^, with a local edit added to exec.sh.
    • doctor names all three and prints the upgrade command.
    • sync --dry-run names the speed fixes on exec.sh and auto-refreshes the two unedited copies.
  • test-doctor-bench: 72/0. New case 8d covers:
    • a stale exec.sh is named;
    • a current lint-gate.sh is not;
    • the upgrade command comes before the Gate-mode advice;
    • no warning once the script is current.
  • test-bug12-sync: 64/0. New case T1c checks that the speed note fires and the exit-code note stays silent.
  • Checks: check-scripts, check-portability, the leak guard and check-pr-discipline are all clean.

Risk

  • More warnings after the pull. Every project with an older edited exec.sh now gets one more WARN line and a different first Recommended fix. That is the intent; the exit code is unchanged.
  • Marker greps. The check could miss a hand-edited copy that kept the marker name but removed the logic.
  • Not run on Windows.

Generated by Claude Code

An older, locally edited bin/exec.sh, _common.sh or lint-gate.sh (no
speed-fix marker) gives a Machine health warning and leads the Recommended
fix with the exact sync-project.sh --upgrade-bin command. sync-project.sh
names the speed fixes on a hand-edited exec.sh/_common.sh.

Field: an ExpenseTracker analysis after the toolkit update still showed a
full mxbuild per change with 15 drifted scripts; reproduced with the real
pre-#587 scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jQvaonym9V1wKKfAEPmRr
--upgrade-bin alone runs the full sync (#390); the printed command now
installs only the named scripts. Field: the printed command on the stale
copy wrote 3 scripts + 3 backups, nothing else; doctor then quiet.

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

2 participants