{"record":{"id":"7993d0cb3fda0c74","repo":"larksuite/cli","slug":"w-whole-skill-source-q-requires-a-bare-target-s","errorCode":null,"errorMessage":"%w: whole-skill source %q requires a bare target skill, got %q","messagePattern":"%w: whole-skill source %q requires a bare target skill, got %q","errorType":"validation","errorClass":"ErrInvalidRemap","httpStatus":null,"severity":"error","filePath":"internal/skillref/resolver.go","lineNumber":61,"sourceCode":"\t}\n\tseen := make(map[string]bool, len(mappings))\n\tfor _, mapping := range mappings {\n\t\tfrom, to := mapping.From, mapping.To\n\t\tif _, err := Parse(from.String()); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"%w: source %q: %w\", ErrInvalidRemap, from.String(), err)\n\t\t}\n\t\tif _, err := Parse(to.String()); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"%w: target %q: %w\", ErrInvalidRemap, to.String(), err)\n\t\t}\n\t\tkey := from.String()\n\t\tif seen[key] {\n\t\t\treturn nil, fmt.Errorf(\"%w: source %q is mapped more than once\", ErrInvalidRemap, key)\n\t\t}\n\t\tseen[key] = true\n\n\t\tif from.Path == \"\" {\n\t\t\tif to.Path != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\t\"%w: whole-skill source %q requires a bare target skill, got %q\",\n\t\t\t\t\tErrInvalidRemap, key, to.String())\n\t\t\t}\n\t\t\tr.skills[from.Skill] = to\n\t\t} else {\n\t\t\tr.exact[key] = to\n\t\t}\n\t\texists, err := probe(content, to)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"%w: cannot inspect target %q: %w\",\n\t\t\t\tErrInvalidRemap, to.String(), err)\n\t\t}\n\t\tif !exists {\n\t\t\treturn nil, fmt.Errorf(\"%w: target %q does not exist in the composed skill tree\",\n\t\t\t\tErrInvalidRemap, to.String())\n\t\t}\n\t}\n\treturn r, nil","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/skillref/resolver.go#L43-L79","documentation":"Guard in skillref New: a whole-skill remap (source with no path) targets a reference that has a path. Whole-skill remaps may only redirect to a bare skill reference; a path-qualified target is invalid.","triggerScenarios":"Thrown at internal/skillref/resolver.go:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Drop the #path fragment from the target, or add a path to the source to remap a fragment instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}