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(status, agents): **`bin/status.sh` WATCHes an Agent Editor project whose extension module does not travel with the model (#778)**: Studio Pro reads `agenteditor.agent` from `modules/AgentEditor.mxmodule` beside the `.mpr`, and a sync of only `.mpr` + `mprcontents/` left it out of git, so the builder stayed green while every colleague's clone showed `unknown type 'agenteditor.agent'`. Two WATCH items, warn-only (exit code and every verdict unchanged), local files and `git ls-files` only, root and `app/` layouts: a `modules/*.mxmodule` git does not track, and a project using Agent Editor (`AgentEditorCommons` in `analysis/app-facts/inventory.json`, or a `create agent` statement in `mdlsource/`) with no `modules/AgentEditor*.mxmodule`. `skills/mendix-agents.md` (on demand) gains the rule plus the note that the GenAI key, `Encryption.EncryptionKey` and `GenAICommons.StoreTraces` belong in the Default configuration, not a start script. Empty agent references / missing model version (mendixlabs/mxcli#1867) and unset runtime constants are not checked: they need a captured agent document (option 2). Fixture `tests/wave2/test-status-extension-modules.sh` — field report from an Agent Editor project, Nov 2026
- 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
Expand Down
35 changes: 34 additions & 1 deletion bin/status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,45 @@ case "$_cur" in 6|7) [ "$_ts_remotes" -eq 0 ] && \
esac
[ -n "$_ts_ahead" ] && TS_WATCH="${TS_WATCH:+$TS_WATCH · }Team Server has commits made outside the toolkit: $_ts_ahead (as of the last fetch) is in no local branch — recover per skills/platform-link.md §3"

# --- extension modules travel with the model (#778) ------------------------------------------
# Studio Pro reads extension document types (agenteditor.agent) from modules/*.mxmodule next to
# the .mpr. A Marketplace install writes that file; a sync of only .mpr + mprcontents/ leaves it
# behind, so the builder stays green and every colleague's clone shows "unknown type
# 'agenteditor.agent'" (field 2026-11). Two WATCH items, never a verdict, local files only:
# (1) a modules/*.mxmodule the model's git repo does not track; (2) the project uses Agent Editor
# (AgentEditorCommons in analysis/app-facts/inventory.json, or a `create agent` statement in
# mdlsource/) but no modules/AgentEditor*.mxmodule sits beside the .mpr. Both layouts: root, app/.
# Agent references and runtime constants are NOT checked here (needs a captured agent document).
AE_WATCH=""; _ae_used=0
if grep -qE '"name": *"AgentEditorCommons"' "$PROJECT_DIR/analysis/app-facts/inventory.json" 2>/dev/null \
|| { [ -d "$MDL_DIR" ] && grep -rqiE --include='*.mdl' '^[[:space:]]*create[[:space:]]+(or[[:space:]]+(replace|modify)[[:space:]]+)?agent([[:space:]]|$)' "$MDL_DIR" 2>/dev/null; }; then
_ae_used=1
fi
_ae_untracked=""; _ae_missing=""
for _md in "$PROJECT_DIR" "$PROJECT_DIR/app"; do
ls "$_md"/*.mpr >/dev/null 2>&1 || continue
_rel="${_md#"$PROJECT_DIR"}"; _rel="${_rel#/}"; _rel="${_rel:+$_rel/}"
if git -C "$_md" rev-parse --git-dir >/dev/null 2>&1; then
for _mm in "$_md"/modules/*.mxmodule; do
[ -f "$_mm" ] || continue
git -C "$_md" ls-files --error-unmatch -- "modules/${_mm##*/}" >/dev/null 2>&1 && continue
_ae_untracked="${_ae_untracked:+$_ae_untracked, }${_rel}modules/${_mm##*/}"
done
fi
if [ "$_ae_used" = 1 ]; then
_hit=0; for _mm in "$_md"/modules/AgentEditor*.mxmodule; do [ -f "$_mm" ] && _hit=1; done
[ "$_hit" = 0 ] && _ae_missing="${_ae_missing:+$_ae_missing, }${_rel}modules/AgentEditor.mxmodule"
fi
done
[ -n "$_ae_untracked" ] && AE_WATCH="extension module not in git: $_ae_untracked — a clone loses its document types; commit it with the model (skills/mendix-agents.md)"
[ -n "$_ae_missing" ] && AE_WATCH="${AE_WATCH:+$AE_WATCH · }project uses Agent Editor but $_ae_missing is missing — Studio Pro shows unknown type 'agenteditor.agent' (skills/mendix-agents.md)"

