{"record":{"id":"da5c881ac2814d65","repo":"gastownhall/beads","slug":"invalid-waits-for-gate-value-q-valid-all-chil","errorCode":null,"errorMessage":"invalid --waits-for-gate value %q (valid: all-children, any-children)","messagePattern":"invalid --waits-for-gate value %q \\(valid: all-children, any-children\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/create_deps.go","lineNumber":211,"sourceCode":"}\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}\n\t\tparts := strings.SplitN(raw, \":\", 2)\n\t\tif len(parts) != 2 {\n\t\t\tcontinue\n\t\t}\n\t\tdepType := types.DependencyType(strings.TrimSpace(parts[0]))\n\t\ttarget := strings.TrimSpace(parts[1])\n\t\tif depType == types.DepDiscoveredFrom && target != \"\" {\n\t\t\treturn target","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/create_deps.go#L193-L229","documentation":"The --waits-for-gate value is validated against types.IsValidWaitsForGate; only the two built-in gates, all-children and any-children, are accepted. Any other spelling is rejected with this error listing the valid options.","triggerScenarios":"`bd create ... --waits-for bd-x --waits-for-gate all` or `--waits-for-gate ANY_CHILDREN` or any typo like \"all-childern\" — buildWaitsFor (runCreateProxiedSingle path) with a non-empty spawnerID but a gate that fails IsValidWaitsForGate.","commonSituations":"Abbreviating gate names; using snake_case or enum-style spellings from internal APIs in the CLI flag; scripts parameterizing the gate with a free-form string.","solutions":["Use exactly \"all-children\" or \"any-children\" (lowercase, hyphenated)","Normalize the gate value in scripts: map \"all\"/\"any\" to the full names before invoking bd","Omit the flag to get the default gate (all-children)"],"exampleFix":"// before\nbd create \"Child\" --waits-for bd-parent --waits-for-gate all\n// after\nbd create \"Child\" --waits-for bd-parent --waits-for-gate all-children","handlingStrategy":"validation","validationCode":"var validGates = map[string]bool{\"all-children\": true, \"any-children\": true}\nif !validGates[gate] {\n    return fmt.Errorf(\"gate %q invalid; use all-children or any-children\", gate)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only the exact lowercase hyphenated gate names","Normalize abbreviations (\"all\"/\"any\") in scripts before passing","Omit the flag to accept the default (all-children)"],"tags":["cli","waits-for","validation","enum-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}