HEL-882 rework: execution-table caps become real hard gates at the wire, SDK hidden retries and mid-add failures recover without loss, the 8360 release package runs offline, and the HEL-874 embedding evidence is corrected - every real provider exit (create/dialogue/life/gist/judgment/growth/proactive phrasing + mem0's internal extraction LLM) now persistently pre-allocates request count (per-category daily + one-shot totals in request_usage/budget_total, BEGIN IMMEDIATE) and a conservative token estimate before sending, refuses at the tightest cap (BudgetStop, no more downgrade-and-keep-calling) and survives restarts; known usage settles to actual, unknown/disconnect/failure keeps the full reservation; ledger guards gain per-day tops (embed_daily/llm_daily) and verify_ledger_authority rejects a fresh file bypassing the frozen 498/500 prefix; the mem0 SDK client's hidden OpenAI retries are disabled (max_retries=0) so every actual send is gated and answered failures (even 5xx) settle as used with only httpx.ConnectError-grade unsent requests released; embed refusals the SDK swallows into empty adds are re-raised as budget errors so the batch re-queues without burning an attempt and resumes when the cap returns, add_group resumes at vector-store level (src_group anchors: only missing rows resent, crash/restart/concurrency never duplicate), sem coverage is per-backend (stub batches no longer block a real rebuild, real done batches never resend) with backend-scoped batch keys; the release package is offline-executable: fresh-dir git clone, cybergril service account, PYTHONPATH in the unit so the lock-only venv imports the product, shipped caps explicitly 0 (=refuse by design until approved), deploy/mem0-stack.lock + accurate 3.11 wheel gap with a no-download path (hel857-venv is 3.10; never present stub/FTS as the real memory experience), and tools/check_release_offline_hel882.py verifies checkout/import/health/fail-closed/approved-run/data-preservation on loopback with echo stand-ins; evidence corrected per manager review: docs/rework/hel874/erratum-hel882.json + README appendix record that e978e87's verification did real local embeddings from cache (provable lower bound 12, exact total unrecoverable, temp sandbox gone) while zero-real-LLM/zero-download/zero-outbound stand, old JSONs and authoritative ledgers untouched, and tools/verify_mem0_real_hel874.py now installs the deterministic 512-dim stand-in before TextEmbedding construction plus non-loopback socket rejection (zero model loads) with final_embed_rows persisted before temp cleanup; verification: 272 python tests pass on 3.11.16 venv + requirements.lock offline (16 new: manager api repro blocked with 0 provider calls, sdk repro 1-HTTP/max_retries=0/llm_ops=1, mid-add swallow requeued-then-resumed, resume-no-duplicate, stub-to-mem0 rebuild, daily embed cap, unified mem0-LLM gate, authority refusal, restart-persistent counters, tightest-constraint settle/release), ruff clean (src/tests/tools), web tsc + 42 vitest + build via npm ci --offline, pinned-install deterministic re-run 12/12, manager review scripts re-run evidence attached in delivery, dual-target requirement checks 4/4 with handoff-HEL-882.json; zero real calls, zero real embeddings, zero non-loopback outbound, authoritative ledgers and freezes untouched, not deployed, PR not merged, no visual changes
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
multica-agent
parent
e978e878df
commit
e291058754
@@ -43,3 +43,18 @@ fastembed 0.9.1;源码 tarball SHA256 `9dcef930…dda23` 与 HEL-857 记录一
|
||||
表面与适配层包装完全吻合(计数=落账)。
|
||||
- metadata 锚点在真实 qdrant payload 中逐字往返。
|
||||
- 滚动 history(save_messages 10 条窗)只含本产品此前 add 的原始消息。
|
||||
|
||||
## 勘正(HEL-882,2026-10-26,原文与前后 JSON 不改写)
|
||||
|
||||
本目录两份 JSON 的运行(e978e87 版脚本)**发生过真实本地嵌入推理**:脚本当时
|
||||
只把 LLM 换成 127.0.0.1 假网关,没有替换 fastembed 边界——`FastEmbedEmbedding`
|
||||
构造时加载了缓存模型,首条 add 即逐笔记了 3 笔真实向量推理
|
||||
(`embed_rows_after_first_add`)。因此提交信息与执行表中「零真实嵌入」的说法
|
||||
不成立;「零真实 LLM 请求/零下载/零非回环出站」仍成立。可证下限
|
||||
**≥12 条真实本地嵌入**(各分段合计,详见 `erratum-hel882.json`);精确总数因
|
||||
临时目录随任务沙箱清除不可恢复。权威三账未写、未补改。
|
||||
|
||||
自 HEL-882 起,`tools/verify_mem0_real_hel874.py` 在 `TextEmbedding` 构造前安装
|
||||
确定性 512 维向量替身(零模型加载、零真实嵌入),socket 层拒绝一切非回环连接
|
||||
(与总管独立复现口径一致),并在清理临时目录前把逐笔账写进证据 JSON
|
||||
(`final_embed_rows` / `final_llm_used`)。
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"card": "HEL-882",
|
||||
"kind": "evidence_erratum",
|
||||
"date": "2026-10-26",
|
||||
"subject": "HEL-874 真实 SDK 验证的嵌入证据口径勘正(原 JSON 一律不改写)",
|
||||
"incorrect_claims": [
|
||||
{
|
||||
"location": "git commit e978e878dfc34f38c781d48f87b93dc21bbf8a61 提交信息",
|
||||
"claim": "zero real model calls, zero real embeddings, zero outbound (fake gateway on loopback + existing local model cache only)",
|
||||
"fact": "LLM 确为零真实请求(全部打在 127.0.0.1 假网关);但嵌入并非零——脚本只替换了 LLM 网关,未替换 fastembed 边界,FastEmbedEmbedding.__init__ 加载了缓存模型并做了真实本地向量推理",
|
||||
"correction": "应为:零真实 LLM 请求、零出站连接、存在真实本地嵌入推理(见 evidence_recovery 的可证下限)"
|
||||
},
|
||||
{
|
||||
"location": "docs/budget-plan-hel874.md 首段(e978e87 版)",
|
||||
"claim": "本卡(HEL-874)零真实模型调用、零真实嵌入、零出站(真实 SDK 验证全部走本地确定性替身与本地模型缓存)",
|
||||
"fact": "『本地模型缓存』那半句与『零真实嵌入』互相矛盾:读取缓存做推理就是真实嵌入,只是零下载、零出站",
|
||||
"correction": "本卡(HEL-882 版)已改写为:零真实模型调用、零真实嵌入(确定性 512 维替身)、零非回环连接"
|
||||
},
|
||||
{
|
||||
"location": "docs/requirements/handoff-HEL-874.json verification/deliverable 字段",
|
||||
"claim": "全部零真实模型/零嵌入/零出站(127.0.0.1 确定性假网关与本地模型缓存除外)",
|
||||
"fact": "『除外』条款实际承认了本地模型缓存的使用,但『零嵌入』表述优先读作零嵌入推理,与事实不符",
|
||||
"correction": "handoff 为历史交接记录不改写;以本勘正为准"
|
||||
}
|
||||
],
|
||||
"evidence_recovery": {
|
||||
"recoverable": [
|
||||
"docs/rework/hel874/real-sdk-after.json: embed_rows_after_first_add 共 3 笔(product:search / product:batch:add / product:add),即首条 add 发生 3 次真实本地嵌入推理",
|
||||
"同 JSON C2_add_ledger_shape: embed_items=3 llm_calls=1(第二条为逐笔明细佐证)",
|
||||
"同 JSON C3_extraction_input_set: 第二条 add 成功 → 按同一流程至少再 2 笔(查询嵌入+提取批嵌入,实体 upsert 0..N 不确定)",
|
||||
"同 JSON C3b_unshared_canary_never_outbound: queued_public_batches=2,tick 处理 1 个批次 → 至少再 2 笔",
|
||||
"同 JSON C4_search_single_debit: embed_delta=1",
|
||||
"同 JSON C6_concurrency_cap: used=3(独立 conc 临时账,同为真实推理)",
|
||||
"同 JSON C7_reopen_after_close: 重开后的 search → +1 笔"
|
||||
],
|
||||
"lower_bound_real_local_embeddings": 12,
|
||||
"upper_bound_estimate": 14,
|
||||
"unrecoverable": [
|
||||
"精确总数不可恢复:脚本临时目录 /tmp/multica-task-4220825970/hel874-real-sdk-*(含逐笔临时账)已随任务沙箱清除,仓库内只留有上述分段 JSON"
|
||||
],
|
||||
"llm_requests": "全部为 127.0.0.1 确定性假网关(gateway_requests_total=3,零真实 LLM 请求,此口径原判断正确,无需勘正)",
|
||||
"downloads_and_outbound": "零下载、零非回环出站(模型缓存为既有只读复用),此口径原判断正确"
|
||||
},
|
||||
"authoritative_ledgers": "权威三账(真实请求 39/60、嵌入 498/500、HEL-835 闸)全程未写、未补改;临时账全部在已清除的临时目录,与权威账无关",
|
||||
"fix_in_this_card": "tools/verify_mem0_real_hel874.py 自本版本起在 TextEmbedding 构造前安装确定性 512 维向量替身(零模型加载)且 socket 拒绝一切非回环连接(总管独立复现同口径);证据 JSON 增记 final_embed_rows/final_llm_used 并在清理临时目录前落盘,避免同类不可恢复"
|
||||
}
|
||||
Reference in New Issue
Block a user