Skip to content

Commit c79e0b4

Browse files
authored
Merge pull request #451 from ako/claude/mxcli-issues-ovfoxk
Measure MDL-FLOW01 prevalence: 12.5% of branching microflows are irreducible, 80% recombinable
2 parents 6842085 + f1af1a5 commit c79e0b4

2 files changed

Lines changed: 441 additions & 7 deletions

File tree

‎docs/11-proposals/PROPOSAL_structured_microflow_description.md‎

Lines changed: 87 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
---
22
title: Structured description of irreducible microflow graphs
3-
status: draft
3+
status: partial
44
date: 2026-08-20
55
---
66

77
# Proposal: Structured description of irreducible microflow graphs
88

9-
**Status:** Draft
10-
**Date:** 2026-08-20
9+
**Status:** Partial — Phase 0 (detector, `MDL-FLOW01`, describe-time warning) is
10+
shipped; the prevalence scan that gates the rest is
11+
[measured below](#measured-2026-09-12) and selects Mode 3. Phases 1–2 unscheduled.
12+
**Date:** 2026-08-20 (scan: 2026-09-12)
1113

1214
`DESCRIBE MICROFLOW` renders a microflow's control flow as nested `if/then/else`.
1315
That works only for graphs that are *properly nested*. A Mendix microflow is an
@@ -253,10 +255,10 @@ Classification for each irreducible split:
253255
- **interleaved** — the intersection contains an activity, or the branches have
254256
more than one shared entry point.
255257

256-
### The prevalence scan (to be run against demo projects)
258+
### The prevalence scan
257259

258260
```bash
259-
mxcli lint -p app.mpr --rule MDL-FLOW01 --format json
261+
mxcli lint -p app.mpr -r MDL-FLOW01 --format json
260262
```
261263

262264
Emit per finding: qualified microflow name, module, split position,
@@ -265,10 +267,88 @@ classification, branch count, size of the overlap region. What the numbers decid
265267
| Result | Consequence |
266268
|---|---|
267269
| Irreducible graphs are rare | Ship Mode 2 only; refuse the rest. Mode 3 not worth building. |
268-
| Common and mostly *recombinable* | Mode 3 earns its cost; it is the pretty answer for most of them. |
270+
| **Common and mostly *recombinable*** | **Mode 3 earns its cost; it is the pretty answer for most of them.** |
269271
| Common and mostly *interleaved* | Mode 2 is the whole feature; Mode 3 would rarely apply. |
270272

271-
Until this is measured, Modes 2 and 3 are **unscheduled**.
273+
#### Measured, 2026-09-12
274+
275+
Corpus: **555 microflows** across **10 Mendix-authored Marketplace modules**
276+
installed into one 11.6.6 project. Administration 4.3.2 and FeedbackModule 4.0.2
277+
ship with a blank app; the rest were installed with
278+
`mxcli marketplace install <id> -p app.mpr`:
279+
280+
| Module | Content id | Version |
281+
|---|---:|---|
282+
| Workflow Commons | 117066 | 4.5.0 (newest built for 11.6.6) |
283+
| Email Connector | 120739 | 6.4.3 |
284+
| DatabaseReplication | 160 | 9.3.1 |
285+
| ExcelImporter | 72 | 11.2.2 |
286+
| Encryption | 1011 | 11.1.2 |
287+
| Audittrail | 138 | 10.2.2 |
288+
| Community Commons | 170 | 11.5.1 |
289+
290+
Marketplace code was chosen
291+
over demo projects because the result is **reproducible by anyone** from a
292+
content id and a version, rather than resting on two numbers pasted into a doc.
293+
All 44 findings — module, microflow, class, branch count, overlap size, split
294+
position — are in
295+
[`data/flow01-prevalence-2026-09-12.json`](data/flow01-prevalence-2026-09-12.json),
296+
so the table below can be recomputed rather than taken on trust.
297+
298+
| Module | Microflows | With a branching split | Flagged | recombinable | interleaved |
299+
|---|---:|---:|---:|---:|---:|
300+
| WorkflowCommons | 176 | 63 | 3 | 3 | 0 |
301+
| Email_Connector | 135 | 65 | 12 | 17 | 0 |
302+
| DatabaseReplication | 121 | 72 | 8 | 7 | 6 |
303+
| ExcelImporter | 79 | 37 | 6 | 4 | 3 |
304+
| Encryption | 16 | 6 | 1 | 1 | 0 |
305+
| AuditTrail | 8 | 3 | 0 | 0 | 0 |
306+
| Administration | 8 | 4 | 1 | 1 | 0 |
307+
| FeedbackModule | 7 | 3 | 1 | 2 | 0 |
308+
| CommunityCommons | 4 | 4 | 0 | 0 | 0 |
309+
| MyFirstModule | 1 | 0 | 0 | 0 | 0 |
310+
| **Total** | **555** | **257** | **32** | **35** | **9** |
311+
312+
- **5.8 %** of all microflows are irreducible (32 / 555), and **12.5 %** of the
313+
ones that actually branch (32 / 257). **7 of 10** modules contain at least one.
314+
- **44 findings** over those 32 microflows — a microflow can carry more than one
315+
irreducible split. **80 % recombinable** (35), **20 % interleaved** (9).
316+
- Interleaved graphs cluster: all 9 are in DatabaseReplication (6) and
317+
ExcelImporter (3). Both are old modules — 9.3.1 and a long lineage — which is
318+
consistent with crossed flows being something that accretes under maintenance
319+
rather than something anyone draws on purpose.
320+
321+
**This is the middle row.** Irreducible graphs are not a curiosity — one in eight
322+
branching microflows written by Mendix's own teams cannot be described faithfully
323+
today — and they are overwhelmingly *recombinable*, which is the class Mode 3 can
324+
render as ordinary nested `if`s. So **Mode 3 earns its cost**, and Mode 2 is the
325+
honest fallback for the ~20 % that stay crossed. Scheduling is still a separate
326+
call; what is settled is that Mode 3 is not speculative work.
327+
328+
Two caveats that matter more than the percentages:
329+
330+
- **The shipped lint rule never sees this corpus.** `LintContext.Microflows()`
331+
filters through `notPlatformModule`, so `mxcli lint` deliberately skips
332+
Marketplace and System modules — linting code the user cannot edit would be
333+
noise. The numbers above were obtained by bypassing that filter in a
334+
throwaway build. The coverage that *does* reach these microflows is the
335+
**describe-time warning**, which is not lint: describing
336+
`Administration.ManageMyAccount` emits the #923 warning today. Prevalence in a
337+
user's own modules is therefore still unmeasured, and may differ.
338+
- **Rules are not covered.** `FullMicroflow` returns nothing for the 5
339+
`RULE`-typed flows (and the 39 nanoflows) in this project, so the rule skips
340+
them silently. A rule is "a special kind of microflow" and can branch, so this
341+
is a real gap in the detector's reach, not just in this measurement.
342+
343+
Method and control, since a rule that never runs and a rule that finds nothing
344+
look identical: the scan was instrumented to report what it actually examined —
345+
`seen=599 loadfail=44 analysed=555 atrisk=257 branchingsplits=560 findings=44` —
346+
and the 44 load failures reconcile exactly with the catalog's 39 `NANOFLOW` + 5
347+
`RULE` rows, so all 555 microflows were genuinely walked. The discriminating
348+
control is a pair: `Administration.ManageMyAccount`, with **one** branching
349+
split, is flagged and warns on describe, while
350+
`Email_Connector.VAL_EmailTemplateRecipients`, with **ten**, is silent on both.
351+
The detector keys on branch *structure*, not on how much a microflow branches.
272352

273353
### Files to modify/create
274354

0 commit comments

Comments
 (0)