The root file is project context and was 38.7k chars, past the context-file budget (20k floor, 30,720 on a 128k window), so every session lost its middle: routing table, testing rules, code-shape rules. It now keeps the two invariants, a condensed rubric (every rule kept), environment, structure, one-line rules that apply everywhere and the routing table (11.8k). Moved verbatim to where they load: Testing -> new tests/AGENTS.md; dependency pinning and PM ownership -> new pm/AGENTS.md; machine facts -> new hermes_platform/AGENTS.md; session-scoped tool availability -> tools/AGENTS.md; the full rubric with its real-close examples -> developer-guide/contributing.md. Pointers in lint, checker messages, docs and test comments name the new homes.
1011 B
hermes_platform/ — machine facts and resource lookup
Applies on top of the root AGENTS.md.
Machine facts and resource lookup go through hermes_platform. hermes_platform.host is the
one answer for OS family, native architecture (IsWow64Process2 → platform.machine(); never
PROCESSOR_ARCHITECTURE alone, it reads AMD64 under x64-on-ARM64 emulation), CPU identity, and
WSL/container/Termux. Facts are cached per process and take no environment-variable input, so
a hardware recognizer (host/products.py) cannot be set from a shell. Distinguish the control
host (where this Python runs) from the terminal execution target (SSH/container) and the Desktop
client (another machine): host.* answers only the first. A new bare shutil.which or a
hand-written known-path table outside hermes_platform/ fails
tests/test_managed_runtime_resolution.py unless allowlisted with a reason; resolvers land in
hermes_platform/resolver/. Lookup never installs, downloads, or starts anything.