hermes-agent/tests/hermes_cli/test_gateway_scm_feature_removed.py
ethernet 92686159d1 fix(pm): integrate audited runtime and lifecycle repairs
Prepare dependency generations before selecting them. Keep shipped tool
bytes separate from writable additions, and store facts beside their entries.
Validate proposed plugin sets before config publication. Restore the previous
config if the facts write fails.

Consolidate duplicate updater, backup, setup, and voice helpers. Repair
launcher selection, dependency consumers, download ownership, update feeds,
and native Windows process and file handling.

Verification: 206 changed/prior-failing Python files reported 4630 passed,
one failed, and 330 skipped. Fix the remaining Hindsight fixture boundary.
The final targeted rerun reported 234 passed and two skipped. The store
review regression batch reported 83 passed and one skipped. Desktop
TypeScript checks, 56 selected Electron tests, 24 release tests, and the
removed-import/compatibility guards passed.

This is an integration checkpoint, not full audit acceptance. The complete
Python suite has not run on this fixed tree. Crash-atomic plugin publication,
generation cleanup, receipt correlation, and packaged lifecycle acceptance
remain open in docs/pm-audit-status.md.
2026-09-05 22:36:48 -04:00

51 lines
1.8 KiB
Python

"""Pins the REMOVAL of the MSIX SCM Windows service feature (audit C06/C07).
Settled user decision (2026-09-03): Windows gateway supervision stays on the
existing user-logon Scheduled Task. The desktop6:Service manifest fragment
and the `gateway run --service` / `hermes gateway service` frontend were
removed because the desktop6 schema cannot grant the promised installing-user
account model (StartAccount is required and limited to
localSystem|localService|networkService). These tests pin the surface the
feature used to own so it cannot silently come back.
"""
from __future__ import annotations
import argparse
import hermes_cli.config_defaults as config_defaults
from hermes_cli.subcommands import gateway as gateway_subcommands
def _build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest="command")
gateway_subcommands.build_gateway_parser(
subparsers, cmd_gateway=lambda *_: None, cmd_proxy=lambda *_: None,
cmd_gateway_enroll=lambda *_: None,
)
return parser
def test_gateway_subparser_has_no_service_subcommand(capsys):
parser = _build_parser()
try:
parser.parse_args(["gateway", "service", "on"])
except SystemExit:
pass
else:
raise AssertionError("`hermes gateway service` must stay removed")
finally:
capsys.readouterr()
def test_gateway_run_has_no_service_flag():
parser = _build_parser()
args = parser.parse_args(["gateway", "run"])
assert not hasattr(args, "service"), "gateway run --service must stay removed"
def test_config_defaults_have_no_gateway_service_key():
assert "service" not in config_defaults.DEFAULT_CONFIG["gateway"], (
"gateway.service (the SCM posture key) must stay removed"
)