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 @@ -25,6 +25,7 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m
- process(obligations): **`bin/lib/obligations.tsv` gains column 10 `modes`, the same column, tokens and tokeniser as `artifact-manifest.tsv` (`migration,requirements,greenfield,existing-app-change`, read through artifact-check.sh's own `_art_entry_mode`, never a second copy of its mapping)**: a row the register's `Entry mode:` does not list reads `N/A — not owed (entry mode …)`, never PASS; no or unrecognised mode = owed. Every row lists all four modes today, so no verdict changes; the column lets a mode that genuinely skips a pass be excused by data instead of by absence. Fixture `test-obligation-quality-floor.sh` T9 — follow-up to #787
- fix(obligations): **`Must-haves: advisory` for projects already past Stage 5 when the must-haves row arrived (follow-up to #787)**: `sync-project.sh` writes one `Must-haves:` line into `PROJECT.md` when none exists, and only then: `advisory — joined at stage N before the must-haves row existed` when gate-check's derived Current stage or `Adopted at stage:` is 6 or 7, else `bound`. `init-project.sh` writes `bound` for new projects. An advisory project's `Obligation must-haves` row reads `ADVISORY` and is left out of the pending count; `bound` keeps PENDING. It is keyed on the written line, not the project's position: a position check would silence a new project the day it passed Stage 5 without the marks. Fixture `tests/wave2/test-must-haves-advisory.sh` — owner request at the review of #787
- fix(obligations): **a quality floor in every entry mode: no per-module obligation reads PASS by absence, and a new `must-haves` row owes one mode-independent checklist per module**: with no module brief and no verify run, `obligation-check.sh` printed `Obligation look PASS — no module has been opened for work yet; nothing owed` (and the same for fidelity, sweep, journeys) on a project that had built ~78 pages and reviewed 0. Now an empty planned scope falls back to the modules that hold built pages, read from the look ledger (`.claude/loop/look/owed.tsv`), else page statements in the project's `*.mdl` scripts, else `.claude/loop/page-scope.json`, each looked for at the root, `app/` and `apps/*/`; every module row reads PENDING with an `OWED BY WHAT WAS BUILT: N page(s) built in M module(s) (...), K of M module(s) discharged` line. A model that has been built on (exec rows in `docs/BUILD-LOG.md`, `*.mdl` scripts, or a derived stage at 5+) with no countable pages is one FAULT naming `bin/page-scope.sh`, never "0 pages"; a `.mpr` with no build evidence (a fresh scaffold) keeps master's PASS line, so `bin/status.sh` still reads `modules opened: 0`. `existing-app-change` never takes scope from `page-scope.json`, which lists the whole model. A project with briefs keeps every earlier verdict. `skills/must-haves.md` (new, on demand) is the single source of poc-build.md's 12-row must-have checklist, generalised to every build type, plus row 13: every region the design shows is on the built page, counted; `poc-build.md` points to it, `module-review.md` stage 5 requires its mark `docs/progress/must-haves/<Module>.md` (first line `13 of 13 rows ticked or NOT DONE with a reason`). Informational, like every obligation row: no gate verdict or exit code changes; synced projects at Stage 5+ gain one `must-haves` PENDING row per module. Always-loaded words 64,984 -> 65,032 (budget 80,000). Fixture `tests/wave2/test-obligation-quality-floor.sh` — two field runs, unattended and requirements-driven, Nov 2026
- process(exec, entry modes): **the entry mode is a declared fact every tool reads, and a pipeline-mode project no longer builds without a plan by default**: with no `Entry mode:` and no `Adopted at stage:` line (register or intake), `bin/status.sh` (both views, plus a NEXT rule), `bin/gate-check.sh`'s summary and every `bin/exec.sh` run print one banner, and the BUILD-LOG row is tagged `no entry mode declared`; warn-only. In `Entry mode: migration` or `requirements-driven`, the first MDL write with no plan evidence is refused ONCE (nothing locked, snapshotted or written; `verdict=refused`), remedy in one line: run stages 1–4, or `gate-check.sh --adopt 5 --reason ...`. Cleared by outside evidence (guard rule 6): adoption at 5+, a reasoned `Waived stage 4:`, gate-check's readout at Stage 5+, or `architecture/build-plan.md` plus a module brief (root or `apps/<App>/`); a re-run after the one refusal goes on, tagged `no plan`. Never refused: `a-la-carte` (new explicit mode: no pipeline, audit or tooling use; gate-check reads its stages WAIVED by mode), `greenfield`, `Build type: poc`, change an existing app, `--patch`. The one entry-mode tokeniser moves to `project-bin/_position.sh` (pure bash, no process starts; installed beside exec.sh, `bin/lib/entry-mode.sh` is now a shim) — identical output on 44 inputs against the old one. Runbook: greenfield's "stages 1–4 collapse to whatever plan the user already has" becomes a design front end (`poc-build.md` steps 1–4, then a short plan with a few lines per module); `design-artifacts.md` Step 2a adopts a supplied prototype by mapping every screen in `design/wireframes/PAGE-MAP.tsv`, and `ui-preflight-pages.md`'s wireframe STOP accepts a mapped prototype. Fixture `tests/wave2/test-entry-mode-plan-rule.sh` (single tree + `apps/<App>/`, register and intake captured from `init-project.sh`) — two field runs, Nov 2026, requirements-driven with a frozen spec and clickable prototypes: ~78 pages built with no plan or target
- 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)
Expand Down
14 changes: 13 additions & 1 deletion bin/gate-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ stage_waiver() {
case "$ENTRY_MODE" in
greenfield)
case "$st" in
1|2|3|4) printf 'mode|greenfield entry mode — stages 1–4 collapse into the plan the user already has (conversion-runbook.md → Entry Modes)\n'; return 0 ;;
1|2|3|4) printf 'mode|greenfield entry mode — stages 1–4 collapse into the design front end and short plan (conversion-runbook.md → Entry Modes)\n'; return 0 ;;
esac ;;
requirements-driven)
case "$st" in
Expand All @@ -743,6 +743,10 @@ stage_waiver() {
case "$st" in
7) printf 'mode|existing-app entry mode — the app is live and stays live; there is no cutover (existing-app-change.md → Deliverables)\n'; return 0 ;;
esac ;;
a-la-carte)
case "$st" in
[0-7]) printf 'mode|a-la-carte entry mode — no pipeline: audit or tooling use only (existing-app-assurance.md); declare another mode to run the stages\n'; return 0 ;;
esac ;;
esac
return 1
}
Expand Down Expand Up @@ -4119,6 +4123,14 @@ echo "not a gate failure and does not affect the exit code — it is a stage nob
echo ""
printf "Summary: %d passed · %d not started · %d waived · %d need attention · %d manual\n" \
"$N_PASS" "$N_PENDING" "$N_WAIVED" "$N_FAIL" "$N_MANUAL"
# Declared position (project-bin/_position.sh; conversion-runbook.md → Entry Modes). The field runs
# that built with no plan (2026-11) had neither line, and this summary read like any other.
# Warn-only, and never the script's last status: an `if`, not an `&&` chain, and the text read with
# a default — a scratch copy of this script without bin/lib/ (tests/wave2/test-bug06-freshness.sh)
# has no banner text, and an unbound variable under `set -u` aborted the run with exit 1.
if [ -z "$ENTRY_MODE" ] && [ -z "$ADOPTED_AT" ] && [ -n "${MXTK_POS_BANNER:-}" ]; then
printf '⚠ %s\n' "$MXTK_POS_BANNER"
fi

