Files
alt-glitch 296308546a feat(compat): serve a moved module under its old names as one module object
hermes_agent.compat.finder is a meta_path finder that maps an old dotted
name to its current one by the longest prefix that is a key of the moves
table, and returns the real module object for it. An old name and its
current name therefore share state, mock.patch through either name
reaches the real code, and reload() re-executes the real file. Keys are
only added; when a target moves again only its value changes, so renames
chain without loading any file twice.

hermes_agent.compat.moves holds the table as plain dicts with no
imports, so an older release can read it. It is empty on today's layout.

With strict=True the finder refuses an old name and names the current
one, for in-repo code that must not depend on the aliases.
2026-11-07 01:55:24 -05:00

2 lines
91 B
Python

"""The Hermes Agent package; today it holds only the module-rename compatibility layer."""