Repository navigation
Resolve external import roots and repair imports during tidy - #236
Merged
Merged
Conversation
…261008 Refactor roots, tidy and migration for cohesive ownership
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.
Metadata-free Git dependencies previously assumed repository-root imports, so legacy
git_repo.root/sub_directoryinputs could not migrate reproducibly. Resolve import roots from the dependency's own import bindings or checked hints, record fallback roots inprotobuf.lock, and replay them on cold caches and frozen operations. Native, Buf and legacy root metadata retain priority.When an explicitly changed requirement adopts a different import namespace,
mod tidyrewrites uniquely verified consumer import declarations, compiles the proposed source, and commits source, manifest and lock together. For example, an old importsvc.protobecomesservice/v1/svc.protowhen the same verified dependency contract gains authoritativeroots api. Tidy does not upgrade declared versions; get/update report implicit namespace shifts with actionable adoption guidance.Migration verifies historical commits and hashes against the legacy archive, preserves target filenames and source bytes, and writes module-local generation filters. A working default namespace remains available beside disconnected protobuf tool projects. Snapshot aliases, full namespace collisions, changed source state, rollback, and omitted selected/reachable archive sources have explicit failure coverage.
Resolution, tidy and migration now have explicit ownership boundaries. Checked graph results own snapshot evidence; tidy planners consume read-only file observations; transaction writers own staged changes and rollback. Migration groups local-selection proof and candidate construction, and named Git requests state the required proof. These structural changes preserve the public CLI, APIs and configuration formats.
Fresh validation on source
4aa291c98817a716a1877c6e8c0880ea1e045765, standalone tests548508f9c9c4d15e6c28d233a2fd5b96b475c806and docs99b3bcb46116675bd537091c261ae6b85577728d:-mod=readonly; fresh CLI and MCP built from the tested source. Go versions and dependencies unchanged.go test -race -count=1 ./...: 836 top-level tests, zero failures/skips; 78.3% statement coverage. Test harness unit tests passed with-racetoo.-race -count=1: 203 top-level tests and 936 passing test/subtest results in 77.075s, zero skips. This includes Go SDK compilation, managed options/output paths, command plugins, migration wizard, internal aliases, replacements, imported breaking changes, historical modules and cold/frozen replay.-race.go vet, pinned golangci-lint 2.14.0 (zero issues), pinned Hadolint, schema drift, developer-task dispatch and deterministic native proto example passed.The external-plugin
python_grpc_reprodiagnostic was also checked with-race: the working gRPC Python control passed all eight cases, while the pinned Djarvur90e4d93generator reproduced six expectedAttributeErrorfailures and passed both same-file controls. Captured requests include the correct imported descriptors; running that generator directly on the same request reproduces its identical faulty response. The builtin passes all eight cases. A separate stale-output experiment verified that changing output directories can leave Python loading older bindings; it does not establish the original report's cause. Windows binaries were cross-compiled but not executed locally. Full Docker builder stages and release upload were not run.Companion PRs: CLI regressions, EN/RU documentation.