# The stage counts above are about STAGES. They say nothing about the per-module passes and the
# per-stage artifacts checked further up, and for a long time nothing down here did either — so
Expand Down
83 changes: 6 additions & 77 deletions bin/lib/entry-mode.sh
Original file line number Diff line number Diff line change
@@ -1,77 +1,6 @@
# entry-mode.sh — ONE tokeniser for the register's "Entry mode:" line.
#
# WHY THIS EXISTS. Two parsers (bin/gate-check.sh and bin/lib/artifact-check.sh) each
# carried the same unanchored-glob case:
#
# *greenfield*) ... ;; *requirement*) ... ;; *migration*) ... ;;
#
# Unanchored globs plus first-arm-wins means the token that appears EARLIEST IN THE
# CASE wins, not the one the line actually declares. "migration (not greenfield)"
# parsed as greenfield. The consumer stage_waiver() then excuses stages on that label
# with `mode` scope, and the manifest consumer marks rows N/A — so a misread here
# silently switches gates off. bin/status.sh used a third, anchored regex and so
# DISPLAYED the right mode while the gate acted on the wrong one, which is why this
# survived: the screen and the verdict disagreed and only the screen was read.
#
# The rule: match the documented multi-word phrase first, else take the FIRST word of
# the value and exact-match it against the known set.
# A value we do not recognise resolves to empty AND says so on stderr. Silence was
# the second half of the bug — a run could not tell you whether the mode had parsed.
#
# Unknown mode means every row applies and no stage is excused: louder, never quieter.

