Repository navigation
docs(proposal): MDL change plans — review agent-proposed scripts, apply them safely - #2819
Merged
Merged
Conversation
…ly them safely Designs PROPOSAL_multi_agent_merge Option A / Phase 3: mxcli plan records a script's observed effect (per-document canonical before/after hashes plus the MDL rendering); mxcli apply re-runs the reviewed script and lands it only if the effect is unchanged, several plans all or nothing. Prerequisites: the journal covers generated source files and survives a crash; document-level canonical hashing. Includes a test plan with a control per case. Informed by the review of upstream mendixlabs#2015/#2019/#2020/#2035 and Terraform, Kubernetes and migration tools. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiMsnXa9crge2qnSk9S7Zn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
docs/11-proposals/PROPOSAL_mdl_change_plans.md, a design for reviewing MDL scripts that several agents propose and applying them to a project safely. It is the detailed design for Option A / Phase 3 ofPROPOSAL_multi_agent_merge.md, which named this workflow and the tooling it needs but did not design them.This PR adds the proposal only, with no code.
The design in short
mxcli planruns a script on a scratch copy, asmxcli diffdoes. It writes a versioned plan file holding the script text itself and its observed effect: per document, a canonical before and after hash plus the MDL rendering a reviewer reads. A domain model is split per entity and per association.mxcli applyre-runs the reviewed script on the current project inside the journal. It lands the script only if the effect equals the reviewed one. If a document the script touches changed since review, or the script now touches a document nobody reviewed, the plan is stale: exit 4, nothing written. Several plans apply all or nothing.plan checkanswers the same question beforehand, against a scratch copy, writing nothing.plan diffshows a re-planned script's delta against the reviewed plan.mxcli planto predict conflicts between several MDL scripts mendixlabs/mxcli#2019 took. This follows Terraform (stale saved plans), Kubernetes (resourceVersion, field ownership) and migration tools (checksums, preconditions), which are compared in the proposal.Prerequisites (separate PRs; each also fixes
exectoday).java/.jsfiles. Today a rolled-backexecleaves them behind, and both writers go throughWriteSourceIfChanged..mxcli/journal/, recovered when the write lock is taken. Today a killed run leaves half a script written.Test plan (in the proposal)
Every case names its control:
applyprocesses, 20 iterations each;mx checkon the results, under-tags integration;Fixtures are built in the test, so nothing can silently skip in CI.
Relation to the upstream PRs reviewed
--skip-stalemode.drop user roleon the administrator role leaves AdminUserRole dangling:checkandmx checkpass, every build then crashes with a NullReferenceException #2015/[up#1778] exec refuses a create or modify that check passes: unchanged multi-path case treated as replaced (MDL-V1-REBUILD) #2035's per-unit compare-and-swap is optional, for writers that bypass the lock.plan check.Open questions
Listed in the proposal:
planname, which upstream fix(catalog): reference the mappings a flow applies and a mapping's JSON structure (#1861) #2019 also uses;Generated by Claude Code