{"record":{"id":"4eda2bd625ae7601","repo":"Humanizr/Humanizer","slug":"path-provenance-must-contain-non-empty-source","errorCode":null,"errorMessage":"'{path}.provenance' must contain non-empty source identifiers.","messagePattern":"'(.+?)\\.provenance' must contain non-empty source identifiers\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":1058,"sourceCode":"            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\n                result.Add(scalar.Value);\n            }\n\n            if (required && result.Count == 0)\n            {\n                throw new InvalidOperationException($\"'{path}.provenance' must not be empty.\");\n            }\n\n            return result.MoveToImmutable();","sourceCodeStart":1040,"sourceCodeEnd":1076,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L1040-L1076","documentation":"Thrown by ParseProvenance when iterating the provenance sequence and encountering an item that is not a SimpleYamlScalar or whose scalar value is empty/whitespace. Every provenance entry must be a non-empty source identifier string.","triggerScenarios":"The provenance list contains a null/empty element, a mapping, a nested sequence, or a scalar value that is whitespace-only.","commonSituations":"A contributor leaves a trailing comma in a flow-style list creating an empty entry, or accidentally nests a mapping inside the provenance list. Also occurs when a source ID is accidentally left blank.","solutions":["Inspect each element of the provenance list at the reported path.","Remove or replace any non-scalar or empty/whitespace entries with a valid non-empty source ID string.","Rebuild to confirm all entries are valid scalars."],"exampleFix":"# before (empty entry from trailing comma)\nprovenance: [cldr-42, ]\n# after\nprovenance: [cldr-42]","handlingStrategy":"validation","validationCode":"# Verify every provenance item is a non-empty string\n# python: for item in unit['provenance']:\n#     assert isinstance(item, str) and item.strip(), 'empty or non-scalar provenance entry'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid trailing commas in flow-style YAML lists that create empty entries.","Keep each provenance entry as a bare scalar string.","Run a YAML linter that flags empty list elements."],"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-14T00:17:13.853Z"}