Files
hermes-agent/tests
kshitijk4poor 18fcbc0cdb fix(providers): reclaim only owned snapshot roots; keep them out of profile homes
Review fold on the previous commit (second-model and gate findings on
8dfadd90e3):

- The leftover-claim sweep deleted every `.reaping-*` directory, and the main
  sweep treated any `hermes-provider-plugins-*` root without an owner lock as
  dead. The second also matches roots made by the commit before this one,
  which have no owner lock, so a process still running that code would lose
  its live copy to the next one starting. Roots now carry their own `owned-`
  prefix, claims are `.reaping-owned-<uuid>` (unique per sweep, so two sweepers
  never delete the same claim), and nothing else in the directory is touched.
- A setup-lock timeout fell through to creating a sweepable root without the
  lock, so a concurrent sweep could reclaim it before its owner lock was taken
  (reproduced by interleaving a sweep right after mkdtemp). Without the setup
  lock, timeout or another user's lock file alike, the root is now made under an
  `unswept-` name no sweep matches; it is still removed on a normal exit.
- Roots lived under the launch profile's home. Deleting a named profile removes
  that home while a multiplexed gateway launched in it may keep serving other
  profiles, which would take its frozen imports with it. Roots now live under
  the Hermes root's runtime/provider-plugins (PROVIDER_PLUGIN_SNAPSHOT_PARTS,
  now shared by the loader, backup and clone-all).
- The clone-all test called the helper directly; it now copies a tree through
  the real clone-all ignore. Comments no longer promise removal on every exit.

Part of #156493.
2026-11-19 03:31:38 -08:00
..