Files
CyberGril/docs/requirements/handoff-HEL-870.json
T
zonggongandmultica-agent 31970c4dd3 HEL-870 assembly: memory/persona/mood/life/proactive-contact joined into one runnable candidate on an additive R4 migration (no existing table or row replaced; no visual changes beyond mechanical proactive flag passthrough) - src/cybergril/memory/semantic.py productizes the audited Mem0 path per plan-next-HEL-869: input-side pre-grouping sends only public rows outbound (user rows always; companion rows only judged+acked with all-told candidates), every batch anchor turn_ids/turn_roles/input_sha256 equals that exact input set, and the read-time gate independently recomputes the fingerprint against the live archive and re-checks every companion row's share state, fail-closed rejecting no_payload/unknown_source/archive_missing/source_mismatch/hit_text_mismatch/anchor_turn_mismatch/role_text_conflict/companion_unshared with honest row_verbatim/row_anchor/batch provenance; main archive chat_message remains the ONLY permanent quote layer; sem_batch/sem_covered carry a lease-recovered idempotent job loop; EmbedLedgerGuard continues the single authoritative embed ledger and with embed_cap=0 (no approved budget) refuses every real embedding so the frozen 498/500 and 39/60 accounts and the HEL-835 gate stay untouched; fixed Mem0 2c81af3 is lazily imported with zero upstream fork, a deterministic stub backend exists for engineering verification and is never claimed semantic; MoodRuntime makes core.mood live (event impulses scaled by bazi strength sensitivity, heartbeat decay, state_snapshot persistence, restart recovery, model sees one word only); DyadRuntime makes the relationship ledger live (completed exchanges are rituals, daily regression, behavior hints stay instructions); life_activity adds start/continue/interrupt/resume/finish continuity across slots and restarts with chat-completion interrupts; reach_out implements the approved R4 scope from character.yaml (>=6h interval, hours 8-23, salience>=0.6, arousal>=0.5, intimacy>=0.4) with traceable already-public bases only, UNIQUE(basis) so restarts and duplicate tasks can never multiply messages, night suppression, absence-rule fail-closed, phi projection, and messages persisted as companion rows (proactive=1) fully synced on reopen; API health reports R4-assembly with per-capability honesty (voice/vision/weather/materials/backup stay false, semantic_memory names its backend); config/semantic.example.yaml sanitized config and docs/runbook-hel870.md (startup, locked deps, health, independent data dir, disable/rollback, experience chain list, budget request, R1-R7 seams); verification: 250 python tests pass on 3.11 venv + requirements.lock (61 new deterministic/fake-provider cases covering every gate negative, restart recovery, dedupe, red line and the full entry chain incl. reopen epoch sync), ruff clean, web typecheck + 42 vitest + build pass with the original author frontend untouched except the one-line proactive passthrough; dual-target requirement checks 4/4 pass vs origin/main and origin/agent/agent/de8874a3803b with handoff-HEL-870.json; zero real model calls, zero embeddings, zero outbound network this card; local unified-instance smoke on port 8360 (stub semantic) serves the built web and reports the life loop waiting; read-only server check recorded in the runbook (existing 8300-8350 services and voice ports observed, end-to-end voice availability NOT verified); not merged, not deployed, no production or shared services touched
Co-authored-by: multica-agent <github@multica.ai>
2026-10-26 21:03:42 +08:00

