Skip to content

learn(microflows): validation collects every field error, then stops once (+ BUG-141) - #136

Open
MendixMau wants to merge 3 commits into
masterfrom
claude/kybappn-pipeline-status-4n0bqw
Open

MendixMau wants to merge 3 commits into
masterfrom
claude/kybappn-pipeline-status-4n0bqw

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

Direct lane

What changed and why (one paragraph):
A product owner reported that validation built with this toolkit's patterns flags one field per submit. If you submit an empty form, only the first required input turns red. You fill it in, resubmit, and only then does the second one turn red. Cause: each check does validation feedback and then return false, so later checks never run. skills/learned-microflow-patterns.md → "Validation Feedback — Correct Pattern" now starts with the collect-all rule. Declare $IsValid = true. Give each field its own if (feedback + set $IsValid = false, no return, no else chaining). After the last check, if not($IsValid) then return false, then save. A cross-field check is guarded on its own inputs being non-empty, never on $IsValid. The section shows the wrong code next to the right code, and says that state guards (wrong status, deadline passed) may still return early. skills/mdl-cookbook-microflows.md §4 says its early-return guard chain is for state guards only, and points to the rule. Cookbook §2 already used collect-all and did not change.

Field evidence: the kybapp project, product owner report, 2026-09-25. A grep of that project's mdlsource/ found 44 feedback-then-return sites across 11 scripts. Some are real state guards; the field checks among them are the defect. Both MDL snippets pass mxcli check (v0.22.0, syntax-only, 0 errors).

Also on this branch: an earlier commit from this same session that was never opened as a PR: fix(bug-logs): BUG-141 alter page set RenderMode on dynamic text + upstream PR package (7e04cd6). Master was merged in; the CHANGELOG conflict was resolved by keeping all Unreleased lines. Note for the merger: that entry is headed ## BUG-141 rather than ## BUG-DRAFT-<slug>. 141 is not taken on master today. Renumber it if another bug takes 141 before this merges. The BUG-141 package (~590 lines, mostly a .patch capture) puts this PR over the size cap. Split it out if you prefer.

  • No client data anywhere in the diff (the credit names the reporting project, kybapp, as the task asked)
  • Size cap: the validation change is 3 files / ~70 lines; with BUG-141 the PR is over the cap (see above)
  • Test tier: skill-text change, checked by mxcli check on both snippets. No fixtures cover these skill files, so no suite was run
  • CHANGELOG.md line appended, crediting the kybapp project

Follow-up (not built here, per the field-proof rules): this could be caught cheaply by a Starlark lint rule in .claude/lint-rules/ or a preflight grep. It would flag a validation feedback activity followed straight away by return in the same if branch, when that branch tests an attribute for emptiness. It would need a real captured project as golden input: kybapp's mdlsource/ has 44 candidate sites, some of which are legitimate state guards and must stay unflagged. Unrelated side note: bug-logs/wengao-5aug-section-a-retest-2026-08-07.md records validation feedback with no CE0639, but learned-microflow-patterns.md still says CE0639 is unavoidable. That claim may be stale and is worth a separate retest.

🤖 Generated with Claude Code

https://claude.ai/code/session_013uU1FnquwBoB43skj34Xh1


Generated by Claude Code

…stream PR package

Issue draft, format-patch of the fork branch, PR body and submission
steps in bug-logs/pending-github-issues/bug141-*.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013uU1FnquwBoB43skj34Xh1
…line-status-4n0bqw

# Conflicts:
#	CHANGELOG.md
…once

Validation microflows that did `validation feedback` + `return` per field
flagged one input per submit: an empty form turned only the first field red.
learned-microflow-patterns.md "Validation Feedback — Correct Pattern" now
leads with the collect-all rule and a before/after (early return vs
$IsValid accumulation, cross-field check guarded on its own inputs, state
guards still allowed to return early). The cookbook's guard-chain example
now says it is for state guards only. Both MDL snippets pass `mxcli check`
(v0.22.0, syntax-only).

Reported by the kybapp project's product owner, 2026-09-25.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013uU1FnquwBoB43skj34Xh1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants