feat(orchestrator): 续写链前一章无已验收终稿发 warning——静默丢前文引子可观测(CR-L1)

This commit is contained in:
Yaojia Wang
2026-07-08 13:02:30 +02:00
parent 832ab7dfa1
commit c9ffada503
2 changed files with 63 additions and 1 deletions

View File

@@ -325,7 +325,17 @@ async def _read_prior_accepted(
if chapter_no <= 1:
return ""
view = await chapter_repo.latest_accepted(project_id, chapter_no - 1)
return view.content if view is not None else ""
if view is None:
# 静默降级须可观测CR-L1续写式链本章续接的前一章尚无已验收终稿——续写会丢失
# 前文引子(降级为 build_continuation_context 的占位)。发 warning 便于查错,勿静默吞。
log.warning(
"chain_prior_accepted_missing",
project_id=str(project_id),
chapter_no=chapter_no,
prior_chapter_no=chapter_no - 1,
)
return ""
return view.content
async def _commit(session: CommitSession) -> None: