删除旧的事件驱动章节(流水账),并同步文档到人物主线
- 移除 output/volumes/v1/chapters/001-1-9.md 与 002-10-19.md(仅普通提交,git 历史保留) - 移除被取代的写作规范 prompts/chronicler.md 与旧的按年代切章模块 - README 全面改写为人物主线流程、参数位置与踩坑记录 - scripts/dfannals 启动器:自动挑一个装了 defusedxml 的解释器
This commit is contained in:
+5
-3
@@ -97,7 +97,7 @@ def _parse(raw: str) -> dict:
|
||||
except json.JSONDecodeError as exc:
|
||||
raise ValueError(f"自评返回的 JSON 无法解析:{exc}|原文:{raw[:200]}") from None
|
||||
if not isinstance(data, dict):
|
||||
raise ValueError(f"自评返回的不是对象:{type(data).__name__}")
|
||||
raise TypeError(f"自评返回的不是对象:{type(data).__name__}")
|
||||
return data
|
||||
|
||||
|
||||
@@ -120,8 +120,10 @@ def evaluate(
|
||||
scores: dict[str, int] = {}
|
||||
for key, _label, _hint in DIMENSIONS:
|
||||
value = data.get(key)
|
||||
if not isinstance(value, (int, float)):
|
||||
raise ValueError(f"自评维度 {key} 缺失或非数字:{data.get(key)!r}")
|
||||
if value is None:
|
||||
raise ValueError(f"自评维度 {key} 缺失:{data!r}")
|
||||
if isinstance(value, bool) or not isinstance(value, (int, float)):
|
||||
raise TypeError(f"自评维度 {key} 不是数字:{value!r}")
|
||||
scores[key] = max(0, min(MAX_SCORE, int(value)))
|
||||
|
||||
reason = str(data.get("reason", "")).strip() or "(未给出理由)"
|
||||
|
||||
Reference in New Issue
Block a user