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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "cmd/mxcli", "date": "2026-11-22", "symptom": "`brain capture --from-json` refused a whole batch with `json: unknown field \"accepts\"`: --accepts, --changes and --partly-meets had no batch spelling, so a decision accepting a lint finding (or changing a requirement) could only be captured one at a time with the flag", "cause": "`BatchItem` (cmd/mxcli/brain/batch.go) mirrored only the text/anchor/slice/open/source flags; the three later flags were added to the single form only, and the requirement-id check lived in the command layer (`applyVerdictFlags`) where `BuildBatch` could not reach it", "file": "`cmd/mxcli/brain/batch.go` (`BatchItem`, `BatchChecks`, `addVerdictsAndAcceptances`), `cmd/mxcli/brain/verdict.go` (`CheckRequirementIDs`), `cmd/mxcli/cmd_brain.go` (`applyVerdictFlags`, `stagedEntry`)", "insight": "**When a command has two input spellings (flags and a batch), every flag added to one is a gap in the other — and the dangerous fix is the one that parses the field but drops it.** Acceptances and verdicts are body lines read by regex, so a batch that accepted `accepts` without writing the line would capture the decision and leave lint reporting the finding: stubbing the write makes the batch succeed with empty bodies. The test that pins it compares the batch entry's body to the flag path's (same order: verdicts, then acceptances) and, through the CLI, the flag form of the same decision is reported 'Already queued' as the batch one. Workaround before the fix: the exact `Accepts lint `RULE` on `@El`: reason` line in `body` is read; prose is not. The BatchItem comment promised list/staged output could be fed back in — false (id/kind/date/shard are refused), so corrected rather than extended", "refs": ["ako/mxcli#2524"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "cmd/mxcli", "date": "2026-11-22", "symptom": "a requirement anchored at a page fed only by database data sources stays 'nothing to reach' in report traceability although a journey opened the page, because the documented journey-log record has no `pages` field", "cause": "the report-tests skill and the report tests/traceability help showed a five-field record; `pages` (and step, message, run, browserMs) existed only in the JourneyRecord comment, so the one proof for a page-only requirement was undiscoverable", "file": "`.claude/skills/mendix/report-tests/SKILL.md`, `report-traceability/SKILL.md`, `cmd/mxcli/cmd_report_evidence.go`, `cmd_report_kinds.go`, `cmd/mxcli/projectreport/traceability.go` (everyRequirement, hasPageAnchor)", "insight": "An input format documented by example is documented only as far as the example goes: a field missing from it does not exist for a reader. Pin the example to the parser with a test, and make the dead-end cell name the way out", "refs": ["ako/mxcli#2526"], "test": "TestTraceabilityPageOnlyRequirementProvenByJourneyPages, TestJourneyLogExamplesNamePages"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl/executor", "date": "2026-11-22", "symptom": "every Data grid Drop-down filter mxcli created failed mx check 11.14.0 with CE0463 (9 on the 68-page testapp copy); mxcli docker check labelled them stale and update-widgets cleared them", "cause": "two gaps on emptyOptionCaption: the editorConfig hides it with `(e.filterable||e.multiSelect)&&hidePropertyIn(…)`, a disjunctive guard the extractor did not lift, so the hidden template was never nulled; and while visible Studio Pro stores the shipped default text (None/Niets) where the embedded template held an empty template and the visible fill wrote an empty one, because top-level property entries did not carry DefaultTranslations", "file": "mdl/executor/editorconfig_extract.go (disjunctiveGuard), modelsdk/widgets/loader.go (top-level DefaultTranslations), mdl/backend/widgetobj/builder.go (ApplyVisibilityRules), modelsdk/widgets/templates/mendix-11.6/datagrid-dropdown-filter.json", "fix": "lift a statement-level `(A||B…)&&hide(P)` as one rule per disjunct (exact: any firing rule hides); fill a visible unset conditional text template with the declared translations; give the template's emptyOptionCaption the shipped text", "insight": "the first path diff (Studio vs mxcli) showed only Object.Properties ORDER differences — a red herring, update-widgets does not reorder them. Diffing mxcli's widget against the same widget after `mx update-widgets` gave the one real change. Nulling the template alone moved the failures to the other filters, which is what showed the value depends on configuration; then the editorConfig named the rule. An empty template is not wrong everywhere: the text/number filters' screenReaderInputCaption ships text and mx check accepts an empty one", "refs": ["ako/mxcli#2518"], "test": "mdl/executor/editorconfig_disjunction_2518_test.go, mdl/backend/widgetobj/visible_texttemplate_translations_2518_test.go, modelsdk/widgets/texttemplate_default_translations_2518_test.go"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl/executor", "date": "2026-11-22", "symptom": "MDL-WIDGET56 reported every other mode's required properties on a combo box set with `attribute:` (12, attributeEnumeration among them) and refEntity/refSearchAttr/linkedDs on a data grid drop-down filter; mx check 11.16.1 builds both with 0 errors.", "cause": "Three gaps. The hide rules were judged on the statement's values only, so source/optionsSourceType, which exec writes from the template (context, enumeration), were unknown and no mode rule fired. A property set through its MDL keyword (`attribute:` -> attributeEnumeration) was not counted as set. And the drop-down filter hides its association properties in a function invoked as a ternary's then-branch, `\"attr\"===e.baseType?t=function(e,t){hide([...refEntity...]),...}(e,t):...`, which parseGuard read as unguarded (its text ends at `{`) and whose nested hides lost the outer condition.", "file": "mdl/executor/validate_widget_required.go, mdl/executor/editorconfig_extract.go", "fix": "validateWidgetRequired fills unset keys from templateWrittenDefaults before judging hide rules, treats any key with a value as set, and skips an isLinked datasource (the grid fills it; mpk.PropertyDef.IsLinked). ternaryThenIIFECondition gives a hide in such a function the ternary's condition (first statement) or adds it as an And term, only when the function is invoked with its own parameter names.", "insight": "Pick the fixture by what the package ships: PedApp's Combobox 2.5.0 and drop-down filter mpk carry no editorConfig.js, so no hide rule exists there and a correct fix still fails the test. `unzip -l` on the fixture's mpk before debugging the extractor would have saved the detour. Control: the association-mode combo box still reports optionsSourceAssociationCaptionAttribute, which mx check reports as CE0642.", "refs": ["ako/mxcli#2523"], "test": "mdl/executor/validate_widget_required_modes_2523_test.go (enumeration combo + attribute filter: none; association combo: its caption only), mdl/executor/editorconfig_extract_iife_2523_test.go TestTernaryThenIIFEHidesCarryTheTernaryCondition_2523"}
2 changes: 1 addition & 1 deletion .claude/skills/mendix/project-brain/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ cap: the cap is what stops the store becoming a file nobody reads.
| `mxcli brain init -p app.mpr` | Creates `docs/brain/`. Refuses a `docs/brain/` it did not write |
| `mxcli brain capture "<text>" [-a @Anchor]…` | Queues an entry. Never commits |
| `mxcli brain staged [--since <id>] [--slice <n>] [--fail-if-empty]` | Lists the queue with the shard each entry would land in. `--since` is the slice boundary — see below |
| `mxcli brain capture --from-json <file\|->` | Queues a JSON array of entries as one act: every item validated first, duplicates skipped. Use it for a list, not a loop of captures |
| `mxcli brain capture --from-json <file\|->` | Queues a JSON array of entries as one act: every item validated first, duplicates skipped. Use it for a list, not a loop of captures. Per item: `text` (or `title`+`body`), `anchors`, `slice`, `open`, `source`, and `accepts` / `changes` / `partly_meets` — the values of `--accepts` / `--changes` / `--partly-meets`, e.g. `"accepts": ["CONV010:demo app"]` |
| `mxcli brain promote <id>… [--to <shard>]` | Writes them into their shards, all or none. The human step. Re-run after an interruption completes it |
| `mxcli brain drop <id>` | Removes it from the queue or from its shard |
| `mxcli brain capture "<text>" --slice <name> [-a @Anchor]…` | Queues a **requirement** of that slice |
Expand Down
22 changes: 17 additions & 5 deletions .claude/skills/mendix/report-tests/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ description: "Produce and read the tests report (mxcli report tests): microflow
| lines | section |
|---|---|
| 31-43 | Preconditions (check every one) |
| 44-66 | Run it |
| 67-83 | Reading it |
| 84-100 | Which gaps deserve a test |
| 101-104 | Related |
| 44-78 | Run it |
| 79-95 | Reading it |
| 96-112 | Which gaps deserve a test |
| 113-116 | Related |

<!-- /skill-index -->
# Tests Report
Expand Down Expand Up @@ -57,9 +57,21 @@ mxcli report tests --from docs/testing/tests.json --annotations docs/testing/not
The journey log is JSONL, one line per journey (or step):

```json
{"journey":"Swap a shift","start":"2026-11-12T10:00:01.120Z","end":"2026-11-12T10:00:09.410Z","status":"passed","checks":["sees 3 offers","swap requested"]}
{"journey":"Swap a shift","step":"open marketplace","start":"2026-11-12T10:00:01.120Z","end":"2026-11-12T10:00:02.410Z","status":"passed","checks":["sees 3 offers"],"pages":["Shifts.Marketplace"]}
```

| Field | Meaning |
|---|---|
| `journey`, `start`, `end`, `status` | required: the name, the time window spans are matched against, `passed` / `failed` / `skipped` |
| `step` | the step within the journey; steps of one journey merge into it |
| `checks` | the script's own assertion messages, shown verbatim |
| `pages` | the qualified names of the pages the step opened. **List them:** a page fed only by database data sources runs no microflow, so this is the only way a journey proves a requirement anchored at it (`report traceability`) |
| `message` | why a failed step failed |
| `run`, `browserMs` | the repeat number and browser time, for `report performance` |

A line `{"meta":true,"database":"fresh seed 2026-11-12","notes":["…"]}` records the
database state the run used.

Write `checks` from the script's own assertion messages. Prose written from a
journey's name drifted from what it checks on the prototype; the page shows the
checks verbatim for that reason.
Expand Down
15 changes: 11 additions & 4 deletions .claude/skills/mendix/report-traceability/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ description: "Produce and read the PRD-to-app traceability report (mxcli report
|---|---|
| 25-74 | Preconditions |
| 75-85 | Run it |
| 86-103 | Reading it |
| 104-107 | Related |
| 86-110 | Reading it |
| 111-114 | Related |

<!-- /skill-index -->
# Traceability Report
Expand Down Expand Up @@ -92,8 +92,15 @@ seed, tracing on, never commit while tests run).
callees, microflows a page/workflow/service calls, microflows that write an anchored
entity, use an anchored attribute or association. Helpers with more than three
callers are left out — they belong to no single requirement.
- **Tests / journeys** reach the footprint (or the journey log names an anchored
page — needed for pages with only database data sources, which run no microflow).
- **Tests / journeys** reach the footprint, or the journey log lists an anchored
page in a record's `pages` — needed for pages with only database data sources,
which run no microflow. Write the pages each step opened into its record:

