{"record":{"id":"0b707de46c2f5a21","repo":"gastownhall/beads","slug":"waits-for-gate-requires-waits-for-no-spawner","errorCode":null,"errorMessage":"--waits-for-gate requires --waits-for (no spawner ID specified)","messagePattern":"--waits-for-gate requires --waits-for \\(no spawner ID specified\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/create_deps.go","lineNumber":203,"sourceCode":"\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)\")\n\t\t}\n\t\treturn nil, nil\n\t}\n\tif gate == \"\" {\n\t\tgate = types.WaitsForAllChildren\n\t}\n\tif !types.IsValidWaitsForGate(gate) {\n\t\treturn nil, fmt.Errorf(\"invalid --waits-for-gate value %q (valid: all-children, any-children)\", gate)\n\t}\n\treturn &domain.WaitsForSpec{SpawnerID: spawnerID, Gate: gate}, nil\n}\n\nfunc discoveredFromParent(deps []string) string {\n\tfor _, raw := range deps {\n\t\traw = strings.TrimSpace(raw)\n\t\tif raw == \"\" || !strings.Contains(raw, \":\") {\n\t\t\tcontinue\n\t\t}","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/create_deps.go#L185-L221","documentation":"buildWaitsFor constructs the WaitsForSpec tying a new issue to a spawner parent. --waits-for-gate only configures HOW children are waited on (all-children vs any-children); it is meaningless without a spawner. When the caller explicitly passed --waits-for-gate but no --waits-for spawner ID, the CLI rejects it instead of silently ignoring the flag.","triggerScenarios":"`bd create \"Task\" --waits-for-gate any-children` without `--waits-for <spawner>`; the gateExplicit path in buildWaitsFor (called from runCreateProxiedSingle) sees an empty trimmed spawnerID and returns this error.","commonSituations":"Users copying the --waits-for-gate flag from an example but omitting the required --waits-for; wrappers that pass through an empty spawner variable while always appending the gate flag.","solutions":["Add the spawner: pass `--waits-for <parent-or-spawner-id>` alongside --waits-for-gate","Drop --waits-for-gate if you don't intend a waits-for relationship at all","In wrappers, only emit --waits-for-gate when the spawner value is non-empty"],"exampleFix":"// before\nbd create \"Child\" --waits-for-gate any-children   # missing spawner\n// after\nbd create \"Child\" --waits-for bd-parent --waits-for-gate any-children","handlingStrategy":"validation","validationCode":"if gate != \"\" && spawner == \"\" {\n    return errors.New(\"--waits-for-gate given without --waits-for\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair --waits-for-gate with --waits-for in wrapper scripts","Emit the gate flag conditionally only when the spawner value is non-empty","Remember the gate alone never creates a waits-for relationship"],"tags":["cli","waits-for","validation","missing-argument"],"backgroundTag":"flag-requires-companion-flag","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}