Commit Graph

4 Commits

Author SHA1 Message Date
Maciej Lisiewski
2cf7a4ef72 fix(install): keep the damaged-checkout probe from resolving to an enclosing repo
The installer's `rev-parse --verify HEAD` probe passed when a damaged
INSTALL_DIR/.git made git walk up to a git-managed $HOME, so the rerun
that `hermes update` now recommends ran fetch, `stash push
--include-untracked`, checkout and `reset --hard` against the home repo.
install.sh and install.ps1 now run the probe with GIT_CEILING_DIRECTORIES
set to INSTALL_DIR's parent, so a damaged checkout is moved aside and
cloned fresh.

Also: the updater's run_git drops inherited GIT_DIR/GIT_WORK_TREE and
friends (they retarget every mutator away from the checkout), and the
pinned-feed plugin update refuses a plugin dir git resolves elsewhere.

Fixes #146032
2026-11-12 22:23:28 +01:00
Maciej Lisiewski
41655ba60f fix(update): refuse to stash/reset/clean a repo enclosing a damaged checkout
With a broken `.git` (bad HEAD, empty dir) git walks up to the nearest
parent repository, so on an install inside a git-managed home directory
`hermes update` ran its autostash (`stash push --include-untracked`),
`reset --hard` and `clean` against the user's home, and the plugin
updater did the same from a broken plugin checkout. `.git` existing was
taken as proof the checkout is its own repo.

Both paths now require `git rev-parse --show-toplevel` to resolve to the
checkout itself before any mutating git runs; otherwise they stop with
the installer-repair hint.

Fixes #146032
2026-11-12 22:23:28 +01:00
Teknium
1b76735a5f feat(telemetry): extension installs and update runs say why they failed; hub skills name their registry
hermes.extension.install.count gains failure_class (closed per-kind set named at each failure exit
of the skills hub, plugin installer and MCP catalog emitters; raised exceptions classify by their
tagged class or TYPE, exception:<Type> collapses to exception, never the message) and registry
(the skills-hub adapter SOURCE_ID that resolved/served a skill; none/unresolved/other otherwise).

hermes.update.run gains failure_class derived from the FINAL receipt only (admission step,
stop_reason exception type, exit_code, stage marks, fleet states, gateway_restart). failed_stage no
longer reads 'other' for runs whose every mark passed: a 'partial' receipt (written only by the
post-restart verification) synthesizes a failed verify stage, and a failed run ending on a skipped
restart reads restart.

Package schema v4 is extended in place (canary-only): the pre-split field sets stay valid as the
second oneOf shape and in _LEGACY_METRIC_FIELDS so pending rows drain.
2026-10-06 11:10:43 -07:00
ethernet
1e76db800c refactor(cli): split plugins_cmd.py into topical siblings
plugins_cmd.py had grown to 2,858 lines, past the ~2,000-line gate. Move
each verb family into a plugins_cmd_<topic>.py sibling: git (install
metadata + git plumbing), install, update (plus adopt / trust-update-url /
check-updates), remove, capabilities, toggle (composite UI) and listing.
The facade keeps the shared primitives, enable/disable selection,
discovery and the dispatch table, and re-exports the names other modules,
tests and the old-updater surface import (978 lines now).

Siblings never import the facade at module level; they read facade names
through _pc() at call time, so monkeypatching plugins_cmd.<name> still
intercepts calls made from a sibling. No behaviour change. Tests that
imported three sibling-only helpers now import them from the defining
module, and two subprocess.run patches target subprocess directly.
2026-09-24 11:50:29 -04:00