feat(eval): memoir A/B chapter judging and eval-web parity with dialogue

- Judge baseline excerpt and library chapter separately; build_memoir_compare_summary for gate, nine-dim and leaf deltas.

- Memoir SSE chapter payload: baseline_judge, compare_summary, baseline_judge_error.

- MemoirJudgeOutput: loose score coercion and post-validate clamp; memoir judge prompt caps from settings.

- app-eval-web: two-column MemoirScoreCard layout, MemoirCompareSummary, chapter blocks and CSS.

- Add memoir_compare_summary, log_events, celery_log_context, memoir_pipeline_progress; tests and migration 0014.

- Misc: memory/evidence and enrichment paths, task/orchestrator updates, internal-eval docs, env examples.
This commit is contained in:
Kevin
2026-04-10 10:23:43 +08:00
parent b0251e5b26
commit ac49bc7f23
59 changed files with 4773 additions and 696 deletions

View File

@@ -90,13 +90,18 @@ def test_single_segment_decide_receives_only_combined_text_not_evidence() -> Non
patch(
"app.features.memoir.story_pipeline_sync.MemoirImageSettings",
) as mis,
patch(
"app.tasks.story_title_tasks.generate_story_title_after_create.delay",
),
patch(
"app.features.memoir.story_pipeline_sync.refresh_chapter_evidence_snapshot_with_retry_sync",
),
):
route_agent_mock.plan_batch.return_value = None
route_agent_mock.decide.side_effect = decide_capture
na = MagicMock()
nac.return_value = na
na.generate_title.return_value = "章节标题"
na.generate_narrative.return_value = '{"paragraphs": [{"content": "叙事正文段落足够长用于测试合并逻辑避免触发过短回退"}]}'
mock_story = MagicMock()
@@ -200,13 +205,18 @@ def test_decide_receives_only_same_stage_story_candidates() -> None:
patch(
"app.features.memoir.story_pipeline_sync.MemoirImageSettings",
) as mis,
patch(
"app.tasks.story_title_tasks.generate_story_title_after_create.delay",
),
patch(
"app.features.memoir.story_pipeline_sync.refresh_chapter_evidence_snapshot_with_retry_sync",
),
):
route_agent_mock.plan_batch.return_value = None
route_agent_mock.decide.side_effect = decide_capture
na = MagicMock()
nac.return_value = na
na.generate_title.return_value = "章节标题"
na.generate_narrative.return_value = '{"paragraphs": [{"content": "叙事正文段落足够长用于测试合并逻辑避免触发过短回退"}]}'
mock_story = MagicMock()