{"record":{"id":"b71e629ee4e66151","repo":"gastownhall/beads","slug":"invalid-dependency-format-q-expected-type-id-o","errorCode":null,"errorMessage":"invalid dependency format %q, expected 'type:id' or 'id'","messagePattern":"invalid dependency format %q, expected 'type:id' or 'id'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/create_deps.go","lineNumber":140,"sourceCode":"\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}\n\trawType := types.DependencyType(strings.TrimSpace(parts[0]))\n\ttarget := strings.TrimSpace(parts[1])\n\n\tspec := domain.DependencySpec{TargetID: target, Type: canonicalDependencyType(rawType)}\n\tif rawType == types.DepBlocks {\n\t\t// Explicit \"blocks:\" (as opposed to the \"depends-on\"/\"blocked-by\"\n\t\t// aliases, which keep direction) reverses direction: the target\n\t\t// depends on the issue being created, not the other way around.\n\t\tspec.SwapDirection = true\n\t}\n\n\tif err := validateDependencyType(spec.Type); err != nil {\n\t\treturn domain.DependencySpec{}, err\n\t}\n\treturn spec, nil\n}\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/create_deps.go#L122-L158","documentation":"parseDepSpec parses each --deps entry as either a bare issue ID or \"type:id\" (single colon split). If the string contains a colon but splitting on the FIRST colon still fails to yield two parts — practically, an empty string that isn't a plain ID or malformed input like \"::\" or a lone \":\" — this error fires. It tells you the expected grammar: 'type:id' or 'id'.","triggerScenarios":"`bd create ... --deps \":\"` or `--deps \"::bd-5\"`-style malformed entries where SplitN(raw,\":\",2) does not return exactly 2 parts (e.g. raw is empty); also any spec string with unexpected formatting that slipped past the empty check.","commonSituations":"Hand-edited scripts with mangled separators (using '|' or ';' instead of ':'); accidentally passing an entire flag string as one dep; empty strings produced by aggressive shell splitting.","solutions":["Write each dep as either '<id>' or '<type>:<id>', e.g. \"blocked-by:bd-3\" or \"bd-3\"","Check for doubled colons or wrong separators in your script's deps string","Echo the composed --deps value before invoking bd to see the malformed entry"],"exampleFix":"// before\nbd create \"Task\" --deps \"blocked-by::bd-3\"   # malformed\n// after\nbd create \"Task\" --deps \"blocked-by:bd-3\"","handlingStrategy":"validation","validationCode":"func validDepSpec(s string) bool {\n    s = strings.TrimSpace(s)\n    if s == \"\" { return false }\n    if !strings.Contains(s, \":\") { return true } // bare id\n    parts := strings.SplitN(s, \":\", 2)\n    return len(parts) == 2 && parts[0] != \"\" && parts[1] != \"\"\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep to the documented grammar: '<id>' or '<type>:<id>'","Quote the --deps value in shell to protect ':' and ','","Log/echo the composed flag before invoking bd in scripts"],"tags":["cli","dependencies","argument-parsing","syntax"],"backgroundTag":"invalid-dependency-format","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}