new: Match package import paths in Go relationship inference - #1
Draft
jonpoole-fluidstack wants to merge 20 commits into
Draft
new: Match package import paths in Go relationship inference#1jonpoole-fluidstack wants to merge 20 commits into
jonpoole-fluidstack wants to merge 20 commits into
Conversation
jonpoole-fluidstack
force-pushed
the
jon/go-single-module-import-inference
branch
from
August 12, 2026 09:05
a8b7eb0 to
39cc84f
Compare
go list -deps ./... enumerates every package under the scanned directory, including packages belonging to projects nested inside it. Those showed up as inferred dependencies from the parent to each nested child, which forms a cycle whenever a child declares dependsOn on its parent (verified against a real workspace with nested projects). Skip anything under the project's own import path when resolving edges. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jonpoole-fluidstack
force-pushed
the
jon/go-single-module-import-inference
branch
from
August 13, 2026 16:34
24c24ba to
84921b1
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…own file, project graph in tier2 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Moon's Go relationship inference resolves
go list -depsoutput by module path only, so a repo where all projects share onego.mod(likesystems) can never infer a project→project edge — every internal package collapses to the root module path (upstream context: moonrepo/moon#2360).This adds a fallback: each project gets a package prefix — its own
go.modmodule path, or the nearest ancestorgo.mod's module path joined with the project's relative directory — andgo listentries that module matching can't resolve are matched by longest import-path prefix instead.go listnow emits{{.Module.Path}}|{{.ImportPath}}pairs so both matching modes share one invocation.go.work)module …package …, e.g.a → b (production)Non-obvious decisions:
go_toolchain-v1.4.4tag, not master — master needs proto ≥0.60 / moon 2.5 APIs; this branch builds and loads under moon 2.4.5 for local verification against a real workspace.viastrings are byte-identical (all 29 pre-existing tests pass unchanged; +1 new single-module test).Verified end-to-end on a demo single-module workspace:
moon project anow reportsDepends on: b (production), and touchinglibs/bmarksaaffected inmoon query projects --affected.🤖 Generated with Claude Code