{"record":{"id":"0124beabf3224d8d","repo":"p-e-w/heretic","slug":"is-not-allowed","errorCode":null,"errorMessage":"'.' is not allowed","messagePattern":"'\\.' is not allowed","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/heretic/config.py","lineNumber":137,"sourceCode":"    instance_name: str | None = Field(\n        default=None,\n        description=(\n            \"Optional name to distinguish multiple instances of the same plugin class. \"\n            \"Instance-specific settings live under `[scorer.<ClassName>_<instance_name>]`.\"\n        ),\n    )\n\n    @field_validator(\"instance_name\")\n    @classmethod\n    def validate_instance_name(cls, value: str | None) -> str | None:\n        if value is None:\n            return value\n\n        if not value.strip():\n            raise ValueError(\"cannot be empty or whitespace\")\n\n        if \".\" in value:\n            raise ValueError(\"'.' is not allowed\")\n\n        if any(char.isspace() for char in value):\n            raise ValueError(\"whitespace is not allowed\")\n\n        return value\n\n\nclass BenchmarkSpecification(BaseModel):\n    task: str = Field(\n        description=\"Task ID of the benchmark in the Language Model Evaluation Harness.\"\n    )\n\n    name: str = Field(description=\"Name of the benchmark for presentation purposes.\")\n\n    description: str = Field(\n        description=\"Description of the benchmark for presentation purposes.\"\n    )\n","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/p-e-w/heretic/blob/bedb94ef117a271532ac2058447fbc165d5051bd/src/heretic/config.py#L119-L155","documentation":"validate_instance_name forbids the '.' character because dots are used as namespace separators in instance keys/plugin paths. A name containing '.' would create ambiguous or colliding identifiers, so it is rejected explicitly.","triggerScenarios":"Calling validate_instance_name with a value containing a period, e.g. \"my.scorer\", usually from dotted config keys, module-style names, or filenames used as instance names.","commonSituations":"Developers naming instances after Python modules (\"scorers.toxicity\"), Hugging Face repo-style ids (\"org/model\"), or config subsection paths copied verbatim.","solutions":["Replace '.' in the name with '_' or '-' (e.g. \"my_scorer\")","Derive the name programmatically: value.replace(\".\", \"_\") before validation","Use a flat, dot-free identifier in config.toml"],"exampleFix":"// before\ninstance_name = \"scorers.toxicity\"\n// after\ninstance_name = \"scorers_toxicity\"","handlingStrategy":"validation","validationCode":"if \".\" in (instance_name or \"\"):\n    raise ValueError(\"instance_name must not contain '.'\")","typeGuard":"def is_dot_free(name: str) -> bool:\n    return isinstance(name, str) and \".\" not in name","tryCatchPattern":"try:\n    cfg.validate_instance_name(name)\nexcept ValueError:\n    name = name.replace(\".\", \"_\")\n    cfg.validate_instance_name(name)","preventionTips":["Use underscores/hyphens instead of dots in names","Sanitize module- or repo-derived names with replace(\".\", \"_\")"],"tags":["config","validation","naming"],"backgroundTag":"invalid-identifier-name","analyzedSha":"bedb94ef117a271532ac2058447fbc165d5051bd","analyzedAt":"2026-08-29T08:38:06.692Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}