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:
commit
90c42f6e1d
13 files changed
+1455
-15
No files matched your search
@@ -85,6 +85,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 CloseupCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tmp = tempfile.TemporaryDirectory()
|
||||
@@ -113,7 +119,11 @@ class CloseupCase(unittest.TestCase):
|
||||
env_extra=None, **overrides):
|
||||
env = {"CHV_EGRESS_PROXY": "http://10.0.0.1:8888",
|
||||
"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)
|
||||
kwargs = dict(
|
||||
@@ -127,6 +137,7 @@ class CloseupCase(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
|
||||
|
||||
Reference in new issue
Block a user