Add structured response feedback
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from app.api.server import chat, health, resolve_permission, resolve_secret
|
||||
from app.api.server import chat, critic_feedback, health, resolve_permission, resolve_secret
|
||||
from app.core.permission_resolution import PermissionResolutionRequest, SecretResolutionRequest
|
||||
from app.api.server import CriticFeedbackRequest
|
||||
from app.core.contracts import UserTask
|
||||
|
||||
|
||||
@@ -25,3 +26,20 @@ def test_resolve_permission_handler_allows_completion() -> None:
|
||||
def test_resolve_secret_handler_requires_pending_request() -> None:
|
||||
body = resolve_secret(SecretResolutionRequest(task_id="missing", secret="x"))
|
||||
assert body["status"] == "failed"
|
||||
|
||||
|
||||
def test_structured_feedback_can_be_accepted_without_memory_write() -> None:
|
||||
initial = chat(UserTask(input="feedback target"))
|
||||
body = critic_feedback(
|
||||
CriticFeedbackRequest(
|
||||
task_id=initial["task_id"],
|
||||
feedback="wrong answer",
|
||||
feedback_type="hallucination",
|
||||
severity="major",
|
||||
correction="check first",
|
||||
remember=False,
|
||||
)
|
||||
)
|
||||
assert body["status"] == "ok"
|
||||
assert body["stored"] is False
|
||||
assert "hallucination" in body["lesson"]
|
||||
|
||||
Reference in New Issue
Block a user