Nine Python gates each re-declared `^[a-z0-9][a-z0-9_-]{0,63}$` instead of using
`hermes_constants.PROFILE_ID_RE`: the `-p` pre-parse, the gateway's session-key
parser, lock-owner and home labels, the SSH spawn argument, saved SSH
`remoteProfile`, service/launchd profile names, the session store's own-profile
derivation and the profile segment of the public `<profile>:<platform>` status
key. Five Desktop files did the same instead of the exported
`profile-id-guard.ts::PROFILE_ID_ARG_RE` (`DESKTOP_PROFILE_NAME_RE` is now
derived from it). A change to the owner would have left each copy accepting the
old set.
Each gate now reads the owner at call time. Accepted and refused names, the
`default`/`main`/`main~` aliases and the platform-segment grammar are unchanged:
a 23-input corpus over all nine Python gates and a real `hermes -p` run give the
same output on base and head. Same-shaped grammars for other identifiers
(peer names, case-insensitive remote handles, webhook names, s6 service names,
kanban slugs, plugin names) are deliberately left alone.
New guards swap the owner for a different grammar and assert every gate
follows it (Python: tests/hermes_cli/test_profile_id_grammar_owner.py; Electron:
apps/desktop/electron/profile-id-guard.test.ts); both fail on the base code.
Refs #155595 (state-24).