{"record":{"id":"e7b463417d910779","repo":"Humanizr/Humanizer","slug":"generated-unicode-16-inflection-data-is-stale-run","errorCode":null,"errorMessage":"Generated Unicode 16 inflection data is stale. Run the generator without --check.","messagePattern":"Generated Unicode 16 inflection data is stale\\. Run the generator without --check\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"tools/Humanizer.UnicodeDataGenerator/Program.cs","lineNumber":116,"sourceCode":"    \"generated-unicode-scripts\",\n    GenerateScriptBlock(\n        Path.Combine(inputDirectory, \"Scripts.txt\"),\n        Path.Combine(inputDirectory, \"ScriptExtensions.txt\"),\n        inputs[\"Scripts.txt\"],\n        inputs[\"ScriptExtensions.txt\"]));\nunicodeSource = ReplaceGeneratedBlock(\n    unicodeSource,\n    \"generated-unicode-nfc-quick-check\",\n    GenerateNfcQuickCheckBlock(\n        Path.Combine(inputDirectory, \"DerivedNormalizationProps.txt\"),\n        inputs[\"DerivedNormalizationProps.txt\"]));\n\nvar unicodeChanged = CheckOrWrite(unicodeDataFile, unicodeSource, check);\nif (check)\n{\n    if (unicodeChanged)\n    {\n        throw new InvalidOperationException(\n            \"Generated Unicode 16 inflection data is stale. Run the generator without --check.\");\n    }\n\n    Console.WriteLine(\"Unicode 16 inflection data is current and all five source hashes match.\");\n}\nelse\n{\n    Console.WriteLine(\"Regenerated Unicode 16 inflection data from all five hash-pinned inputs.\");\n}\n\nreturn 0;\n\nstatic string FindRepositoryRoot(string start)\n{\n    for (var current = new DirectoryInfo(start); current is not null; current = current.Parent)\n    {\n        if (File.Exists(Path.Combine(current.FullName, \"Humanizer.slnx\")))\n        {","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/tools/Humanizer.UnicodeDataGenerator/Program.cs#L98-L134","documentation":"Thrown by the UnicodeDataGenerator when run with the --check flag and the checked-in generated file (InflectionUnicodeData.cs) differs from what the generator would produce. This is a staleness guard used in CI to ensure generated data is always committed after regeneration.","triggerScenarios":"Running dotnet run --project tools/Humanizer.UnicodeDataGenerator -- <dir> --check after modifying the generator or updating UCD data without regenerating the output file. The CheckOrWrite function detects the diff.","commonSituations":"CI pipeline runs the check and fails because the developer forgot to regenerate. Generator logic was updated but the output wasn't re-committed. UCD input hashes were changed in a PR without running the generator.","solutions":["Run the generator WITHOUT the --check flag to regenerate the output, then commit the result.","Ensure you run the generator from the correct directory with all UCD files present.","Add a pre-commit or local build step that runs the generator automatically."],"exampleFix":"# before: check fails because output is stale\ndotnet run --project tools/Humanizer.UnicodeDataGenerator -- ./ucd --check\n\n# after: regenerate, then commit\ndotnet run --project tools/Humanizer.UnicodeDataGenerator -- ./ucd\ngit add src/Humanizer/Inflections/InflectionUnicodeData.cs\ngit commit -m \"chore: regenerate Unicode 16 inflection data\"","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run the generator without --check after modifying generator logic or UCD data.","Commit regenerated output in the same PR that changes the inputs.","Add the --check step to CI to catch uncommitted regeneration."],"tags":["unicode-generator","tooling","stale-data","ci"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}