{"record":{"id":"e665b2da09eaa043","repo":"gastownhall/beads","slug":"invalid-dependency-type-q-must-be-non-empty-max","errorCode":null,"errorMessage":"invalid dependency type %q (must be non-empty, max %d chars); valid types: %s","messagePattern":"invalid dependency type %q \\(must be non-empty, max (.+?) chars\\); valid types: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/create_deps.go","lineNumber":185,"sourceCode":"// like \"parent-child\" and custom types) passes through unchanged.\nfunc canonicalDependencyType(t types.DependencyType) types.DependencyType {\n\tswitch t {\n\tcase \"depends-on\", \"blocked-by\":\n\t\treturn types.DepBlocks\n\tdefault:\n\t\treturn t\n\t}\n}\n\n// validateDependencyType enforces that a (post-alias-normalization)\n// dependency type is both structurally valid and one of the well-known\n// built-in types. `bd create --deps` and `bd dep add --type` intentionally\n// reject custom/unknown dependency types (see the comment on\n// WellKnownDependencyTypes) — this is the single shared check so both\n// commands stay in lockstep.\nfunc validateDependencyType(t types.DependencyType) error {\n\tif !t.IsValid() {\n\t\treturn fmt.Errorf(\"invalid dependency type %q (must be non-empty, max %d chars); valid types: %s\",\n\t\t\tt, types.MaxDependencyTypeLen, createDepsAcceptedTypeList())\n\t}\n\tif !t.IsWellKnown() {\n\t\treturn fmt.Errorf(\"unknown dependency type %q; valid types: %s\",\n\t\t\tt, createDepsAcceptedTypeList())\n\t}\n\treturn nil\n}\n\n// buildWaitsFor validates and constructs a WaitsForSpec from the --waits-for\n// and --waits-for-gate flag values. gateExplicit must be true when the caller\n// explicitly passed --waits-for-gate (not relying on its default); in that case\n// a missing spawnerID is rejected rather than silently ignored.\nfunc buildWaitsFor(spawnerID, gate string, gateExplicit bool) (*domain.WaitsForSpec, error) {\n\tspawnerID = strings.TrimSpace(spawnerID)\n\tif spawnerID == \"\" {\n\t\tif gateExplicit {\n\t\t\treturn nil, fmt.Errorf(\"--waits-for-gate requires --waits-for (no spawner ID specified)\")","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/create_deps.go#L167-L203","documentation":"validateDependencyType is the single shared gate used by `bd create --deps` and `bd dep add`: custom/unknown dependency types are intentionally rejected, only well-known built-ins are accepted. This first branch fires when the type fails basic IsValid() checks — empty, or longer than types.MaxDependencyTypeLen.","triggerScenarios":"`bd create ... --deps \":bd-5\"` (empty type after canonicalization path), or a type string exceeding MaxDependencyTypeLen, via parseDepSpec, readBulkDepEdges, or runDepAddProxiedServer (`bd dep add --type \"<very long string>\"`).","commonSituations":"Bulk dependency files (bd dep add bulk) with a mangled first column leaving an empty type; generated scripts concatenating type names incorrectly and exceeding the length limit.","solutions":["Use one of the accepted built-in types listed in the error (blocks, parent-child, conditional-blocks, waits-for, related, discovered-from, etc.)","Fix the empty/overlong type value in your bulk file or script variable","Rely on the aliases \"depends-on\"/\"blocked-by\" which canonicalize to blocks"],"exampleFix":"// before\nbd dep add bd-1 --type \"super-long-custom-dependency-type-name-exceeding-limit\" --target bd-2\n// after\nbd dep add bd-1 --type blocks --target bd-2","handlingStrategy":"validation","validationCode":"if depType == \"\" || len(depType) > maxLen {\n    return fmt.Errorf(\"dependency type empty or too long\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate bulk-file columns before running bd dep add bulk","Only pass built-in type names; the CLI intentionally rejects custom types","Keep type constants centralized in your tooling, not ad-hoc strings"],"tags":["cli","dependencies","validation","custom-types-rejected"],"backgroundTag":"invalid-dependency-type","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}