{"record":{"id":"5cac9962a936aeae","repo":"larksuite/cli","slug":"w-source-q-w","errorCode":null,"errorMessage":"%w: source %q: %w","messagePattern":"%w: source %q: %w","errorType":"validation","errorClass":"skillref.ErrInvalidRemap","httpStatus":null,"severity":"error","filePath":"internal/skillpolicy/resolver.go","lineNumber":133,"sourceCode":"\t\tcomposed := newOverlayFS(lowerSnapshot, upperSnapshot, spec.Remove, spec.Allow)\n\t\tif err := validateRequiredSkills(composed); err != nil {\n\t\t\treturn Resolution{}, fmt.Errorf(\"plugin %q skill spec: %w\", owner, err)\n\t\t}\n\t\tcontent = composed\n\t}\n\trefs, err := resolveReferences(content, spec.ReferenceRemaps)\n\tif err != nil {\n\t\treturn Resolution{}, fmt.Errorf(\"plugin %q skill spec: %w\", owner, err)\n\t}\n\treturn Resolution{Content: content, References: refs}, nil\n}\n\nfunc resolveReferences(content fs.FS, remaps []platform.SkillRefRemap) (*skillref.Resolver, error) {\n\tmappings := make([]skillref.Mapping, 0, len(remaps))\n\tfor _, remap := range remaps {\n\t\tfrom, err := skillref.Parse(remap.From())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"%w: source %q: %w\", skillref.ErrInvalidRemap, remap.From(), err)\n\t\t}\n\t\tto, err := skillref.Parse(remap.To())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"%w: target %q: %w\", skillref.ErrInvalidRemap, remap.To(), err)\n\t\t}\n\t\tmappings = append(mappings, skillref.Mapping{From: from, To: to})\n\t}\n\treturn skillref.New(content, mappings)\n}\n\n// distinctOwners returns the unique contributing plugin names in\n// first-seen order. Mirrors cmdpolicy.distinctOwners.\nfunc distinctOwners(specs []PluginSkill) []string {\n\tseen := map[string]bool{}\n\towners := make([]string, 0, len(specs))\n\tfor _, s := range specs {\n\t\tif !seen[s.PluginName] {\n\t\t\tseen[s.PluginName] = true","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/skillpolicy/resolver.go#L115-L151","documentation":"resolveReferences could not parse the remap's source ('From') string into a skill reference; it wraps skillref.ErrInvalidRemap with the offending string and the parse error. Remap endpoints must be valid canonical skill references.","triggerScenarios":"A plugin's SkillsOverlay.ReferenceRemaps contains an entry whose From() fails skillref.Parse: empty string, invalid skill name, or a path/reference shape the parser rejects. Reached only via ResolveWithReferences with at least one remap.","commonSituations":"Hand-written remap tables with typos ('Code-Review'), path fragments ('skills/x/SKILL.md'), or a From value that predates a skill rename in a newer plugin version.","solutions":["Read the quoted source value and the underlying parse error in the message","Correct From() to the canonical reference syntax skillref.Parse accepts","Run skillref.Parse(remap.From()) in a plugin test to catch regressions","If the source skill was renamed, update the remap's From to the new name"],"exampleFix":"// before\nplatform.NewSkillRefRemap(\"Skills/Deploy\", \"release\")\n// after\nplatform.NewSkillRefRemap(\"deploy\", \"release\")","handlingStrategy":"validation","validationCode":"if _, err := skillref.Parse(remap.From()); err != nil {\n\treturn fmt.Errorf(\"invalid remap source %q: %w\", remap.From(), err)\n}","typeGuard":null,"tryCatchPattern":"_, err := skillpolicy.ResolveWithReferences(base, specs)\nif errors.Is(err, skillref.ErrInvalidRemap) { /* fix From value */ }","preventionTips":["Run skillref.Parse on every From at plugin init","Use canonical skill names without paths or case drift","Update remaps whenever a source skill is renamed"],"tags":["go","skillref","parsing","remap"],"backgroundTag":"invalid-skill-reference-remap","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}