1. 建立问题库大纲,对应每个人生阶段槽位
2. 鼓励使用更生活化的交流语言共情与总结
3. 降低评审模型可能发生截断的概率
4. 成稿质量维度强化情感表达和上下文连贯性
This commit is contained in:
yangshilin
2026-04-09 15:32:35 +08:00
parent 064ad2161d
commit e1341c6d18
49 changed files with 938 additions and 271 deletions

View File

@@ -24,6 +24,7 @@ from app.agents.state_schema import MemoirStateSchema
# Phase1 batch path defaults
# ---------------------------------------------------------------------------
def test_phase1_batch_enabled_by_default() -> None:
"""memoir_phase1_batch_llm_enabled should default to True after optimization."""
from app.core.config import Settings
@@ -43,6 +44,7 @@ def test_quality_pass_enabled_by_default() -> None:
# Phase1 orchestrator selects batch path when available
# ---------------------------------------------------------------------------
def test_orchestrator_tries_batch_first(monkeypatch: pytest.MonkeyPatch) -> None:
"""When batch LLM is enabled and LLM is available, batch path should be attempted."""
monkeypatch.setattr(
@@ -136,6 +138,7 @@ def test_orchestrator_fallback_to_sequential(monkeypatch: pytest.MonkeyPatch) ->
# Memory enrichment decoupled from ingest
# ---------------------------------------------------------------------------
def test_ingest_transcript_sync_no_longer_calls_enrichment_inline() -> None:
"""After decoupling, ingest_transcript_sync should NOT import enrichment inline."""
import inspect
@@ -150,6 +153,7 @@ def test_ingest_transcript_sync_no_longer_calls_enrichment_inline() -> None:
# Post-commit unified fan-out
# ---------------------------------------------------------------------------
def test_post_commit_result_includes_quality_pass() -> None:
"""PostCommitResult should have quality_pass_scheduled field."""
from app.features.story.post_commit import PostCommitResult
@@ -173,6 +177,7 @@ def test_post_commit_signature_accepts_quality_pass() -> None:
# resolve_append_target
# ---------------------------------------------------------------------------
def test_resolve_append_target_forced_new_on_overflow() -> None:
"""When canonical exceeds limit, should force new story."""
from app.features.memoir.story_pipeline_sync import _resolve_append_target
@@ -208,15 +213,19 @@ def test_resolve_append_target_forced_new_on_overflow() -> None:
# _run_post_pipeline_commit helper
# ---------------------------------------------------------------------------
def test_run_post_pipeline_commit_calls_post_commit() -> None:
"""Shared helper should call enqueue_story_post_commit_effects."""
from app.tasks.memoir_tasks import _run_post_pipeline_commit
with patch(
"app.features.story.post_commit.enqueue_story_post_commit_effects"
) as mock_pc, patch(
"app.features.memoir.memoir_images.settings.MemoirImageSettings"
) as mock_img:
with (
patch(
"app.features.story.post_commit.enqueue_story_post_commit_effects"
) as mock_pc,
patch(
"app.features.memoir.memoir_images.settings.MemoirImageSettings"
) as mock_img,
):
mock_pc.return_value = MagicMock(
enqueued_story_image_count=0,
enqueued_chapter_recompose_count=0,