Files
CyberGril/spike/hel857/__main__.py
T
zonggongandmultica-agent e31ae2d946 HEL-857: approved Mem0 isolation spike - zero-model gates all pass, A/B synthetic scenarios within 26/60 real-call budget
- Fixed mem0 source commit 2c81af3 (2.2.1) in isolated venv, qdrant embedded + fastembed local zh embeddings (95.3MB, within 500MB cap)
- Gate0 transport-level persistent debit ledger: 61st call blocked pre-send, failures count, cross-process persistence, retries disabled+counted (fake transport, zero network)
- Gate1 qdrant embedded checks: keyword_search functional (Chinese segmentation gap recorded honestly), restart subprocess, clean-copy restore, no telemetry collections
- Gate2 privacy with stub LLM: P1-P5 zero leak, first-share timing F1-F6 (failed/cancel/unconfirmed no migration, ack+judged migrates told content with anchors, duplicate receipt idempotent), full backup incl. unshared internal memories restores clean
- A/B same-material same-criteria: Mem0 paraphrase recall strictly better than current lexical path (S3, model answers in Chinese), S1-S9 all pass, no regression
- Headline findings: Chinese input extracted as English memories (default upstream prompt), BM25 lexical channel inert for Chinese, ADD-only infer confirmed with our update orchestration, custom metadata needs direct payload read
- 26/60 real outbound via persistent ledger (incl. one parse-failure retry), usage/latency per row; embeddings 28/500; HEL-835 quota untouched
- Experiment branch only: no merge to main/product, no deploy, no real-profile access; handoff JSON + dual-base requirement checks pass

Co-authored-by: multica-agent <github@multica.ai>
2026-10-25 23:19:26 +08:00

54 lines
1.7 KiB
Python

#!/usr/bin/env python3
"""按批准顺序运行全部门禁,再(仅当全过)运行真实 A/B。
用法:
python -m spike.hel-857 --gates-only # 只跑零真实模型门禁
python -m spike.hel-857 --with-ab # 门禁全过后继续真实 A/B(≤60 次出站)
"""
from __future__ import annotations
import sys
from . import ledger_fake_test, step0_backend_check, stub_gate
def main(argv: list[str]) -> int:
gates_only = "--gates-only" in argv
with_ab = "--with-ab" in argv
print("== 门禁 0:传输层持久扣账(零网络)==")
r0 = ledger_fake_test.main([])
print(json_summary("G0_ledger", r0))
print("== 门禁 1:qdrant 嵌入式三查(零真实模型)==")
r1 = step0_backend_check.main([])
print(json_summary("G1_backend", r1))
print("== 门禁 2:隐私与首次分享时序(stub LLM,零真实模型)==")
r2 = stub_gate.main([])
print(json_summary("G2_privacy", r2))
gates_ok = r0.get("ok") and r1.get("ok") and r2.get("ok")
if not gates_ok:
print("门禁未全过,停止;不运行任何真实请求。")
return 1
if gates_only or not with_ab:
print("门禁全过。未请求真实模型(本调用未带 --with-ab)。")
return 0
print("== A/B 真实合成场景(≤60 次出站)==")
from . import ab_scenarios
r3 = ab_scenarios.main([])
print(json_summary("AB_scenarios", r3))
return 0 if r3.get("completed") else 1
def json_summary(name: str, payload: dict) -> str:
import json
ok = payload.get("ok", payload.get("completed"))
return f"[{name}] ok={ok}"
if __name__ == "__main__":
raise SystemExit(main(sys.argv[1:]))