{"record":{"id":"1f67d37e75714d9a","repo":"gastownhall/beads","slug":"bulk-dependency-validation-failed-s","errorCode":null,"errorMessage":"bulk dependency validation failed:\n  %s","messagePattern":"bulk dependency validation failed:\n  (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/dep.go","lineNumber":747,"sourceCode":"\t\t\tcontinue\n\t\t}\n\n\t\tresolved = append(resolved, current)\n\t}\n\n\tif len(errs) > 0 {\n\t\tfor _, edge := range resolved {\n\t\t\tfor _, cleanup := range edge.Cleanups {\n\t\t\t\tcleanup()\n\t\t\t}\n\t\t}\n\t\treturn nil, bulkDepValidationError(errs)\n\t}\n\treturn resolved, nil\n}\n\nfunc bulkDepValidationError(errs []string) error {\n\treturn fmt.Errorf(\"bulk dependency validation failed:\\n  %s\", strings.Join(errs, \"\\n  \"))\n}\n\nfunc dependencyStoreKey(s storage.DoltStorage) string {\n\tif locator, ok := storage.UnwrapStore(s).(storage.StoreLocator); ok {\n\t\tif cliDir := strings.TrimSpace(locator.CLIDir()); cliDir != \"\" {\n\t\t\treturn \"cli:\" + filepath.Clean(cliDir)\n\t\t}\n\t\tif path := strings.TrimSpace(locator.Path()); path != \"\" {\n\t\t\treturn \"path:\" + filepath.Clean(path)\n\t\t}\n\t}\n\treturn fmt.Sprintf(\"instance:%p\", s)\n}\n\n// depListAnchor is one resolved `bd dep list` argument: the canonical id, the\n// store that actually holds it, and the routing handle that has to be closed.\ntype depListAnchor struct {\n\tfullID string","sourceCodeStart":729,"sourceCodeEnd":765,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/dep.go#L729-L765","documentation":"Aggregated validation error returned by bulkDepValidationError when one or more edges in a bulk dependency file fail validation. Each individual problem is joined with newlines after the header, so the full message lists every bad line. It guards `bd dep add --file` from partially applying an invalid batch.","triggerScenarios":"readBulkDepEdges or validateBulkDepEdges collect per-edge errors (malformed IDs, bad dependency type, unknown issue, self-dependency) and find errs len > 0, so the entire batch is rejected with the joined list.","commonSituations":"Hand-written dependency files with typos in issue IDs; using an unsupported type keyword instead of blocks/blocks, parent-child, related, etc.; copying a file from another project whose issues don't exist locally.","solutions":["Read each indented line in the error — it names the offending edge and reason.","Fix the listed lines in the dependency file (correct issue IDs, use valid types: blocks, related, parent-child, discovered-from, etc.).","Run `bd show <id>` for each referenced issue to confirm the IDs exist in this repo's database.","Re-run the bulk add after corrections; the batch is all-or-nothing so no partial state needs cleanup."],"exampleFix":"// before (deps.txt)\nbd-1 blocks bd-99999   # bd-99999 does not exist\nbd-2 bloks bd-3        # typo in type\n\n// after (deps.txt)\nbd-1 blocks bd-2\nbd-2 related bd-3","handlingStrategy":"validation","validationCode":"// lint deps.txt before applying: id<TAB|space>type<TAB|space>id\nwhile read -r from t to; do\n  case \"$t\" in blocks|related|parent-child|discovered-from) ;; *) echo \"bad type: $t\" >&2; exit 1;; esac\n  bd show \"$from\" >/dev/null || { echo \"unknown issue $from\" >&2; exit 1; }\n  bd show \"$to\" >/dev/null || { echo \"unknown issue $to\" >&2; exit 1; }\ndone < deps.txt","typeGuard":null,"tryCatchPattern":"if err := addBulkDeps(file); err != nil {\n\tvar verr *bulkValidation\n\tif errors.As(err, &verr) {\n\t\tfor _, line := range strings.Split(verr.msg, \"\\n\")[1:] {\n\t\t\tfmt.Fprintln(os.Stderr, line)\n\t\t}\n\t\tos.Exit(1)\n\t}\n\treturn err\n}","preventionTips":["Validate issue IDs exist with bd show before writing them into a bulk file.","Use only documented dependency type keywords.","Keep bulk files generated by scripts rather than hand-edited.","Sync (`bd dolt pull`) before bulk-adding refs to issues created elsewhere."],"tags":["validation","cli","dependencies"],"backgroundTag":"schema-validation-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}