Violation categories for code enforcement keep expanding beyond a fixed list. Which enum pattern helps?
Select an answer to reveal the explanation.
Short Explanation
City violation types mutate like weeds. An enum with unclear and other-plus-detail gives Claude a honest parking spot when the neat list runs out.
Full Explanation
Code-enforcement violation categories expand as ordinances and field practice evolve. Enums that include unclear and other-plus-detail members give Claude honest exits when a case does not fit the neat list: mark unclear when evidence is insufficient, or other with a detail string when the violation is novel. That extensible pattern preserves structured reporting without forcing wrong labels.
Using a closed enum with no escape hatch and forcing nearest-neighbor guesses fails because novel violations get misfiled under the closest wrong code, poisoning enforcement analytics. Forbidding enums and returning only unstructured free text forever fails downstream systems that need countable categories for workloads and reporting. Mapping every novel case to the first enum member regardless of meaning fails by systematic misclassification and hides the growth signal that should trigger taxonomy updates.
Exam caveat: unclear/other escapes improve honesty; operations must review other-detail volume periodically to promote frequent novels into first-class enum members. Operational check: add unclear and other-plus-detail to the violation schema, sample edge cases, and confirm the model stops nearest-neighbor stuffing while detail text remains actionable for supervisors.