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.
18 lines
589 B
Python
18 lines
589 B
Python
"""Pure-stdlib tests for the retained JSON helper on the dormant LLM client.
|
|
|
|
The LLM no longer participates in any decision path (assessment and fidelity
|
|
are SemIf decisions), so only `_parse_json` — which the authoring parsers
|
|
borrow — is exercised here.
|
|
"""
|
|
|
|
from semif_agent.llm import LLMClient
|
|
|
|
|
|
def test_parse_json_extracts_object_from_prose():
|
|
parsed = LLMClient._parse_json('Sure, here: {"a": 1, "b": "two"} — done.')
|
|
assert parsed == {"a": 1, "b": "two"}
|
|
|
|
|
|
def test_parse_json_handles_bare_object():
|
|
assert LLMClient._parse_json('{"ok": true}') == {"ok": True}
|