Files
writer-work-flow/tests/craft_eval/__init__.py
Yaojia Wang 51bfb6e320 test(qa): craft 成稿质量前后对照评估回路(灵感 F2)
固定 3 题材金标准输入(仙侠/都市/悬疑,各含最小 spec+world+outline 及开篇章),
经真实 assemble()+build_write_request() 组装 craft-on / craft-off 两版写章请求:

- dry 模式(默认,零成本、免真实 LLM,可进 CI):断言 craft 教条块、genre 片段、
  开篇黄金三章 marker 确实按 fixture 注入正确内容,且 craft-off 基线不含这三者;
  并把两版将发送给模型的 prompt 并排 dump 供人眼看。这些断言即 tests/test_craft_eval.py,
  是 craft/审查注入路径的回归门禁。
- --live 模式(真实付费 LLM,绝不进 CI):经 gateway 各生成一章 + analyst 五维裁判,
  凭据读 DB、路由走 tier_routing,与生产写章同一网关路径。

入口 `uv run python -m tests.craft_eval [--live]`;用法/成本/门禁说明见 README.md。
2026-07-06 17:57:31 +02:00

39 lines
879 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""craft A/B 成稿质量前后对照评估回路(灵感 F2
固定金标准题材输入 → 组装 craft-on / craft-off 两版写章请求 → dry 确定性校验(零成本、
可进 CI或 `--live` 真实生成 + LLM 五维裁判。用法见 `README.md` / `python -m tests.craft_eval -h`。
"""
from __future__ import annotations
from .fixtures import FIXTURES, FixtureCase
from .harness import (
OPENING_CHAPTER_LIMIT,
CaseReport,
Check,
PromptPair,
all_passed,
build_prompt_pair,
input_text,
render_report,
system_text,
verify_case,
write_report,
)
__all__ = [
"FIXTURES",
"OPENING_CHAPTER_LIMIT",
"CaseReport",
"Check",
"FixtureCase",
"PromptPair",
"all_passed",
"build_prompt_pair",
"input_text",
"render_report",
"system_text",
"verify_case",
"write_report",
]