# --- print ----------------------------------------------------------------------------------
TK="toolkit $TK_COMMIT_NOW"; [ -n "$TK_COMMIT_REG" ] && [ "$TK_COMMIT_REG" != "$TK_COMMIT_NOW" ] && TK="$TK (register says $TK_COMMIT_REG)"
[ -n "$TK_UPD" ] && TK="$TK · updates: $TK_UPD"
WATCH=""
for _w in "$STAGE_STALE" "${APPROVED_OVER:+APPROVED OVER A FAILING GATE: $APPROVED_OVER}" "$DONE_STALL" "${BP_STALE%% (*}" \
"$( [ "${PH_TOTAL:-0}" -gt 0 ] && [ "$EAC" = 0 ] && echo "agent slots unfilled: $PH_TOTAL in $PH_FILES file(s)" )" "$PACK_GAP" "$LINT_UNVERSIONED" "$TS_WATCH"; do
"$( [ "${PH_TOTAL:-0}" -gt 0 ] && [ "$EAC" = 0 ] && echo "agent slots unfilled: $PH_TOTAL in $PH_FILES file(s)" )" "$PACK_GAP" "$LINT_UNVERSIONED" "$TS_WATCH" "$AE_WATCH"; do
[ -n "$_w" ] && WATCH="${WATCH:+$WATCH · }$_w"
done
if [ "$BRIEF" = 1 ]; then
Expand Down
16 changes: 16 additions & 0 deletions skills/mendix-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,21 @@ version. Three things the field run taught:

→ `skills/agents-examples/single-call.example.mdl`, `skills/agents-examples/single-call.agent.json`

## A colleague's clone must run it too

