{"record":{"id":"21aad78abe9dc332","repo":"gastownhall/beads","slug":"cannot-use-both-ephemeral-and-pour","errorCode":null,"errorMessage":"cannot use both --ephemeral and --pour","messagePattern":"cannot use both --ephemeral and --pour","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/mol_bond.go","lineNumber":187,"sourceCode":"\tcustomTitle string\n\tdryRun      bool\n\tvars        map[string]string\n\tephemeral   bool\n\tpour        bool\n\tchildRef    string\n}\n\nfunc gatherMolBondInput(cmd *cobra.Command, args []string) (molBondInput, error) {\n\tin := molBondInput{argA: args[0], argB: args[1]}\n\tin.bondType, _ = cmd.Flags().GetString(\"type\")\n\tin.customTitle, _ = cmd.Flags().GetString(\"as\")\n\tin.dryRun, _ = cmd.Flags().GetBool(\"dry-run\")\n\tin.ephemeral, _ = cmd.Flags().GetBool(\"ephemeral\")\n\tin.pour, _ = cmd.Flags().GetBool(\"pour\")\n\tin.childRef, _ = cmd.Flags().GetString(\"ref\")\n\n\tif in.ephemeral && in.pour {\n\t\treturn in, fmt.Errorf(\"cannot use both --ephemeral and --pour\")\n\t}\n\tif in.bondType != types.BondTypeSequential && in.bondType != types.BondTypeParallel && in.bondType != types.BondTypeConditional {\n\t\treturn in, fmt.Errorf(\"invalid bond type '%s', must be: sequential, parallel, or conditional\", in.bondType)\n\t}\n\n\tvarFlags, _ := cmd.Flags().GetStringArray(\"var\")\n\tvars, err := parseVarFlags(varFlags)\n\tif err != nil {\n\t\treturn in, err\n\t}\n\tin.vars = vars\n\treturn in, nil\n}\n\nfunc renderMolBondDryRun(in molBondInput, issueA *types.Issue, formulaA string, issueB *types.Issue, formulaB string) {\n\tidA := in.argA\n\tidB := in.argB\n\taIsProto := false","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/mol_bond.go#L169-L205","documentation":"bd mol bond accepts either --ephemeral (bond without persisting a pour target) or --pour, but not both; gatherMolBondInput rejects the conflicting combination at flag-parse time.","triggerScenarios":"Running `bd mol bond ... --ephemeral --pour` — both boolean flags set on the same invocation.","commonSituations":"Script or shell alias accumulating flags, or a user unsure of the semantics passing both to be safe.","solutions":["Remove one of the two flags: use --pour to persist the pour, or --ephemeral for a non-persisted bond.","If a wrapper script sets flags conditionally, ensure the two branches are mutually exclusive (if/else, not both).","Run `bd mol bond --help` to confirm which mode you intend."],"exampleFix":"// before (wrapper script)\nFLAGS=\"$FLAGS --ephemeral --pour\"\n// after\nif [ \"$PERSIST\" = \"1\" ]; then FLAGS=\"$FLAGS --pour\"; else FLAGS=\"$FLAGS --ephemeral\"; fi","handlingStrategy":"validation","validationCode":"# shell pre-check\nif [ -n \"$EPHEMERAL\" ] && [ -n \"$POUR\" ]; then echo \"choose --ephemeral OR --pour\"; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat --ephemeral and --pour as mutually exclusive modes.","In wrapper scripts, use if/else so only one flag is ever appended.","Check `bd mol bond --help` for current flag semantics."],"tags":["cli","flag-validation","mol-bond"],"backgroundTag":"conflicting-flags","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}