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

@@ -142,7 +142,6 @@ def build_structured_evidence_text(
def evidence_summary_line(
*,
lineage_tier: str,
segment_n: int,
conv_n: int,
chunk_n: int,
@@ -152,7 +151,6 @@ def evidence_summary_line(
notes: list[str],
) -> str:
bits = [
f"tier={lineage_tier}",
f"segments={segment_n}",
f"conversations={conv_n}",
f"chunks={chunk_n}",
@@ -203,7 +201,6 @@ def format_chapter_for_judge(
structured_evidence_chars_included=len(struct),
)
summary = evidence_summary_line(
lineage_tier=bundle.lineage_tier,
segment_n=len(bundle.segment_ids),
conv_n=len(bundle.conversation_ids),
chunk_n=len(bundle.memory_chunk_ids),
@@ -258,7 +255,6 @@ def format_story_for_judge(
structured_evidence_chars_included=len(struct),
)
summary = evidence_summary_line(
lineage_tier=bundle.lineage_tier,
segment_n=len(bundle.segment_ids),
conv_n=len(bundle.conversation_ids),
chunk_n=len(bundle.memory_chunk_ids),