{"record":{"id":"f7720bbdafb445fe","repo":"gastownhall/beads","slug":"resolving-deps-target-q-w","errorCode":null,"errorMessage":"resolving --deps target %q: %w","messagePattern":"resolving --deps target %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/create_deps.go","lineNumber":123,"sourceCode":"// good fully-qualified row (GH#5005).\nfunc resolveDepSpecTargets(ctx context.Context, st storage.Storage, specs []domain.DependencySpec) ([]domain.DependencySpec, error) {\n\tif len(specs) == 0 {\n\t\treturn specs, nil\n\t}\n\tout := make([]domain.DependencySpec, len(specs))\n\tfor i, spec := range specs {\n\t\tout[i] = spec\n\t\ttarget := strings.TrimSpace(spec.TargetID)\n\t\tif target == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"--deps target is empty\")\n\t\t}\n\t\tif strings.HasPrefix(target, \"external:\") {\n\t\t\tout[i].TargetID = target\n\t\t\tcontinue\n\t\t}\n\t\tresolved, err := utils.ResolvePartialID(ctx, st, target)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"resolving --deps target %q: %w\", target, err)\n\t\t}\n\t\tout[i].TargetID = resolved\n\t}\n\treturn out, nil\n}\n\nfunc parseDepSpec(raw string) (domain.DependencySpec, error) {\n\tif !strings.Contains(raw, \":\") {\n\t\treturn domain.DependencySpec{\n\t\t\tType:     types.DepBlocks,\n\t\t\tTargetID: raw,\n\t\t}, nil\n\t}\n\n\tparts := strings.SplitN(raw, \":\", 2)\n\tif len(parts) != 2 {\n\t\treturn domain.DependencySpec{}, fmt.Errorf(\"invalid dependency format %q, expected 'type:id' or 'id'\", raw)\n\t}","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/create_deps.go#L105-L141","documentation":"After basic validation, each non-external --deps target is passed to utils.ResolvePartialID, which turns a partial ID or bare slug into a canonical issue ID. If that resolution fails (no match, ambiguous prefix), resolveDepSpecTargets wraps the underlying error with this prefix so the offending target is named in the message.","triggerScenarios":"`bd create ... --deps \"blocks:bd-999\"` where bd-999 doesn't exist; a too-ambiguous prefix like \"bd-1\" matching multiple issues; a misspelled slug such as \"blocks:auth-fix\" when no issue has that slug. Only \"external:...\" targets bypass resolution.","commonSituations":"Typo'd or stale issue IDs from deleted/closed issues in another DB; running against a different .beads database than the one the IDs came from; abbreviated IDs that match more than one issue.","solutions":["Run `bd list` (or `bd show <partial>`) to find the correct full ID and use it","Use a longer, unambiguous ID prefix so ResolvePartialID has a unique match","Check you are in the right repo/database — the target issue may live elsewhere","If the target is genuinely not a local issue, prefix it with \"external:\" to skip resolution"],"exampleFix":"// before\nbd create \"Task\" --deps \"blocked-by:bd-1\"   # ambiguous: matches bd-1 and bd-10\n// after\nbd create \"Task\" --deps \"blocked-by:bd-1a2b\"  # longer unambiguous prefix","handlingStrategy":"validation","validationCode":"out, err := exec.Command(\"bd\", \"show\", partialID).CombinedOutput()\nif err != nil {\n    return fmt.Errorf(\"dep target %q does not resolve in this DB: %s\", partialID, out)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-resolve partial IDs with `bd show` before passing them as deps","Use full IDs in scripts to avoid ambiguity","Use the \"external:\" prefix for targets that aren't local issues","Confirm you're operating on the intended .beads database"],"tags":["cli","dependencies","id-resolution","not-found"],"backgroundTag":"issue-id-not-found","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}