# entry_mode_token <raw> -> canonical token on stdout, "" if unrecognised.
#
# Canonical set: greenfield | requirements-driven | migration | existing-app-change
entry_mode_token() {
local raw="${1-}" v full
v="$(printf '%s' "$raw" | tr -d '\r' | tr '[:upper:]' '[:lower:]')"
# gate-check.sh's intake fallback passes the WHOLE answer line, not just the value —
# "answered: migration", "decision: requirements-driven", "assumed (2026-09-01):
# greenfield" — because that same line is re-parsed downstream for its qualifier.
# Strip the question-answer prefix (and the qualifier's OWN parenthetical, e.g. the
# date in "assumed (...)") here, before the trailing-parenthetical stripping below —
# doing it after would let that stripping treat "(2026-09-01)" as if it opened at the
# start of the value and eat everything from "assumed (" onward, value included. The
# register's bare value ("migration") has no such prefix and passes through untouched.
v="$(printf '%s' "$v" | sed -E 's/^[[:blank:]>*_-]*(answered|answer|a|decision|assumed)[[:blank:]]*(\([^)]*\))?[[:blank:]]*:[[:blank:]]*//')"
v="${v%%(*}" # drop a trailing parenthetical: "migration (not greenfield)"
v="${v%%,*}" # drop anything after the first comma
v="${v%%;*}" # ...or semicolon
# Trim leading/trailing noise, INCLUDING markdown emphasis markers on both ends
# ("**migration**", "_greenfield_") — the old trailing trim only stripped spaces,
# tabs and a period, so a bolded or italicised value never matched anything.
v="$(printf '%s' "$v" | sed 's/^[[:blank:]>*_-]*//; s/[[:blank:].*_-]*$//')"
full="$v"
# Documented multi-word phrases resolve on the WHOLE value, before the first-word
# truncation below: the runbook's own label for the fourth mode is "Change an existing
# app", whose first word is "change" and matches nothing. Matched as a phrase, not as a
# bare `*existing*` glob, so "Migration from an existing Oracle Forms system" still reads
# as migration (its own first word) rather than being waived as an existing-app change.
case "$full" in
*"change an existing app"*|*"existing app change"*|*"existing-app change"*)
echo "existing-app-change"; return ;;
esac

# First word only — space, tab, or "/" as a separator ("migration/brownfield" reads
# as migration, its own leading declaration, not as an unrecognised compound value).
v="${v%%[ /]*}"
# ...and trim emphasis/punctuation off THAT word too. The whole-value trim above only
# reaches the value's last character, so "**Migration**. Evidence: 409 .java files"
# (an auto-mode intake answer, #634) left the first word as "migration**." and the mode
# silently vanished. Re-trimming after the cut is what makes the header's "bolded
# values are handled" true for a bolded value with prose after it.
v="$(printf '%s' "$v" | sed 's/^[*_]*//; s/[.:!*_-]*$//')"

