Skip to content

Commit e95653f

Browse files
committed
Merge remote-tracking branch 'origin/master' into feat/interaction-model-gate-v2
# Conflicts: # CHANGELOG.md
2 parents 6adfb45 + 125d7f4 commit e95653f

16 files changed

Lines changed: 355 additions & 55 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m
2020
## Unreleased
2121

2222
- new(gate-check, interaction-model): **Stage 3 now fails on an interaction model that leaves out a user task or a wireframe's page parameter, and asks about BRD actors with no home** ([#291](https://github.com/MendixMau/mxcli-project-toolkit/issues/291), part 2). Once `design/interaction-model.md` exists, `bin/lib/interaction-model-check.sh` (called by `gate-check.sh`) lists one FAIL per BRD approval/review/sign-off/user-task use case not named on any line (row or bullet) under an Inbox heading, and per `design/wireframes/*.html` without a `Page parameter:` line (`Module.Entity`, a trailing `(note)` allowed, or `none — <reason>`) in its `wf-contract` block; any of them fails Stage 3. A BRD actor with no "Role homes" row is MANUAL (confirm it is a user role, or add a `none — <reason>` row), never FAIL. Findings are waived by hand in the register (`Waived artifact interaction-model/<unit>: reason`); a project adopted above stage 3 reports ADOPTED. A new `artifact-manifest.tsv` row reports the artifact PENDING when it is absent, which does not block. `checkpoint-design.md` asks "who lands where, and how does each role find its work" next to the layout question; `brd-to-build-plan.md` Step 7 reads wire points from the artifact. Fixture `tests/wave2/test-interaction-model-gate.sh` (synthetic trees only). Brought up to date with master 2026-11-03; run against six Stage-3 worker outputs, which found two defects, both fixed: a MANUAL role finding no longer hides the "no Stage-3 CONFIRMED decision" FAIL (it was reported MANUAL, exit 2), and a role cell with a trailing note in parentheses (`Owner (signed-in …)`) now names the role. After review: a "Homes and inboxes" heading with a `Home` column reads as the Role homes table. Fixture cases T13–T18. A field run on a client project is still owed — field retro (#291)
23+
- fix(lint-gate, conformance-check): **loosening a ratchet baseline needs the user's own command (#348)**: `--approved-in-chat` was a flag the agent whose script caused the rise could type itself. Now `lint-gate.sh --update-baseline` that raises any rule count, and `conformance-check.sh --update-baseline` that turns an OK row into a non-OK one, ask for `loosen` typed at a terminal; an agent's tool call (and Claude Code's `!` prefix) has none, so it is refused with the exact command for the user to run in their own terminal window. Deleting the baseline first no longer dodges it: the write is compared with the one git HEAD holds. Tightening, a first baseline, newly seeded conformance rows and check runs are unchanged; `--approved-in-chat` still parses and is ignored. No terminal (cloud/web session): the user edits the baseline file and commits it — the commit is the approval, and a committed baseline is the bar with no prompt. The prompt times out after 300s (`MXTK_LOOSEN_TIMEOUT`) and refuses, so a pty-backed harness (Cursor / VS Code) cannot hang on it; a conformance check run with its baseline deleted says `git checkout -- <baseline>` first. Stale `--approved-in-chat` / agent-runs-it hints dropped from the SEC014 notice, `lint-rules/`, the rename notes and `doctor.sh`. Not covered: a pty wrapper faking a terminal, or an uncommitted hand edit of the baseline (git shows it). New fixture `tests/wave2/test-baseline-loosen-lock.sh` (24 checks; 6 of the review-fix cases fail before them). Smaller rewrite of #375 — external reviewer feedback (2026-10-14)
2324
- process(roadmap): **RM-02 — every toolkit release is measured for build speed and token cost**: a parked roadmap entry from cook-off ProcureFlow run 2 (2026-10-26/27: 0.93 scripts per plan row, 18.3 min of lint + score after every exec, 40,161 tokens of fixed load per call with 0 Skill and 0 MCP calls), with what to build (a per-release speed benchmark, a cost and reader per exec step, cadence over repetition, quiet output, lean sessions), its trigger and exit bar; its Assets table records what has already landed (#581, #582, #586, #587, #589–#591, #596, #597). On-demand file, 0 baseline words — MendixMau (#580)
2425
- docs(doctor-triage): **the `~/.mxcli/mxbuild/` cache lane is no longer called Linux-only**: on macOS it held a working Mach-O arm64 build for 11.14.0, while 10.24 and 11.12 downloads were ELF. The lane table now says to run `file` on the cached `mx` before calling the lane unavailable (#525). — AlvinnYeo (report)
2526
- fix(_common): **an `export KEY=value` line in `toolkit.env` now sets KEY**: `mxtk_load_env` squeezed all whitespace out of the key, so `export MENDIX_APP=...` set a variable named `exportMENDIX_APP` and the override did nothing, although the function's own comment says that form works. `KEY = "value"` also kept its quotes (the quote strip ran before the trim); the trim now runs first. Pure bash, no extra process per line. Fixture `tests/wave2/test-common-windows.sh` case 4b (#579). — triage of #579

‎agents/gate-agent.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ This table is your whole list. The baseline table in the project's CLAUDE.local.
102102
get the per-document list behind a rise. Name each rule that rose, the documents behind it,
103103
and whether the rise belongs to the script under review or to earlier debt. A rise is a FAIL
104104
for the script even when mxbuild is clean. Never re-baseline to turn a row green — that is
105-
the user's decision, made in chat; `--update-baseline` refuses a rise without `--reason`, a
106-
security-tier rise (SEC*, CONV006) also without `--approved-in-chat`, and logs each one to
105+
the user's decision: `--update-baseline` refuses a rise without `--reason`, and without the
106+
user typing `loosen` in their own terminal (an agent's call has none), and logs each one to
107107
`.claude/lint-acceptances.tsv`. A row reading `LINT BLIND` is an instrument fault (a rule
108108
inspected nothing), not a rise: name the rule and its configuration fix. `LINT BLIND: rules
109109
reverted to stock (…)` means `mxcli init` re-seeded the toolkit rules and lint did not run:

‎bin/doctor.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2283,7 +2283,9 @@ if [ -n "$PROJECT_DIR" ] && [ -f "$_lb" ] && [ -n "$_lb_now" ]; then
22832283
note " the next bin/lint-gate.sh --update-baseline records it; nothing to do until lint actually rises."
22842284
else
22852285
note "lint baseline was taken with mxcli $_lb_was; this is $_lb_now. New built-in rules can raise lint."
2286-
note " after reviewing the new findings: bin/lint-gate.sh --update-baseline --reason \"mxcli $_lb_now built-in rules\""
2286+
note " after reviewing the new findings, the user runs in their own terminal (and types loosen):"
2287+
note " bin/lint-gate.sh --update-baseline --reason \"mxcli $_lb_now built-in rules\""
2288+
note " no terminal (cloud/web session): the user edits the baseline and commits it; the commit is the approval."
22872289
fi
22882290
fi
22892291
fi

‎bin/lib/install-lint-rules.sh‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ _mxtk_lint_migrate_renames() {
331331
echo " current template replaces it."
332332
if grep -q '^PROJECT_MODULES = ()' "$_rn_f"; then
333333
echo " It was the old template with PROJECT_MODULES empty, so it inspected nothing. The new one"
334-
echo " defaults to \"*\" and will report: review its findings, then"
335-
echo " bin/lint-gate.sh --update-baseline --reason \"$_rn_nid now configured\""
334+
echo " defaults to \"*\" and will report: review its findings, then the user runs, in their own"
335+
echo " terminal, bin/lint-gate.sh --update-baseline --reason \"$_rn_nid now configured\""
336+
echo " and types loosen (or commits the edited baseline); an agent's run is refused."
336337
fi
337338
rm -f "$_rn_f"
338339
fi
@@ -446,7 +447,8 @@ RNEOF
446447
if [ "${_rn_a:-0}" -gt 0 ]; then
447448
echo "NOTE: .claude/lint-baseline.json holds $_rn_oid as a count only ($_rn_a; written before findings were"
448449
echo " recorded), so the toolkit rule's findings cannot be told from mxcli's built-in $_rn_oid. Not"
449-
echo " changed. Re-baseline: bin/lint-gate.sh --update-baseline --reason \"$_rn_oid renamed $_rn_nid\""
450+
echo " changed. Re-baseline (the user, in their own terminal, then types loosen; or commit the"
451+
echo " edited baseline): bin/lint-gate.sh --update-baseline --reason \"$_rn_oid renamed $_rn_nid\""
450452
echo " (Said once.)"
451453
[ "$_rn_dry" -eq 1 ] || echo "$_rn_oid counts-only" >> "$_rn_notes"
452454
fi ;;

‎bin/lib/sec014-notice.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ mxtk_sec014_notice() {
5454
echo " external_roles: \"RoleA, RoleB\" # one text, not a YAML list"
5555
echo "\"none\" (or SEC014 enabled: false) switches this security rule off: only on the user's answer in chat, recorded in"
5656
echo "PROJECT.md — never to silence this notice. The first configured run raises SEC014 0 -> N, so"
57-
echo "re-baseline right after: bin/lint-gate.sh --update-baseline --reason \"SEC014 configured\" --approved-in-chat"
57+
echo "re-baseline right after: bin/lint-gate.sh --update-baseline --reason \"SEC014 configured\""
58+
echo "(the user runs it in their own terminal and types loosen, or commits the edited baseline)."
5859
return 0
5960
}

‎lint-rules/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ asked in chat. `external_roles: "none"` switches off a security rule, and so doe
221221
`rules: SEC014: enabled: false`. Either one is set only on the user's answer and recorded as a
222222
decision row in `PROJECT.md`. An agent never sets one to make the NOTE go away. The first run after configuring raises SEC014 from 0 to N at once, and lint-gate
223223
would blame that security-tier rise on whatever script ran next. So re-baseline in the same step:
224-
`bin/lint-gate.sh --update-baseline --reason "SEC014 configured" --approved-in-chat`, after the
225-
user has seen the findings.
224+
`bin/lint-gate.sh --update-baseline --reason "SEC014 configured"`, which the user runs in their
225+
own terminal and answers `loosen` (or commits the edited baseline), after seeing the findings.
226226
227227
**Tuning a toolkit rule never means editing it.** `conv009` and `sec014` read their settings
228228
with `get_option()` from `.claude/lint-config.yaml` (`rules: <RULE_ID>: options:`), so the file

‎lint-rules/sec014_external_role_write.star‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# finding here would make lint-gate exit PASS-BLIND on every exec of every synced project until
4444
# someone answers a question — the #229 pattern. The silence is not a pass: the sync names it.
4545
# After configuring, SEC014 jumps 0 -> N in one run; re-baseline right then
46-
# (lint-gate.sh --update-baseline --reason "SEC014 configured" --approved-in-chat), or the
46+
# (lint-gate.sh --update-baseline --reason "SEC014 configured"), or the
4747
# rise is blamed on whatever script runs next.
4848
#
4949
# SELF-CHECKS (configured but unusable: the rule must say so, never report a clean pass):

‎project-bin/conformance-check.sh‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,43 @@ KEYED="$(printf '%s\n' "$RESULTS" | awk -F'\t' '{print $1"\t"$2"\t"$5}')"
425425
# whole dropped every other module's baseline, and their regressions went unmeasured with
426426
# nothing said (card-disbursement build, 2026-09-26: `--update-baseline --module MockServices`
427427
# dropped the 127 Disbursement rows).
428+
#
429+
# LOOSENING IS THE USER'S OWN COMMAND (#348). A rewrite that turns an OK row into a non-OK one
430+
# accepts a regression, so it asks for `loosen` typed at a terminal; an agent's tool call has none
431+
# and is refused with the command to hand the user. A baseline deleted from the tree is compared
432+
# with git HEAD's (a check run then says `git checkout -- <baseline>` first). The prompt times out
433+
# after 300s (MXTK_LOOSEN_TIMEOUT) and refuses. No terminal (cloud/web session): the user edits
434+
# the baseline and commits it; the commit is the approval, and the committed file is the bar with
435+
# no prompt. Seeding new rows and rewrites that loosen nothing are unchanged.
428436
if [ "$UPDATE_BASELINE" -eq 1 ] || [ ! -f "$BASELINE" ]; then
437+
_was="$(cat "$BASELINE" 2>/dev/null || git show "HEAD:./$BASELINE" 2>/dev/null || true)"
438+
LOOSENED="$(printf '%s\n' "$KEYED" | awk -F'\t' 'NR==FNR { if ($3=="OK") ok[$1"\t"$2]=1; next }
439+
($1"\t"$2) in ok && $3!="OK" { print " " $1 " " $2 " was OK, now " $3 }' <(printf '%s\n' "$_was") -)"
440+
if [ -n "$LOOSENED" ]; then
441+
echo "conformance-check: this baseline write LOOSENS it — rows that were OK and are not now:" >&2
442+
printf '%s\n' "$LOOSENED" >&2
443+
_conf_refuse() { # $1 = why there is no answer (no terminal / no answer in time)
444+
if [ "$UPDATE_BASELINE" -eq 0 ] && [ ! -f "$BASELINE" ]; then
445+
echo "conformance-check: REFUSED — $BASELINE was deleted; restore it first:" >&2
446+
echo " git checkout -- $BASELINE" >&2
447+
echo " then re-run. If the regressions above are really to be accepted:" >&2
448+
else
449+
echo "conformance-check: REFUSED — accepting a regression is the user's call, and $1." >&2
450+
fi
451+
echo " User: run this yourself in your own terminal window (not through the agent, not via" >&2
452+
echo " Claude Code's ! prefix), then type \`loosen\` when asked:" >&2
453+
echo " bin/conformance-check.sh${MODULE:+ --module $MODULE} --update-baseline" >&2
454+
echo " No terminal (cloud/web session)? You edit the baseline file yourself and commit it;" >&2
455+
echo " the commit is the approval ($BASELINE, the rows named above)." >&2
456+
echo " Or fix the build so these rows are OK again. Tightening never asks." >&2
457+
exit 2
458+
}
459+
[ -t 0 ] || _conf_refuse "there is no terminal here"
460+
printf "Type 'loosen' to accept these regressions (anything else cancels): " >&2
461+
# -t 300: a pty-backed agent harness (Cursor / VS Code terminal) has a terminal nobody answers.
462+
read -r -t "${MXTK_LOOSEN_TIMEOUT:-300}" _ans || { [ $? -gt 128 ] && _conf_refuse "nobody answered within ${MXTK_LOOSEN_TIMEOUT:-300}s"; _ans=""; }
463+
[ "$_ans" = loosen ] || { echo "conformance-check: not accepted; baseline unchanged." >&2; exit 2; }
464+
fi
429465
if [ -n "$MODULE" ] && [ -f "$BASELINE" ]; then
430466
{ awk -F'\t' -v m="$MODULE" '$1!=m' "$BASELINE"; printf '%s\n' "$KEYED"; } \
431467
| sed '/^$/d' | sort > "$BASELINE.tmp" && mv "$BASELINE.tmp" "$BASELINE"

‎project-bin/exec.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,9 +1248,9 @@ PY
12481248
LINT_DETAIL="lint rose: +${_thisn} new or unfixed (${_thisc:-0} carried from earlier execs): ${_rest#* }"
12491249
echo " ✗ lint: ${_thisn} finding(s) new this script or still unfixed from an earlier one — read each one:"
12501250
case "$_thisnew" in *$'\n'*) printf '%s\n' "${_thisnew#*$'\n'}" ;; esac
1251-
echo " Fix the script and re-run. Accepting the debt is the user's call, made in chat:"
1252-
echo " bin/lint-gate.sh --update-baseline --reason \"<why>\" (a security-tier rise also"
1253-
echo " needs --approved-in-chat). The acceptance is logged to .claude/lint-acceptances.tsv."
1251+
echo " Fix the script and re-run. Accepting the debt is the user's call: THE USER runs"
1252+
echo " bin/lint-gate.sh --update-baseline --reason \"<why>\" in their own terminal and types"
1253+
echo " \`loosen\` (#348). The acceptance is logged to .claude/lint-acceptances.tsv."
12541254
fi
12551255
fi ;;
12561256
2) if [ "$_L_NOBASE" = 1 ]; then

0 commit comments

Comments
 (0)