2026-10-09 校注:文中部署目录、服务、版本和验收计数为各段标注日期的历史记录;当前可验证状态见 current-status-2026-10-09,本次未复跑历史测试或读取私有健康/对话数据。

Humon 健康派生收件箱 v1

目标

给 Humon 预留睡眠、HRV、静息心率、活动负荷和恢复背景,但不把 Health Connect、Mi Fitness、Zepp、Apple Health 或可穿戴的原始数据复制进系统,也不把生理信号误写成情绪、精力、专注或压力。

当前源审计没有发现可消费的真实导出,因此正式配置保持关闭、来源白名单为空、收件箱不存在。缺失只能是 disabled/unknown,不能从旧笔记空白或设备离线推断健康状态。

权威实现

  • 模块:humon_health.py
  • 输入规范:HEALTH_INBOX_SCHEMA.md
  • 示例配置:health.example.json
  • 私有配置:~/.config/humon/health.json,mode 600
  • 可选收件箱:~/.local/share/humon/health-derived.json,mode 600
  • Observation source:health-derived
  • Schema:humon-health-derived-v1
  • 回滚点:${HOME}/.hermes/backups/humon-v3-pre-health-derived-20260717-000308

授权边界

启用必须同时满足:

  1. 私有配置显式 enabled=true;
  2. source 精确命中 allowlist;
  3. consent.granted=true;
  4. consent scope 精确为 humon-health-derived-v1;
  5. grant 时间有效且 expiry 尚未到期;
  6. config 与 inbox 都是当前用户拥有、非 symlink、mode 600 的普通文件;
  7. inbox 小于 64 KiB(正式默认 16 KiB);
  8. payload 和每个子对象只含固定允许字段。

配置文件本身不能通过配置项放宽 POSIX 私有权限;测试注入才可关闭该检查。

允许的派生区间

  • sleep.duration_band = unknown|short|typical|long
  • sleep.quality_band = unknown|low|typical|high
  • sleep.regularity_band = unknown|irregular|typical|regular
  • physiology.hrv_vs_personal = unknown|below|typical|above
  • physiology.resting_hr_vs_personal = unknown|below|typical|above
  • activity.load_band = unknown|low|typical|high
  • recovery.band = unknown|low|typical|high

sleep 默认 TTL 36 小时;physiology/activity/recovery 默认 TTL 12 小时。每组独立过期;stale 后值变回 unknown。

输入 generated_at、consent 时间和 metric observed_at 只在内存用于授权/TTL 校验,持久化前丢弃。Observation 只含 bands、fresh boolean、consent_valid、授权 source class、available group 与 affect_inference=not-authorized;source_ref 是截短 SHA-256 去重指纹。它不包含原始健康值,但无密钥哈希不保证无法枚举或关联源信息,不能当作匿名化证明。

禁止字段与双重防线

任何 extra key 都使整份 inbox invalid,且错误 observation 不记录 key/value。Store 与 quality auditor 再次拒绝/标记:

  • heart_rate/hr/hrv/RMSSD/SDNN/RR intervals、beat/sample arrays;
  • sleep stages、bedtime/wake_time、sleep start/end、duration minutes/seconds;
  • steps、calories、distance、floors;
  • SpO2、temperature、respiration、ECG/PPG;
  • glucose、blood pressure、weight/BMI/body fat;
  • raw_samples/values 与其他精确载荷。

拒绝写入时只在 privacy_events 保存被拒绝键名,不保存数值。

认识论与帮助边界

健康 bands 完全不进入 humon_fusion.py,所以不能让 mood/energy/focus/stress 变成 known,也不能生成 action。Agent perception 只暴露固定 health block 与明确规则:

  • device-derived health context 不等于当前主观感受或诊断;
  • 不因 short sleep / low recovery 等值擅自断言疲劳、压力或低精力;
  • 用户没问且没有直接自报确认相关性时,不主动提健康 band;
  • 健康 source 不授权主动消息、干预或 delivery。

Humon → Hermes 回复桥 1.1.0 会继续省略 health source name、时间戳和原始值,只传 bands;非 direct inner evidence 时强制 in_reply_action=none。

验证证据

  • Windows 开发镜像与 WSL 正式运行目录:37 项测试、compileall、定向 Ruff 全通过。
  • 覆盖 disabled 零读取、授权/expiry/source allowlist、owner-only、strict keys、per-group TTL、stale→unknown、raw heart rate 全量拒绝、SignalSnapshot、Agent context、Hermes 固定投影、store denylist、quality bypass 审计。
  • 正式 verification:health-derived=disabled;consent_valid=false;所有 health band unknown。
  • 正式配置 enabled=false、authorized sources=0、inbox 不存在。
  • 正式库 health-derived observations=0、privacy_events=0、delivered=0、delivery_eligible=0、integrity=ok。
  • 00:05 后自然 cron 自动写入 health-derived=disabled;自然 Humon-fusion-v3=43、重复五分钟槽=0。
  • quality=operational-collecting,operational_ready=true,longitudinal_ready=false,delivery_ready=false。
  • /api/perception 返回 source_status=disabled、usable=false、privacy=derived-bands-only。
  • Hermes 真实 PluginManager:pre_llm hooks=1;授权 1 block、未授权 0;上下文含 disabled/unknown health block,禁用 raw 字段未泄露。
  • 开发、正式 Humon 与 profile plugin 共 25 个文件 SHA-256 完全一致。

下一步

只有获得真实、用户授权且能输出本 schema 的 exporter 后,才为该 exporter 增加唯一 source allowlist 并启用。先测数据新鲜度和缺失模式,再考虑是否需要与明确自报做相关性校准;在有足够配对真值前,健康 bands 永远不改变回复风格或动作。

关联