diff --git a/pkg/cli/add_package_manifest_includes.go b/pkg/cli/add_package_manifest_includes.go index 72d42106e52..dc6f33b7e1f 100644 --- a/pkg/cli/add_package_manifest_includes.go +++ b/pkg/cli/add_package_manifest_includes.go @@ -93,6 +93,7 @@ func extractManifestIncludes(value any, manifestPath string) ([]repositoryPackag seen[include] = struct{}{} normalized = append(normalized, include) } + addPackageManifestLog.Printf("Extracted %d includes entries from %s (%d warnings)", len(normalized), manifestPath, len(warnings)) return normalized, warnings, nil } @@ -299,6 +300,7 @@ func extractManifestSkillDirs(value any, manifestPath string) ([]string, []strin seen[dir] = struct{}{} normalized = append(normalized, dir) } + addPackageManifestLog.Printf("Extracted %d skill directories from %s (%d warnings)", len(normalized), manifestPath, len(warnings)) return normalized, warnings } @@ -434,6 +436,7 @@ func normalizePackageInstallablePaths(includes []repositoryPackageInclude, packa DestinationPath: destination, }) } + addPackageManifestLog.Printf("Normalized %d package installable paths (package path=%q)", len(normalized), packagePath) return normalized } diff --git a/pkg/cli/add_package_manifest_parse.go b/pkg/cli/add_package_manifest_parse.go index c343b0de783..a25cdac5653 100644 --- a/pkg/cli/add_package_manifest_parse.go +++ b/pkg/cli/add_package_manifest_parse.go @@ -30,6 +30,8 @@ type repositoryPackageManifest struct { } func parseRepositoryPackageManifest(manifestPath string, content []byte) (*repositoryPackageManifest, []string, error) { + addPackageManifestLog.Printf("Parsing package manifest %s (%d bytes)", manifestPath, len(content)) + root, name, err := parseRepositoryPackageManifestRoot(manifestPath, content) if err != nil { return nil, nil, err @@ -101,6 +103,7 @@ func populateRepositoryPackageManifestVersions(manifest *repositoryPackageManife } currentVersion = semverutil.NormalizeGitDescribeSemver(currentVersion) if semverutil.Compare(currentVersion, manifest.MinVersion) < 0 { + addPackageManifestLog.Printf("Manifest min-version %s exceeds current gh-aw version %s", manifest.MinVersion, currentVersion) return fmt.Errorf("invalid Agentic Workflow manifest %q: min-version %q requires gh-aw %s or newer (current: %s). Upgrade gh-aw, or lower min-version in aw.yml to a version at or below the current one. Example:\nmin-version: %s", manifestPath, manifest.MinVersion, manifest.MinVersion, currentVersion, currentVersion) } } @@ -203,6 +206,7 @@ func validateManifestInstallableWorkflowPrivacy(manifestPath string, installatio privateValue, hasPrivate := ExtractWorkflowPrivateSetting(string(content)) if hasPrivate && privateValue { + addPackageManifestLog.Printf("Rejecting manifest %s: installable workflow %s sets private: true", manifestPath, installationSource) return fmt.Errorf("invalid Agentic Workflow manifest %q: workflow %q sets private: true and cannot be included because private workflows cannot be added. Remove 'private: true' from the workflow frontmatter or exclude it from the manifest. Example:\n---\nprivate: false\n---", manifestPath, installationSource) } } diff --git a/pkg/cli/add_package_manifest_remote.go b/pkg/cli/add_package_manifest_remote.go index 29d7ec9e301..1bb1a055371 100644 --- a/pkg/cli/add_package_manifest_remote.go +++ b/pkg/cli/add_package_manifest_remote.go @@ -55,6 +55,7 @@ func parseRepositoryPackageSpec(spec string) (*RepoSpec, bool, error) { repoSpec.Version = parts[1] } + addPackageManifestLog.Printf("Parsed repository package spec %q as repo=%s path=%q version=%q", spec, repoSpec.RepoSlug, repoSpec.PackagePath, repoSpec.Version) return repoSpec, true, nil } @@ -134,6 +135,7 @@ func resolveRepositoryPackageDefaultBranch(ctx context.Context, repoSlug, host s } return "", fmt.Errorf("repository %s on %s returned an empty default branch. Ensure the repository exists and is accessible", repoSlug, targetHost) } + addPackageManifestLog.Printf("Resolved default branch for %s: %s", repoSlug, branch) return branch, nil } @@ -163,6 +165,7 @@ func isGhAwRepository(repoSlug string) bool { // hostname (for example "github.com" or a GHES host); when provided, gh API // calls are executed against that host. func resolveRepositoryPackageLatestRelease(ctx context.Context, repoSlug, host string) (string, error) { + addPackageManifestLog.Printf("Resolving latest release for %s (host=%q)", repoSlug, host) deps := workflowUpdateDeps{ runReleasesAPI: func(innerCtx context.Context, repo string) ([]byte, error) { args := []string{"api", fmt.Sprintf("/repos/%s/releases", repo), "--jq", ".[].tag_name"} diff --git a/pkg/cli/add_package_manifest_resources.go b/pkg/cli/add_package_manifest_resources.go index 6a29be0e526..f4cd5970fc1 100644 --- a/pkg/cli/add_package_manifest_resources.go +++ b/pkg/cli/add_package_manifest_resources.go @@ -38,6 +38,7 @@ func extractManifestResources(value any, manifestPath string) ([]repositoryPacka seenDestinations[key] = resource.Source resources = append(resources, resource) } + addPackageManifestLog.Printf("Extracted %d resources entries from %s", len(resources), manifestPath) return resources, nil } @@ -109,6 +110,7 @@ func normalizeLocalPackageResourcePaths(resources []repositoryPackageResource, p for _, resource := range resources { absolutePath := filepath.Clean(filepath.Join(packageDir, filepath.FromSlash(resource.Source))) if err := validateLocalPackageMappingSource(absolutePath, packageDir, resource.Source); err != nil { + addPackageManifestLog.Printf("Rejecting local resource source %q outside package dir %q: %v", resource.Source, packageDir, err) return nil, err } normalized = append(normalized, resolvedPackageResource{ diff --git a/pkg/cli/add_package_manifest_skills.go b/pkg/cli/add_package_manifest_skills.go index c3651123e9a..a327cfae3a5 100644 --- a/pkg/cli/add_package_manifest_skills.go +++ b/pkg/cli/add_package_manifest_skills.go @@ -18,6 +18,8 @@ import ( // contain a SKILL.md file but are not already covered by the manifest. Each skill folder // is traversed recursively so that all nested files are included. func resolvePackageSkillFiles(ctx context.Context, owner, repo, packagePath, ref, host string, explicitSkillDirs []string) ([]resolvedPackageSkillFile, []string, error) { + addPackageManifestLog.Printf("Resolving skill files for %s/%s (path=%q, ref=%s, %d explicit dirs)", owner, repo, packagePath, ref, len(explicitSkillDirs)) + // Step 1: resolve manifest skills first (explicit dirs). manifestSkillDirs := normalizeManifestSkillDirs(explicitSkillDirs, packagePath) skillDirs, warnings, err := resolvePackageSkillDirs(ctx, owner, repo, packagePath, ref, host, manifestSkillDirs) @@ -61,6 +63,7 @@ func resolvePackageSkillDirs(ctx context.Context, owner, repo, packagePath, ref, if len(manifestSkillDirs) == 0 { return nil, nil, err } + addPackageManifestLog.Printf("Skills auto-scan failed, proceeding with %d manifest-declared dirs only: %v", len(manifestSkillDirs), err) warnings = append(warnings, fmt.Sprintf("failed to auto-scan skills directory, proceeding with manifest skills only: %v", err)) } @@ -164,6 +167,7 @@ func scanPackageSkillDirs(ctx context.Context, owner, repo, packagePath, ref, ho } } } + addPackageManifestLog.Printf("Auto-scan found %d skill directories under %s/%s (path=%q)", len(skillDirs), owner, repo, packagePath) return skillDirs, nil }