Delete sdk/mpr — the legacy engine is gone - #1114
Merged
Merged
Conversation
163 files, 41,674 lines. This finishes docs/plans/2026-09-14-retire-legacy-engine.md. Zero importers was not the same as safe to rm -rf. Two live dependencies survived, and neither is visible to a check written against the parent package's import path. sdk/mpr/version had six importers, two of them shipping code (cmd/mxcli/docker/build.go and patch.go) — a subpackage is a different import path. And cmd/mxcli/docker/update_widgets_test.go read sdk/mpr/testdata/v1-project by filesystem path, an os.DirFS string rather than an import. So: before deleting a package, search for three things — its own import path, its subpackages' paths, and its directory as a literal string (testdata, go:embed, scripts). The last two are invisible to any importer census. The six importers went to mdl/types, not to modelsdk/mpr/version. sdk/mpr/version.ProjectVersion is `type ProjectVersion = types.ProjectVersion`, an alias, so types.ProjectVersion is the same type — while modelsdk/mpr/version declares a duplicate struct that would have been a different one. Read the declaration, not the name. The v1 fixture moved to modelsdk/mpr/testdata/. Everything was repointed and proven green with the package still present, which separates "the repoint was wrong" from "the deletion was wrong". Two measurements worth keeping. The shipped binary is identical in size before and after, so the linker had already dropped the package: this removes source weight, not runtime behaviour. And sdk/widgets fell to zero importers as a side effect but is deliberately kept — modelsdk/widgets/dirty_template_test.go reads sdk/widgets/templates/mendix-11.6 by path. Same trap, caught by grepping the directory name rather than the import. The import guard added in the previous slice is removed: with the package gone, an import is a compile error, strictly stronger than a test asserting it. Gates: build, vet (incl. -tags integration), go test ./..., check-mdl (560), check-findings, and the full repo-wide integration suite: exit 0, no failures. docker check and check --post-migration are byte-identical to the pre-deletion binary. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018hifgRSawfaRWXS44YKtSJ
Deleting sdk/mpr left the always-in-context routing document pointing at files that are gone. CLAUDE.md is where a session looks first, so a dead path there does not just go stale — it sends the next reader somewhere that cannot be opened, and every one of these was a routing instruction rather than prose. Eight sites. The architecture tree listed sdk/mpr's reader/writer/parser/utils and no modelsdk at all, which had it describing the deleted engine as the format layer and omitting the real one. The BSON storage-name procedure said to verify against sdk/mpr/parser_microflow.go; that now points at modelsdk/codec and modelsdk/gen. The write-choke-point list named both engines' files — there is one engine, so the list is now one entry and says so. The test-first checklist sent a parser test to sdk/mpr/ and a backend mutation test to mdl/backend/mpr/, neither of which exists. Useful Files offered sdk/mpr/parser.go and writer_widgets.go. Two checklist items were rules about a package that no longer exists, so they are restated as rules about the engine that does: "no sdk/mpr write imports in the executor" becomes "no engine internals in the executor" (modelsdk/mpr, modelsdk/codec, modelsdk/gen), with the note that a missing backend method gets implemented rather than bypassed — which is what the last five slices kept running into. The shared-types rule described sdk/mpr re-exporting aliases; it now states the rule directly and cites modelsdk/mpr/version.ProjectVersion as the cautionary case, since that one duplicates types.ProjectVersion instead of aliasing it and the two print under the same name. Every path the file now names was checked to exist. Docs under docs/ are deliberately untouched: they describe what the code used to do, and ADRs are immutable by convention. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018hifgRSawfaRWXS44YKtSJ
AI Code ReviewCritical Issues
Moderate Issues
Minor Issues
What Looks Good
Recommendation Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
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.
Deletes
sdk/mpr. 163 files, 41,674 lines. This is the last step ofdocs/plans/2026-09-14-retire-legacy-engine.md, whose porting slices are alreadyupstream — this branch is those two commits and nothing else, on top of current
main.Why it can land on its own
The importer count was taken from 27 to 0 by the slices already merged here. On
this base the only remaining mention of the package is the guard test that held
the count at zero, and the six importers of the
sdk/mpr/versionsubpackage.Both are handled in the first commit.
Zero importers was not the same as safe to
rm -rfTwo live dependencies survived the count reaching zero, and neither is visible
to a check written against the parent package's import path:
sdk/mpr/version— 6 importers, two of them shipping code (docker/build.go,patch.go)sdk/mpr/testdata/v1-project— read bydocker/update_widgets_test.goos.DirFSstring, not an import at allThe six went to
mdl/types, not tomodelsdk/mpr/version, which looks likethe natural home and is the wrong one:
Reading the declaration rather than the name is what distinguishes them. The v1
fixture moved to
modelsdk/mpr/testdata/.Everything was repointed and proven green with the package still present,
then deleted as a separate step — which is what separates "the repoint was wrong"
from "the deletion was wrong".
Two measurements worth keeping
already dropped the package: this removes source weight, not runtime
behaviour.
docker checkandcheck --post-migrationare byte-identical tothe pre-deletion binary.
sdk/widgetsfell to zero importers as a side effect but is deliberatelykept —
modelsdk/widgets/dirty_template_test.goreadssdk/widgets/templates/mendix-11.6by path. The same path-not-import trap,caught by grepping the directory name. Worth its own look; not this PR's call.
The import guard is removed
The guard test that held the count at zero is deleted with the package: an import
of something that does not exist is a compile error, which is strictly
stronger than a test asserting the same thing.
The second commit: CLAUDE.md routing
Deleting the package left the always-in-context file pointing at files that are
gone — the architecture tree described the deleted engine and omitted
modelsdkentirely, the BSON storage-name procedure sent you to
sdk/mpr/parser_microflow.go, and the test-first checklist sent a parser test tosdk/mpr/. Eight sites updated; every path the file now names was checked toexist. Two checklist rules that were about the dead package are restated as
rules about the engine that does exist.
Docs under
docs/are deliberately untouched: they describe what the code usedto do, and ADRs are immutable by convention.
Verification
Run on this branch, on top of current upstream
main:make buildgo test ./...And on the fork before merge:
make vet(incl.-tags integration),the full repo-wide
make test-integration(exit 0, no failures),make check-mdl(560),
make check-findings(1,091 records)