- Problem
- Four services had grown four slightly different ad-hoc filtering implementations — inconsistent pagination, injection-prone string building, and tenant scoping by convention.
- My approach
- I designed the target: one query DSL parsed to an AST, compiled to parameterized queries, with field whitelisting and mandatory tenant scoping. Then I treated the migration as a well-specified transformation.
- How AI contributed
- AI generated the mechanical migration of dozens of endpoints to the new DSL, drafted the parser test suite against my grammar spec, and caught two inconsistencies between services that humans had normalized.
- Engineering decision
- I wrote the parser and compiler by hand — they are the security boundary — and delegated the endpoint migrations and test scaffolding.
- Outcome
- All services on one safe-by-construction search path; the library was extracted as the open-source Spring Search DSL project.
- Lesson
- Split work by risk, not by size: the 10% that is a security boundary gets human hands; the 90% that is mechanical gets automated and reviewed.