Skip to content

fix(exec.sh): mxbuild delta gate keeps a write that reduces the pre-existing error set - #141

Draft
MendixMau wants to merge 1 commit into
masterfrom
fix/exec-delta-gate-subset
Draft

MendixMau wants to merge 1 commit into
masterfrom
fix/exec-delta-gate-subset

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

What changed and why (one paragraph)

Field report from a colleague's naming-conventions change (mxcli v0.23.0): a script that took 34 pre-existing mxbuild errors down to 1 was rolled back by project-bin/exec.sh and logged blocked: PRE-EXISTING CE1613, because the delta gate could only recognise "identical to baseline", never "reduced". The gate now keeps the write when the post-exec error set is the baseline exactly OR a strict subset of it (nothing new); any set containing a new message still restores the snapshot as before. The comparison key is unchanged (err_set's per-message string); a bash-native is_subset_of helper (bash 3.2 safe, no arrays) does the membership test. The reduced case logs ⚠️ applied (dirty model, reduced) with errors 34→1 (pre-existing, reduced); remaining [...] still blocks deploy. Doc-only: the exec.sh header and the README crash-net paragraph now say out loud that exec.sh refuses to run on uncommitted model changes and why, with FORCE_EXEC=1 as the override (field item T3, "by design but undocumented").

Assessed, not built: T2 (script-header declaration to skip the pre-check for rename module scripts) — no header-parsing mechanism exists; SKIP_CHECK=1 remains the sanctioned override. T4 (.gitignore ignoring all of .claude/) — the toolkit's own scaffold does not do this; root cause is external, needs a maintainer call.

Field evidence

  • Scratch harness using the extracted real err_set / err_codes / is_subset_of functions over synthetic mxbuild JSON: 34→1 subset accepted, 34→35 (one new code) rejected, identical and empty sets pass, 8/8. Positive control: the pre-fix logic rejects the 34→1 case, matching the report.
  • bash -n clean; check-portability, check-scripts (95/95), leak guard, pr-discipline all pass.
  • Fixture tests/wave2/test-bug07-08.sh inspected: all 10 cases use SKIP_BASELINE=1, so the subset branch is never reached; unaffected.
  • Not yet done: a real mxbuild run of the patched exec.sh against a model with a pre-existing error set. Per the "Shipping an instrument" rule this PR stays draft until one is cited.

Checklist

  • No client data (leak guard clean)
  • Size cap: 3 files, +68/−6
  • Test tier T1 (scratch harness over extracted functions)
  • Instrument rules: rule 4 (one field run, cited) pending
  • Routing row: n/a
  • CHANGELOG line in the same commit
  • Bug entries: n/a

🤖 Generated with Claude Code

https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw


Generated by Claude Code

…duction

The mxbuild delta gate previously kept a write only when the post-exec
error set matched the pre-flight baseline exactly. A script that took
34 pre-existing errors down to 1 was rolled back and logged
"blocked: PRE-EXISTING CE1613", because the gate had no way to
recognise "reduced" as distinct from "unchanged but different."

Adds a bash-native is_subset_of() helper (no new Python call, no new
comparison key — reuses err_set()'s existing per-message string) and
classifies the post-exec set as identical / subset / reject. Only a
set containing something genuinely NEW still triggers the snapshot
restore. The kept-write BUILD-LOG row for the reduced case now reads
"applied (dirty model, reduced)" with the before->after counts and
remaining codes in the detail column.

Also documents (header comment + README's crash-net paragraph) that
exec.sh refuses to run while the model has uncommitted changes, since
the delta-gate change touches the same header block.

Verified against a scratch harness (not committed) using the real
extracted err_set/err_codes/is_subset_of functions fed two synthetic
mxbuild error-JSON fixtures: 34->1 subset accepted, 34->35 (one new
code) rejected, plus guard cases for the identical-set and empty-set
paths. No real .mpr/mxcli/mxbuild was exercised.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
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.

1 participant