Skip to content

Commit c9bc073

Browse files
committed
Merge #380: chore(context): per-role on-demand token in the routing agents column (stub diet T1) — stacked on #378
Review: independent review MERGE — `<role>?` on-demand routing token; audit refuses all?, ? on non-baseline rows, and plain+? duplicates; the five re-tiered skills hold no rule mdl needs before drafting. Confirmation MERGE at 966caff (stacked on #378 via merge commits): Stage 5 mdl 43,599 → 30,647, review 32,181 → 30,265, baseline 73,233; fixtures routing-tier 26, runbook-slice 31, baseline-pack 22, render-routing 5, bug03 31, bug12 61, ritual-slim 17. Behaviour A/B as on #378: no worse than master on every metric. Follow-up: completed agent stubs in existing projects are never re-rendered, so they don't get the saving. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
2 parents 57eed6a + 966caff commit c9bc073

13 files changed

Lines changed: 156 additions & 40 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m
3535
- process(context): **stories and old measurements move out of four always-loaded skills; baseline 75,028 → 74,223 words (−805).** Verbatim moves into `process/baseline-incident-history.md` (new sections UI1–UI4, TO1–TO3, MF1, MP1), each leaving a one-line pointer: `ui-preflight-pages.md` (the 2026-09-09 design-reach story, the ToeicBuddy fidelity numbers, the fidelity-vs-checklist table, the repeated 2026-08-31 A/B paragraph), `tool-output-is-not-ground-truth.md` (the three 2026-07-29 instance narratives, the `$?` instance table, the Part 3 workflow story), `microflow-preflight.md` (`mxcli layout` probe history) and `learned-mdl-preflight.md` (#879 re-probe numbers). Rules, STOP rows and their numbers, denominators and one-line failure examples stay in place. New `bin/check-moved-text.sh` makes the #315 line-by-line review mechanical: every removed line must be found with `grep -F` in its new home (83 of 83 here). It exits 2 on a source with no diff or on 0 removed lines (never "0 of 0" green), lists lines under 15 characters as trivially found, and has a fixture (`tests/wave2/test-check-moved-text.sh`). Behaviour A/B still owed before merge. — T4 of the stub-diet research report
3636
- new(app-facts): **the app map's loop sweep is incremental, and `bin/status.sh` says how stale the map is** ([#297](https://github.com/MendixMau/mxcli-project-toolkit/issues/297)). Every run re-described every loop-containing microflow: on a 17,500-unit app that was 1,917 describes in 2 h 45 at 6 workers (about 31 s each, not the 1-2 s `app-analysis.md` promised), while about 80 units had changed between rounds. `manifest.json` now stores a `{UnitID: ContentsHash}` snapshot of the `.mpr` Unit table and an `mdl_index` recording the unit state each `mdl/` file was described from. A refresh describes only candidates whose hash, module or folder changed, or that have no output, keeps the rest and deletes outputs of removed or loop-free units. The sweep is full on the first run, with `--full`, after an mxcli version change, or when the Unit table cannot be read (MPR v1); `sections.loops.sweep` says which and why. UnitID-to-name mapping is `mx-metadata-note.py units`, the Studio Pro History note's own walk, refactored into a shared `Model` base for git revisions and the working tree. The hash is computed from the `.mxunit` bytes in the column's format, so a Unit-table row that lags its file cannot hide a change; disagreements are counted in the manifest. `bin/status.sh` prints `app map: N units changed since <date>` or `app map: fresh` when a map exists (`app-facts.sh --freshness`, no mxcli needed; the unit list goes through a temp file, never an env var, so it works past ~1,600 units), and nothing otherwise. A `--skip-loops` run keeps the last loop sweep's snapshot, so a stale loop map never reads fresh. `app-analysis.md` gives the measured cost by app size and names `--full` as the remedy after edits made outside Studio Pro. Fixture `tests/wave2/test-app-facts-incremental.sh`, 108 checks on both layouts with captured template units and a stub mxcli: all describes on a first run, 0 when nothing changed, 1 for a changed, moved, or stale-row unit, a removed unit's output deleted, a failed describe retried, a renamed module re-described under its new name, `--freshness` and status.sh on 2,101 units, a `--skip-loops` run not reading fresh, outputs byte-identical to `--full` and to a fresh full run, and the status line; 78 checks fail against master. `tests/wave2/bench-app-sweep.sh`, 2,000 units with 1 % changed: 20 describes incremental against 2,000 full, and `--freshness` reads fresh / 20 changed / fresh. Follow-up, not built: skip re-hashing unchanged `.mxunit` files by mtime + size. Field evidence: no field run; checked on synthetic and captured fixtures only. Not built: replacing describe with catalog queries (mxcli v0.25 `activities` with loop depth), NEEDS-FIELD-DATA, a real v0.25 catalog capture to check parity with the parser. — jopterhorst (#297)
3737
- fix(app-facts): **the catalog is opened through an escaped read-only URI, so a model folder with `#` or `?` in its name no longer breaks step 2 or leaves a stray file beside the project.** Step 2 built `"file:%s?mode=ro" % DB` from the raw path; `#` and `?` end the path in a URI, so `mode=ro` was dropped and SQLite created an empty database at the truncated path (a zero-byte `a ` beside `a #2/`) and opened that. On master that ends in a Python traceback (`no such table: modules_data`, exit 2) after the shell's catalog check had passed. The URI now comes from new `mxtk_sqlite_ro_uri` in `_common.sh`, the `pathname2url` escaping `mxtk_model_version` already did, which now calls the same helper. Step 2 also refuses with a FAULT line when the catalog it opened has 0 tables, rather than writing facts from it, and with a `_common.sh` that predates the helper (or none) app-facts builds the same `pathname2url` URI inline, as its `require_py`/`find_mpr` fallbacks already do, passing the path through `native_path` when that exists. Fixture `tests/wave2/test-app-facts-db-uri.sh` (10 cases: folders `a #2`, `b?c` and a plain control, the URI shape, the 0-table refusal, and `a #2` beside an older `_common.sh` without the helper); 8 fail on master, and the older-`_common.sh` case fails on the previous revision of this fix, which refused. Windows (MSYS path conversion of the env var) is unchanged and unverified. Field evidence: none yet. — r-eng-backlog item 3, MendixMau
38+
- chore(context): **a routing row can be on demand for one role: `mdl?` in the agents column — mdl at Stage 5 reads 43,599 → 30,647 words, review 32,181 → 30,265.** The tier column is per row, so a row one role needs every session and another needs once per module was baseline for both. The `<role>?` token keeps a baseline row in that role's stub, among the on-demand rows (trigger only, still findable), and out of its always-read set and word count; the Role(s) column names it (`review (mdl: on demand)`, `every role except mdl, review (on demand for those)`), and the agent audit refuses a `?` on a non-baseline row or beside its own plain token. Applied for mdl to module-review, ui-loop, teamserver-alignment, learned-css-that-never-applied and skills-over-scripts; for review to teamserver-alignment and skills-over-scripts. Baseline total unchanged (73,233). Behaviour A/B (5 reps × 2 tasks + 5 probes × 3 reps, sonnet): trimmed pack no worse than master on every scored metric — planted STOP refused 10/10 each arm, mxcli-check parse failures page 2/5 vs 3/5, retrieval probes 15/15. — context-cost research (r-stub-diet, T1)
3839
- chore(context): **helpers read the runbook slice for their stage, and the runbook no longer carries a copy of the baseline table — mdl at Stage 5 reads 56,236 → 43,599 words; baseline 75,028 → 73,233.** `skills/conversion-runbook.md` held a fourth rendered copy of the baseline routing table (README, ROUTING.md and every project's CLAUDE.local.md carry it too); it is out of the render surfaces and replaced by a one-line pointer. New `bin/runbook-slice.sh <stage>` prints §1b plus that stage's section, using the span logic gate-check already had (now `bin/lib/runbook-span.sh`, shared). The runbook routing row is split: lead, ba and architect keep the runbook; mdl, gate, test and review get the slice, and `render-routing.sh --check` counts the slice's printed words for them, so the per-role numbers stay honest. New `tests/bench/trim-noloss.sh` checks that every removed line is found again or is a still-routed table row. Behaviour A/B (5 reps × 2 tasks + 5 probes × 3 reps, sonnet): trimmed pack no worse than master on every scored metric — planted STOP refused 10/10 each arm, mxcli-check parse failures page 2/5 vs 3/5, retrieval probes 15/15. — context-cost research (r-stub-diet, T2+T3)
3940
- process(build): **Stage 5 drafts the ready set in parallel and applies serially.** The runbook dispatch row said "sequential within a module", which serialised drafting even for independent scripts; it now points to `iterative-build-loop.md` → Gate cost, the single statement of the rule. The unit is the build-plan row: every `BUILD` row whose "Depends on" rows are all applied, minus overlapping writers (two rows that replace, alter or drop+create the same document never share a ready set, and no row is drafted while it overlaps a queued unapplied one; `brd-to-build-plan.md` has Produces name every document a row writes), runs at once, its scripts in order, one `mdl-agent` per script. Applies stay one at a time through `bin/exec.sh`, and the ready set is recomputed after each. A queued draft made before a sibling apply landed is re-checked with `mxcli diff --format struct` (preflight STOP rule 23); any removal line (checked against `describe` per BUG-146) or STOP rule 21 target means re-draft, never patch, because a stale restatement of a shared document is exactly rule 21's silent seed-call loss and passes `check --references`. Report `ready set N, drafted N, applied k`; the `mdl-agent` template says a drafter never applies and never depends on an unapplied draft. Field evidence: none yet. — MendixMau
4041
- fix(platform-link): **CLI commits now show their changed documents in Studio Pro History.** Studio Pro's History → Model changes pane reads a `ModelChanges` array from the commit's `refs/notes/mx_metadata` note. Trap 6c's hand-written template set it to `[]`, so every mxcli/agent commit showed "Model changes 0" (field project: 270 of 270 notes empty). New `project-bin/mx-metadata-note.py` (stdlib only) computes the array from the commit's changed `.mxunit` files, in Studio Pro's entry shape: Status, UnitID, UnitType, UnitName and Module (walked up the `.mpr` Unit tree). It has `changes` / `write` / `backfill` / `sync <remote>` subcommands. `install-project-hooks.sh` now also installs post-commit and post-rewrite hooks that write the note and never block, and `--check` covers them, so `sync-project.sh` rolls them out to wired projects. Notes are published with `mx-metadata-note.py sync <remote>` after the branch push. Push config is never touched. With mxcli v0.26+ in the project root the hooks call `mxcli git note --write` instead (mendixlabs/mxcli#1337); the Python script is the fallback for older pins, and on 160 field commits both wrote the same 3,594 entries. Trap 6c rewritten. Measured against Studio Pro's own notes, 51 commits in 5 apps: 3387/3389 entries exact on all five fields. Field run on a 357-commit Mendix 11.15.0 app: 158 notes backfilled and pushed, and Studio Pro History lists the documents per revision. Review fixes: an earlier revision added `HEAD` + the notes ref to `remote.<r>.push`. It was dropped because any push refspec replaces `push.default`. A branch tracking a differently named upstream got a new same-named branch on Team Server where `simple` refuses, a missing local notes ref failed the whole push, and nobody knows whether Studio Pro's own push reads that config. The installer now only fetches the remote's notes (non-forced). It removes that exact `HEAD` + notes pair if present, and leaves and reports any other entry. `sync` handles a remote with no notes ref (it used to exit 1) and retries a rejected push once after re-merging. A note that already lists changes (Studio Pro's) is never overwritten by `write`/`backfill` without `--force`, and `sync` keeps a colleague's non-empty note over ours. The mxcli probe greps `git note --help` for `--write`. Hooks and docs call the script through `resolve_py`. Fixture `tests/wave2/test-mx-metadata-note.sh` (40 cases, over real captured template units; single- and two-tree layouts, amend, backfill and `--force`, push exit codes identical to a no-hooks clone, leftover-refspec cleanup, sync to an empty remote and its retry, notes fetch at install, a diverged notes merge; green under `init.defaultBranch` master and main). — field project (Mendix 11.15 app), MendixMau

0 commit comments

Comments
 (0)