Merge feat-chv-muse-p9: inference/telemetry restricted channel

- executor.py: P9 _inference_gate inserted before P1 dispatcher
  _run_with_vm; gate call is the first statement, so deny/ask
  fail-closed before any resident resume or cold wake. P9's own
  _run_with_vm (old-body variant) dropped: its body is byte-identical
  to P1 _run_cold (verbatim move), kept once in _run_cold.
- sentinel.py: P9 superset version wins (P5 base + inference entries
  POST /v1/responses, GET /v1/models + comments).
- inference_channel.py / telemetry.py / host.py: P9 as-is.
- Tests: P9 51 + closeup/gaps/optimize/cloud_hypervisor/fix 272 OK.
- mypy on changed files: P9's 5 cross-track errors gone (P5
  capabilities.py now in tree); remaining 4 are 06c3e17 baseline
  legacy (marker_tools.py:142, executor.py:1573/1578), untouched.
This commit is contained in:
host committed 2026-11-07 00:09:26 +00:00
commit 90c42f6e1d
13 files changed
+1455 -15

No files matched your search

+12 -1
View File
@@ -73,6 +73,12 @@ def _write(path, content=b"x"):
return path
def _public_resolver(host, port):
"""feat-chv-muse-p9:假解析器(公网 IP),供推理出口预审用;
实验室绝不联网,真实解析只在真机发生。"""
return ["93.184.216.34"]
class ChvCase(unittest.TestCase):
def setUp(self):
self.tmp = tempfile.TemporaryDirectory()
@@ -106,7 +112,11 @@ class ChvCase(unittest.TestCase):
# genisoimage,测的不是 host key 模式,故显式
# 声明实验室路径,绝不把它写成生产默认。
"CHV_HOST_KEY_MODE": "keyscan",
"CHV_SSH_FORWARD": "1"}
"CHV_SSH_FORWARD": "1",
# feat-chv-muse-p9:推理出口预审的假 origin(公网
# https,配假解析器;实验室不起真 VM、不联网)。
"SUB2API_BASE_URL": "https://xgapi.lol",
"CHV_INFERENCE_ORIGIN": "https://xgapi.lol"}
if env_extra:
env.update(env_extra)
if runner is None:
@@ -124,6 +134,7 @@ class ChvCase(unittest.TestCase):
sleeper=lambda s: None, env=env)
kwargs.update(overrides)
ex = CloudHypervisorExecutor(**kwargs)
ex.sentinel_resolver = _public_resolver
ex.audit_callback = lambda e, t, d, k=None: self.audit.append(
(e, t.get("id") if isinstance(t, dict) else t, d, k))
return ex