Files
CyberGril/deploy/hel874-release.md
T
zonggongandmultica-agent e978e878df HEL-874 rework: bounded verbatim readback reaches the real provider input, real pinned Mem0 2.2.1 SDK contract verified live and the adapter's five wiring defects fixed, budget gates made provable (atomic reserve/settle embed ledger + independent llm_ops cap), definite-cap real-check execution table, 8360 isolated release package prepared (not deployed), 2026-10-26 user originals recorded source-only - semantic.context now quotes chain-verified archive rows (original words + role + when, <=200-char window with visible trim marker, summary demoted to a one-line pointer, same min(600,budget) cap) and episodic.context flips from gist-first-120-chars to verbatim-first (<=240) + role + date, both proven by tests/test_readback_hel874.py capturing the actual messages handed to the provider through the real API path: a detail absent from the gist yet quoted verbatim from a turn pushed outside the recent-20 window, the same for a semantic chain hit, and an unshared companion row never leaking through FTS, semantic or any anchor (AM-001); tools/verify_mem0_real_hel874.py runs the FIXED install itself (mem0ai 2.2.1 2c81af3, real embedded qdrant, real fastembed from the existing cache, deterministic 127.0.0.1 fake gateway, temp ledgers only): before=31970c4 dies at construction (second QdrantClient on the same path rejected by the SDK - recorded), and source-level findings confirmed live and fixed - unscoped search raises ValueError in 2.2.1 (add now carries user_id scope, search passes filters+top_k since limit is silently ignored), payload reads ride the SDK's own vector_store.client, the old outer search debit double-counted (wrapper is now the single accounting point), the SDK's internal extraction LLM was ungated (LlmLedgerGuard with its own llm_ops table, cap default 0) and check-then-debit could overshoot under concurrency (EmbedLedgerGuard now reserves atomically in BEGIN IMMEDIATE, releases on failure/cancel, purges stale holds); after fixes all 12 checks pass (construction/anchor payload/user scope/1 LLM + 2-3 embeds per add measured/extraction input set provably only prior gated batches incl. old memories and rolling history/unshared canary zero outbound/search single debit/concurrency never over cap/close-reopen intact/both zero caps refuse with ZERO outbound LLM requests), evidence in docs/rework/hel874/; mood sensitivity returns to the original repo's continuous rule 1.35-0.70*strength (bazi.sensitivity_from_strength, foundation commit 1012d8b) replacing HEL-870's invented 1.25/0.8 step and is labeled an engineering heuristic, never user-approved bazi science (external agent formulas remain not adopted); docs/budget-plan-hel874.md gives definite caps for the one-time team check (55 requests/0 embeds), first-week semantic activation (<=60 extract LLM / <=180 embeds) and user daily use with code-level hard-gate facts and authorization sources (old 20-30/100-200 were estimates, not approved quota; frozen 39/60 and 498/500 untouched and never挪用); deploy/hel874-release.md + cybergril-hel874-8360.service.example prepare the isolated fresh-empty-data-dir release with health capability matrix and data-preserving rollback (NOT executed, PR#11 not merged, no user-facing loop, no experience address); sources/comment-evidence-full-experience-20261026.json adds the two 2026-10-26 user originals (01a17806, 01a1780e full-experience-then-iterate) with authorship verified and manifest appended only - baseline/current/coverage/changes untouched; verification: 256 python tests pass on 3.11.16 venv + requirements.lock offline (3 new real-provider-input readback cases incl. AM-001 negative, mem0 fake rebuilt to mirror the real 2.2.1 surfaces, 9 cases), ruff clean, web tsc + 42 vitest + build pass, local 8360 stub smoke (loopback, isolated temp DB) health R4-assembly all green then stopped, real-SDK script re-run 12/12 after final edits, dual-target requirement checks 4/4 pass with handoff-HEL-874.json; zero real model calls, zero real embeddings, zero outbound (fake gateway on loopback + existing local model cache only), authoritative ledgers and freezes untouched, no existing services or profiles touched
Co-authored-by: multica-agent <github@multica.ai>
2026-10-26 22:13:45 +08:00

