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(permissions): **exec approval `auto` no longer prompts on every exec's mode check, and `install-claude-hooks.sh` no longer runs unprompted (#782)**: `install-claude-permissions.sh` now allow-lists `exec-approval.sh`, `interview-mode.sh` and `permission-profile.sh`, so their reads run without a prompt, while their only writers, `--set` and `--clear`, prompt through six `ask` rules (`Bash(*exec-approval.sh*--set*)`, …) in the shared settings under every profile (an ask rule beats an allow rule, `full`'s bare `Bash` included). `install-claude-hooks.sh`, which writes `~/.claude/settings.json` for every repo on the machine, gets no allow rule. A re-install adds the ask rules and removes the hooks-installer rule an earlier install added (sidecar); entries someone else wrote are untouched, and `sync-project.sh`'s permission check names both until then. Field run on claude 2.1.325: the read ran, `--set auto` and `--clear` were refused, and with the ask rules removed `--set` ran — from the two independent reviews of #781
- process(skills): **trim PR, moves only: always-loaded words 66,271 -> 64,984 (budget 80,000); Stage 5 test 21,906 -> 20,619, gate 22,954 -> 21,744, review 31,681 -> 30,394 (#783)**: `testing-shape.md` §5's stack and scratch-copy mechanics move verbatim to `e2e-harness-base.md` § Bringing the stack up (the rule and a one-line list of its rules stay in §5); the three new Unit false-green rows move to `unit-test.md` § False-green rows (a pointer row stays in the register); `module-review.md`'s re-shoot mechanics move to `iterative-build-loop.md` § Pipeline mode (the rule, the denominator and the failure example stay) and its MXTK-AI001 sentence to `marketplace-catalogue.md` § Reviewing a built module. Every removed line is in its destination, checked line by line — weekly word-budget audit (#783)
- fix(permissions): **`install-claude-permissions.sh` now writes one allow rule per script that exists, space form, `*` only at the end; the scripts that record a person's decision (`init-project.sh`, which installs permissions from the profile PROJECT.md names, `install-claude-permissions.sh`, `install-harness-permissions.sh`, `permission-profile.sh`, `exec-approval.sh`, `interview-mode.sh`) and the sourced `_*.sh` libraries get no allow rule and keep prompting (`Bash(./bin/gate-check.sh *)`, `Bash(bin/…)`, `Bash(bash bin/…)` shared; `Bash(<toolkit>/bin/<name>.sh *)` and one `mx` rule per installed `~/.mxcli/mxbuild/<ver>` local), replacing `Bash(./bin/*.sh:*)` and friends (#780)**: a `*` mixed with the trailing `:*` never matched — `claude doctor` 2.1.325 flags each as "matched as a literal prefix … will likely never match", and a real `claude -p` run was denied both `./bin/status.sh` and `./bin/status.sh --brief` under master's rules while `Bash(./bin/status.sh *)` ran both. Re-install removes the old entries through the existing sidecar and never touches foreign ones; `--check` (so `sync-project.sh`) names the ones it will remove and any script installed since. Also fixed: a run that pruned an entry dropped every addition in that same run (the prune rebound the allow list). Project-profile allow rules move to the space form; deny/ask unchanged; `doctor.sh` greps the new exec.sh spelling. Fixture `test-install-claude-permissions.sh` T12 — reported by toolkit users, relayed by the maintainer
- 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
Expand Down
23 changes: 18 additions & 5 deletions bin/install-claude-permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,14 @@ _script_rules() { # $1 = directory, $2... = prefixes ("./bin/", "bash bin/", ..
case "$n" in exec.sh|*[\*\ \(\)]*) continue ;; esac # exec.sh is listed first, always
# Scripts that record a person's decision about what the agent may do keep prompting: an
# allow rule would let an agent widen its own permissions (`--profile full` adds a bare
# `Bash`), set its own exec autonomy or interview mode. init-project.sh is one of them: it runs the
# harness installer with the profile PROJECT.md names, which an agent with Edit(/**) can change. Sourced libraries (`_*.sh`) are never run.
case "$n" in _*|init-project.sh|install-claude-permissions.sh|install-harness-permissions.sh|permission-profile.sh|exec-approval.sh|interview-mode.sh) continue ;; esac
# `Bash`). init-project.sh is one of them: it runs the harness installer with the profile
# PROJECT.md names, which an agent with Edit(/**) can change. install-claude-hooks.sh writes
# ~/.claude/settings.json, whose hooks fire in every repo on the machine (`--ceiling` blocks
# tool calls everywhere) (#782). Sourced libraries (`_*.sh`) are never run.
# exec-approval.sh, interview-mode.sh and permission-profile.sh ARE allowed: their plain read
# runs before every exec (#782). Their writers, `--set` and `--clear`, prompt through the
# DECISION_ASK rules below; an ask rule beats an allow rule, a bare `Bash` included.
case "$n" in _*|init-project.sh|install-claude-permissions.sh|install-harness-permissions.sh|install-claude-hooks.sh) continue ;; esac
for p in "$@"; do printf '%s\n' "Bash($p$n *)"; done
done
}
Expand Down Expand Up @@ -261,7 +266,15 @@ DENY=(
# that line, not a y/N an agent could type into a pty, is the gate. --file/--all stay denied.
# `--import` (the maintainer filing a mailed bundle with their own gh, no opt-in line) is denied
# too, --dry-run included: a deny rule is a glob with no negation, so it cannot spare the dry run.
ASK=()
# The writers of the three decision scripts allowed above (#782): `--set <value>` and `--clear`
# are their only state-changing arguments (there is no `--set=` form; anything else reads). Every
# profile gets these, `wrappers` included. They carry no machine path, so they are shared. One
# glob per writer covers every spelling: ./bin/, bin/, bash bin/, and the toolkit's absolute path.
DECISION_ASK=()
for _s in exec-approval.sh interview-mode.sh permission-profile.sh; do
DECISION_ASK+=( "Bash(*$_s*--set*)" "Bash(*$_s*--clear*)" )
done
ASK=( "${DECISION_ASK[@]}" )

# `project` profile: relative, committable, shared. mkdir/cp/mv/rm are not here — a Bash rule
# cannot be scoped to a folder; in Manual mode they prompt, in acceptEdits/auto mode Claude Code
Expand All @@ -283,7 +296,7 @@ if [ "$PROFILE" = project ] || [ "$PROFILE" = full ]; then
"Bash(python3 tests/*)" # portability-ok: a permission-rule string, not an interpreter call
)
# Prompt even in auto/bypass mode and even under `full`: hard to undo, or outside the project.
ASK=(
ASK+=(
"Bash(git push*--force*)"
"Bash(git push* -f*)"
"Bash(git reset --hard*)"
Expand Down
80 changes: 72 additions & 8 deletions tests/wave2/test-install-claude-permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ EXPECTED_SHARED=(
"Bash(mxcli *)"
)
# The entries that embed the absolute toolkit-root path -> the per-machine settings.local.json:
# two per toolkit script (exec.sh is the project's own copy, never the toolkit's; the scripts that
# record a person's decision and the sourced _*.sh libraries get none — #781 review).
# two per toolkit script (exec.sh is the project's own copy, never the toolkit's; the installers
# that record a person's decision and the sourced _*.sh libraries get none — #781 review, #782).
# exec-approval.sh, interview-mode.sh and permission-profile.sh are allowed; their --set/--clear
# prompt through ask rules (#782, T12).
EXPECTED_LOCAL=()
for _f in "$TOOLKIT_ROOT"/bin/*.sh; do
_n="${_f##*/}"
case "$_n" in exec.sh|_*|init-project.sh|install-claude-permissions.sh|install-harness-permissions.sh|permission-profile.sh|exec-approval.sh|interview-mode.sh) continue ;; esac
case "$_n" in exec.sh|_*|init-project.sh|install-claude-permissions.sh|install-harness-permissions.sh|install-claude-hooks.sh) continue ;; esac
EXPECTED_LOCAL+=( "Bash($TOOLKIT_ROOT/bin/$_n *)" "Bash(bash $TOOLKIT_ROOT/bin/$_n *)" )
done