case "$v" in
greenfield) echo "greenfield" ;;
requirements-driven|requirements|requirement) echo "requirements-driven" ;;
migration) echo "migration" ;;
existing-app-change|existing-app|existing) echo "existing-app-change" ;;
"") echo "" ;;
*)
printf 'entry mode "%s" not recognised; no stage is excused\n' "$raw" >&2
echo ""
;;
esac
}
# entry-mode.sh — shim. The ONE tokeniser for the register's "Entry mode:" line now lives in
# project-bin/_position.sh, because the installed exec.sh needs it too and cannot reach bin/lib/
# (2026-11-17). Sourcing this file defines the same entry_mode_token() it always did, plus the
# position reader (mxtk_pos_read) and the banner. Why there is only one tokeniser: the header
# of project-bin/_position.sh.
. "$(cd "$(dirname "${BASH_SOURCE[0]}")/../../project-bin" && pwd)/_position.sh"
4 changes: 3 additions & 1 deletion bin/lib/install-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ MXTK_AGENTS_STAGE_BUILD="mdl-agent.md gate-agent.md test-agent.md review-agent.m
# runs it per module (informational; see project-bin/mf-canvas-facts.py header).
# model-scope.py joined on 2026-10-21: it imports mxpatch.py (and through it mxunit_bson.py) from
# its own directory. It puts back units a write changed only in XPath whitespace (mxcli#1596).
MXTK_PROJECT_BIN="reload.sh module-close.sh build-tree.py row-groups.sh process-map.js process-map.template.html app-restart.sh test-scratch.sh script-owners.sh describe-baseline.sh assemble-prototype.js prototype-route.js check-prototype-links.js wf-add-path-terminators.py wf-set-call-captions.py model-scope.py mf-canvas-facts.py mxunit_bson.py mxpatch.py _common.sh app-facts.sh _claims.sh snapshot-mpr.sh restore-mpr.sh exec.sh idempotence-check.sh persona-preflight.sh affected-tests.sh rollback-scan.sh rollback-scan.py rollback-effects.tsv look-ledger.sh look-shots.js save-sp.sh restart-sp.sh check-sp-health.sh verify-module.sh harness-scan.sh test-stack-up.sh fixture-manifest.sh check-root-clean.sh lint-gate.sh lint-trend.sh metrics-ledger.sh metrics-trend.sh close-task.sh conformance-check.sh coverage-preflight.sh graph-sweep.sh review-module.sh coherence-cadence.sh build-plan-status.sh progress-report.py done-drift-check.sh page-scope.sh render-improvement-register.sh check-design-portability.sh check-design-reaches-app.sh check-page-shell.sh page-fidelity.js model-stamp.sh verify-model.sh install-project-hooks.sh mx-metadata-note.py session-check.sh constants-audit.sh context-pack.sh check-staged-secrets.sh project-facts.sh security-check.sh demo-login-tiles.sh"
# _position.sh joined on 2026-11-17: exec.sh sources it as its sibling (the register's position
# lines + the one entry-mode tokeniser; bin/lib/entry-mode.sh is a shim onto the same file).
MXTK_PROJECT_BIN="reload.sh module-close.sh build-tree.py row-groups.sh process-map.js process-map.template.html app-restart.sh test-scratch.sh script-owners.sh describe-baseline.sh assemble-prototype.js prototype-route.js check-prototype-links.js wf-add-path-terminators.py wf-set-call-captions.py model-scope.py mf-canvas-facts.py mxunit_bson.py mxpatch.py _common.sh _position.sh app-facts.sh _claims.sh snapshot-mpr.sh restore-mpr.sh exec.sh idempotence-check.sh persona-preflight.sh affected-tests.sh rollback-scan.sh rollback-scan.py rollback-effects.tsv look-ledger.sh look-shots.js save-sp.sh restart-sp.sh check-sp-health.sh verify-module.sh harness-scan.sh test-stack-up.sh fixture-manifest.sh check-root-clean.sh lint-gate.sh lint-trend.sh metrics-ledger.sh metrics-trend.sh close-task.sh conformance-check.sh coverage-preflight.sh graph-sweep.sh review-module.sh coherence-cadence.sh build-plan-status.sh progress-report.py done-drift-check.sh page-scope.sh render-improvement-register.sh check-design-portability.sh check-design-reaches-app.sh check-page-shell.sh page-fidelity.js model-stamp.sh verify-model.sh install-project-hooks.sh mx-metadata-note.py session-check.sh constants-audit.sh context-pack.sh check-staged-secrets.sh project-facts.sh security-check.sh demo-login-tiles.sh"

# Files in project-bin/ that are deliberately NOT installed into projects. The reverse check
# below flags anything named by NEITHER list, so a new file in project-bin/ has to be either
Expand Down
Loading
Loading