feat: trust explicit user goals
This commit is contained in:
@@ -44,7 +44,7 @@ def test_tool_loop_uses_no_tool_convergence_repair(
|
||||
return SimpleNamespace(
|
||||
final_output=(
|
||||
'{"standalone":true,"reasoning_note":"暂时独立保留",'
|
||||
'"assessments":[]}'
|
||||
'"direction_signal":"none","assessments":[]}'
|
||||
)
|
||||
)
|
||||
|
||||
@@ -100,6 +100,7 @@ def test_curator_recovers_visible_prior_fragment(
|
||||
return SimpleNamespace(
|
||||
final_output=(
|
||||
"{"
|
||||
'"direction_signal":"explicit",'
|
||||
'"standalone":false,'
|
||||
'"reasoning_note":"明确的新工作,应形成可跟踪脉络",'
|
||||
'"assessments":[{'
|
||||
|
||||
+29
-1
@@ -1,8 +1,16 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
from app.config import UserSeed
|
||||
from app.curator import _rank_ideas, build_curator_prompt
|
||||
from app.curator import (
|
||||
CURATOR_INSTRUCTIONS,
|
||||
_rank_ideas,
|
||||
build_curator_prompt,
|
||||
)
|
||||
from app.db import Database
|
||||
from app.schemas import CuratorDecision
|
||||
|
||||
|
||||
ADMIN = UserSeed(
|
||||
@@ -128,6 +136,26 @@ def test_curator_prompt_contains_recent_continuity_and_idea_catalog(
|
||||
assert "是否形成新的未完成方向" in prompt
|
||||
|
||||
|
||||
def test_explicit_user_direction_cannot_be_silently_discarded():
|
||||
with pytest.raises(
|
||||
ValidationError,
|
||||
match="explicit user-declared direction cannot remain standalone",
|
||||
):
|
||||
CuratorDecision.model_validate(
|
||||
{
|
||||
"direction_signal": "explicit",
|
||||
"standalone": True,
|
||||
"reasoning_note": "目标太大,暂时不值得跟踪",
|
||||
"assessments": [],
|
||||
}
|
||||
)
|
||||
|
||||
assert "有根据的信任" in CURATOR_INSTRUCTIONS
|
||||
assert "用户拥有自己话语的严肃程度" in CURATOR_INSTRUCTIONS
|
||||
assert "不能成为拒绝创建的门槛" in CURATOR_INSTRUCTIONS
|
||||
assert "保持诚实,不做空洞吹捧" in CURATOR_INSTRUCTIONS
|
||||
|
||||
|
||||
def test_later_fragment_can_recover_earlier_standalone_evidence(
|
||||
tmp_path: Path,
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user