Expand Down Expand Up @@ -393,10 +395,12 @@ import json, os, re, sys
mode, args = sys.argv[1], sys.argv[2:]
cut = args.index("--") if "--" in args else len(args)
files, cmds = args[:cut], args[cut + 1:]
rules = []
rules, asks = [], []
for f in files:
if os.path.exists(f):
rules += [r for r in json.load(open(f)).get("permissions", {}).get("allow", []) if r.startswith("Bash")]
perms = json.load(open(f)).get("permissions", {})
rules += [r for r in perms.get("allow", []) if r.startswith("Bash")]
asks += [r for r in perms.get("ask", []) if r.startswith("Bash")]
def match(rule, cmd):
if rule == "Bash":
return True
Expand All @@ -416,6 +420,15 @@ if mode == "match":
for c in miss:
print(" no rule matches: " + c)
sys.exit(1 if miss else 0)
if mode in ("runs", "asks"): # an ask rule beats an allow rule (docs: deny > ask > allow)
def runs(c):
return any(match(r, c) for r in rules) and not any(match(r, c) for r in asks)
def asked(c):
return any(match(r, c) for r in asks)
wrong = [c for c in cmds if not (runs(c) if mode == "runs" else asked(c))]
for c in wrong:
print(" " + ("prompts: " if mode == "runs" else "no ask rule matches: ") + c)
sys.exit(1 if wrong else 0)
PY
}
P12="$WORK/p780"; mkdir -p "$P12/bin" "$HOME/.mxcli/mxbuild/11.12.0/modeler"
Expand All @@ -439,9 +452,33 @@ py_get_allow "$P12/.claude/settings.json" | grep -qF "mxbuild" \
&& bad "T12: a per-machine mxbuild rule leaked into the shared settings.json" \
|| ok "T12: mxbuild rules stay in settings.local.json"
{ py_get_allow "$P12/.claude/settings.json"; py_get_allow "$P12/.claude/settings.local.json"; } \
| grep -E 'init-project\.sh|install-claude-permissions\.sh|install-harness-permissions\.sh|permission-profile\.sh|exec-approval\.sh|interview-mode\.sh|/_[a-z]+\.sh' \
&& bad "T12: an allow rule lets the agent run a script that records a person's decision, or a sourced library" \
|| ok "T12: permission/approval/interview-mode scripts and _*.sh libraries keep prompting (#781 review)"
| grep -E 'init-project\.sh|install-claude-permissions\.sh|install-harness-permissions\.sh|install-claude-hooks\.sh|/_[a-z]+\.sh' \
&& bad "T12: an allow rule lets the agent run an installer that records a person's decision, or a sourced library" \
|| ok "T12: init-project, the permission and hooks installers, and _*.sh libraries keep prompting (#781 review, #782)"
# #782: the decision scripts' reads run unprompted (exec-approval.sh is read before every exec);
# their writers --set/--clear prompt in every spelling, under every profile.
TK="$TOOLKIT_ROOT/bin"
py_rules runs "$P12/.claude/settings.json" "$P12/.claude/settings.local.json" -- \
"$TK/exec-approval.sh $P12" "$TK/exec-approval.sh $P12 --explain" "bash $TK/exec-approval.sh $P12" \
"$TK/interview-mode.sh $P12 --explain" "$TK/interview-mode.sh $P12 --remote" "bash $TK/interview-mode.sh $P12" \
"$TK/permission-profile.sh $P12" "$TK/permission-profile.sh $P12 --explain" \
"./bin/exec-approval.sh ." "bin/interview-mode.sh . --explain" \
&& ok "T12: exec-approval/interview-mode/permission-profile reads are allowed (#782)" \
|| bad "T12: a read-only exec-approval/interview-mode/permission-profile call prompts (#782)"
DECIDE_WRITES=()
for _s in exec-approval.sh interview-mode.sh permission-profile.sh; do
DECIDE_WRITES+=( "$TK/$_s $P12 --set auto" "bash $TK/$_s $P12 --set full" "$TK/$_s $P12 --clear" \
"./bin/$_s . --set auto" "bin/$_s . --clear" "bash bin/$_s . --set unattended" )
done
py_rules asks "$P12/.claude/settings.json" "$P12/.claude/settings.local.json" -- "${DECIDE_WRITES[@]}" \
&& ok "T12: every --set/--clear of the three decision scripts hits an ask rule (#782)" \
|| bad "T12: a --set/--clear of a decision script is not behind an ask rule (#782)"
PF="$WORK/p782full"; mkdir -p "$PF"
"$SUBJECT" "$PF" --profile full >/dev/null 2>&1
py_get_allow "$PF/.claude/settings.local.json" | grep -qxF 'Bash' \
&& py_rules asks "$PF/.claude/settings.json" -- "${DECIDE_WRITES[@]}" \
&& ok "T12: under the full profile (bare Bash allowed) --set/--clear still ask (#782)" \
|| bad "T12: under the full profile an ask rule is missing (#782)"
"$SUBJECT" "$P12" --hooks-only --check >"$WORK/t12-hooks.out" 2>&1
grep -q "the next install removes" "$WORK/t12-hooks.out" \
&& bad "T12: --hooks-only --check lists allow entries as stale (it never prunes)" \
Expand Down Expand Up @@ -490,6 +527,33 @@ py_rules match "$M12/.claude/settings.json" -- ./bin/gate-check.sh && py_rules s
&& ok "T12: after migration a bare ./bin/gate-check.sh is allowed and no rule warns" \
|| bad "T12: after migration a bare call prompts or a rule still warns"