```json
{"journey":"Browse systems","step":"open overview","start":"…","end":"…","status":"passed","checks":["sees 4 systems"],"pages":["FieldService.LithoSystem_Overview"]}
```

A row "nothing to reach" anchored at a page stays so until a journey lists it.
- **Decisions / open questions** share an anchor or cite the id. Linking by shared
anchor is noisy around hub elements; cite the id in the body when it matters.

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Fixed

- **`check` no longer reports the required properties of a widget mode the statement did not choose** (ako/mxcli#2523) — a combo box bound with `attribute:` was warned (MDL-WIDGET56) about 12 properties of the association and database modes, and a data grid drop-down filter about `refEntity`, `refSearchAttr` and `linkedDs`; mxbuild builds both clean. The widget's hide rules are now judged with the values exec writes for unset properties, a property set through its MDL keyword counts as set, and the drop-down filter's association-mode hide rules are read. A combo box in association mode still reports the caption attribute it needs (CE0642).
- **Data grid Drop-down filters no longer fail CE0463** (ako/mxcli#2518) — every drop-down filter mxcli created failed with "the definition of this widget has changed". Its `emptyOptionCaption` was written with an empty text, where Studio Pro stores none while `filterable` or `multiSelect` hides it and the widget's default text ("None") while it is visible. Rules that the widget editor writes as `(a || b) && hide(…)` are now read, and a visible text property that is left unset gets the widget's default text. Measured on mx check 11.14.0: 68 pages copied from the testapp went from 9 × CE0463 to 0.

## [0.33.0] - 2026-11-22

Headline: **`check` catches far more type and reference errors before the build, native mobile apps get their navigation and widgets, and four new lint rules read the model's design.** Values, variables and list operations are type-checked in microflows, a dropped attribute a document still uses is refused, and mxcli writes keys in Studio Pro's order so a first open no longer rewrites what mxcli wrote. `create navigation NativePhone` builds a native profile with its bottom bar, and native mobile pluggable widgets build without CE0463. New lint rules `MPR016`-`MPR019` report overlapping domain model boxes, a one-valued Boolean flag, a model element named in a string literal and an unindexed XPath attribute; published REST services and business events gain operation-level editing; and nightly builds can be pinned and rolled back.
Expand Down
55 changes: 47 additions & 8 deletions cmd/mxcli/brain/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ import (
"time"
)

// BatchItem is one entry of `brain capture --from-json`. The fields are the
// input half of what `staged --json` and `list --json` print, so a caller can
// feed a list straight back in.
// BatchItem is one entry of `brain capture --from-json`, with a field for each
// capture flag that describes an entry.
//
// It is NOT the shape `staged --json` or `list --json` prints, and their output
// cannot be fed back in: it carries id, kind, date and shard, which are refused
// as unknown fields, and it reports acceptances and verdicts as parsed objects
// rather than as the flag specs below. A round trip would need its own design
// (which output fields to ignore, how an object maps back to a spec).
type BatchItem struct {
// Text is the single-argument form of capture: first line title, the rest
// body. Give it or Title (with an optional Body), not both.
Expand All @@ -33,6 +38,23 @@ type BatchItem struct {
Slice string `json:"slice,omitempty"`
Open bool `json:"open,omitempty"`
Source string `json:"source,omitempty"`
// Accepts, Changes and PartlyMeets are --accepts, --changes and
// --partly-meets: each "<value>" or "<value>:<reason>", written into the
// body as the lines lint, check and plan read (ako/mxcli#2524).
Accepts []string `json:"accepts,omitempty"`
Changes []string `json:"changes,omitempty"`
PartlyMeets []string `json:"partly_meets,omitempty"`
}

// BatchChecks is what BuildBatch needs from outside the items.
type BatchChecks struct {
// NormalizeSource resolves an item's source the way --source does on the
// command line; nil leaves sources as given.
NormalizeSource func(string) (string, error)
// KnownRequirements is the plan's requirement ids, which a verdict must
// name. Nil means there is no plan to check against (no store yet), and
// ids are not checked — as the flags behave.
KnownRequirements map[string]bool
}

// ParseBatch reads a JSON array of items. Unknown fields are refused: a
Expand All @@ -59,17 +81,20 @@ func ParseBatch(r io.Reader) ([]BatchItem, error) {
// writes anything. The first invalid item fails the whole batch, named by its
// index in the array, so nothing is queued from a list that is partly wrong.
//
// normalizeSource resolves an item's source the way --source does on the
// command line; nil leaves sources as given.
func BuildBatch(items []BatchItem, now time.Time, normalizeSource func(string) (string, error)) ([]Entry, error) {
// Acceptances and verdicts are added exactly as the flags add them, in the same
// order, so the two spellings of one decision produce the same entry.
func BuildBatch(items []BatchItem, now time.Time, checks BatchChecks) ([]Entry, error) {
out := make([]Entry, 0, len(items))
for i, it := range items {
e, err := it.entry(now)
if err == nil && it.Source != "" && normalizeSource != nil {
e.Source, err = normalizeSource(it.Source)
if err == nil && it.Source != "" && checks.NormalizeSource != nil {
e.Source, err = checks.NormalizeSource(it.Source)
} else if err == nil {
e.Source = it.Source
}
if err == nil {
e, err = it.addVerdictsAndAcceptances(e, checks.KnownRequirements)
}
if err != nil {
return nil, fmt.Errorf("items[%d]: %w; nothing was queued", i, err)
}
Expand All @@ -78,6 +103,20 @@ func BuildBatch(items []BatchItem, now time.Time, normalizeSource func(string) (
return out, nil
}

func (it BatchItem) addVerdictsAndAcceptances(e Entry, known map[string]bool) (Entry, error) {
if err := CheckRequirementIDs(append(append([]string{}, it.Changes...), it.PartlyMeets...), known); err != nil {
return Entry{}, err
}
e, err := AddVerdicts(e, VerdictChanges, it.Changes)
if err != nil {
return Entry{}, err
}
if e, err = AddVerdicts(e, VerdictPartly, it.PartlyMeets); err != nil {
return Entry{}, err
}
return AddAcceptances(e, it.Accepts)
}

func (it BatchItem) entry(now time.Time) (Entry, error) {
text := it.Text
switch {
Expand Down
12 changes: 6 additions & 6 deletions cmd/mxcli/brain/batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ func queueLen(t *testing.T, q *Queue) int {
func TestBuildBatchRefusesTheWholeBatchNamingTheBadItem(t *testing.T) {
bad := items("One", "Two", "Three")
bad[1].Anchors = []string{"not an anchor"}
if _, err := BuildBatch(bad, day, nil); err == nil || !strings.Contains(err.Error(), "items[1]") {
if _, err := BuildBatch(bad, day, BatchChecks{}); err == nil || !strings.Contains(err.Error(), "items[1]") {
t.Fatalf("err = %v, want a refusal naming items[1]", err)
}

// Control: the same batch without the bad item builds, and queues N-1.
s, q := batchStore(t)
good := append(bad[:1:1], bad[2])
es, err := BuildBatch(good, day, nil)
es, err := BuildBatch(good, day, BatchChecks{})
if err != nil {
t.Fatalf("control batch refused: %v", err)
}
Expand All @@ -71,12 +71,12 @@ func TestBuildBatchRefusesAmbiguousOrEmptyItems(t *testing.T) {
"bare module requirement": {Title: "Needs a module element", Slice: "01-x",
Anchors: []string{"@Sales"}},
} {
if _, err := BuildBatch([]BatchItem{it}, day, nil); err == nil {
if _, err := BuildBatch([]BatchItem{it}, day, BatchChecks{}); err == nil {
t.Errorf("%s: accepted, want a refusal", name)
}
}
// title + body is the two-field form of text.
es, err := BuildBatch([]BatchItem{{Title: "Head", Body: "Prose"}}, day, nil)
es, err := BuildBatch([]BatchItem{{Title: "Head", Body: "Prose"}}, day, BatchChecks{})
if err != nil || es[0].Title != "Head" || es[0].Body != "Prose" {
t.Fatalf("title+body = %+v, %v", es, err)
}
Expand All @@ -100,7 +100,7 @@ func TestCaptureBatchSkipsDuplicatesAndIsIdempotent(t *testing.T) {
t.Fatal(err)
}

es, err := BuildBatch(items("Fresh one", "Already decided", "Fresh two", "Fresh one"), day, nil)
es, err := BuildBatch(items("Fresh one", "Already decided", "Fresh two", "Fresh one"), day, BatchChecks{})
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -161,7 +161,7 @@ func TestCaptureBatchAssignsIDsAgainstEarlierItems(t *testing.T) {

func stage(t *testing.T, s *Store, q *Queue, texts ...string) []string {
t.Helper()
es, err := BuildBatch(items(texts...), day, nil)
es, err := BuildBatch(items(texts...), day, BatchChecks{})
if err != nil {
t.Fatal(err)
}
Expand Down
Loading
Loading