{"record":{"id":"507755fc89f8fa3c","repo":"nexu-io/open-design","slug":"competitors-competitors-must-be-competitor","errorCode":null,"errorMessage":"[Competitors] --competitors must be >= {COMPETITORS_MIN} (got {count}).\\n","messagePattern":"\\[Competitors\\] --competitors must be >= (.+?) \\(got (.+?)\\)\\.\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"design-templates/last30days/scripts/last30days.py","lineNumber":463,"sourceCode":"            sys.stderr.write(\n                f\"[Competitors] --competitors={competitors_flag} ignored; using \"\n                f\"{count} entries from --competitors-list.\\n\"\n            )\n        if count > COMPETITORS_MAX:\n            sys.stderr.write(\n                f\"[Competitors] --competitors-list has {count} entries, clamping to {COMPETITORS_MAX}.\\n\"\n            )\n            explicit_list = explicit_list[:COMPETITORS_MAX]\n            count = COMPETITORS_MAX\n        return True, count, explicit_list\n\n    # flag_present, no explicit list\n    count = competitors_flag\n    if count < COMPETITORS_MIN:\n        sys.stderr.write(\n            f\"[Competitors] --competitors must be >= {COMPETITORS_MIN} (got {count}).\\n\"\n        )\n        raise SystemExit(2)\n    if count > COMPETITORS_MAX:\n        sys.stderr.write(\n            f\"[Competitors] --competitors={count} exceeds max {COMPETITORS_MAX}; clamping.\\n\"\n        )\n        count = COMPETITORS_MAX\n    return True, count, []\n\n\ndef _missing_sources_for_promo(diag: dict[str, object]) -> str | None:\n    available = set(diag.get(\"available_sources\") or [])\n    missing = []\n    if \"reddit\" not in available:\n        missing.append(\"reddit\")\n    if \"x\" not in available:\n        missing.append(\"x\")\n    if \"grounding\" not in available:\n        missing.append(\"web\")\n    if not missing:","sourceCodeStart":445,"sourceCodeEnd":481,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/design-templates/last30days/scripts/last30days.py#L445-L481","documentation":"In the flag-only branch of resolve_competitors() (around line 463), when `--competitors N` is supplied without an explicit list and N is below COMPETITORS_MIN, the code writes `[Competitors] --competitors must be >= <MIN> (got <N>).` and raises SystemExit(2). Values above COMPETITORS_MAX are clamped (warned, not fatal); only the lower bound is a hard failure. This prevents asking for fewer than the meaningful minimum.","triggerScenarios":"`--competitors 0`, `--competitors -1`, or any value below COMPETITORS_MIN (commonly 2 or 3) when no `--competitors-list` is given.","commonSituations":"Passing 0 to disable competitors (use `--competitors-list` empty / omit instead); negative value from an arithmetic bug in a wrapper script; misreading the min.","solutions":["Pass a value >= COMPETITORS_MIN (check the constant in the file if unsure).","If you want zero competitors, omit both `--competitors` and `--competitors-list` (the function returns False,0,[]).","If you want exactly one named competitor, use `--competitors-list name`."],"exampleFix":"# before\npython3.12 last30days.py --topic x --competitors 0\n# after (omit to disable)\npython3.12 last30days.py --topic x\n# after (meet minimum)\npython3.12 last30days.py --topic x --competitors 3","handlingStrategy":"validation","validationCode":"if args.competitors is not None and args.competitors < COMPETITORS_MIN:\n    raise ValueError(f'--competitors must be >= {COMPETITORS_MIN}, got {args.competitors}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit --competitors when you want auto-discovery or no competitors.","Use --competitors-list for a single named entity instead of --competitors 1."],"tags":["cli","argument-validation","python","competitors"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}