{"record":{"id":"a7b1bd0596a3e59f","repo":"gastownhall/beads","slug":"invalid-dependency-format-q-for-issue-q","errorCode":null,"errorMessage":"invalid dependency format %q for issue %q","messagePattern":"invalid dependency format %q for issue %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/markdown.go","lineNumber":452,"sourceCode":"\treturn nil\n}\n\n// parseMarkdownDependencies reads a template's `### Dependencies` section as\n// the role's edge specs. `type:target` names the type; a bare target blocks.\nfunc parseMarkdownDependencies(deps []string, templateTitle string) ([]issueops.CreateDependency, error) {\n\tvar out []issueops.CreateDependency\n\tfor _, raw := range deps {\n\t\traw = strings.TrimSpace(raw)\n\t\tif raw == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar depType types.DependencyType\n\t\tvar target string\n\t\tif strings.Contains(raw, \":\") {\n\t\t\tparts := strings.SplitN(raw, \":\", 2)\n\t\t\tif len(parts) != 2 {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid dependency format %q for issue %q\", raw, templateTitle)\n\t\t\t}\n\t\t\tdepType = types.DependencyType(strings.TrimSpace(parts[0]))\n\t\t\ttarget = strings.TrimSpace(parts[1])\n\t\t} else {\n\t\t\tdepType = types.DepBlocks\n\t\t\ttarget = raw\n\t\t}\n\t\tif !depType.IsValid() {\n\t\t\treturn nil, fmt.Errorf(\"invalid dependency type %q for issue %q\", depType, templateTitle)\n\t\t}\n\t\tout = append(out, issueops.CreateDependency{Type: depType, TargetID: target})\n\t}\n\treturn out, nil\n}\n\n// reportMarkdownBatch prints what the batch created, in the one shape both\n// routes print.\nfunc reportMarkdownBatch(issues []*types.Issue, in createInput) error {","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/markdown.go#L434-L470","documentation":"Markdown dependency lines use `type:target` (e.g. `blocks:BD-123`); parseMarkdownDependencies splits on the first colon and validates it yields exactly two parts. Because SplitN with n=2 always returns one or two parts, this error fires when the raw token contains no colon in this branch's expectation being violated or the raw value is otherwise malformed (e.g. empty or whitespace-only segment), producing an invalid dependency spec for the given issue title.","triggerScenarios":"A `Depends on`/dependency field line for an issue in the markdown contains a malformed `raw` entry — e.g. `\"blocks:\"` with empty target or a token that fails the two-part split — while building the batch request from parsed issue templates.","commonSituations":"Hand-edited markdown where a dependency value was truncated (\"blocks:\" with no target); copy-paste dropping text after the colon; template generators emitting empty dependency entries; typos like an extra colon creating unexpected segments in surrounding validation.","solutions":["Fix the dependency line to full `type:target` form, e.g. `blocks:bd-42`","Remove empty or truncated dependency entries from the markdown","Ensure the target issue exists / is spelled correctly","Use the bare-target shorthand (no colon) if you just want a plain `blocks` dependency"],"exampleFix":"// before\nDepends on: blocks:\n// after\nDepends on: blocks:bd-42","handlingStrategy":"validation","validationCode":"func validDep(raw string) bool {\n\tif !strings.Contains(raw, \":\") {\n\t\treturn strings.TrimSpace(raw) != \"\" // bare blocks shorthand\n\t}\n\tparts := strings.SplitN(raw, \":\", 2)\n\treturn strings.TrimSpace(parts[0]) != \"\" && strings.TrimSpace(parts[1]) != \"\"\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write dependencies as `type:target` with a non-empty target","Never hand-truncate dependency lines in markdown","Lint generated markdown for empty dependency values before import"],"tags":["markdown","parsing","dependency-format","validation"],"backgroundTag":"invalid-dependency-format","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}