56 lines
7.8 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"baseline_version": "1.11",
"read_commit": "56719462673eb6d4ea07208d539b53b46b4e03b3",
"task": "HEL-870 总装:在已认可前端与既有 R1–R3 工程成果上,把记忆(Mem0 产品路径)、人格/情绪/关系/生活接线、主动联系(R4)与普通入口链路接成可运行的统一候选,交接独立审核;不做部署、不合并、不动现网与三账",
"requirement_ids": [
"CG-001",
"CG-006",
"CG-007",
"CG-008",
"CG-011",
"CG-012",
"CG-013",
"CG-014",
"CG-015",
"CG-016",
"CG-018",
"CG-021",
"AM-001",
"AM-002",
"AM-003",
"UX-004",
"UX-005",
"UX-006",
"GOV-001",
"GOV-002",
"GOV-003",
"GOV-005",
"GOV-006",
"DEL-001"
],
"deliverable": "独立总装分支 hel-870-assembly(自 origin/hel-857-mem0-spike @ 5671946,包含关系已核对:de8874a ⊂ hel-835-unified-review ⊂ hel-857-mem0-spike):1) 记忆成为产品路径——src/cybergril/memory/semantic.py 把固定源 Mem0(2c81af3,mem0ai 2.2.1)适配进真实 API 与作业循环:输入侧预分组(仅公开行出站:用户行恒公开、伴侣行须分享判定 judged+acked 且候选全 told)、锚点 turn_ids/turn_roles/input_sha256=实际输入集、读时门独立重算指纹并逐行复查分享状态(fail-closed:no_payload/unknown_source/archive_missing/source_mismatch/hit_text_mismatch/anchor_turn_mismatch/role_text_conflict/companion_unshared),溯源分层 row_verbatim/row_anchor/batch;主档案 chat_message 仍是唯一永久原话层;sem_batch/sem_covered 作业队列带租约恢复、行级覆盖幂等;EmbedLedgerGuard 沿用唯一权威嵌入账且 embed_cap=0(未批预算)时拒绝一切真实嵌入,不碰 498/500 冻结余额;mem0 后端固定安装懒加载、零上游 fork,另附 stub 确定性后端供工程验证(不冒充语义)。2) 人格/情绪/生活/对话接线——MoodRuntime(core.mood 方程成真:事件冲激按八字强弱敏感度、心跳衰减、state_snapshot 持久、重启恢复、模型只见一个词);DyadRuntime(关系账本成真:完成交谈=ritual、每日回归、行为提示为指令非台词);生活活动连续性 life_activity(start/continue/resume/finish 状态机、对话完成即打断、后续时段可恢复,跨重启持久);生活生成提示供给活动状态与情绪词。3) 主动联系与重开同步——reach_out 引擎按已批准参数(character.yaml:间隔≥6h、8–23 点、显著度≥0.6、唤醒≥0.5、亲密≥0.4):依据只取已公开高显著生活事件/公开记忆、UNIQUE(basis) 使重启/重复任务绝不重复、冷却只认已发、夜间抑制、缺席红线 fail-closed(violates_absence_rule 拒绝)、措辞经 φ 投影、消息落 chat_message(proactive=1) 随重开全量同步可见。4) 普通入口一条链路——创建→人格/关系→真实传输→原话与记忆写入→回忆/日子页→关闭重开同状态+未读主动消息全链真实(web 仅机械透传 proactive 标记,未改视觉)。5) 统一实例准备——config/semantic.example.yaml 脱敏配置、docs/runbook-hel870.md(启动/锁定依赖/健康版本/独立数据目录/停用回退/体验链路清单/预算申请/R1–R7 承接);本机统一实例冒烟(8360 端口、stub 语义、生活循环待建档案、web 根 200);服务器 .12 只读核实(8310/8320/8340/8350/S1 运行中、8090/8081 监听、/opt/voice-agent 存在,端到端语音可用性未验证)。测试:新增 5 个测试文件 61 项(语义门正负例、mem0 假 SDK 适配器与预算闸、情绪运行时、主动联系全部闸门与终态、API 级总装链路),全套 250 过;ruff 0 错;web typecheck/42 测试/build 通过。",
"acceptance": [
"语义记忆产品路径:仅公开行进入提取批次(未分享伴侣行永不出站)、锚点=实际输入集且门内 sha256 重算、负例(篡改档案行/伪造命中文本/锚点缺 turn_ids/轮次互矛/分享状态被撤销)全部整条拒绝;作业队列重启恢复不重发、行级覆盖幂等(tests/test_semantic.py 7 项 + tests/test_mem0_backend.py 3 项)",
"情绪/关系/生活接线:事件真实推动状态并持久、心跳衰减、重启按快照续衰减不重置;完成交谈计入 ritual、每日回归;活动 start/continue/resume/finish 全状态机含对话打断与跨槽恢复(tests/test_mood_runtime.py 5 项、tests/test_r4_api.py 生活槽 4 步)",
"主动联系批准范围内可解释:夜间与冷却与显著度/唤醒/亲密闸门逐项负例通过;同一依据永远只产生一条消息(重启/重复 tick 不增);缺席武器化文案 fail-closed 拒绝且不留消息;消息经 /api/messages 全量同步并带 proactive 标记(tests/test_reach_out.py 4 项、test_r4_api DTO)",
"入口链路:无档案→创建→对话→重开同状态(epoch 递增、消息一致)通过 TestClient 双实例验证;/api/health 如实报告 R4-assembly 与各能力开关,未接能力(语音/视觉/天气/备份/真实语义)保持 false/null 与界面诚实文案",
"预算与冻结:本卡零真实模型请求、零嵌入、零网络出站(除 .11:8731 探活与 .12 只读 ssh 核查);HEL-857 三账、39/60、498/500、HEL-835 闸门原样未动;真实冒烟预算与日常预算清单已按类别列出交总管核定",
"工程检查:python 250 项测试全过(3.11 venv+requirements.lock 离线安装)、ruff 0 错、web tsc/vitest42/build 通过;双目标需求结构检查(origin/main 与 origin/agent/agent/de8874a3803b 各含/不含本 handoff)退出码 0"
],
"deferred": [
"语义层真实激活(CYBERGRIL_SEMANTIC=mem0):固定安装并入部署环境与嵌入预算批准后执行(embed_cap=0 fail-closed 中);中文提取 custom_instructions 定制按 HEL-869 §4 触发条件另评",
"统一候选独立审核与按已批准流程部署(建议 8360 独立端口+全新独立数据空间):由后续审核卡执行,本卡未部署未合并未触 8300–8350/共享语音口型/4080",
"R5 语音连续对话:/opt/voice-agent 底座与 8090/8081 监听在 .12 存活但端到端未验证;音色(D1)与 HTTPS 路径待决;R6 天气(open-meteo 出网实测)/素材包 manifest/备份导出恢复产品化;R7 视觉观察默认关待白栖知授权与 4080 决策(D4)——接缝与所需资源已列 docs/runbook-hel870.md §7",
"主动消息打开页面期间的实时呈现节奏与未读提示的视觉表达:交视觉总监按已认可视觉语言设计(后端契约 proactive 已通,无需后端改动);intimacy≥0.4 的解锁节奏(约 10+ 次完成交谈)为已批准参数的真实行为,如需调整须走需求变更",
"用户整体验验与沉浸判断:本卡为工程总装,不代表白栖知体验验收;体验问题继续在主卡定位讨论"
],
"requirement_changes": [],
"verification": [
"分支 hel-870-assembly 提交(含 r4.sql 增量迁移、semantic.py/mood_runtime.py/reach_out.py/activity.py/dyad runtime/runbook);平台合同开候选 PR 不合并",
"python3.11 venv:250 项测试全过(含新增 61 项确定性/假 provider 验证);ruff 0 错;web typecheck+42 测试+build 通过",
"统一实例本机冒烟:CYBERGRIL_SEMANTIC=stub 启动、/api/health 返回 R4-assembly 全绿(mood/reach_out/semantic 接线、proactive=true、semantic_memory=stub)、web 根 200、生活循环 waiting_for_companion",
"服务器只读核查记录(runbook §8):.12 现有服务与监听端口清单、/opt/voice-agent 存在;未触任何现网服务与共享资源",
"python3 scripts/check_requirements.py --base-ref origin/main [--handoff docs/requirements/handoff-HEL-870.json] 与 --base-ref origin/agent/agent/de8874a3803b [--handoff …] 四项通过"
]
}