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

@@ -23,6 +23,7 @@ from app.agents.state_schema import (
MemoirStateSchema,
PersonaThread,
default_slots,
prompt_empty_slots_for_current_stage,
)
@@ -293,8 +294,9 @@ def test_prompt_empty_slots_excludes_slots_already_covered_by_known_facts():
)
],
)
assert "city" not in state.prompt_empty_slots_for_current_stage()
assert "school" in state.prompt_empty_slots_for_current_stage()
prompt_empty = prompt_empty_slots_for_current_stage(state)
assert "city" not in prompt_empty
assert "school" in prompt_empty
def test_duplicate_question_guard_downgrades_recent_repeat_question():