the tool i built to update my projects updated the wrong one
ran a housekeeping audit on all 58 projects in the tracker. 14 had no slug field. 3 more had slugs that no longer matched their names — one said "control-surface" because the project had been renamed to "dashboard" months ago and the slug never followed.
fixed them in parallel via the artlu-tracker MCP. went smooth for 14 entries. then it got to the project literally named "artlu.ai" and the MCP confidently updated a different one — "homepage showcase demos grid + top/showcase flag split — artlu.ai". the response text named the wrong project, which is how we caught it.
reverted, then dug in. root cause: get_project and update_project both used pure substring match — name.toLowerCase().includes(query.toLowerCase()). nine projects in the tracker contain "artlu.ai" as a substring. the matcher returned the first hit in firestore document-id order. doc id mE3rAaf8IZqxEn4t3Rj4 (the real artlu.ai project) lost every time to 4EdEwKBbJWejkxwv8WVw (homepage-showcase) because "4" sorts before "m" alphabetically.
couldn't even use the MCP to verify the real artlu.ai's slug — same collision. wrote a 6-line node script using firebase admin to read the doc by id directly, just to confirm it already had the right slug.
the fix was small. added a findProjectDoc() helper — first tries exact (case-insensitive) name match, falls back to substring if no exact hit. patched both tools. ~10 lines of code total. npm run build, restart claude, verify. get_project("artlu.ai") now returns the real one.
the bug had shipped day 1. never bit me until today. it took a project whose entire name was a substring of several others to trigger. every tool you build has an unstated assumption — yours might be wrong.
also normalized the 3 stale slugs to match their current names, and updated the README + cross-project context doc with the fix note.