{"record":{"id":"6045fdd3b5b569cc","repo":"Humanizr/Humanizer","slug":"path-provenance-references-unknown-source-so","errorCode":null,"errorMessage":"'{path}.provenance' references unknown source '{sourceId}'.","messagePattern":"'(.+?)\\.provenance' references unknown source '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":1086,"sourceCode":"                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();\n        }\n\n        static void ValidateProvenance(\n            ImmutableArray<string> provenance,\n            ImmutableDictionary<string, DurationCaseSource> sources,\n            string path)\n        {\n            foreach (var sourceId in provenance.Where(sourceId => !sources.ContainsKey(sourceId)))\n            {\n                throw new InvalidOperationException(\n                    $\"'{path}.provenance' references unknown source '{sourceId}'.\");\n            }\n        }\n\n        static string RequireScalar(SimpleYamlMapping mapping, string key, string path) =>\n            mapping.GetScalar(key)\n            ?? throw new InvalidOperationException($\"'{path}' must define scalar '{key}'.\");\n\n        static string RequireReason(string reason, string path) =>\n            string.IsNullOrWhiteSpace(reason)\n                ? throw new InvalidOperationException($\"'{path}' must not be empty.\")\n                : reason;\n\n        static ImmutableDictionary<string, DurationCaseRealization> EmptyRealizations() =>\n            ImmutableDictionary<string, DurationCaseRealization>.Empty.WithComparers(StringComparer.Ordinal);\n\n        static DurationCaseOverlay CreateBaseDurationOverlay()\n        {","sourceCodeStart":1068,"sourceCodeEnd":1104,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L1068-L1104","documentation":"Thrown by ValidateProvenance when a source ID in the provenance sequence does not match any key in the locale's sources dictionary. Every provenance entry must reference a source defined in the durationCases.sources section.","triggerScenarios":"A unit realization's provenance lists a source ID (e.g. 'cldr-42') but no matching entry exists in the locale's sources registry.","commonSituations":"A contributor adds a new source ID to a provenance list but forgets to declare the corresponding source object in the 'sources' section. Also occurs when a source ID is renamed in the sources section but not updated in provenance references, or vice versa.","solutions":["Check the source ID named in the error message against the locale's 'sources' section.","Either add a source entry with that ID (including kind, url, revision, locator, and credit fields) or correct the provenance reference to match an existing source ID.","Rebuild to confirm all provenance references resolve."],"exampleFix":"# before — provenance references 'cldr-43' but sources only defines 'cldr-42'\nsources:\n  cldr-42:\n    kind: cldr\n    url: ...\n    ...\nsecond:\n  phrase: ...\n  provenance: [cldr-43]\n# after\nsecond:\n  phrase: ...\n  provenance: [cldr-42]","handlingStrategy":"validation","validationCode":"# Verify every provenance source ID exists in the sources registry\n# python: source_ids = set(yaml['durationCases']['sources'].keys())\n#         for unit in all_units:\n#             for sid in unit.get('provenance', []):\n#                 assert sid in source_ids, f'unknown source {sid}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare all source entries in the sources section before referencing them in provenance.","When renaming a source ID, update all provenance references simultaneously.","Use a script or IDE find-and-replace to keep source IDs consistent across the file."],"tags":["humanizer","locale","yaml","source-generator","duration-cases","provenance","source-reference","build-time"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}