assessment: make assess/fidelity SemIf decisions, drop LLM from decision path
Assessment was an LLM generation step emitting prose. Move it to SemIf: - assess:outcome (success/failure @ tau) and assess:requeue (complete/retry, updated_request = request.text bounded by max_reentries) are logged decisions. - Run summary is deterministic (category.skill + ok/failed + action_log/new_state). - Fidelity gate is a real authoring:fidelity accept/reconsider decision plus static integration findings; it only triggers a rewrite, never a diagnosis. - Corrective regens receive the raw evidence bundle as-is (render_evidence), never an LLM paraphrase. - Every EngineUnavailable is fatal app-wide: Scheduler.fatal is recorded, the worker stops, and the CLI prints 'decision engine not available' and exits non-zero. Remove llm.assess/review_skill_body (keep _parse_json). - Tests: ScriptedEngine double in tests/conftest.py for scheduling mechanics; replace the review_skill_body integration test with a SemIf fidelity test; add deterministic-summary and evidence-renderer unit tests.
This commit is contained in:
1 parent
ddc5cb66c8
commit
3d0cff325c
16 files changed
+610
-463
No files matched your search
@@ -22,11 +22,13 @@ from semif_agent.scheduler import Scheduler
|
||||
from semif_agent.skills import ActionResult, Prediction, Skill
|
||||
from semif_agent.trace import TraceLog
|
||||
|
||||
from tests.conftest import ScriptedEngine
|
||||
|
||||
|
||||
def build_scheduler(tmp_path):
|
||||
log = DecisionLog(str(tmp_path / "decisions.jsonl"))
|
||||
trace = TraceLog(str(tmp_path / "runs.jsonl"))
|
||||
engine = SemIfEngine(EngineConfig())
|
||||
engine = ScriptedEngine(default="success")
|
||||
llm = LLMClient(base_url="http://localhost:1/v1", model="test")
|
||||
return Scheduler(
|
||||
engine=engine,
|
||||
@@ -133,7 +135,6 @@ def test_service_submit_error_is_replied(tmp_path):
|
||||
service.handle_inbound(InboundMessage(text="hi", chat_id="4", contact_id="4"))
|
||||
outbound = drain_outbound(service)
|
||||
assert outbound, "expected a reply"
|
||||
assert "unavailable" in outbound[-1]
|
||||
|
||||
|
||||
def test_service_routes_pending_answer_to_same_chat(tmp_path):
|
||||
@@ -180,7 +181,7 @@ def test_service_drain_routes_queued_run_to_owner(tmp_path):
|
||||
|
||||
service.drain()
|
||||
outbound = drain_outbound(service)
|
||||
assert any("queued work" in text or "unavailable" in text or "failed" in text for text in outbound)
|
||||
assert outbound, "the queued run's outcome must be routed back to its owner"
|
||||
|
||||
|
||||
def test_service_answered_question_routes_back(tmp_path):
|
||||
|
||||
Reference in new issue
Block a user