Files
hermes-agent/tests/scripts
kshitijk4poor 96d816a10f refactor(profiles): one entry point for profile create
`hermes profile create`, `POST /api/profiles` and the Desktop/TUI
`profiles.create` RPC each called `create_profile()` and then ran their own
post-create steps (skills, alias, credentials, model, MCP servers, skill
selection). The same "new profile" therefore came out different
depending on where it was started, and a fix to one surface missed the
other two.

Add `hermes_cli/profile_provision.py` with
`provision_profile(ProfileCreateRequest) -> ProvisionResult`. Every surface
now builds a request and renders the result. `create_profile()` keeps the
folder work (validate, copy, strip channels, stage, publish, notify);
`provision_profile` runs every later step in one fixed order. A failing
later step never undoes the create: it is a warning in the result, as the
dashboard and RPC already treated it.

- The dashboard's model / MCP / skill-selection writers and the RPC's
  launch-credential mirroring moved into the module; the routers import
  them. Every config read-modify-write during create now holds the
  dashboard's `_CONFIG_MUTATION_LOCK` (MCP servers, voice sections,
  endpoint seed and base_url restore were unlocked on main).
- Plugins get no step here: since main's 6933155eaf the core create calls
  the selected memory provider's on_profile_created hook, so every surface
  already gets the provider's per-profile files.
- `scripts/check_profile_create_entry.py` (scripts/check, lint.yml) scans
  every production Python file and fails on any use of `create_profile`
  outside its definition and the new module: calls, imports, aliases, the
  function passed as a value, getattr by name, and files that do not parse.

Behaviour is unchanged on purpose: each surface passes the options it used
before (only the RPC mirrors launch credentials). Two small differences,
both on failure paths: a failing post-create step in the CLI prints a
warning instead of a traceback, and the RPC writes SOUL.md during the core
create (as the dashboard already did), so a failed write fails the create
instead of returning soul_written=false.
2026-11-10 14:09:08 +05:30
..