# #782 migration: a project installed by #781 (master 1e0c38a0) has an allow rule for
# install-claude-hooks.sh, recorded in the local sidecar, and no decision ask rules. Re-install
# removes the hooks rule it added, keeps an identical-looking foreign one in a second project,
# and adds the ask rules; --check names the stale rule and reports the ask rules missing.
M2="$WORK/m782"; mkdir -p "$M2/.claude"
HK="Bash($TOOLKIT_ROOT/bin/install-claude-hooks.sh *)"; HKB="Bash(bash $TOOLKIT_ROOT/bin/install-claude-hooks.sh *)"
printf '{"permissions": {"allow": ["Bash(make *)", "%s", "%s"]}}\n' "$HK" "$HKB" > "$M2/.claude/settings.local.json"
printf '{"allow": ["%s", "%s"], "deny": []}\n' "$HK" "$HKB" > "$M2/.claude/.mxtk-permissions-added-local.json"
"$SUBJECT" "$M2" --profile wrappers --check >"$WORK/t782c.out" 2>&1; rc782=$?
[ "$rc782" -ne 0 ] && grep -qxF " - $HK" "$WORK/t782c.out" && grep -qxF ' Bash(*exec-approval.sh*--set*)' "$WORK/t782c.out" \
&& ok "T12: --check on a #781 install names the stale hooks rule and the missing ask rules (#782)" \
|| bad "T12: --check on a #781 install does not name the stale hooks rule / missing ask rules (#782)"
"$SUBJECT" "$M2" --profile wrappers >"$WORK/t782m.out" 2>&1
py_get_allow "$M2/.claude/settings.local.json" | grep -qF 'install-claude-hooks.sh' \
&& bad "T12: re-install left the install-claude-hooks.sh allow rule it added (#782)" \
|| ok "T12: re-install removes the install-claude-hooks.sh allow rule it added (#782)"
py_get_allow "$M2/.claude/settings.local.json" | grep -qxF 'Bash(make *)' \
&& py_rules asks "$M2/.claude/settings.json" -- "$TK/exec-approval.sh $M2 --set auto" >/dev/null \
&& ok "T12: after the #782 migration foreign entries survive and --set asks" \
|| bad "T12: after the #782 migration a foreign entry is gone or --set does not ask"
F2="$WORK/f782"; mkdir -p "$F2/.claude"
printf '{"permissions": {"allow": ["%s"]}}\n' "$HK" > "$F2/.claude/settings.local.json"
"$SUBJECT" "$F2" --profile wrappers >/dev/null 2>&1
py_get_allow "$F2/.claude/settings.local.json" | grep -qxF "$HK" \
&& ok "T12: a hooks-installer rule someone else wrote (no sidecar record) is left alone (#782)" \
|| bad "T12: a foreign hooks-installer rule was removed (#782)"

# ══════════════════════════════════════════════════════════════════════════════════════════
# install-harness-permissions.sh — Copilot and Aider (Claude delegated, spot-checked only)
# ══════════════════════════════════════════════════════════════════════════════════════════
Expand Down
Loading