Skip to content

Commit 97c9d89

Browse files
committed
fix(interaction-model): accept Module.Entity (note), split the malformed remedy, read "Homes" headings (#291 review)
Review fixes for #333: - Page parameter accepts a trailing parenthesised note after Module.Entity (`Puffin.Dashboard (new)`); `Puffin Dashboard` and `Puffin.Dashboard or none` still FAIL. design-artifacts.md Step 3 says a trailing (note) is allowed. - A Page parameter line that is there but malformed gets its own remedy (write the bare Module.Entity, optionally with a (note), or none — <reason>); the add-the-line remedy stays for a missing block or line. - An interaction-model FAIL at Stage 3 also says "; also: no Stage-3 CONFIRMED decision" when the register has none. - A heading naming "homes" (e.g. "Homes and inboxes") and a `Home` column read as the Role homes table; a heading naming both is read both ways, so inbox detection matches exactly the headings it did before. Fixture cases T15-T18 (each fails on the previous head). Re-run against the six Stage-3 worker outputs with a Stage-3 CONFIRMED row: S1, S3, PA2, PA3 PASS; S2, PA1 MANUAL (unmatched actor names). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018LeNWZV2sVH62vkgfYh5u5
1 parent c90aad0 commit 97c9d89

5 files changed

Lines changed: 67 additions & 15 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m
1919

2020
## Unreleased
2121

22-
- 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` 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. Fixture cases T13–T14. A field run on a client project is still owed — field retro (#291)
22+
- 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)
2323
- fix(exec): **a write no longer leaves units that changed only in XPath whitespace for the reviewer to read.** mxcli v0.27.0's `alter entity … rename attribute` rewrote 135 units in 20 unrelated modules that way (mendixlabs/mxcli#1596; fixed upstream in v0.29.0, ako/mxcli#1506, so this is insurance for projects on v0.27–v0.28). `exec.sh` now runs `model-scope.py restore` after the write (MDL and `--patch`) and before the mxbuild gate, so the gate checks the final model; it prints the real changes per module and puts a `scope:` note in the BUILD-LOG row. It never blocks: a failure is a warning, `MXTK_NO_SCOPE=1` skips it, and it is skipped when `FORCE_EXEC` let the write run over uncommitted model changes. No pre-commit refusal (maintainer decision on #593): `model-scope.py check --staged` stays available to run by hand. Fixture `tests/wave2/test-model-scope.sh` section F. Ported from #593 onto current master — saingge
2424
- learn(demo): **`skills/live-demo-autopilot.md` — run the demo live, not as a video**: Playwright drives the real app through scripted scenes, captions carry a WHY line, a control panel lets the presenter pause and take over, redo or skip; plus the traps that each broke a run (trial licence stops the runtime 2–4 h after start, 6-session cap and proving a logout freed its slot by the `System.Session` count, demo sign-in tiles kept out of any deployed build, focus-stealing panel pausing the run, SIGTERM closing the browser before sign-out). Field: a desktop+phone offline manufacturing demo (4/4 scenes) and a three-app process-hub demo (28/28 with an app killed mid-run and an 11 min pause), 2026-10 — Maurits Visser
2525
- docs(bug-ledger): **32 ledger entries now say what mxcli v0.22–v0.29 changed about them, before anyone re-runs an old workaround**: 22 are fixed upstream per the mxcli changelog or source (among them BUG-121 terminators, BUG-141 workflow PersistentId, BUG-151 `rest call body $Var`, BUG-100 shared Docker stack, BUG-94 role visibility, BUG-128 module-role idempotence) and 10 changed shape or are partly fixed (BUG-154; BUG-04 no automatic module role since v0.27, BUG-WF04/WF05 named call arguments since v0.25, BUG-130/131 vs the v0.27 `exec` rollback). Each gets an "Upstream status" line naming the version, the issue and what to retest; none is closed or archived, because none was retested — the ledger archives only after a retest. Also corrects `BUG-DRAFT-audit-member-access-ce0066`: commit `2455ee9f` first shipped in v0.23.0, not v0.22. Source: mxcli v0.29 compatibility audit 2026-10-30

‎bin/gate-check.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,9 @@ check_stage_3() {
12781278
# that) and ADOPTED/WAIVED leave this verdict alone; a finding is something examined and wrong.
12791279
# A FAIL returns here; a MANUAL only replaces a PASS, so it never hides the register FAIL below.
12801280
if [ "${MXTK_IM_STATUS:-}" = "FAIL" ]; then
1281-
echo "FAIL|interaction model: ${MXTK_IM_NOTE} — each finding is listed under 'Interaction model (stage 3 facts)' (skills/interaction-model.md)"; return
1281+
local im_also=""
1282+
if ! reg_unavailable && ! has_confirmed_decision 3; then im_also="; also: no Stage-3 CONFIRMED decision"; fi
1283+
echo "FAIL|interaction model: ${MXTK_IM_NOTE} — each finding is listed under 'Interaction model (stage 3 facts)' (skills/interaction-model.md)${im_also}"; return
12821284
fi
12831285
if reg_unavailable; then reg_unavailable_note; return; fi
12841286
if has_confirmed_decision 3; then

‎bin/lib/interaction-model-check.sh‎

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,24 +101,27 @@ IM_EOF
101101
}
102102

103103
# _im_tables <interaction-model.md> — one awk pass over the artifact:
104-
# HOME<TAB>role<TAB>home rows of the table under a "Role homes" heading
104+
# HOME<TAB>role<TAB>home rows of the table under a heading naming "homes" ("Role homes",
105+
# "Homes and inboxes")
105106
# INBOX<TAB>line every non-blank line (table row, bullet, prose) under any heading
106-
# naming "Inbox" — the skill's own Step 2 writes inboxes as bullets
107+
# naming "Inbox" — the skill's own Step 2 writes inboxes as bullets.
108+
# A heading naming both ("Homes and inboxes") is read both ways.
107109
# Cells are trimmed and stripped of backticks and bold. CRLF files read like LF ones. The Role /
108-
# Home page columns are found by header name, so a reordered table still reads.
110+
# Home page (or Home) columns are found by header name, so a reordered table still reads.
109111
_im_tables() {
110112
awk '
111113
function clean(s) { gsub(/`/, "", s); gsub(/\*\*/, "", s); gsub(/^[ \t]+|[ \t]+$/, "", s); return s }
112114
{ sub(/\r$/, "") }
113115
/^#+[ \t]/ {
114116
h = tolower($0)
115117
sec = ""
116-
if (h ~ /role homes/) sec = "home"
117-
else if (h ~ /inbox/) sec = "inbox"
118+
if (h ~ /homes/) sec = "home"
119+
if (h ~ /inbox/) sec = (sec == "home" ? "both" : "inbox")
118120
hdr = 0; next
119121
}
120122
sec == "" { next }
121-
sec == "inbox" { if ($0 ~ /[^ \t]/) printf "INBOX\t%s\n", clean($0); next }
123+
sec != "home" && /[^ \t]/ { printf "INBOX\t%s\n", clean($0) }
124+
sec == "inbox" { next }
122125
!/^[ \t]*\|/ { hdr = 0; next }
123126
{
124127
line = $0
@@ -128,7 +131,7 @@ _im_tables() {
128131
for (i = 2; i < n; i++) {
129132
c = tolower(clean(cell[i]))
130133
if (c == "role") rc = i
131-
if (c == "home page") hc = i
134+
if (c == "home page" || c == "home") hc = i
132135
}
133136
next
134137
}
@@ -302,7 +305,7 @@ IM_EOF
302305
fi
303306

304307
# ── (c): every wireframe carries its page-parameter line ──────────────────────────────────
305-
local wfs=() wf n_wf=0 n_wf_ok=0 n_wf_fail=0 state val name why
308+
local wfs=() wf n_wf=0 n_wf_ok=0 n_wf_fail=0 n_wf_bad=0 state val name why
306309
for wf in "$base"/design/wireframes/*.html; do [ -s "$wf" ] && wfs+=("$wf"); done
307310
if [ "${#wfs[@]}" -gt 0 ]; then
308311
while IFS= read -r row; do
@@ -315,9 +318,9 @@ IM_EOF
315318
NOBLOCK) why="no wf-contract block" ;;
316319
NOLINE) why="its wf-contract block has no \"Page parameter:\" line" ;;
317320
VALUE)
318-
if printf '%s' "$val" | grep -Eq '^[A-Za-z_][A-Za-z0-9_]*\.[A-Za-z_][A-Za-z0-9_]*$'; then :
321+
if printf '%s' "$val" | grep -Eq '^[A-Za-z_][A-Za-z0-9_]*\.[A-Za-z_][A-Za-z0-9_]*( \(.*\))?$'; then :
319322
elif printf '%s' "$val" | grep -Eq '^none (—|–|-) [^ ]'; then :
320-
else why="\"Page parameter: $val\" is neither Module.Entity nor \"none — <reason>\""
323+
else why="\"Page parameter: $val\" is neither Module.Entity (optionally with a trailing (note)) nor \"none — <reason>\""
321324
fi ;;
322325
esac
323326
if [ -z "$why" ]; then n_wf_ok=$((n_wf_ok+1))
@@ -328,13 +331,17 @@ IM_EOF
328331
n_fail=$((n_fail+1))
329332
lines="$lines FAIL wireframe $name — $why (design-artifacts.md Step 3)"$'\n'
330333
n_wf_fail=$((n_wf_fail+1))
334+
[ "$state" = VALUE ] && n_wf_bad=$((n_wf_bad+1))
331335
fi
332336
done <<IM_EOF
333337
$(_im_wireframes "${wfs[@]}")
334338
IM_EOF
335339
fi
336340

337-
if [ "$n_wf_fail" -gt 0 ]; then
341+
if [ "$n_wf_bad" -gt 0 ]; then
342+
lines="$lines remedy: a Page parameter line that is there but malformed takes the bare Module.Entity, optionally with a trailing (note), or none — <reason> (design-artifacts.md Step 3)"$'\n'
343+
fi
344+
if [ "$n_wf_fail" -gt "$n_wf_bad" ]; then
338345
lines="$lines remedy: add <p>Page parameter: Module.Entity</p> (or: none — <reason>) to each wireframe's wf-contract block (design-artifacts.md Step 3), or waive one in the register: \"Waived artifact interaction-model/<file>.html: <reason>\" — wireframes drawn before the interaction model existed are expected to land here"$'\n'
339346
fi
340347

‎skills/design-artifacts.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ Each wireframe is assembled from Step 1's components — never restyled from scr
248248
</div>
249249
```
250250

251-
The value is the qualified entity (`Module.Entity`) or `none — <reason>`, in exactly that form
252-
(a later gate parses the line). `none` is a statement, not a blank: it says the page is a list, a
251+
The value is the qualified entity (`Module.Entity`, a trailing `(note)` allowed) or `none — <reason>`,
252+
in exactly that form (a later gate parses the line). `none` is a statement, not a blank: it says the page is a list, a
253253
home or a singleton. The `wf-` prefix makes the block annotation, so `page-fidelity.js` does not score it as
254254
page content and `assemble-prototype.js` hides it behind **Show bindings**. Draw the screen as the
255255
role named there, with that role's menu.

‎tests/wave2/test-interaction-model-gate.sh‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,49 @@ OUT="$(run "$P")"
289289
case "$(imline "$OUT")" in *"2 of 2 BRD actors"*) ok "Reviewer (note) covers Reviewer" ;; *) bad "$(imline "$OUT")" ;; esac
290290
case "$(stage3 "$OUT")" in *": PASS"*) ok "stage 3 passes" ;; *) bad "stage 3: $(stage3 "$OUT")" ;; esac
291291

292+
echo "== T15: Module.Entity with a trailing (note) is valid; prose around the entity is not =="
293+
P="$(mkproj t15)"; W="$(base_of "$P")/design/wireframes"
294+
wf "$W/note.html" ' <p>Page parameter: Sales.Order (new, Customer set)</p>'
295+
wf "$W/space.html" ' <p>Page parameter: Sales Order</p>'
296+
wf "$W/or.html" ' <p>Page parameter: Sales.Order or none</p>'
297+
OUT="$(run "$P")"
298+
case "$OUT" in *"FAIL wireframe note.html"*) bad "trailing (note) rejected" ;; *) ok "Sales.Order (note) accepted" ;; esac
299+
case "$OUT" in *"FAIL wireframe space.html"*) ok "'Sales Order' rejected" ;; *) bad "'Sales Order' accepted" ;; esac
300+
case "$OUT" in *"FAIL wireframe or.html"*) ok "'Sales.Order or none' rejected" ;; *) bad "'Sales.Order or none' accepted" ;; esac
301+
case "$(imline "$OUT")" in *"3 of 5 wireframes"*) ok "3 of 5 wireframes valid" ;; *) bad "$(imline "$OUT")" ;; esac
302+
303+
echo "== T16: a malformed value gets the write-it-bare remedy; a missing line keeps the add remedy =="
304+
P="$(mkproj t16)"; wf "$(base_of "$P")/design/wireframes/Bad.html" ' <p>Page parameter: the order</p>'
305+
OUT="$(run "$P")"
306+
case "$OUT" in *"remedy: "*"malformed"*"bare Module.Entity"*"(note)"*"none — <reason>"*) ok "malformed remedy says write the bare value" ;; *) bad "no malformed remedy: $(printf '%s\n' "$OUT" | grep 'remedy:')" ;; esac
307+
case "$OUT" in *"remedy: add <p>Page parameter:"*) bad "add-the-line remedy printed for a line that exists" ;; *) ok "add remedy not printed for a malformed-only project" ;; esac
308+
P="$(mkproj t16b)"; wf "$(base_of "$P")/design/wireframes/NoLine.html" ' <p>Parameter: Sales.Order</p>'
309+
OUT="$(run "$P")"
310+
case "$OUT" in *"remedy: add <p>Page parameter:"*) ok "missing line keeps the add remedy" ;; *) bad "add remedy lost" ;; esac
311+
case "$OUT" in *"malformed"*) bad "malformed remedy printed for a missing line" ;; *) ok "no malformed remedy for a missing line" ;; esac
312+
313+
echo "== T17: an interaction-model FAIL also names a missing Stage-3 CONFIRMED decision =="
314+
P="$(mkproj t17)"; B="$(base_of "$P")"
315+
grep -v '^| UC002' "$B/design/interaction-model.md" > "$B/x" && mv "$B/x" "$B/design/interaction-model.md"
316+
sed 's/CONFIRMED 2026-10-14/ASSUMED 2026-10-14/' "$P/PROJECT.md" > "$P/x" && mv "$P/x" "$P/PROJECT.md"
317+
OUT="$(run "$P")"
318+
case "$(stage3 "$OUT")" in *": FAIL"*"interaction model"*"also: no Stage-3 CONFIRMED decision"*) ok "both problems in the verdict" ;; *) bad "stage 3: $(stage3 "$OUT")" ;; esac
319+
P="$(mkproj t17b)"; B="$(base_of "$P")"
320+
grep -v '^| UC002' "$B/design/interaction-model.md" > "$B/x" && mv "$B/x" "$B/design/interaction-model.md"
321+
OUT="$(run "$P")"
322+
case "$(stage3 "$OUT")" in *"also: no Stage-3"*) bad "suffix printed with a CONFIRMED decision" ;; *": FAIL"*) ok "no suffix when the decision is there" ;; *) bad "stage 3: $(stage3 "$OUT")" ;; esac
323+
324+
echo "== T18: a 'Homes and inboxes' heading with a Home column reads as homes and inboxes =="
325+
P="$(mkproj t18)"; B="$(base_of "$P")"
326+
printf '# Interaction model\n\n## Homes and inboxes\n\n| Role | Home | Inbox |\n|---|---|---|\n| Manager | `Order_Overview` | none |\n| Reviewer | `Review_Inbox` | UC002 Approve order |\n\n%s' "$PAGES" > "$B/design/interaction-model.md"
327+
OUT="$(run "$P")"
328+
case "$(imline "$OUT")" in *"2 of 2 BRD actors"*"1 of 1 BRD approval"*) ok "homes and inbox both read from the combined table" ;; *) bad "$(imline "$OUT")" ;; esac
329+
case "$(stage3 "$OUT")" in *": PASS"*) ok "stage 3 passes" ;; *) bad "stage 3: $(stage3 "$OUT")" ;; esac
330+
P="$(mkproj t18b)"; B="$(base_of "$P")"
331+
printf '# Interaction model\n\n## Role homes\n\n| Role | Home | Comes to do |\n|---|---|---|\n| Manager | `Order_Overview` | x |\n| Reviewer | `Review_Inbox` | UC002 Approve order |\n\n%s' "$PAGES" > "$B/design/interaction-model.md"
332+
OUT="$(run "$P")"
333+
case "$OUT" in *"FAIL task F001/UC002"*) ok "a homes-only heading is still not an inbox" ;; *) bad "Role homes table counted as an inbox: $(imline "$OUT")" ;; esac
334+
292335
rm -rf "$WORK"
293336
echo ""
294337
echo "test-interaction-model-gate: $PASS passed, $FAIL failed"

0 commit comments

Comments
 (0)