{"record":{"id":"8f66cb3107c0f4ca","repo":"Humanizr/Humanizer","slug":"path-provenance-must-be-a-sequence","errorCode":null,"errorMessage":"'{path}.provenance' must be a sequence.","messagePattern":"'(.+?)\\.provenance' must be a sequence\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":1049,"sourceCode":"\n            return result;\n        }\n\n        static ImmutableArray<string> ParseProvenance(\n            SimpleYamlMapping mapping,\n            string path,\n            bool required)\n        {\n            if (!mapping.TryGetValue(\"provenance\", out var value))\n            {\n                return required\n                    ? throw new InvalidOperationException($\"'{path}' must define provenance.\")\n                    : [];\n            }\n\n            if (value is not SimpleYamlSequence sequence)\n            {\n                throw new InvalidOperationException($\"'{path}.provenance' must be a sequence.\");\n            }\n\n            var result = ImmutableArray.CreateBuilder<string>(sequence.Items.Length);\n            var seen = new HashSet<string>(StringComparer.Ordinal);\n            foreach (var item in sequence.Items)\n            {\n                if (item is not SimpleYamlScalar scalar || string.IsNullOrWhiteSpace(scalar.Value))\n                {\n                    throw new InvalidOperationException(\n                        $\"'{path}.provenance' must contain non-empty source identifiers.\");\n                }\n\n                if (!seen.Add(scalar.Value))\n                {\n                    throw new InvalidOperationException(\n                        $\"'{path}.provenance' contains duplicate source '{scalar.Value}'.\");\n                }\n","sourceCodeStart":1031,"sourceCodeEnd":1067,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L1031-L1067","documentation":"Thrown by ParseProvenance when the 'provenance' key exists but its YAML value is not a SimpleYamlSequence (i.e. not a list). The parser requires provenance to be a sequence of source identifiers.","triggerScenarios":"The 'provenance' key is set to a scalar string (e.g. provenance: cldr-42) or a mapping instead of a YAML list/array.","commonSituations":"A contributor writes provenance as a single bare string instead of a one-element list, or uses a mapping (key-value pairs) misunderstanding the expected shape.","solutions":["Change the provenance value to a YAML sequence (square-bracket list syntax or block list syntax).","Ensure each element is a scalar string matching a source ID in the sources registry.","Rebuild to confirm the sequence is parsed."],"exampleFix":"# before (scalar instead of sequence)\nprovenance: cldr-42\n# after\nprovenance: [cldr-42]","handlingStrategy":"validation","validationCode":"# Verify provenance is a list, not a scalar or mapping\n# python: assert isinstance(unit['provenance'], list), 'provenance must be a sequence'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use list syntax for provenance: [source-id] or block list with dashes.","Even for a single source, wrap it in brackets.","Review a known-good locale file for the correct provenance shape."],"tags":["humanizer","locale","yaml","source-generator","duration-cases","provenance","build-time"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}