Commit Graph

18 Commits

Author SHA1 Message Date
alt-glitch
177a764aca docs(onboarding): document onboarding.run; salvaged reads say first-run onboarding
onboarding.run gets its entry in user-guide/configuration.md (null on a
fresh install, true while onboarding is open, false once finished or
skipped; always the default profile's config).

The questionnaire the host summary, machine.facts and onboarding.run were
written for was dropped; their docstrings and contract docs now name the
first-run onboarding that reads them.
2026-10-13 22:08:21 +05:30
alt-glitch
9fb5e24c9f refactor(platform): machine.facts names the NVIDIA platform from nvidia_platform()
The salvaged host summary kept its own Spark detector: win32 + arm64 +
an NVIDIA GPU, or a dgx|spark|gb10 regex on the CPU name. That is one
of the readers the previous commit's products.nvidia_platform() replaces,
and the two disagree (the regex calls any CPU string with "spark" in it a
DGX Spark).

summary() now asks nvidia_platform() once and answers it as
nvidia_platform (rtx_spark | dgx_spark | discrete | null) instead of the
is_spark bool. machine_kind is "Spark" for the two Spark platforms.
machine.facts has no client yet, so the contract field is renamed, not
kept beside the new one.
2026-10-13 22:08:20 +05:30
alt-glitch
1e92db235f fix(platform): host summary reports the macOS version on a Mac
machine.os_release came from platform.release(), which on macOS is the
Darwin kernel version (25.x), not the macOS version the questionnaire
shows as "macOS <release>". On darwin (by the os_family fact the summary
already reads) it now uses platform.mac_ver()[0], falling back to
platform.release() when that is empty; other systems are unchanged.

(cherry picked from commit 4e1849dc9c47a087bdff8fa6d79f860dc9d3d89a)
2026-10-13 22:08:20 +05:30
alt-glitch
132d4d3d91 feat(platform): host summary for the desktop questionnaire
hermes_platform/host/summary.py answers what the first-run questionnaire
needs to know about this machine: the measured hardware facts, the
machine kind (Spark, Mac, PC, computer), whether it has an NVIDIA GPU,
whether it is a Spark, the OS locale and the account's full name.

The Spark predicate, the account and locale readers are copied from
agent/initiate_setup_facts.py, which PR4 deletes with the agentic setup.
Cached per process; OS records only, no environment input, no subprocess,
no network.

(cherry picked from commit ed545b59f60fa94de741e290c00975ebb4633f76)
2026-10-13 22:07:46 +05:30
alt-glitch
840c2d9dff fix(platform): RTX Spark needs the N1X marker, not just an NVIDIA GPU
Windows on arm64 with an NVIDIA GPU counted as rtx_spark even without
an N1X marker. It now needs the N1X CPU name or a GPU in the N1X PCI
range (the range the local catalog's measured row uses); any other
NVIDIA GPU there is discrete.

facts.nvidia_gpu_names() becomes facts.nvidia_gpus(), name plus packed
PCI id per GPU: Windows reads DEV_ from MatchingDeviceId, Linux reads
/sys/bus/pci/devices/<bus>/device for each driver procfs bus. The
fixture table uses the CPU name and display-class rows measured on an
N1X laptop.
2026-10-13 22:07:20 +05:30
alt-glitch
84c07f6de9 docs(platform): record the N1X markers measured on hardware
The registry CPU name, the two NVIDIA display adapters and their PCI
device ids were read on an N1X laptop; nvidia_platform() returned
rtx_spark under native arm64 and emulated x64 Python.
2026-10-13 22:07:19 +05:30
alt-glitch
5384e22099 fix(platform): host facts are right on every OS and read no environment
Audit of hermes_platform/host/facts.py, verified on an NVIDIA N1X laptop
with native arm64 and emulated x64 Python 3.14:

- process_arch: on Windows platform.machine() names the native machine,
  so an x64 Python on arm64 reported arm64. It now reads the
  interpreter's own build (sysconfig.get_platform()).
- native_arch: the PROCESSOR_ARCHITECTURE env fallback is deleted;
  facts take no environment input. IsWow64Process2, then
  platform.machine().
- cpu_vendor: macOS reports Apple on Apple silicon and
  machdep.cpu.vendor on Intel; arm64 Linux names the CPU implementer
  (aarch64 /proc/cpuinfo has no vendor_id).
- gpu_class: Intel Macs read PCI display controllers from IOKit
  (new darwin_pci.py) instead of returning unknown; Windows skips
  virtual adapters (remote display) instead of counting them as
  unreadable; WSL counts the Windows NVIDIA driver's bridged libcuda.
- nvidia_gpu_names: Windows reads DriverDesc of NVIDIA display adapters.
- _read_text reads utf-8-sig; the Linux-only os.getuid line carries the
  footgun marker.
2026-10-13 22:07:19 +05:30
alt-glitch
d9617f4924 refactor(platform): setup facts read nvidia_platform(); drop is_nvidia_arm_soc
The setup facts kept their own Spark rule (win32 + arm64 + NVIDIA, a
dgx|spark|gb10 regex on the CPU model) beside is_nvidia_arm_soc(),
which existed only for that caller. Both now read nvidia_platform(), so
there is one answer, and the wrapper is deleted (no-compat ruling).
2026-10-13 22:07:19 +05:30
alt-glitch
5c479698c2 refactor(platform): one nvidia_platform() answer for the backend
hermes_platform.host.products.nvidia_platform() returns rtx_spark,
dgx_spark, discrete or None from cached host facts only: no subprocess,
no driver library, no network. RTX Spark is Windows on arm64 with an
NVIDIA GPU or the N1X CPU marker; DGX Spark is Linux on arm64 whose
driver names a GB10 GPU (new facts.nvidia_gpu_names(), read from
/proc/driver/nvidia/gpus) or whose CPU/device-tree model names GB10 or
DGX Spark; discrete is any other NVIDIA host.

is_nvidia_arm_soc() now delegates to it, so the setup facts reader
agrees with the new answer; looks_like_nvidia_arm_soc and its cpu_vendor
check are removed (aarch64 /proc/cpuinfo has no vendor_id, and the
check missed a Windows N1X whose CPU string lacks the marker).
2026-10-13 22:07:19 +05:30
Teknium
a274d3388f fix: core modules import again on Python 3.11-3.13 (re-quote eager forward references)
#135348 ran ruff's UP037 autofix with ruff.strict.toml's target-version = "py314". On 3.14
annotations are lazy (PEP 649), so stripping quotes is safe there; on 3.11-3.13 a function or
variable annotation is evaluated when the def or statement runs. Every unquoted annotation that
names the enclosing class (`def clone_for_agent(self) -> ContextEngine`), a class bound later in
the module, or a TYPE_CHECKING-only import now raises NameError on import: 300 modules on main
(gateway.config, run_agent, hermes_state, cron.jobs, the Telegram adapter, ...) fail to import
under 3.11, the update path crashes mid-`hermes update` on any install whose interpreter is
older than 3.14, and the e2e-upgrade suite's retry leg fails with
`NameError: name 'ContextEngine' is not defined`.

- Re-quote exactly the 79 annotations (36 files) that name something unbound when they are
  evaluated (including tui_gateway/server.py's `_TurnScopes`, which only reaches that module's
  globals through register() after import); no other text changes.
- agent/turn_scripted_prelude.py: `Generator[...]` gets its third argument back. d76cce4f11
  applied UP043 (default type args, valid only from 3.13) to a module-level alias, so
  `Generator[Y, S]` raises TypeError on 3.11/3.12 and takes gateway.run, agent.conversation_loop
  and tui_gateway.{server,ws,entry} down with it.
- ruff.strict.toml target-version = "py311", the requires-python floor. With it UP037 leaves
  these quotes alone and only strips the two that are genuinely redundant, which this commit
  strips; any future version-gated fix stays valid on every supported Python.
- tests/ci/test_strict_ruff_target.py pins the target to the requires-python floor (red on main).
2026-10-09 14:25:07 -07:00
emozilla
7cc440395e fix(local-models): size a Windows integrated GPU from what Windows lets it allocate
With no nvidia-smi answer and no discrete engine device, probe_budget budgeted
all of RAM as unified memory. Windows caps an integrated GPU at its GPU memory
(DXGI dedicated plus shared, Task Manager's figure): an Arc B390 on a 31.5 GB
machine gets 18 GB, yet Local Models showed 31.5 GB and priced the 27B as
fitting. The pool is now capped at that figure, read through DXGI for the
adapter the engine named, else the only non-NVIDIA adapter when a Vulkan or HIP
engine will run the model. The CPU engine keeps the RAM budget, whether the
user chose it or it is the only build for the machine (a Snapdragon). The
engine's own number would overshoot: ggml-vulkan sums every heap of an
integrated GPU, host-visible ones included. The DXGI reader is a cached host
fact in hermes_platform. The cap only lowers the pool; CPU-only machines,
other platforms and a failed DXGI read keep the RAM figure.
2026-10-09 00:44:27 -04:00
teknium1
b412ee9206 fix(platform): an unreadable GPU classifies as unknown, so requires.gpu fails open as documented
When every DRM card's vendor file or every Windows display adapter's
MatchingDeviceId was unreadable, classify_gpu_vendors returned 'none' and
availability refused with unsupported_gpu, contradicting the documented
'unreadable GPU passes' rule. Windows now records an unreadable numbered
adapter as an empty id so the classifier sees it.

Also drops the type-narrowing assert in availability() and makes
_action's gpu_label required.
2026-10-03 10:26:12 -07:00
Ryan Hill
7e66781c2c docs(local-models): refer to N1X by product name 2026-09-28 16:36:38 -07:00
Ryan Hill
cba90a19b8 refactor(local-models): simplify PCI identity matching 2026-09-28 16:22:00 -07:00
Ryan Hill
dd2a047607 fix(local-models): identify N1X by PCI vendor/device ID 2026-09-28 16:05:20 -07:00
teknium1
91fbaa8d3b feat(platform): RAM total and GPU class host facts
The install snapshot needs coarse hardware facts, and machine facts belong in
hermes_platform.host (root AGENTS.md). ram_total_bytes reads /proc/meminfo,
sysctl hw.memsize or GlobalMemoryStatusEx; gpu_class reads /proc/driver/nvidia
and DRM PCI vendor ids on Linux, the display-adapter registry class on Windows,
and native arm64 on macOS. Both are cached per process, take no env input and
never spawn a subprocess or load a driver library, so the daily snapshot can
call them on its path. A discrete vendor wins over an integrated one on hybrid
machines.
2026-09-28 12:43:03 -07:00
Siddharth Balyan
eb5d735e9a Application-backed MCP servers: live endpoint per attempt, tools follow app liveness, errors and the tool catalog say why (NS-943) (#119050)
* feat: expose interactive and live endpoint facts

* feat: hydrate application-backed MCP liveness

* feat: export interactive session fact

* fix: classify unsupported declared hosts

* test(mcp): a runtime file without a token connects without an Authorization header

* fix(mcp): server_json liveness fields default to http/token/pid; an invalid declaration degrades to static instead of failing the server task

* fix(mcp): a connected server is offerable regardless of the interactive-session rule; the rule only shapes the not-connected sentence

* test(mcp): follow main's ToolSearchConfig fields and patch _bump_server_error at its origin module
2026-09-22 17:54:42 +05:30
alt-glitch
48ed4e5364 feat(platform): hermes_platform.host with machine facts, runtime predicates, SoC recognizer
Host facts and runtime predicates need one stdlib-only source that stays correct under architecture emulation.
Hardware recognition reads host facts, not environment variables or GPU proxies.
The package boundary gives later resolvers and catalog checks a shared foundation.
Linear NS-920.
2026-09-22 01:13:23 -07:00