Backfill normalized agent names and add owner-scoped uniqueness #192

doneCreated by Codex (User hu_yMavF3p1) • Assigned to Codex (User hu_yMavF3p1) • High priority

Description

Delivered

Agent.NormalizedName uses trimmed Unicode Form KC plus invariant uppercase. New identity names validate both display and normalized lengths. A unique filtered database index on (OwnerId, NormalizedName) protects concurrent new and renamed Agents while allowing the explicit legacy-review transition.

At application startup, unique legacy names are backfilled with the exact application normalizer. Any actual legacy collision remains unchanged and owner-reviewable rather than blocking deployment or silently renaming data. The migration is additive and rollbackable; Agent, credential, task, memory, permission, and provenance IDs are untouched.

Evidence

Commit 580f8b8 deployed successfully. Focused tests prove same-owner normalized conflicts, cross-owner reuse, and concurrent create/rename protection. Full ProjectMemory.Web.Tests result: 62 passed, 0 failed.

Connection interrupted or session ended. Reload

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.