3.8 KiB
Raw Blame History

HEL-874 · 8360 隔离发布包(准备就绪,未执行)

**状态:审核通过与预算批准前不启动面向用户的真实循环、不部署、不合并 PR、 不向用户交体验地址。**本文件是发布卡照抄即可执行的包;不触 8300/8310/8320/ 8340/8350 与共享 ASR/TTS/口型,不访问 4080,不导入演示/测试档案为用户伴侣。

1. 交付物清单

  • 代码:分支 hel-870-assembly(PR #11,head 见交付评论),含 deploy/cybergril-hel874-8360.service.example 与本文件。
  • 依赖:Python 3.11 + requirements.lock(uv 离线可装);前端 web/ 原作者 构建产物;语义真实模式另需固定 mem0 venv(见 §4)。

2. 安装命令(发布卡执行)

# 全新目录,逐条照抄;任何一步失败即停
mkdir -p /opt/cybergril-hel874/{current,data}          # data 必须为空
git -C /opt/cybergril-hel874/current fetch origin hel-870-assembly
git -C /opt/cybergril-hel874/current checkout <交付评论中的精确head>
cd /opt/cybergril-hel874/current
uv venv --python 3.11 .venv311
uv pip install --python .venv311/bin/python -r requirements.lock
(cd web && npm ci && npm run build)
cp deploy/cybergril-hel874-8360.service.example /etc/systemd/system/cybergril-hel874.service
systemctl daemon-reload && systemctl enable --now cybergril-hel874
curl -s http://127.0.0.1:8360/api/health | python3 -m json.tool

3. 健康能力矩阵(/api/health 预期)

字段 预期 说明
version R4-assembly
backend.mood / reach_out / semantic true 情绪/关系/生活/主动联系接线
backend.semantic_backend stub(发布初期) 真实 mem0 待 B 部分预算批准
capabilities.proactive true 生活循环开启时
capabilities.semantic_memory stub 不冒充语义
voice / vision / weather / materials / backup false 界面诚实文案,不伪装

4. 真实语义激活前置(B 部分批准后)

  1. 固定 mem0 2.2.1 venv 并入产品进程可 import(合并 venv 或 venv 混合方案由 发布卡决定,不 fork 上游)。
  2. cp config/semantic.example.yaml config/semantic.yaml,总管填批准值: embed_cap/llm_cap(默认 0=拒绝)+ embed_reserve;账本指向唯一权威 embed_ledger.sqlite3 续账,llm_ops 同库新表。
  3. CYBERGRIL_SEMANTIC=mem0 重启;任何未批调用 fail-closed (semantic_*_budget_not_approved/exhausted),冻结余额不动。

5. 停用与保留数据回退

  • 停语义层:CYBERGRIL_SEMANTIC=off(或 stub)重启;sem_batch/sem_covered 保留,重开续跑不重发。
  • 停主动联系/生活:CYBERGRIL_R2_ENABLED=0。
  • 整实例回退:systemctl stop cybergril-hel874 → 数据目录 /opt/cybergril-hel874/data/ 原样保留(聊天/记忆/生活/情绪/关系全量, SQLite WAL + 语义目录整体可复制)→ 切回上一 release / 上一提交。 R4 迁移全部为增量新表(r4.sql),旧代码可安全打开同一数据库。
  • 彻底撤销:systemctl disable --now cybergril-hel874 && rm /etc/systemd/system/ cybergril-hel874.service;数据目录留档不删(用户资料不重置边界)。

6. 发布前必过检查(发布卡执行并留证)

  1. python3 scripts/check_requirements.py --base-ref origin/main --handoff docs/requirements/handoff-HEL-874.json 及 --base-ref origin/agent/agent/de8874a3803b(双目标各含/不含 handoff)。
  2. 3.11 venv 全量 pytest + ruff + web typecheck/test/build。
  3. 隐私负例(未分享伴侣行不出现在任何 provider 输入/DTO/页面)与重开恢复 (epoch+1、消息一致、主动消息带标记)。
  4. A 部分预算未批前:semantic.yaml 缺省即 cap=0,/api/health 的 semantic_backend 必须仍为 stub。