Uh oh!
There was an error while loading. Please reload this page.
feat: reference an out-of-repo module into the run graph (#467) - #468
Merged
antoinetoussaint-byte merged 1 commit intoAug 24, 2026
Conversation
Add a `codefly add module <name> --source <path>` mode that declares a module by reference instead of vendoring a copy, and surface referenced modules in `codefly doctor workspace`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Closes#467.
Summary
ModuleReference.PathOverride(path:inworkspace.codefly.yaml) flows throughWorkspace.ModulePath→LoadModuleFromReference→LoadServices, socodefly runalready boots a referenced module alongside local ones. The gap was purely CLI surface: no way to declare a reference, anddoctornever reported one.codefly add module <name> --source <path>: registers a module by reference (records apath:override, absolute for out-of-repo sources, workspace-relative when the source lives in-tree) instead of vendoring a copy undermodules/<name>/. The source is loaded and its manifest name checked, so a dangling or mislabelled reference fails before anything is written. Mutually exclusive with--agent(scaffold mode).codefly doctor workspacecheck that names each referenced module and its resolved path, flagging an unresolved reference with the new stable diagnostic codemodule_reference_unresolved— instead of the opaque "cannot load workspace services" that surfaced before.sync module, which still vendors a hash-pinned base.Known constraint — out-of-repo references are stored as absolute paths (interim)
This CLI is pinned to
core v0.3.8, whose module-reference validation confines relative overrides to the workspace subtree. So an out-of-repo source (a sibling checkout) can only be stored as an absolutepath:— which is machine-specific and not portable across checkouts/CI. Committing such a reference and cloning the repo elsewhere will surface asmodule_reference_unresolvedincodefly doctoruntil the path is fixed locally.The portable form (
path: ../host, a relative sibling path) is unblocked by codefly-dev/core#351 (merged), which permits upward-traversing relative overrides for module references specifically. A follow-up will bump this CLI's core pin to a release containing #351 and switchadd module --sourceto store the relative form when possible. Shipping the absolute-path interim now keeps the surface flexible while that lands.Test plan
go test ./cmd/add/ ./cmd/— new tests: reference registers apath:entry without vendoring and resolves back to the source; name mismatch is rejected without registering; doctor reports a resolved reference and flags an unresolved one asmodule_reference_unresolved.gofmt/go vetclean on changed files;go build ./cmd/....docs/commands.mdupdated with the--sourceexample and the composition-vs-vendoring note.🤖 Generated with Claude Code