feat(api)!: memory single chain — async MemoryService, strict eval closure

Route all memory ingest/retrieve/enrichment/compaction through async MemoryService.
Remove legacy sync memory implementations (ingest/retrieve/compaction); Celery and
memoir Phase2 call asyncio.run into MemoryService-backed helpers.

Memoir Phase1 batch ingest uses MemoryService.ingest_transcripts_batch; drop chapters.
evidence_bundle_json mirror (Alembic 0015). Evaluation uses snapshot/link-only bundles;
raise EvidenceClosureMissing instead of partial/fallback lineage tiers.

Split memoir state into NarrativeCoverageState and InterviewControlState; delete the
_interview_meta_store adapter layer. Remove rolling-query and recent-fact fallback
settings from config and evidence assembly.

Update judges, docs, tests, and PlaygroundPage alignment.

Made-with: Cursor
This commit is contained in:
Kevin
2026-04-30 14:11:46 +08:00
parent ac436b87a2
commit 71fbd39e32
53 changed files with 953 additions and 2448 deletions

View File

@@ -42,6 +42,20 @@ def test_build_eval_judge_deepseek_requires_key(
assert build_eval_judge_llm_spec("deepseek", None) is None
def test_build_eval_judge_deepseek_v4_flash_non_thinking_default_path(
monkeypatch: pytest.MonkeyPatch,
) -> None:
"""默认 deepseek-v4-flash 且关闭 thinking 时显式传 disabled避免 API 默认 enabled"""
monkeypatch.setattr(settings, "deepseek_api_key", "d-test")
monkeypatch.setattr(settings, "eval_judge_deepseek_model", "deepseek-v4-flash")
monkeypatch.setattr(settings, "eval_judge_deepseek_thinking_enabled", False)
spec = build_eval_judge_llm_spec("deepseek", None)
assert spec is not None
assert spec.resolved_model == "deepseek-v4-flash"
assert spec.llm.extra_body == {"thinking": {"type": "disabled"}}
assert spec.llm.reasoning_effort is None
def test_build_eval_judge_deepseek_context_budget(
monkeypatch: pytest.MonkeyPatch,
) -> None: