Python
feat(memhub): HY pipeline log off, SDK text logs only in hy_memory.log
alvinfei5791c0d1e7da
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 8c519a9..b9b1c4f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,18 @@ Hy Memory and MemHub are versioned and released independently.## Unreleased+- MemHub turns off the HY pipeline log and trace at every diagnostic level+ (hy-memory 2.0.8 `MEMORY_PIPELINE_LOG_ENABLED=false`,+ `MEMORY_PIPELINE_TRACE_ENABLED=false`), so the per-step JSONL files under+ `hy-memory/governed-v2/logs/` and the `pipeline_logs` rows stop growing.+ The Debug panel no longer shows the HY pipeline section. Existing files are+ left in place.+- HY SDK text logs are written once, to `hy_memory.log`. They are no longer+ copied to `service.log` and `service-error.log` through the SDK's+ stdout/stderr streams. SDK warnings and errors also go to `core.log`, so the+ Debug panel still shows them. A live switch of the diagnostic level now also+ changes the level of `hy_memory.log`.+- MemHub shows when working and coding experiences were talked about. Afterthe SDK upgrade every one of them read "时间未知" (time unknown) because theSDK never stored their conversation time; hy-memory 2.0.7 stores it anddiff --git a/memhub/PRIVACY.md b/memhub/PRIVACY.mdindex bae6628..e4616df 100644--- a/memhub/PRIVACY.md+++ b/memhub/PRIVACY.md@@ -29,10 +29,12 @@ prompt/response、密钥、访问令牌或完整本地路径。结构化日志文件。详细合同见[`docs/contracts/diagnostic-logging.md`](docs/contracts/diagnostic-logging.md)。-用户显式把诊断级别切换为 `debug` 时,Core 会启用 HY pipeline trace,并将-`MEMORY_LOG_LLM_CONTENT` 设为 `true`。该模式会把完整模型 prompt/response 写入本地调试-日志,其中可能包含获授权的对话正文和模型输出;它只应用于有意识的故障排查,不应长期-开启,也不应在未经检查和脱敏时分享相关日志。切回 `info` 会停止后续正文记录,但不会+HY pipeline 日志与 trace 在任何级别下都关闭。HY SDK 的文本日志只写入+`hy-memory/governed-v2/logs/hy_memory.log`,其中的 WARNING 及以上同时写入 `core.log`;+SDK 不在 INFO 及以上级别记录对话或记忆正文。用户显式把诊断级别切换为 `debug` 时,Core 将+`MEMORY_LOG_LLM_CONTENT` 设为 `true`。该模式会把完整模型 prompt/response 写入+`hy_memory.log` 的 DEBUG 行,其中可能包含获授权的对话正文和模型输出;它只应用于有意识的+故障排查,不应长期开启,也不应在未经检查和脱敏时分享相关日志。切回 `info` 会停止后续正文记录,但不会自动删除此前已写入的调试文件。具体行为以当前源码、网络请求实现和发布说明为准。发现实现与本说明不一致时,请按diff --git a/memhub/apps/core/src/one_memory/hy_runtime_config.py b/memhub/apps/core/src/one_memory/hy_runtime_config.pyindex 9d36b22..cef9958 100644--- a/memhub/apps/core/src/one_memory/hy_runtime_config.py+++ b/memhub/apps/core/src/one_memory/hy_runtime_config.py@@ -109,11 +109,30 @@ def apply_diagnostic_log_level(level: DiagnosticLogLevel) -> None:if any(name == root or name.startswith(f"{root}.") for root in _NOISY_LIBRARY_LOGGERS):logging.getLogger(name).setLevel(noisy_level)+ # HY configures its text log once, on the first client, at the level of+ # that moment. Its file handler must follow later changes too, or a live+ # switch to debug never reaches hy_memory.log.+ for handler in logging.getLogger("hy_memory").handlers:+ if isinstance(handler, logging.FileHandler):+ handler.setLevel(selected)+os.environ["MEMORY_LOG_LEVEL"] = logging.getLevelName(selected)- os.environ["MEMORY_PIPELINE_TRACE_ENABLED"] = "true" if level == "debug" else "false"+ _apply_hy_pipeline_policy()os.environ["MEMORY_LOG_LLM_CONTENT"] = "true" if level == "debug" else "false"+def _apply_hy_pipeline_policy() -> None:+ """Keep HY's per-step pipeline log and trace off at every level.++ Nothing in MemHub reads them: Core's own diagnostics carry the step+ timing, and the JSONL/SQLite copies only grew on disk. With both off+ the SDK skips the per-step bookkeeping altogether.+ """++ os.environ["MEMORY_PIPELINE_LOG_ENABLED"] = "false"+ os.environ["MEMORY_PIPELINE_TRACE_ENABLED"] = "false"++def hy_memory_version() -> str:"""Return the installed SDK version, failing if the pinned dist is absent."""@@ -131,7 +150,9 @@ def configure_hy_runtime_environment(data_dir: Path) -> None:os.environ["MEMORY_LOG_DIR"] = str(log_dir)level = diagnostic_log_level(data_dir)os.environ["MEMORY_LOG_LEVEL"] = level.upper()- os.environ["MEMORY_PIPELINE_TRACE_ENABLED"] = "true" if level == "debug" else "false"+ _apply_hy_pipeline_policy()+ # Still meaningful with the pipeline log off: it decides whether HY's+ # DEBUG lines in hy_memory.log carry full model prompts and responses.os.environ["MEMORY_LOG_LLM_CONTENT"] = "true" if level == "debug" else "false"os.environ["MEMORY_MEMORY_OPERATIONS_ENABLED"] = "false"os.environ["ANONYMIZED_TELEMETRY"] = "False"diff --git a/memhub/apps/core/src/one_memory/hy_sdk_runtime.py b/memhub/apps/core/src/one_memory/hy_sdk_runtime.pyindex 854bb48..4b4d2a6 100644--- a/memhub/apps/core/src/one_memory/hy_sdk_runtime.py+++ b/memhub/apps/core/src/one_memory/hy_sdk_runtime.py@@ -36,6 +36,7 @@ from one_memory.hy_graph_admin import ()from one_memory.hy_sdk_types import HySdkRuntimeErrorfrom one_memory.local_embedding import LocalEmbedder+from one_memory.log_file import confine_hy_sdk_loggingfrom one_memory.model_profiles import (ModelProfileSnapshot,ProviderKind,@@ -391,6 +392,10 @@ def _acquire_client(except BaseException:_release_runtime(key)raise+ finally:+ # The constructor's first step configures HY's text log (once per+ # process), so by here it exists whether or not construction succeeded.+ confine_hy_sdk_logging()return ClientLease(client, key)diff --git a/memhub/apps/core/src/one_memory/log_file.py b/memhub/apps/core/src/one_memory/log_file.pyindex 23be281..27b207b 100644--- a/memhub/apps/core/src/one_memory/log_file.py+++ b/memhub/apps/core/src/one_memory/log_file.py@@ -20,8 +20,11 @@ def start_logging_to_file(data_dir: Path) -> Path:nowhere. That includes the loop watchdog: the one report that names whatstalled the app was unreadable in exactly the situation it exists for.- The active diagnostic collection level controls Core, HY SDK, and provider- client records. Uvicorn keeps its request log on its own non-propagating+ The active diagnostic collection level controls Core and provider client+ records. The HY SDK keeps its own text log, hy_memory.log under the SDK's+ log directory, and stops propagating here once its first client is built;+ `confine_hy_sdk_logging` then forwards only its warnings and errors to+ this file. Uvicorn keeps its request log on its own non-propagatingloggers."""destination = log_path(data_dir)@@ -49,3 +52,53 @@ def start_logging_to_file(data_dir: Path) -> Path:if root.level > logging.INFO or root.level == logging.NOTSET:root.setLevel(logging.INFO)return destination+++HY_SDK_LOGGER = "hy_memory"+++class _CoreLogForwarder(logging.Handler):+ """Hands HY warnings to Core's own core.log handler, rotation and format."""++ def __init__(self, target: logging.Handler) -> None:+ super().__init__(level=logging.WARNING)+ self.target = target++ def emit(self, record: logging.LogRecord) -> None:+ self.target.handle(record)+++def confine_hy_sdk_logging() -> None:+ """Keep HY's text log in hy_memory.log, with only its problems in core.log.++ HY's first client sets up hy_memory.log plus a stdout and a stderr stream+ on the "hy_memory" logger, and stops it propagating to the root. Under+ launchd those streams are service.log and service-error.log, so every SDK+ line was written twice, and none reached core.log. Drop the streams and+ forward WARNING and above to core.log, which the Debug panel reads; the+ SDK keeps conversation text out of those levels.++ Idempotent. Does nothing until HY has configured its logger, because a+ propagating logger already reaches core.log through the root.+ """+ sdk = logging.getLogger(HY_SDK_LOGGER)+ if sdk.propagate:+ return+ for handler in list(sdk.handlers):+ if isinstance(handler, logging.StreamHandler) and not isinstance(+ handler, logging.FileHandler+ ):+ sdk.removeHandler(handler)+ if any(isinstance(handler, _CoreLogForwarder) for handler in sdk.handlers):+ return+ core = next(+ (+ handler+ for handler in logging.getLogger().handlers+ if isinstance(handler, RotatingFileHandler)+ and Path(handler.baseFilename).name == "core.log"+ ),+ None,+ )+ if core is not None:+ sdk.addHandler(_CoreLogForwarder(core))diff --git a/memhub/apps/core/tests/TEST_INDEX.md b/memhub/apps/core/tests/TEST_INDEX.mdindex fd2f457..7f2d910 100644--- a/memhub/apps/core/tests/TEST_INDEX.md+++ b/memhub/apps/core/tests/TEST_INDEX.md@@ -79,7 +79,7 @@| `test_database_file_permissions.py` | `contract` | 覆盖 a new main database is readable by its owner alone、the wal sidecars are not left world readable、a database from an older build is tightened on open 场景。 || `test_db_session_utc.py` | `contract` | The MySQL session must be pinned to UTC. || `test_derived_echo.py` | `contract` | A host that saves our injection back must not mint a new user decision. |-| `test_detailed_logging.py` | `contract` | 覆盖 detailed pipeline logging defaults off and survives restart、live log level applies to full hy and provider call chain、info collects hy info without enabling debug pipeline content 等 7 个场景。 |+| `test_detailed_logging.py` | `contract` | 覆盖 detailed logging defaults off and survives restart、hy pipeline log and trace stay off at every level、live level change reaches the hy text log file 等 7 个场景。 || `test_diagnostic_log.py` | `contract` | 覆盖 high frequency success events are summarized but warnings are not、structured log is private correlated and owner only、arbitrary detail and absolute stack are rejected 等 14 个场景。 || `test_diagnostic_log_durability.py` | `contract` | 写线程报告的「已落盘」必须是真的。 || `test_diagnostic_log_off_loop.py` | `contract` | 诊断日志不得在调用线程上做磁盘 I/O。 |@@ -112,6 +112,7 @@| `test_hy_log_privacy.py` | `contract` | HY SDK records are not rewritten by One Memory's logging setup. || `test_hy_network_egress.py` | `contract` | Where a real HY client is allowed to send bytes, and where it is not. || `test_hy_runtime_config.py` | `contract` | MEMORY.md is the audited record of what we send HY; keep it answerable. |+| `test_hy_sdk_log_routing.py` | `contract` | HY SDK text logs go to hy_memory.log only, with warnings also in core.log. || `test_hy_step_trace_switch.py` | `contract` | Rule 15: the per-step HY trace is off unless the debug tier asks for it. || `test_import_api.py` | `integration` | 覆盖 resume during cleanup returns conflict without internal error、authorize detect import and revoke api flow、protected api rejects missing token and foreign origin 等 5 个场景。 || `test_import_control_races_review.py` | `contract` | Read-only review repro: real runner/store, synthetic delayed adapter cleanup. |@@ -307,4 +308,4 @@| `test_workspace_recall.py` | `contract` | Workspace memories were unreachable from every host; these pin the way in. || `test_write_queue_lease_renewal.py` | `contract` | Rule 8: a lease must outlive the work it covers, and be renewed while it runs. |-共 302 个测试文件。+共 303 个测试文件。diff --git a/memhub/apps/core/tests/core_test_classification.py b/memhub/apps/core/tests/core_test_classification.pyindex 5f362a3..805b8f4 100644--- a/memhub/apps/core/tests/core_test_classification.py+++ b/memhub/apps/core/tests/core_test_classification.py@@ -14,8 +14,8 @@ from pathlib import Pathimport pytestPRIMARY_MARKERS = ("unit", "contract", "integration", "performance", "live")-EXPECTED_TEST_FILE_COUNT = 302-EXPECTED_TEST_FILES_SHA256 = "07707528025ac134e46c93ebef12335e852df1ed0f52f8beb62abb3b4d1b0e97"+EXPECTED_TEST_FILE_COUNT = 303+EXPECTED_TEST_FILES_SHA256 = "7993203411697fc0bf42b92fa316f222a66e6826c5b4a0132dbb0a1ca6da4e32"# Pure transformations, validation models, parity checks and state machines.# This list is intentionally small: uncertain files default to contract.diff --git a/memhub/apps/core/tests/test_detailed_logging.py b/memhub/apps/core/tests/test_detailed_logging.pyindex 6bcdf44..dd61599 100644--- a/memhub/apps/core/tests/test_detailed_logging.py+++ b/memhub/apps/core/tests/test_detailed_logging.py@@ -1,6 +1,5 @@import jsonimport logging-from importlib import import_modulefrom pathlib import Pathfrom one_memory.hy_runtime_config import (@@ -12,20 +11,50 @@ from one_memory.hy_runtime_config import ()-def test_detailed_pipeline_logging_defaults_off_and_survives_restart(- tmp_path: Path, monkeypatch-) -> None:- monkeypatch.delenv("MEMORY_PIPELINE_TRACE_ENABLED", raising=False)+def test_detailed_logging_defaults_off_and_survives_restart(tmp_path: Path, monkeypatch) -> None:+ monkeypatch.delenv("MEMORY_LOG_LEVEL", raising=False)assert detailed_logging_enabled(tmp_path) is Falseconfigure_hy_runtime_environment(tmp_path)- assert __import__("os").environ["MEMORY_PIPELINE_TRACE_ENABLED"] == "false"+ assert __import__("os").environ["MEMORY_LOG_LEVEL"] == "INFO"assert diagnostic_log_level(tmp_path) == "info"assert set_detailed_logging(tmp_path, True) is Trueassert detailed_logging_enabled(tmp_path) is True- monkeypatch.delenv("MEMORY_PIPELINE_TRACE_ENABLED", raising=False)+ monkeypatch.delenv("MEMORY_LOG_LEVEL", raising=False)configure_hy_runtime_environment(tmp_path)- assert __import__("os").environ["MEMORY_PIPELINE_TRACE_ENABLED"] == "true"+ assert __import__("os").environ["MEMORY_LOG_LEVEL"] == "DEBUG"+++def test_hy_pipeline_log_and_trace_stay_off_at_every_level(tmp_path: Path, monkeypatch) -> None:+ environment = __import__("os").environ+ for level in ("error", "warning", "info", "debug"):+ for name in ("MEMORY_PIPELINE_LOG_ENABLED", "MEMORY_PIPELINE_TRACE_ENABLED"):+ monkeypatch.setenv(name, "true")+ set_diagnostic_log_level(tmp_path, level)+ assert environment["MEMORY_PIPELINE_LOG_ENABLED"] == "false"+ assert environment["MEMORY_PIPELINE_TRACE_ENABLED"] == "false"++ for name in ("MEMORY_PIPELINE_LOG_ENABLED", "MEMORY_PIPELINE_TRACE_ENABLED"):+ monkeypatch.setenv(name, "true")+ configure_hy_runtime_environment(tmp_path)+ assert environment["MEMORY_PIPELINE_LOG_ENABLED"] == "false"+ assert environment["MEMORY_PIPELINE_TRACE_ENABLED"] == "false"+++def test_live_level_change_reaches_the_hy_text_log_file(tmp_path: Path) -> None:+ sdk = logging.getLogger("hy_memory")+ text_log = logging.FileHandler(tmp_path / "hy_memory.log", encoding="utf-8")+ text_log.setLevel(logging.INFO)+ sdk.addHandler(text_log)+ try:+ set_diagnostic_log_level(tmp_path, "debug")+ assert text_log.level == logging.DEBUG+ set_diagnostic_log_level(tmp_path, "warning")+ assert text_log.level == logging.WARNING+ finally:+ sdk.removeHandler(text_log)+ text_log.close()+ set_diagnostic_log_level(tmp_path, "info")def test_live_log_level_applies_to_full_hy_and_provider_call_chain(@@ -60,43 +89,9 @@ def test_info_collects_hy_info_without_enabling_debug_pipeline_content(assert logging.getLogger("openai._base_client").isEnabledFor(logging.INFO)assert not logging.getLogger("openai._base_client").isEnabledFor(logging.DEBUG)assert __import__("os").environ["MEMORY_LOG_LEVEL"] == "INFO"- assert __import__("os").environ["MEMORY_PIPELINE_TRACE_ENABLED"] == "false"assert __import__("os").environ["MEMORY_LOG_LLM_CONTENT"] == "false"-def test_live_debug_switch_makes_sdk_pipeline_writer_keep_original_content(- tmp_path: Path,-) -> None:- writer_type = import_module("hy_memory.utils.pipeline_log_writer").PipelineLogWriter- writer = writer_type(str(tmp_path / "pipeline"))-- set_diagnostic_log_level(tmp_path, "info")- writer.write_step(- request_id="info",- step="EXTRACT",- prompt="info prompt",- response="info response",- )- set_diagnostic_log_level(tmp_path, "debug")- writer.write_step(- request_id="debug",- step="EXTRACT",- prompt="debug prompt",- response="debug response",- )-- lines = [- json.loads(line)- for target in (tmp_path / "pipeline").rglob("*.log")- for line in target.read_text(encoding="utf-8").splitlines()- ]- info, debug = lines- assert info["prompt"].startswith("<redacted len=")- assert info["content"].startswith("<redacted len=")- assert debug["prompt"] == "debug prompt"- assert debug["content"] == "debug response"--def test_log_level_document_migrates_the_old_boolean_shape(tmp_path: Path) -> None:target = tmp_path / "settings" / "diagnostic-logging.json"target.parent.mkdir(parents=True)@@ -117,6 +112,7 @@ def test_configure_environment_passes_debug_content_settings_to_sdk("MEMORY_DATA_DIR","MEMORY_LOG_DIR","MEMORY_LOG_LEVEL",+ "MEMORY_PIPELINE_LOG_ENABLED","MEMORY_PIPELINE_TRACE_ENABLED","MEMORY_LOG_LLM_CONTENT",):@@ -129,5 +125,6 @@ def test_configure_environment_passes_debug_content_settings_to_sdk(assert environment["MEMORY_DATA_DIR"] == str(memory_root)assert environment["MEMORY_LOG_DIR"] == str(memory_root / "logs")assert environment["MEMORY_LOG_LEVEL"] == "DEBUG"- assert environment["MEMORY_PIPELINE_TRACE_ENABLED"] == "true"+ assert environment["MEMORY_PIPELINE_LOG_ENABLED"] == "false"+ assert environment["MEMORY_PIPELINE_TRACE_ENABLED"] == "false"assert environment["MEMORY_LOG_LLM_CONTENT"] == "true"diff --git a/memhub/apps/core/tests/test_hy_sdk_log_routing.py b/memhub/apps/core/tests/test_hy_sdk_log_routing.pynew file mode 100644index 0000000..4e8cb55--- /dev/null+++ b/memhub/apps/core/tests/test_hy_sdk_log_routing.py@@ -0,0 +1,146 @@+"""HY SDK text logs go to hy_memory.log only, with warnings also in core.log.++The SDK's first client adds a stdout and a stderr stream to the "hy_memory"+logger and stops it propagating. Under launchd those streams are+service.log and service-error.log, so each SDK line used to be written+twice and none reached core.log.+"""++import logging+import sys+from logging.handlers import RotatingFileHandler+from pathlib import Path+from types import SimpleNamespace++import pytest++from one_memory import hy_sdk_runtime+from one_memory.log_file import (+ HY_SDK_LOGGER,+ confine_hy_sdk_logging,+ log_path,+ start_logging_to_file,+)+++def sdk_logger():+ """The "hy_memory" logger as HY's setup_logging leaves it, restored after."""+ sdk = logging.getLogger(HY_SDK_LOGGER)+ root = logging.getLogger()+ saved = (list(sdk.handlers), sdk.propagate, sdk.level, list(root.handlers), root.level)+ yield sdk+ for handler in sdk.handlers:+ if handler not in saved[0]:+ handler.close()+ for handler in root.handlers:+ if handler not in saved[3]:+ handler.close()+ sdk.handlers, sdk.propagate, root.handlers = saved[0], saved[1], saved[3]+ sdk.setLevel(saved[2])+ root.setLevel(saved[4])+++def _configure_like_hy(sdk: logging.Logger, log_dir: Path) -> logging.FileHandler:+ log_dir.mkdir(parents=True, exist_ok=True)+ text_log = logging.FileHandler(log_dir / "hy_memory.log", encoding="utf-8")+ stdout = logging.StreamHandler(sys.stdout)+ stderr = logging.StreamHandler(sys.stderr)+ stderr.setLevel(logging.WARNING)+ sdk.handlers = [text_log, stdout, stderr]+ sdk.propagate = False+ sdk.setLevel(logging.INFO)+ return text_log+++def test_sdk_lines_stay_in_hy_memory_log_and_warnings_reach_core_log(+ tmp_path: Path, sdk_logger: logging.Logger+) -> None:+ start_logging_to_file(tmp_path)+ text_log = _configure_like_hy(sdk_logger, tmp_path / "hy")++ confine_hy_sdk_logging()+ confine_hy_sdk_logging()++ assert not [+ handler+ for handler in sdk_logger.handlers+ if isinstance(handler, logging.StreamHandler)+ and not isinstance(handler, logging.FileHandler)+ ]+ assert text_log in sdk_logger.handlers+ assert len(sdk_logger.handlers) == 2, "the core.log forwarder is added once"++ child = logging.getLogger("hy_memory.client")+ child.info("[add] routine sdk line")+ child.warning("[add] sdk problem")+ for handler in logging.getLogger().handlers:+ handler.flush()+ text_log.flush()++ hy_text = (tmp_path / "hy" / "hy_memory.log").read_text(encoding="utf-8")+ core_text = log_path(tmp_path).read_text(encoding="utf-8")+ assert "routine sdk line" in hy_text and "sdk problem" in hy_text+ assert "sdk problem" in core_text+ assert "routine sdk line" not in core_text+ assert core_text.count("sdk problem") == 1+++def test_nothing_changes_before_hy_has_configured_its_logger(+ tmp_path: Path, sdk_logger: logging.Logger+) -> None:+ start_logging_to_file(tmp_path)+ sdk_logger.handlers = []+ sdk_logger.propagate = True++ confine_hy_sdk_logging()++ assert sdk_logger.handlers == []+++def test_without_core_log_the_streams_are_still_dropped(+ tmp_path: Path, sdk_logger: logging.Logger+) -> None:+ logging.getLogger().handlers = [+ handler+ for handler in logging.getLogger().handlers+ if not isinstance(handler, RotatingFileHandler)+ ]+ text_log = _configure_like_hy(sdk_logger, tmp_path / "hy")++ confine_hy_sdk_logging()++ assert sdk_logger.handlers == [text_log]++[email protected]("fails", [False, True])+def test_every_client_construction_confines_the_sdk_log(+ tmp_path: Path, monkeypatch, fails: bool+) -> None:+ order: list[str] = []++ class Client:+ def __init__(self, **_options):+ order.append("client")+ if fails:+ raise RuntimeError("construction failed")++ monkeypatch.setattr(hy_sdk_runtime, "HyMemoryClient", Client)+ monkeypatch.setattr(hy_sdk_runtime, "build_sdk_config", lambda *_a, **_k: SimpleNamespace())+ monkeypatch.setattr(hy_sdk_runtime, "inspect_graph_width_mismatch", lambda _c: None)+ monkeypatch.setattr(hy_sdk_runtime, "_acquire_runtime", lambda _c, _k: object())+ monkeypatch.setattr(hy_sdk_runtime, "_release_runtime", lambda _k: None)+ monkeypatch.setattr(hy_sdk_runtime, "confine_hy_sdk_logging", lambda: order.append("confine"))+ profile = SimpleNamespace(embedding_provider_kind=None, provider_kind=None)++ if fails:+ with pytest.raises(RuntimeError):+ hy_sdk_runtime._acquire_client(+ profile, api_key=None, data_dir=tmp_path, http_transport_factory=None+ )+ else:+ hy_sdk_runtime._acquire_client(+ profile, api_key=None, data_dir=tmp_path, http_transport_factory=None+ )++ assert order == ["client", "confine"]diff --git a/memhub/docs/PRODUCT_LOG_TROUBLESHOOTING.md b/memhub/docs/PRODUCT_LOG_TROUBLESHOOTING.mdindex 94af606..66cd356 100644--- a/memhub/docs/PRODUCT_LOG_TROUBLESHOOTING.md+++ b/memhub/docs/PRODUCT_LOG_TROUBLESHOOTING.md@@ -7,12 +7,12 @@3. 如果停住,停在导入、模型调用还是最终写入。默认 `info` 下的官方结构化事件不应写入会话正文、模型输入输出或 API Key;但本地原始日志允许-新增受限标量标签,仍应按私人数据处理,不能直接对外发送。`debug` 会额外启用 HY pipeline-trace,其中可能包含完整 prompt/response 和获授权的对话正文。+新增受限标量标签,仍应按私人数据处理,不能直接对外发送。`debug` 会让 HY 的+`hy_memory.log` 记录 DEBUG 行,其中可能包含完整 prompt/response 和获授权的对话正文。排查时只通过 App 的“导出日志”提供文件:导出过程会按安全白名单重新生成诊断事件,不会打包-原始日志。不要直接发送 `diagnostic-*.jsonl`、整个 `~/.one-memory` 数据目录或 debug pipeline-日志;后者如确需分享,必须由开发人员另行确认并脱敏。+原始日志。不要直接发送 `diagnostic-*.jsonl`、整个 `~/.one-memory` 数据目录或 debug 级别的+`hy_memory.log`;后者如确需分享,必须由开发人员另行确认并脱敏。## 1. Log level 设什么@@ -181,8 +181,8 @@ memhub logs --since 24h --errors-only --tail 500 --jsonmemhub status --json```-以下 `jq` 命令仅用于 `diagnostic-core.jsonl`,不要对 `core.log`、`service.log` 或 debug-pipeline 日志直接运行后把完整输出发给他人。+以下 `jq` 命令仅用于 `diagnostic-core.jsonl`,不要对 `core.log`、`service.log` 或+`hy_memory.log` 直接运行后把完整输出发给他人。### 查看最近的失败