{"record":{"id":"e27e7eb6942e7e71","repo":"github/spec-kit","slug":"invalid-template-type-tmpl-type-must-be-on","errorCode":null,"errorMessage":"Invalid template type '{tmpl['type']}': must be one of {sorted(VALID_PRESET_TEMPLATE_TYPES)}","messagePattern":"Invalid template type '(.+?)': must be one of (.+?)","errorType":"validation","errorClass":"PresetValidationError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/presets/__init__.py","lineNumber":436,"sourceCode":"                raise PresetValidationError(\n                    \"Template missing 'type', 'name', or 'file'\"\n                )\n\n            # 'name' feeds re.match and 'file' feeds os.path.normpath below;\n            # both raise a bare TypeError on a non-string, which is not a\n            # PresetValidationError and so escapes the callers that handle a\n            # malformed manifest. The sibling extension manifest already\n            # rejects a non-string command 'file' via\n            # relative_extension_path_violation().\n            for field in (\"type\", \"name\", \"file\"):\n                if not isinstance(tmpl[field], str):\n                    raise PresetValidationError(\n                        f\"Invalid template {field}: expected a string, \"\n                        f\"got {type(tmpl[field]).__name__}\"\n                    )\n\n            if tmpl[\"type\"] not in VALID_PRESET_TEMPLATE_TYPES:\n                raise PresetValidationError(\n                    f\"Invalid template type '{tmpl['type']}': \"\n                    f\"must be one of {sorted(VALID_PRESET_TEMPLATE_TYPES)}\"\n                )\n\n            # Validate file path safety: must be relative, no parent traversal\n            file_path = tmpl[\"file\"]\n            normalized = os.path.normpath(file_path)\n            if os.path.isabs(normalized) or normalized.startswith(\"..\"):\n                raise PresetValidationError(\n                    f\"Invalid template file path '{file_path}': \"\n                    \"must be a relative path within the preset directory\"\n                )\n\n            # Validate strategy field (optional, defaults to \"replace\")\n            strategy = tmpl.get(\"strategy\", \"replace\")\n            if not isinstance(strategy, str):\n                raise PresetValidationError(\n                    f\"Invalid strategy value: must be a string, \"","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/presets/__init__.py#L418-L454","documentation":"Error \"Invalid template type '{tmpl['type']}': must be one of {sorted(VALID_PRESET_TEMPLATE_TYPES)}\" thrown in github/spec-kit.","triggerScenarios":"Thrown at src/specify_cli/presets/__init__.py:436 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the template type to one of the supported preset template types."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}