**Commit `modules/*.mxmodule` with the model.** Studio Pro reads the `agenteditor.agent`
document type from `modules/AgentEditor.mxmodule` beside the `.mpr`. The Marketplace install
writes it; a sync of only `.mpr` + `mprcontents/` drops it, and with it every extension type.
Failure: the builder's copy is green, and after a plain `git pull` a colleague's Studio Pro shows
`unknown type 'agenteditor.agent'` on every agent. `bin/status.sh` WATCHes an untracked
`.mxmodule`, and a project using Agent Editor with none (#778).

**The GenAI key and the constants it needs live in the project, not a start script.** Set the
key constant, plus what startup needs once a key is present (`Encryption.EncryptionKey`,
`GenAICommons.StoreTraces = true`), in the Default configuration (never a real key in git: a placeholder plus where to get it). Failure: the key
existed only as an environment variable the builder's start script set, so a colleague running
from Studio Pro got a blank key at runtime. No check covers this yet; read the configuration.

## Never commit a client export

Real exports carry client-identifying content — system prompts naming the client, tool
Expand All @@ -264,3 +279,4 @@ before committing, or keep the export outside the repo. See `anonymize-client-ap
- [ ] KB loaders use `AddKnowledgeBaseChunk` + `Embed_Replace` + guarded metadata
- [ ] Read-only status stated explicitly in the system prompt, if it applies
- [ ] Verified by **reading data back**, not by a green exec log
- [ ] `modules/*.mxmodule` committed; key and required constants set in the Default configuration
103 changes: 103 additions & 0 deletions tests/wave2/test-status-extension-modules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/usr/bin/env bash
# test-status-extension-modules.sh — bin/status.sh WATCHes when an extension module
# (modules/*.mxmodule) does not travel with the model, or a project using Agent Editor has none (#778).
#
# Usage: bash tests/wave2/test-status-extension-modules.sh bin/status.sh
#
# The defect: Studio Pro reads the agenteditor.agent document type from modules/AgentEditor.mxmodule
# beside the .mpr. A model sync that copies only .mpr + mprcontents/ leaves it out of git, so the
# builder stays green and every colleague's clone shows "unknown type 'agenteditor.agent'".
#
# T1 root layout, modules/AgentEditor.mxmodule untracked -> WATCH names modules/AgentEditor.mxmodule
# T2 root layout, the same file committed -> no extension WATCH
# T3 two-tree (app/ inside the root repo), untracked -> WATCH names app/modules/AgentEditor.mxmodule
# T4 two-tree, app/ its own repo, committed there -> no extension WATCH
# T5 root, mdlsource has `create agent`, no .mxmodule -> WATCH: uses Agent Editor but ... missing
# T6 two-tree, inventory.json lists AgentEditorCommons, none -> WATCH names app/modules/AgentEditor.mxmodule missing
# T7 no agents, no .mxmodule, no git -> no extension WATCH
# T8 the full screen carries the same WATCH
# T9 mdlsource only mentions `create agent` in a comment and a string -> no Agent Editor WATCH
#
# GOLDEN INPUT: PROJECT.md is the real bin/init-project.sh scaffold; tracked/untracked is whatever
# this machine's git reports. inventory.json is printed in the json.dump(indent=1) shape app-facts.sh
# writes (its own output, not mxcli's). gate-check.sh is stubbed silent in the toolkit copy.
export MXTK_LEAKGUARD_DENYFILE="${TMPDIR:-/tmp}/mxtk-fixture-denylist.$$"
export MXTK_NO_GUIDE=1 MXTK_SYNC_SKIP_CLONE_CHECK=1
set -uo pipefail
SUT="${1:?usage: test-status-extension-modules.sh /path/to/bin/status.sh}"
case "$SUT" in /*) ;; *) SUT="$PWD/$SUT" ;; esac
SRC="$(cd "$(dirname "$SUT")/.." && pwd)"

W="$(mktemp -d "${TMPDIR:-/tmp}/statusxm.XXXXXX")" || exit 2
trap 'rm -rf "$W"; rm -f "$MXTK_LEAKGUARD_DENYFILE"' EXIT
PASS=0; FAIL=0
ok() { PASS=$((PASS+1)); printf ' ok %s\n' "$1"; }
bad() { FAIL=$((FAIL+1)); printf ' FAIL %s\n' "$1"; [ -n "${2:-}" ] && printf '%s\n' "$2" | sed 's/^/ FAIL-detail: /'; }
g() { git -C "$1" -c user.name=t -c user.email=t@t "${@:2}"; }

mkdir -p "$W/tk"
(cd "$SRC" && tar --exclude=.git --exclude=node_modules -cf - .) | (cd "$W/tk" && tar -xf -)
cp "$SUT" "$W/tk/bin/status.sh"
printf '#!/usr/bin/env bash\nexit 0\n' > "$W/tk/bin/gate-check.sh"
mkproj() { # mkproj <name> <model subdir: "" or app> -> project root; .mpr in <root>/<subdir>
local d="$W/proj-$1" m="$W/proj-$1${2:+/$2}"; mkdir -p "$m"; : > "$m/Fixture.mpr"
"$W/tk/bin/init-project.sh" "$d" >/dev/null 2>&1
echo "$d"
}
addmod() { mkdir -p "$1/modules"; printf 'PK-fixture\n' > "$1/modules/AgentEditor.mxmodule"; }
watch() { bash "$W/tk/bin/status.sh" "$1" --brief 2>&1; }

echo "== bin/status.sh extension-module WATCH (#778) =="
P="$(mkproj t1 '')"; g "$P" init -q; addmod "$P"
out="$(watch "$P")"
case "$(grep '^WATCH' <<<"$out")" in
*"extension module not in git: modules/AgentEditor.mxmodule"*) ok "T1 root, untracked: WATCH names modules/AgentEditor.mxmodule" ;;
*) bad "T1 want the untracked-module WATCH" "$out" ;;
esac

P="$(mkproj t2 '')"; g "$P" init -q; addmod "$P"; g "$P" add -- modules/AgentEditor.mxmodule; g "$P" commit -qm m
out="$(watch "$P")"
if grep -qE 'extension module|uses Agent Editor' <<<"$out"; then bad "T2 committed module must not WATCH" "$out"; else ok "T2 root, committed: no extension WATCH"; fi

P="$(mkproj t3 app)"; g "$P" init -q; addmod "$P/app"
out="$(watch "$P")"
case "$(grep '^WATCH' <<<"$out")" in
*"extension module not in git: app/modules/AgentEditor.mxmodule"*) ok "T3 two-tree, untracked: WATCH names app/modules/AgentEditor.mxmodule" ;;
*) bad "T3 want the untracked-module WATCH under app/" "$out" ;;
esac

P="$(mkproj t4 app)"; g "$P/app" init -q; addmod "$P/app"; g "$P/app" add -- modules/AgentEditor.mxmodule; g "$P/app" commit -qm m
out="$(watch "$P")"
if grep -qE 'extension module|uses Agent Editor' <<<"$out"; then bad "T4 app/ repo with committed module must not WATCH" "$out"; else ok "T4 two-tree, app/ own repo, committed: no extension WATCH"; fi

P="$(mkproj t5 '')"; g "$P" init -q; mkdir -p "$P/mdlsource"
printf "create agent Support.HelpAgent (\n Title: 'Help'\n);\n" > "$P/mdlsource/310-agent.mdl"
out="$(watch "$P")"
case "$(grep '^WATCH' <<<"$out")" in
*"project uses Agent Editor but modules/AgentEditor.mxmodule is missing"*) ok "T5 root, create agent, no .mxmodule: missing WATCH" ;;
*) bad "T5 want the missing-module WATCH" "$out" ;;
esac

P="$(mkproj t6 app)"; mkdir -p "$P/analysis/app-facts"
# the shape json.dump(indent=1, sort_keys=True) gives app-facts.sh's inventory (python3 -c prints it)
printf '{\n "modules": [\n {\n "kind": "own",\n "name": "MyFirstModule"\n },\n {\n "kind": "marketplace",\n "name": "AgentEditorCommons"\n }\n ]\n}' \
> "$P/analysis/app-facts/inventory.json"
out="$(watch "$P")"
case "$(grep '^WATCH' <<<"$out")" in
*"project uses Agent Editor but app/modules/AgentEditor.mxmodule is missing"*) ok "T6 two-tree, inventory lists AgentEditorCommons: missing WATCH under app/" ;;
*) bad "T6 want the missing-module WATCH under app/" "$out" ;;
esac

P="$(mkproj t7 '')"
out="$(watch "$P")"
if grep -qE 'extension module|uses Agent Editor' <<<"$out"; then bad "T7 no agents, no git must not WATCH" "$out"; else ok "T7 no agents, no .mxmodule, no git: no extension WATCH"; fi

P="$(mkproj t9 '')"; g "$P" init -q; mkdir -p "$P/mdlsource"
printf -- "-- TODO: create agent later\ncreate microflow Support.Note () begin\n log info node 'App' 'please create agent first';\nend;\n" > "$P/mdlsource/320-note.mdl"
out="$(watch "$P")"
if grep -q 'uses Agent Editor' <<<"$out"; then bad "T9 a comment or string mentioning create agent must not WATCH" "$out"; else ok "T9 create agent only in a comment and a string: no Agent Editor WATCH"; fi

out="$(bash "$W/tk/bin/status.sh" "$W/proj-t1" 2>&1)"
if grep -q '^WATCH .*extension module not in git' <<<"$out"; then ok "T8 full screen: same WATCH"; else bad "T8 full screen lacks the WATCH" "$out"; fi

echo "-- $PASS passed, $FAIL failed"; [ "$FAIL" -eq 0 ]
Loading