-
Notifications
You must be signed in to change notification settings - Fork 74
feat(compose): resolve local profiles and providers in base harness (#5240) #5461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
01b9a7f
bcc6eb3
d3bda09
4ad640d
719ef49
e794b9a
893ec29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -779,17 +779,29 @@ func resolveFromLock(h *harness.Harness, entry *lock.HarnessLock, workspaceRoot | |
| } | ||
| h.Skills = filtered | ||
|
|
||
| // Strip URL entries from providers — URL-resolved providers are now in | ||
| // the ResolvedProvider list, mirroring resolve.ResolveHarness behavior. | ||
| // Strip URL and absolute-path entries from providers — URL-resolved | ||
| // providers are in the ResolvedProvider list, and absolute-path entries | ||
| // (from base composition cache) will be resolved by the local-only | ||
| // ResolveHarness pass. Keep only bare provider names. | ||
| remainingProviders := h.Providers[:0] | ||
| for _, p := range h.Providers { | ||
| if !harness.IsURL(p) { | ||
| if !harness.IsURL(p) && !harness.IsProviderPath(p) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [HIGH] correctness — H1 is not actually fixed: local providers are still dropped in the lock path The Trace: The strip is also asymmetric: providers strip on Suggestion: In |
||
| remainingProviders = append(remainingProviders, p) | ||
| } | ||
| } | ||
| h.Providers = remainingProviders | ||
| // Strip URL and absolute-path profiles — URL-resolved profiles are in | ||
| // the ResolvedProfile list from lock deps, and absolute-path entries | ||
| // (from base composition cache) are reconstructed from lock deps too. | ||
| // Keep only relative-path profiles for the local-only ResolveHarness pass. | ||
| if h.OpenShell != nil { | ||
| h.OpenShell.Profiles = nil | ||
| remaining := h.OpenShell.Profiles[:0] | ||
| for _, p := range h.OpenShell.Profiles { | ||
|
maruiz93 marked this conversation as resolved.
|
||
| if !harness.IsURL(p) && !filepath.IsAbs(p) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [medium] logic-error resolveFromLock strips ALL absolute-path profiles via !filepath.IsAbs(p) and all provider paths via !harness.IsProviderPath(p), but local-path profiles/providers resolved by ResolveRelativeTo are also absolute. When a harness combines URL references (triggering the lock-file path) with local-path profiles/providers, the local entries are stripped without appearing in the lock file. They cannot be recovered by the second ResolveHarness call because the guards find no remaining entries. A harness with a URL-referenced skill and a local profile path would silently lose the local profile when running with a lock file. Suggested fix: Track which entries correspond to lock-file dependencies and only strip those. Alternatively, preserve remaining absolute-path entries that have no corresponding lock dep so the second ResolveHarness pass can process them. |
||
| remaining = append(remaining, p) | ||
| } | ||
| } | ||
| h.OpenShell.Profiles = remaining | ||
| } | ||
|
|
||
| return resolve.ResolveResult{ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.